@runmedev/renderers 3.16.0 → 3.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/console/runme.d.ts +14 -28
- package/dist/components/console/runme.d.ts.map +1 -1
- package/dist/components/console/view.d.ts +17 -8
- package/dist/components/console/view.d.ts.map +1 -1
- package/dist/index.cjs +113 -113
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +7730 -6576
- package/dist/types.d.ts +0 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var fi=function(e,t){return fi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},fi(e,t)};function rt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fi(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Wa(e,t,r,i){function a(m){return m instanceof r?m:new r(function(v){v(m)})}return new(r||(r=Promise))(function(m,v){function s(f){try{h(i.next(f))}catch(u){v(u)}}function c(f){try{h(i.throw(f))}catch(u){v(u)}}function h(f){f.done?m(f.value):a(f.value).then(s,c)}h((i=i.apply(e,t||[])).next())})}function On(e,t){var r={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},i,a,m,v=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return v.next=s(0),v.throw=s(1),v.return=s(2),typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function s(h){return function(f){return c([h,f])}}function c(h){if(i)throw new TypeError("Generator is already executing.");for(;v&&(v=0,h[0]&&(r=0)),r;)try{if(i=1,a&&(m=h[0]&2?a.return:h[0]?a.throw||((m=a.return)&&m.call(a),0):a.next)&&!(m=m.call(a,h[1])).done)return m;switch(a=0,m&&(h=[h[0]&2,m.value]),h[0]){case 0:case 1:m=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,a=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(m=r.trys,!(m=m.length>0&&m[m.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!m||h[1]>m[0]&&h[1]<m[3])){r.label=h[1];break}if(h[0]===6&&r.label<m[1]){r.label=m[1],m=h;break}if(m&&r.label<m[2]){r.label=m[2],r.ops.push(h);break}m[2]&&r.ops.pop(),r.trys.pop();continue}h=t.call(e,r)}catch(f){h=[6,f],a=0}finally{i=m=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Ct(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ge(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),a,m=[],v;try{for(;(t===void 0||t-- >0)&&!(a=i.next()).done;)m.push(a.value)}catch(s){v={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(v)throw v.error}}return m}function Qe(e,t,r){if(r||arguments.length===2)for(var i=0,a=t.length,m;i<a;i++)(m||!(i in t))&&(m||(m=Array.prototype.slice.call(t,0,i)),m[i]=t[i]);return e.concat(m||Array.prototype.slice.call(t))}function St(e){return this instanceof St?(this.v=e,this):new St(e)}function Ga(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,t||[]),a,m=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",v),a[Symbol.asyncIterator]=function(){return this},a;function v(y){return function(E){return Promise.resolve(E).then(y,u)}}function s(y,E){i[y]&&(a[y]=function(p){return new Promise(function(n,l){m.push([y,p,n,l])>1||c(y,p)})},E&&(a[y]=E(a[y])))}function c(y,E){try{h(i[y](E))}catch(p){g(m[0][3],p)}}function h(y){y.value instanceof St?Promise.resolve(y.value.v).then(f,u):g(m[0][2],y)}function f(y){c("next",y)}function u(y){c("throw",y)}function g(y,E){y(E),m.shift(),m.length&&c(m[0][0],m[0][1])}}function Ka(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ct=="function"?Ct(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(m){r[m]=e[m]&&function(v){return new Promise(function(s,c){v=e[m](v),a(s,c,v.done,v.value)})}}function a(m,v,s,c){Promise.resolve(c).then(function(h){m({value:h,done:s})},v)}}/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const _r=globalThis,Ti=_r.ShadowRoot&&(_r.ShadyCSS===void 0||_r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Di=Symbol(),ps=new WeakMap;let Nn=class{constructor(t,r,i){if(this._$cssResult$=!0,i!==Di)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o;const r=this.t;if(Ti&&t===void 0){const i=r!==void 0&&r.length===1;i&&(t=ps.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ps.set(r,t))}return t}toString(){return this.cssText}};const Mt=e=>new Nn(typeof e=="string"?e:e+"",void 0,Di),Ne=(e,...t)=>{const r=e.length===1?e[0]:t.reduce(((i,a,m)=>i+(v=>{if(v._$cssResult$===!0)return v.cssText;if(typeof v=="number")return v;throw Error("Value passed to 'css' function must be a 'css' function result: "+v+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+e[m+1]),e[0]);return new Nn(r,e,Di)},Za=(e,t)=>{if(Ti)e.adoptedStyleSheets=t.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(const r of t){const i=document.createElement("style"),a=_r.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=r.cssText,e.appendChild(i)}},_s=Ti?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(const i of t.cssRules)r+=i.cssText;return Mt(r)})(e):e;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:za,defineProperty:Ya,getOwnPropertyDescriptor:ja,getOwnPropertyNames:Xa,getOwnPropertySymbols:Ja,getPrototypeOf:qa}=Object,qe=globalThis,vs=qe.trustedTypes,Qa=vs?vs.emptyScript:"",jr=qe.reactiveElementPolyfillSupport,Ut=(e,t)=>e,wr={toAttribute(e,t){switch(t){case Boolean:e=e?Qa:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},Oi=(e,t)=>!za(e,t),ms={attribute:!0,type:String,converter:wr,reflect:!1,useDefault:!1,hasChanged:Oi};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),qe.litPropertyMetadata??(qe.litPropertyMetadata=new WeakMap);let mt=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=ms){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(t,r),!r.noAccessor){const i=Symbol(),a=this.getPropertyDescriptor(t,i,r);a!==void 0&&Ya(this.prototype,t,a)}}static getPropertyDescriptor(t,r,i){const{get:a,set:m}=ja(this.prototype,t)??{get(){return this[r]},set(v){this[r]=v}};return{get:a,set(v){const s=a==null?void 0:a.call(this);m==null||m.call(this,v),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ms}static _$Ei(){if(this.hasOwnProperty(Ut("elementProperties")))return;const t=qa(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ut("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ut("properties"))){const r=this.properties,i=[...Xa(r),...Ja(r)];for(const a of i)this.createProperty(a,r[a])}const t=this[Symbol.metadata];if(t!==null){const r=litPropertyMetadata.get(t);if(r!==void 0)for(const[i,a]of r)this.elementProperties.set(i,a)}this._$Eh=new Map;for(const[r,i]of this.elementProperties){const a=this._$Eu(r,i);a!==void 0&&this._$Eh.set(a,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const r=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const a of i)r.unshift(_s(a))}else t!==void 0&&r.push(_s(t));return r}static _$Eu(t,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((r=>this.enableUpdating=r)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((r=>r(this)))}addController(t){var r;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((r=t.hostConnected)==null||r.call(t))}removeController(t){var r;(r=this._$EO)==null||r.delete(t)}_$E_(){const t=new Map,r=this.constructor.elementProperties;for(const i of r.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Za(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((r=>{var i;return(i=r.hostDisconnected)==null?void 0:i.call(r)}))}attributeChangedCallback(t,r,i){this._$AK(t,i)}_$ET(t,r){var m;const i=this.constructor.elementProperties.get(t),a=this.constructor._$Eu(t,i);if(a!==void 0&&i.reflect===!0){const v=(((m=i.converter)==null?void 0:m.toAttribute)!==void 0?i.converter:wr).toAttribute(r,i.type);this._$Em=t,v==null?this.removeAttribute(a):this.setAttribute(a,v),this._$Em=null}}_$AK(t,r){var m,v;const i=this.constructor,a=i._$Eh.get(t);if(a!==void 0&&this._$Em!==a){const s=i.getPropertyOptions(a),c=typeof s.converter=="function"?{fromAttribute:s.converter}:((m=s.converter)==null?void 0:m.fromAttribute)!==void 0?s.converter:wr;this._$Em=a;const h=c.fromAttribute(r,s.type);this[a]=h??((v=this._$Ej)==null?void 0:v.get(a))??h,this._$Em=null}}requestUpdate(t,r,i){var a;if(t!==void 0){const m=this.constructor,v=this[t];if(i??(i=m.getPropertyOptions(t)),!((i.hasChanged??Oi)(v,r)||i.useDefault&&i.reflect&&v===((a=this._$Ej)==null?void 0:a.get(t))&&!this.hasAttribute(m._$Eu(t,i))))return;this.C(t,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,r,{useDefault:i,reflect:a,wrapped:m},v){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,v??r??this[t]),m!==!0||v!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(r=void 0),this._$AL.set(t,r)),a===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[m,v]of this._$Ep)this[m]=v;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[m,v]of a){const{wrapped:s}=v,c=this[m];s!==!0||this._$AL.has(m)||c===void 0||this.C(m,void 0,v,c)}}let t=!1;const r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(i=this._$EO)==null||i.forEach((a=>{var m;return(m=a.hostUpdate)==null?void 0:m.call(a)})),this.update(r)):this._$EM()}catch(a){throw t=!1,this._$EM(),a}t&&this._$AE(r)}willUpdate(t){}_$AE(t){var r;(r=this._$EO)==null||r.forEach((i=>{var a;return(a=i.hostUpdated)==null?void 0:a.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((r=>this._$ET(r,this[r])))),this._$EM()}updated(t){}firstUpdated(t){}};mt.elementStyles=[],mt.shadowRootOptions={mode:"open"},mt[Ut("elementProperties")]=new Map,mt[Ut("finalized")]=new Map,jr==null||jr({ReactiveElement:mt}),(qe.reactiveElementVersions??(qe.reactiveElementVersions=[])).push("2.1.1");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/const Vt=globalThis,Er=Vt.trustedTypes,bs=Er?Er.createPolicy("lit-html",{createHTML:e=>e}):void 0,Mn="$lit$",Je=`lit$${Math.random().toFixed(9).slice(2)}$`,Fn="?"+Je,ec=`<${Fn}>`,ft=document,Wt=()=>ft.createComment(""),Gt=e=>e===null||typeof e!="object"&&typeof e!="function",Ni=Array.isArray,tc=e=>Ni(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Xr=`[
|
|
14
|
+
\f\r]`,Ot=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ss=/-->/g,ys=/>/g,st=RegExp(`>|${Xr}(?:([^\\s"'>=/]+)(${Xr}*=${Xr}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Cs=/'/g,ws=/"/g,Pn=/^(?:script|style|textarea|title)$/i,rc=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),Y=rc(1),wt=Symbol.for("lit-noChange"),fe=Symbol.for("lit-nothing"),Es=new WeakMap,at=ft.createTreeWalker(ft,129);function Un(e,t){if(!Ni(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return bs!==void 0?bs.createHTML(t):t}const ic=(e,t)=>{const r=e.length-1,i=[];let a,m=t===2?"<svg>":t===3?"<math>":"",v=Ot;for(let s=0;s<r;s++){const c=e[s];let h,f,u=-1,g=0;for(;g<c.length&&(v.lastIndex=g,f=v.exec(c),f!==null);)g=v.lastIndex,v===Ot?f[1]==="!--"?v=Ss:f[1]!==void 0?v=ys:f[2]!==void 0?(Pn.test(f[2])&&(a=RegExp("</"+f[2],"g")),v=st):f[3]!==void 0&&(v=st):v===st?f[0]===">"?(v=a??Ot,u=-1):f[1]===void 0?u=-2:(u=v.lastIndex-f[2].length,h=f[1],v=f[3]===void 0?st:f[3]==='"'?ws:Cs):v===ws||v===Cs?v=st:v===Ss||v===ys?v=Ot:(v=st,a=void 0);const y=v===st&&e[s+1].startsWith("/>")?" ":"";m+=v===Ot?c+ec:u>=0?(i.push(h),c.slice(0,u)+Mn+c.slice(u)+Je+y):c+Je+(u===-2?s:y)}return[Un(e,m+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class Kt{constructor({strings:t,_$litType$:r},i){let a;this.parts=[];let m=0,v=0;const s=t.length-1,c=this.parts,[h,f]=ic(t,r);if(this.el=Kt.createElement(h,i),at.currentNode=this.el.content,r===2||r===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(a=at.nextNode())!==null&&c.length<s;){if(a.nodeType===1){if(a.hasAttributes())for(const u of a.getAttributeNames())if(u.endsWith(Mn)){const g=f[v++],y=a.getAttribute(u).split(Je),E=/([.?@])?(.*)/.exec(g);c.push({type:1,index:m,name:E[2],strings:y,ctor:E[1]==="."?nc:E[1]==="?"?oc:E[1]==="@"?ac:Or}),a.removeAttribute(u)}else u.startsWith(Je)&&(c.push({type:6,index:m}),a.removeAttribute(u));if(Pn.test(a.tagName)){const u=a.textContent.split(Je),g=u.length-1;if(g>0){a.textContent=Er?Er.emptyScript:"";for(let y=0;y<g;y++)a.append(u[y],Wt()),at.nextNode(),c.push({type:2,index:++m});a.append(u[g],Wt())}}}else if(a.nodeType===8)if(a.data===Fn)c.push({type:2,index:m});else{let u=-1;for(;(u=a.data.indexOf(Je,u+1))!==-1;)c.push({type:7,index:m}),u+=Je.length-1}m++}}static createElement(t,r){const i=ft.createElement("template");return i.innerHTML=t,i}}function Et(e,t,r=e,i){var v,s;if(t===wt)return t;let a=i!==void 0?(v=r._$Co)==null?void 0:v[i]:r._$Cl;const m=Gt(t)?void 0:t._$litDirective$;return(a==null?void 0:a.constructor)!==m&&((s=a==null?void 0:a._$AO)==null||s.call(a,!1),m===void 0?a=void 0:(a=new m(e),a._$AT(e,r,i)),i!==void 0?(r._$Co??(r._$Co=[]))[i]=a:r._$Cl=a),a!==void 0&&(t=Et(e,a._$AS(e,t.values),a,i)),t}class sc{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:r},parts:i}=this._$AD,a=((t==null?void 0:t.creationScope)??ft).importNode(r,!0);at.currentNode=a;let m=at.nextNode(),v=0,s=0,c=i[0];for(;c!==void 0;){if(v===c.index){let h;c.type===2?h=new tr(m,m.nextSibling,this,t):c.type===1?h=new c.ctor(m,c.name,c.strings,this,t):c.type===6&&(h=new cc(m,this,t)),this._$AV.push(h),c=i[++s]}v!==(c==null?void 0:c.index)&&(m=at.nextNode(),v++)}return at.currentNode=ft,a}p(t){let r=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,r),r+=i.strings.length-2):i._$AI(t[r])),r++}}class tr{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,r,i,a){this.type=2,this._$AH=fe,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=i,this.options=a,this._$Cv=(a==null?void 0:a.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=Et(this,t,r),Gt(t)?t===fe||t==null||t===""?(this._$AH!==fe&&this._$AR(),this._$AH=fe):t!==this._$AH&&t!==wt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):tc(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==fe&&Gt(this._$AH)?this._$AA.nextSibling.data=t:this.T(ft.createTextNode(t)),this._$AH=t}$(t){var m;const{values:r,_$litType$:i}=t,a=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=Kt.createElement(Un(i.h,i.h[0]),this.options)),i);if(((m=this._$AH)==null?void 0:m._$AD)===a)this._$AH.p(r);else{const v=new sc(a,this),s=v.u(this.options);v.p(r),this.T(s),this._$AH=v}}_$AC(t){let r=Es.get(t.strings);return r===void 0&&Es.set(t.strings,r=new Kt(t)),r}k(t){Ni(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let i,a=0;for(const m of t)a===r.length?r.push(i=new tr(this.O(Wt()),this.O(Wt()),this,this.options)):i=r[a],i._$AI(m),a++;a<r.length&&(this._$AR(i&&i._$AB.nextSibling,a),r.length=a)}_$AR(t=this._$AA.nextSibling,r){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,r);t!==this._$AB;){const a=t.nextSibling;t.remove(),t=a}}setConnected(t){var r;this._$AM===void 0&&(this._$Cv=t,(r=this._$AP)==null||r.call(this,t))}}class Or{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,i,a,m){this.type=1,this._$AH=fe,this._$AN=void 0,this.element=t,this.name=r,this._$AM=a,this.options=m,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=fe}_$AI(t,r=this,i,a){const m=this.strings;let v=!1;if(m===void 0)t=Et(this,t,r,0),v=!Gt(t)||t!==this._$AH&&t!==wt,v&&(this._$AH=t);else{const s=t;let c,h;for(t=m[0],c=0;c<m.length-1;c++)h=Et(this,s[i+c],r,c),h===wt&&(h=this._$AH[c]),v||(v=!Gt(h)||h!==this._$AH[c]),h===fe?t=fe:t!==fe&&(t+=(h??"")+m[c+1]),this._$AH[c]=h}v&&!a&&this.j(t)}j(t){t===fe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class nc extends Or{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===fe?void 0:t}}class oc extends Or{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==fe)}}class ac extends Or{constructor(t,r,i,a,m){super(t,r,i,a,m),this.type=5}_$AI(t,r=this){if((t=Et(this,t,r,0)??fe)===wt)return;const i=this._$AH,a=t===fe&&i!==fe||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,m=t!==fe&&(i===fe||a);a&&this.element.removeEventListener(this.name,this,i),m&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,t):this._$AH.handleEvent(t)}}class cc{constructor(t,r,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Et(this,t)}}const Jr=Vt.litHtmlPolyfillSupport;Jr==null||Jr(Kt,tr),(Vt.litHtmlVersions??(Vt.litHtmlVersions=[])).push("3.3.1");const lc=(e,t,r)=>{const i=(r==null?void 0:r.renderBefore)??t;let a=i._$litPart$;if(a===void 0){const m=(r==null?void 0:r.renderBefore)??null;i._$litPart$=a=new tr(t.insertBefore(Wt(),m),m,void 0,r??{})}return a._$AI(e),a};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const
|
|
19
|
+
*/const ht=globalThis;class we extends mt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const t=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=t.firstChild),t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=lc(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return wt}}var Dn;we._$litElement$=!0,we.finalized=!0,(Dn=ht.litElementHydrateSupport)==null||Dn.call(ht,{LitElement:we});const qr=ht.litElementPolyfillSupport;qr==null||qr({LitElement:we});(ht.litElementVersions??(ht.litElementVersions=[])).push("4.2.1");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const xe=e=>(t,r)=>{r!==void 0?r.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const
|
|
27
|
+
*/const dc={attribute:!0,type:String,converter:wr,reflect:!1,hasChanged:Oi},hc=(e=dc,t,r)=>{const{kind:i,metadata:a}=r;let m=globalThis.litPropertyMetadata.get(a);if(m===void 0&&globalThis.litPropertyMetadata.set(a,m=new Map),i==="setter"&&((e=Object.create(e)).wrapped=!0),m.set(r.name,e),i==="accessor"){const{name:v}=r;return{set(s){const c=t.get.call(this);t.set.call(this,s),this.requestUpdate(v,c,e)},init(s){return s!==void 0&&this.C(v,void 0,e,s),s}}}if(i==="setter"){const{name:v}=r;return function(s){const c=this[v];t.call(this,s),this.requestUpdate(v,c,e)}}throw Error("Unsupported decorator location: "+i)};function j(e){return(t,r)=>typeof r=="object"?hc(e,t,r):((i,a,m)=>{const v=a.hasOwnProperty(m);return a.constructor.createProperty(m,i),v?Object.getOwnPropertyDescriptor(a,m):void 0})(e,t,r)}/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
-
*/function
|
|
31
|
+
*/function uc(e){return j({...e,state:!0,attribute:!1})}var fc=Object.getOwnPropertyDescriptor,gc=(e,t,r,i)=>{for(var a=i>1?void 0:i?fc(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=v(a)||a);return a};let gi=class extends we{onClose(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("closed");this.dispatchEvent(t)}render(){return Y`
|
|
32
32
|
<div class="close-button tooltip">
|
|
33
33
|
<span class="tooltiptext">Close</span>
|
|
34
34
|
<vscode-button
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<span class="icon icon-close"></span>
|
|
41
41
|
</vscode-button>
|
|
42
42
|
</div>
|
|
43
|
-
`}};
|
|
43
|
+
`}};gi.styles=Ne`
|
|
44
44
|
:host {
|
|
45
45
|
--button-icon-hover-background: var(--vscode-toolbar-hoverBackground);
|
|
46
46
|
--tooltip-background: #343434;
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
.tooltip:not(:hover) .tooltiptext {
|
|
114
114
|
transition-delay: 0s;
|
|
115
115
|
}
|
|
116
|
-
`;
|
|
116
|
+
`;gi=gc([xe("close-cell-button")],gi);const Vn=Y`
|
|
117
117
|
<svg
|
|
118
118
|
class="icon"
|
|
119
119
|
width="16"
|
|
@@ -133,11 +133,11 @@
|
|
|
133
133
|
d="M3 1L2 2v10l1 1V2h6.414l-1-1H3z"
|
|
134
134
|
/>
|
|
135
135
|
</svg>
|
|
136
|
-
`;var
|
|
136
|
+
`;var pc=Object.defineProperty,_c=Object.getOwnPropertyDescriptor,Hn=(e,t,r,i)=>{for(var a=i>1?void 0:i?_c(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&pc(t,r,a),a};let kr=class extends we{constructor(){super(...arguments),this.copyText="Copy"}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t)}render(){return Y`
|
|
137
137
|
<vscode-button appearance="secondary" @click=${this.onCopy}>
|
|
138
|
-
${
|
|
138
|
+
${Vn} ${this.copyText}
|
|
139
139
|
</vscode-button>
|
|
140
|
-
`}};
|
|
140
|
+
`}};kr.styles=Ne`
|
|
141
141
|
vscode-button {
|
|
142
142
|
color: var(--vscode-button-foreground);
|
|
143
143
|
background-color: var(--vscode-button-background);
|
|
@@ -154,25 +154,25 @@
|
|
|
154
154
|
margin: 0 5px 0 -5px;
|
|
155
155
|
padding: 0;
|
|
156
156
|
}
|
|
157
|
-
`;sn([G({type:String})],gr.prototype,"copyText",2);gr=sn([Ie("copy-button")],gr);var ar={exports:{}},aa=ar.exports,Yi;function ca(){return Yi||(Yi=1,(function(e,t){(function(r,o){e.exports=o()})(aa,(()=>(()=>{var r={930:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const h=l(485);i.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(f,d,v){this._css.set(f,d,v)}getCss(f,d){return this._css.get(f,d)}setColor(f,d,v){this._color.set(f,d,v)}getColor(f,d){return this._color.get(f,d)}clear(){this._color.clear(),this._css.clear()}}},997:function(S,i,l){var h=this&&this.__decorate||function(w,p,k,A){var L,T=arguments.length,R=T<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,k):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,p,k,A);else for(var M=w.length-1;M>=0;M--)(L=w[M])&&(R=(T<3?L(R):T>3?L(p,k,R):L(p,k))||R);return T>3&&R&&Object.defineProperty(p,k,R),R},f=this&&this.__param||function(w,p){return function(k,A){p(k,A,w)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const d=l(930),v=l(160),m=l(345),E=l(859),_=l(97),s=v.css.toColor("#ffffff"),a=v.css.toColor("#000000"),n=v.css.toColor("#ffffff"),c=v.css.toColor("#000000"),g={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],p=[0,95,135,175,215,255];for(let k=0;k<216;k++){const A=p[k/36%6|0],L=p[k/6%6|0],T=p[k%6];w.push({css:v.channels.toCss(A,L,T),rgba:v.channels.toRgba(A,L,T)})}for(let k=0;k<24;k++){const A=8+10*k;w.push({css:v.channels.toCss(A,A,A),rgba:v.channels.toRgba(A,A,A)})}return w})());let y=i.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:s,background:a,cursor:n,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:g,selectionBackgroundOpaque:v.color.blend(a,g),selectionInactiveBackgroundTransparent:g,selectionInactiveBackgroundOpaque:v.color.blend(a,g),ansi:i.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(w={}){const p=this._colors;if(p.foreground=b(w.foreground,s),p.background=b(w.background,a),p.cursor=b(w.cursor,n),p.cursorAccent=b(w.cursorAccent,c),p.selectionBackgroundTransparent=b(w.selectionBackground,g),p.selectionBackgroundOpaque=v.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=b(w.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=v.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=w.selectionForeground?b(w.selectionForeground,v.NULL_COLOR):void 0,p.selectionForeground===v.NULL_COLOR&&(p.selectionForeground=void 0),v.color.isOpaque(p.selectionBackgroundTransparent)&&(p.selectionBackgroundTransparent=v.color.opacity(p.selectionBackgroundTransparent,.3)),v.color.isOpaque(p.selectionInactiveBackgroundTransparent)&&(p.selectionInactiveBackgroundTransparent=v.color.opacity(p.selectionInactiveBackgroundTransparent,.3)),p.ansi=i.DEFAULT_ANSI_COLORS.slice(),p.ansi[0]=b(w.black,i.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=b(w.red,i.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=b(w.green,i.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=b(w.yellow,i.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=b(w.blue,i.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=b(w.magenta,i.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=b(w.cyan,i.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=b(w.white,i.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=b(w.brightBlack,i.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=b(w.brightRed,i.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=b(w.brightGreen,i.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=b(w.brightYellow,i.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=b(w.brightBlue,i.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=b(w.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=b(w.brightCyan,i.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=b(w.brightWhite,i.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const k=Math.min(p.ansi.length-16,w.extendedAnsi.length);for(let A=0;A<k;A++)p.ansi[A+16]=b(w.extendedAnsi[A],i.DEFAULT_ANSI_COLORS[A+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}modifyColors(w){w(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function b(w,p){if(w!==void 0)try{return v.css.toColor(w)}catch{}return p}i.ThemeService=y=h([f(0,_.IOptionsService)],y)},160:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let l=0,h=0,f=0,d=0;var v,m,E,_,s;function a(c){const g=c.toString(16);return g.length<2?"0"+g:g}function n(c,g){return c<g?(g+.05)/(c+.05):(c+.05)/(g+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(g,y,b,w){return w!==void 0?`#${a(g)}${a(y)}${a(b)}${a(w)}`:`#${a(g)}${a(y)}${a(b)}`},c.toRgba=function(g,y,b,w=255){return(g<<24|y<<16|b<<8|w)>>>0},c.toColor=function(g,y,b,w){return{css:c.toCss(g,y,b,w),rgba:c.toRgba(g,y,b,w)}}})(v||(i.channels=v={})),(function(c){function g(y,b){return d=Math.round(255*b),[l,h,f]=s.toChannels(y.rgba),{css:v.toCss(l,h,f,d),rgba:v.toRgba(l,h,f,d)}}c.blend=function(y,b){if(d=(255&b.rgba)/255,d===1)return{css:b.css,rgba:b.rgba};const w=b.rgba>>24&255,p=b.rgba>>16&255,k=b.rgba>>8&255,A=y.rgba>>24&255,L=y.rgba>>16&255,T=y.rgba>>8&255;return l=A+Math.round((w-A)*d),h=L+Math.round((p-L)*d),f=T+Math.round((k-T)*d),{css:v.toCss(l,h,f),rgba:v.toRgba(l,h,f)}},c.isOpaque=function(y){return(255&y.rgba)==255},c.ensureContrastRatio=function(y,b,w){const p=s.ensureContrastRatio(y.rgba,b.rgba,w);if(p)return v.toColor(p>>24&255,p>>16&255,p>>8&255)},c.opaque=function(y){const b=(255|y.rgba)>>>0;return[l,h,f]=s.toChannels(b),{css:v.toCss(l,h,f),rgba:b}},c.opacity=g,c.multiplyOpacity=function(y,b){return d=255&y.rgba,g(y,d*b/255)},c.toColorRGB=function(y){return[y.rgba>>24&255,y.rgba>>16&255,y.rgba>>8&255]}})(m||(i.color=m={})),(function(c){let g,y;try{const b=document.createElement("canvas");b.width=1,b.height=1;const w=b.getContext("2d",{willReadFrequently:!0});w&&(g=w,g.globalCompositeOperation="copy",y=g.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return l=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),f=parseInt(b.slice(3,4).repeat(2),16),v.toColor(l,h,f);case 5:return l=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),f=parseInt(b.slice(3,4).repeat(2),16),d=parseInt(b.slice(4,5).repeat(2),16),v.toColor(l,h,f,d);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const w=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return l=parseInt(w[1]),h=parseInt(w[2]),f=parseInt(w[3]),d=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),v.toColor(l,h,f,d);if(!g||!y)throw new Error("css.toColor: Unsupported css format");if(g.fillStyle=y,g.fillStyle=b,typeof g.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(g.fillRect(0,0,1,1),[l,h,f,d]=g.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(l,h,f,d),css:b}}})(E||(i.css=E={})),(function(c){function g(y,b,w){const p=y/255,k=b/255,A=w/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))}c.relativeLuminance=function(y){return g(y>>16&255,y>>8&255,255&y)},c.relativeLuminance2=g})(_||(i.rgb=_={})),(function(c){function g(b,w,p){const k=b>>24&255,A=b>>16&255,L=b>>8&255;let T=w>>24&255,R=w>>16&255,M=w>>8&255,F=n(_.relativeLuminance2(T,R,M),_.relativeLuminance2(k,A,L));for(;F<p&&(T>0||R>0||M>0);)T-=Math.max(0,Math.ceil(.1*T)),R-=Math.max(0,Math.ceil(.1*R)),M-=Math.max(0,Math.ceil(.1*M)),F=n(_.relativeLuminance2(T,R,M),_.relativeLuminance2(k,A,L));return(T<<24|R<<16|M<<8|255)>>>0}function y(b,w,p){const k=b>>24&255,A=b>>16&255,L=b>>8&255;let T=w>>24&255,R=w>>16&255,M=w>>8&255,F=n(_.relativeLuminance2(T,R,M),_.relativeLuminance2(k,A,L));for(;F<p&&(T<255||R<255||M<255);)T=Math.min(255,T+Math.ceil(.1*(255-T))),R=Math.min(255,R+Math.ceil(.1*(255-R))),M=Math.min(255,M+Math.ceil(.1*(255-M))),F=n(_.relativeLuminance2(T,R,M),_.relativeLuminance2(k,A,L));return(T<<24|R<<16|M<<8|255)>>>0}c.blend=function(b,w){if(d=(255&w)/255,d===1)return w;const p=w>>24&255,k=w>>16&255,A=w>>8&255,L=b>>24&255,T=b>>16&255,R=b>>8&255;return l=L+Math.round((p-L)*d),h=T+Math.round((k-T)*d),f=R+Math.round((A-R)*d),v.toRgba(l,h,f)},c.ensureContrastRatio=function(b,w,p){const k=_.relativeLuminance(b>>8),A=_.relativeLuminance(w>>8);if(n(k,A)<p){if(A<k){const R=g(b,w,p),M=n(k,_.relativeLuminance(R>>8));if(M<p){const F=y(b,w,p);return M>n(k,_.relativeLuminance(F>>8))?R:F}return R}const L=y(b,w,p),T=n(k,_.relativeLuminance(L>>8));if(T<p){const R=g(b,w,p);return T>n(k,_.relativeLuminance(R>>8))?L:R}return L}},c.reduceLuminance=g,c.increaseLuminance=y,c.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}})(s||(i.rgba=s={})),i.toPaddedHex=a,i.contrastRatio=n},345:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===l)return void this._listeners.splice(h,1)}}})),this._event}fire(l,h){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,l,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(l,h){return l((f=>h.fire(f)))},i.runAndSubscribe=function(l,h){return h(void 0),l((f=>h(f)))}},859:(S,i)=>{function l(h){for(const f of h)f.dispose();h.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.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 f=this._disposables.indexOf(h);f!==-1&&this._disposables.splice(f,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var f;this._isDisposed||h===this._value||((f=this._value)==null||f.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}},i.toDisposable=function(h){return{dispose:h}},i.disposeArray=l,i.getDisposeArrayDisposable=function(h){return{dispose:()=>l(h)}}},485:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(f,d,v){this._data[f]||(this._data[f]={}),this._data[f][d]=v}get(f,d){return this._data[f]?this._data[f][d]:void 0}clear(){this._data={}}}i.TwoKeyMap=l,i.FourKeyMap=class{constructor(){this._data=new l}set(h,f,d,v,m){this._data.get(h,f)||this._data.set(h,f,new l),this._data.get(h,f).set(d,v,m)}get(h,f,d,v){var m;return(m=this._data.get(h,f))==null?void 0:m.get(d,v)}clear(){this._data.clear()}}},726:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const l="di$target",h="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(f){return f[h]||[]},i.createDecorator=function(f){if(i.serviceRegistry.has(f))return i.serviceRegistry.get(f);const d=function(v,m,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,s,a){s[l]===s?s[h].push({id:_,index:a}):(s[h]=[{id:_,index:a}],s[l]=s)})(d,v,E)};return d.toString=()=>f,i.serviceRegistry.set(f,d),d}},97:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const h=l(726);var f;i.IBufferService=(0,h.createDecorator)("BufferService"),i.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),i.ICoreService=(0,h.createDecorator)("CoreService"),i.ICharsetService=(0,h.createDecorator)("CharsetService"),i.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(f||(i.LogLevelEnum=f={})),i.ILogService=(0,h.createDecorator)("LogService"),i.IOptionsService=(0,h.createDecorator)("OptionsService"),i.IOscLinkService=(0,h.createDecorator)("OscLinkService"),i.IUnicodeService=(0,h.createDecorator)("UnicodeService"),i.IDecorationService=(0,h.createDecorator)("DecorationService")}},o={};function u(S){var i=o[S];if(i!==void 0)return i.exports;var l=o[S]={exports:{}};return r[S].call(l.exports,l,l.exports,u),l.exports}var C={};return(()=>{var S=C;Object.defineProperty(S,"__esModule",{value:!0}),S.HTMLSerializeHandler=S.SerializeAddon=void 0;const i=u(997);function l(_,s,a){return Math.max(s,Math.min(_,a))}class h{constructor(s){this._buffer=s}serialize(s,a){const n=this._buffer.getNullCell(),c=this._buffer.getNullCell();let g=n;const y=s.start.y,b=s.end.y,w=s.start.x,p=s.end.x;this._beforeSerialize(b-y,y,b);for(let k=y;k<=b;k++){const A=this._buffer.getLine(k);if(A){const L=k===s.start.y?w:0,T=k===s.end.y?p:A.length;for(let R=L;R<T;R++){const M=A.getCell(R,g===n?c:n);M?(this._nextCell(M,g,k,R),g=M):console.warn(`Can't get cell at row=${k}, col=${R}`)}}this._rowEnd(k,k===b)}return this._afterSerialize(),this._serializeString(a)}_nextCell(s,a,n,c){}_rowEnd(s,a){}_beforeSerialize(s,a,n){}_afterSerialize(){}_serializeString(s){return""}}function f(_,s){return _.getFgColorMode()===s.getFgColorMode()&&_.getFgColor()===s.getFgColor()}function d(_,s){return _.getBgColorMode()===s.getBgColorMode()&&_.getBgColor()===s.getBgColor()}function v(_,s){return _.isInverse()===s.isInverse()&&_.isBold()===s.isBold()&&_.isUnderline()===s.isUnderline()&&_.isOverline()===s.isOverline()&&_.isBlink()===s.isBlink()&&_.isInvisible()===s.isInvisible()&&_.isItalic()===s.isItalic()&&_.isDim()===s.isDim()&&_.isStrikethrough()===s.isStrikethrough()}class m extends h{constructor(s,a){super(s),this._terminal=a,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(s,a,n){this._allRows=new Array(s),this._lastContentCursorRow=a,this._lastCursorRow=a,this._firstRow=a}_rowEnd(s,a){var c;this._nullCellCount>0&&!d(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let n="";if(!a){s-this._firstRow>=this._terminal.rows&&((c=this._buffer.getLine(this._cursorStyleRow))==null||c.getCell(this._cursorStyleCol,this._backgroundCell));const g=this._buffer.getLine(s),y=this._buffer.getLine(s+1);if(y.isWrapped){n="";const b=g.getCell(g.length-1,this._thisRowLastChar),w=g.getCell(g.length-2,this._thisRowLastSecondChar),p=y.getCell(0,this._nextRowFirstChar),k=p.getWidth()>1;let A=!1;(p.getChars()&&k?this._nullCellCount<=1:this._nullCellCount<=0)&&((b.getChars()||b.getWidth()===0)&&d(b,p)&&(A=!0),k&&(w.getChars()||w.getWidth()===0)&&d(b,p)&&d(w,p)&&(A=!0)),A||(n="-".repeat(this._nullCellCount+1),n+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(n+="\x1B[A",n+=`\x1B[${g.length-this._nullCellCount}C`,n+=`\x1B[${this._nullCellCount}X`,n+=`\x1B[${g.length-this._nullCellCount}D`,n+="\x1B[B"),this._lastContentCursorRow=s+1,this._lastContentCursorCol=0,this._lastCursorRow=s+1,this._lastCursorCol=0)}else n=`\r
|
|
158
|
-
`,this._lastCursorRow=s+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=n,this._currentRow="",this._nullCellCount=0}_diffStyle(s,a){const n=[],c=!f(s,a),g=!d(s,a),y=!v(s,a);if(c||g||y)if(s.isAttributeDefault())a.isAttributeDefault()||n.push(0);else{if(c){const b=s.getFgColor();s.isFgRGB()?n.push(38,2,b>>>16&255,b>>>8&255,255&b):s.isFgPalette()?b>=16?n.push(38,5,b):n.push(8&b?90+(7&b):30+(7&b)):n.push(39)}if(g){const b=s.getBgColor();s.isBgRGB()?n.push(48,2,b>>>16&255,b>>>8&255,255&b):s.isBgPalette()?b>=16?n.push(48,5,b):n.push(8&b?100+(7&b):40+(7&b)):n.push(49)}y&&(s.isInverse()!==a.isInverse()&&n.push(s.isInverse()?7:27),s.isBold()!==a.isBold()&&n.push(s.isBold()?1:22),s.isUnderline()!==a.isUnderline()&&n.push(s.isUnderline()?4:24),s.isOverline()!==a.isOverline()&&n.push(s.isOverline()?53:55),s.isBlink()!==a.isBlink()&&n.push(s.isBlink()?5:25),s.isInvisible()!==a.isInvisible()&&n.push(s.isInvisible()?8:28),s.isItalic()!==a.isItalic()&&n.push(s.isItalic()?3:23),s.isDim()!==a.isDim()&&n.push(s.isDim()?2:22),s.isStrikethrough()!==a.isStrikethrough()&&n.push(s.isStrikethrough()?9:29))}return n}_nextCell(s,a,n,c){if(s.getWidth()===0)return;const g=s.getChars()==="",y=this._diffStyle(s,this._cursorStyle);if(g?!d(this._cursorStyle,s):y.length>0){this._nullCellCount>0&&(d(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=c,this._currentRow+=`\x1B[${y.join(";")}m`;const b=this._buffer.getLine(n);b!==void 0&&(b.getCell(c,this._cursorStyle),this._cursorStyleRow=n,this._cursorStyleCol=c)}g?this._nullCellCount+=s.getWidth():(this._nullCellCount>0&&(d(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=s.getChars(),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=c+s.getWidth())}_serializeString(s){let a=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(a=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let n="";for(let b=0;b<a;b++)n+=this._allRows[b],b+1<a&&(n+=this._allRowSeparators[b]);if(!s){const b=this._buffer.baseY+this._buffer.cursorY,w=this._buffer.cursorX,p=k=>{k>0?n+=`\x1B[${k}C`:k<0&&(n+=`\x1B[${-k}D`)};(b!==this._lastCursorRow||w!==this._lastCursorCol)&&((c=b-this._lastCursorRow)>0?n+=`\x1B[${c}B`:c<0&&(n+=`\x1B[${-c}A`),p(w-this._lastCursorCol))}var c;const g=this._terminal._core._inputHandler._curAttrData,y=this._diffStyle(g,this._cursorStyle);return y.length>0&&(n+=`\x1B[${y.join(";")}m`),n}}S.SerializeAddon=class{activate(_){this._terminal=_}_serializeBufferByScrollback(_,s,a){const n=s.length,c=a===void 0?n:l(a+_.rows,0,n);return this._serializeBufferByRange(_,s,{start:n-c,end:n-1},!1)}_serializeBufferByRange(_,s,a,n){return new m(s,_).serialize({start:{x:0,y:typeof a.start=="number"?a.start:a.start.line},end:{x:_.cols,y:typeof a.end=="number"?a.end:a.end.line}},n)}_serializeBufferAsHTML(_,s){var g;const a=_.buffer.active,n=new E(a,_,s);if(!s.onlySelection){const y=a.length,b=s.scrollback,w=b===void 0?y:l(b+_.rows,0,y);return n.serialize({start:{x:0,y:y-w},end:{x:_.cols,y:y-1}})}const c=(g=this._terminal)==null?void 0:g.getSelectionPosition();return c!==void 0?n.serialize({start:{x:c.start.x,y:c.start.y},end:{x:c.end.x,y:c.end.y}}):""}_serializeModes(_){let s="";const a=_.modes;if(a.applicationCursorKeysMode&&(s+="\x1B[?1h"),a.applicationKeypadMode&&(s+="\x1B[?66h"),a.bracketedPasteMode&&(s+="\x1B[?2004h"),a.insertMode&&(s+="\x1B[4h"),a.originMode&&(s+="\x1B[?6h"),a.reverseWraparoundMode&&(s+="\x1B[?45h"),a.sendFocusMode&&(s+="\x1B[?1004h"),a.wraparoundMode===!1&&(s+="\x1B[?7l"),a.mouseTrackingMode!=="none")switch(a.mouseTrackingMode){case"x10":s+="\x1B[?9h";break;case"vt200":s+="\x1B[?1000h";break;case"drag":s+="\x1B[?1002h";break;case"any":s+="\x1B[?1003h"}return s}serialize(_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let s=_!=null&&_.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,_.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,_==null?void 0:_.scrollback);return _!=null&&_.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(s+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),_!=null&&_.excludeModes||(s+=this._serializeModes(this._terminal)),s}serializeAsHTML(_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,_||{})}dispose(){}};class E extends h{constructor(s,a,n){super(s),this._terminal=a,this._options=n,this._currentRow="",this._htmlContent="",a._core._themeService?this._ansiColors=a._core._themeService.colors.ansi:this._ansiColors=i.DEFAULT_ANSI_COLORS}_padStart(s,a,n){return a>>=0,n=n??" ",s.length>a?s:((a-=s.length)>n.length&&(n+=n.repeat(a/n.length)),n.slice(0,a)+s)}_beforeSerialize(s,a,n){var b,w;this._htmlContent+="<html><body><!--StartFragment--><pre>";let c="#000000",g="#ffffff";this._options.includeGlobalBackground&&(c=((b=this._terminal.options.theme)==null?void 0:b.foreground)??"#ffffff",g=((w=this._terminal.options.theme)==null?void 0:w.background)??"#000000");const y=[];y.push("color: "+c+";"),y.push("background-color: "+g+";"),y.push("font-family: "+this._terminal.options.fontFamily+";"),y.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+y.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(s,a){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(s,a){const n=a?s.getFgColor():s.getBgColor();return(a?s.isFgRGB():s.isBgRGB())?"#"+[n>>16&255,n>>8&255,255&n].map((c=>this._padStart(c.toString(16),2,"0"))).join(""):(a?s.isFgPalette():s.isBgPalette())?this._ansiColors[n].css:void 0}_diffStyle(s,a){const n=[],c=!f(s,a),g=!d(s,a),y=!v(s,a);if(c||g||y){const b=this._getHexColor(s,!0);b&&n.push("color: "+b+";");const w=this._getHexColor(s,!1);return w&&n.push("background-color: "+w+";"),s.isInverse()&&n.push("color: #000000; background-color: #BFBFBF;"),s.isBold()&&n.push("font-weight: bold;"),s.isUnderline()&&s.isOverline()?n.push("text-decoration: overline underline;"):s.isUnderline()?n.push("text-decoration: underline;"):s.isOverline()&&n.push("text-decoration: overline;"),s.isBlink()&&n.push("text-decoration: blink;"),s.isInvisible()&&n.push("visibility: hidden;"),s.isItalic()&&n.push("font-style: italic;"),s.isDim()&&n.push("opacity: 0.5;"),s.isStrikethrough()&&n.push("text-decoration: line-through;"),n}}_nextCell(s,a,n,c){if(s.getWidth()===0)return;const g=s.getChars()==="",y=this._diffStyle(s,a);y&&(this._currentRow+=y.length===0?"</span><span>":"</span><span style='"+y.join(" ")+"'>"),this._currentRow+=g?" ":s.getChars()}_serializeString(){return this._htmlContent}}S.HTMLSerializeHandler=E})(),C})()))})(ar)),ar.exports}var la=ca(),cr={exports:{}},da=cr.exports,Ji;function ha(){return Ji||(Ji=1,(function(e,t){(function(r,o){e.exports=o()})(da,(()=>(()=>{var r={433:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV11=void 0;const h=l(938),f=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],d=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],v=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],m=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let E;function _(s,a){let n,c=0,g=a.length-1;if(s<a[0][0]||s>a[g][1])return!1;for(;g>=c;)if(n=c+g>>1,s>a[n][1])c=n+1;else{if(!(s<a[n][0]))return!0;g=n-1}return!1}i.UnicodeV11=class{constructor(){if(this.version="11",!E){E=new Uint8Array(65536),E.fill(1),E[0]=0,E.fill(0,1,32),E.fill(0,127,160);for(let s=0;s<f.length;++s)E.fill(0,f[s][0],f[s][1]+1);for(let s=0;s<v.length;++s)E.fill(2,v[s][0],v[s][1]+1)}}wcwidth(s){return s<32?0:s<127?1:s<65536?E[s]:_(s,d)?0:_(s,m)?2:1}charProperties(s,a){let n=this.wcwidth(s),c=n===0&&a!==0;if(c){const g=h.UnicodeService.extractWidth(a);g===0?c=!1:g>n&&(n=g)}return h.UnicodeService.createPropertyValue(0,n,c)}}},345:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===l)return void this._listeners.splice(h,1)}}})),this._event}fire(l,h){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,l,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(l,h){return l((f=>h.fire(f)))},i.runAndSubscribe=function(l,h){return h(void 0),l((f=>h(f)))}},490:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const h=l(938),f=[[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]],d=[[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 v;i.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let m=0;m<f.length;++m)v.fill(0,f[m][0],f[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?v[m]:(function(E,_){let s,a=0,n=_.length-1;if(E<_[0][0]||E>_[n][1])return!1;for(;n>=a;)if(s=a+n>>1,E>_[s][1])a=s+1;else{if(!(E<_[s][0]))return!0;n=s-1}return!1})(m,d)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,E){let _=this.wcwidth(m),s=_===0&&E!==0;if(s){const a=h.UnicodeService.extractWidth(E);a===0?s=!1:a>_&&(_=a)}return h.UnicodeService.createPropertyValue(0,_,s)}}},938:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const h=l(345),f=l(490);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,E,_=!1){return(16777215&m)<<3|(3&E)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const m=new f.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let E=0,_=0;const s=m.length;for(let a=0;a<s;++a){let n=m.charCodeAt(a);if(55296<=n&&n<=56319){if(++a>=s)return E+this.wcwidth(n);const y=m.charCodeAt(a);56320<=y&&y<=57343?n=1024*(n-55296)+y-56320+65536:E+=this.wcwidth(y)}const c=this.charProperties(n,_);let g=d.extractWidth(c);d.extractShouldJoin(c)&&(g-=d.extractWidth(_)),E+=g,_=c}return E}charProperties(m,E){return this._activeProvider.charProperties(m,E)}}i.UnicodeService=d}},o={};function u(S){var i=o[S];if(i!==void 0)return i.exports;var l=o[S]={exports:{}};return r[S](l,l.exports,u),l.exports}var C={};return(()=>{var S=C;Object.defineProperty(S,"__esModule",{value:!0}),S.Unicode11Addon=void 0;const i=u(433);S.Unicode11Addon=class{activate(l){l.unicode.register(new i.UnicodeV11)}dispose(){}}})(),C})()))})(cr)),cr.exports}var ua=ha(),Pr={exports:{}},qi;function fa(){return qi||(qi=1,(function(e,t){(function(r,o){e.exports=o()})(self,(()=>(()=>{var r={6:(S,i)=>{function l(f){try{const d=new URL(f),v=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return f.toLocaleLowerCase().startsWith(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(i,"__esModule",{value:!0}),i.LinkComputer=i.WebLinkProvider=void 0,i.WebLinkProvider=class{constructor(f,d,v,m={}){this._terminal=f,this._regex=d,this._handler=v,this._options=m}provideLinks(f,d){const v=h.computeLink(f,this._regex,this._terminal,this._handler);d(this._addCallbacks(v))}_addCallbacks(f){return f.map((d=>(d.leave=this._options.leave,d.hover=(v,m)=>{if(this._options.hover){const{range:E}=d;this._options.hover(v,m,E)}},d)))}};class h{static computeLink(d,v,m,E){const _=new RegExp(v.source,(v.flags||"")+"g"),[s,a]=h._getWindowedLineStrings(d-1,m),n=s.join("");let c;const g=[];for(;c=_.exec(n);){const y=c[0];if(!l(y))continue;const[b,w]=h._mapStrIdx(m,a,0,c.index),[p,k]=h._mapStrIdx(m,b,w,y.length);if(b===-1||w===-1||p===-1||k===-1)continue;const A={start:{x:w+1,y:b+1},end:{x:k,y:p+1}};g.push({range:A,text:y,activate:E})}return g}static _getWindowedLineStrings(d,v){let m,E=d,_=d,s=0,a="";const n=[];if(m=v.buffer.active.getLine(d)){const c=m.translateToString(!0);if(m.isWrapped&&c[0]!==" "){for(s=0;(m=v.buffer.active.getLine(--E))&&s<2048&&(a=m.translateToString(!0),s+=a.length,n.push(a),m.isWrapped&&a.indexOf(" ")===-1););n.reverse()}for(n.push(c),s=0;(m=v.buffer.active.getLine(++_))&&m.isWrapped&&s<2048&&(a=m.translateToString(!0),s+=a.length,n.push(a),a.indexOf(" ")===-1););}return[n,E]}static _mapStrIdx(d,v,m,E){const _=d.buffer.active,s=_.getNullCell();let a=m;for(;E;){const n=_.getLine(v);if(!n)return[-1,-1];for(let c=a;c<n.length;++c){n.getCell(c,s);const g=s.getChars();if(s.getWidth()&&(E-=g.length||1,c===n.length-1&&g==="")){const y=_.getLine(v+1);y&&y.isWrapped&&(y.getCell(0,s),s.getWidth()===2&&(E+=1))}if(E<0)return[v,c]}v++,a=0}return[v,a]}}i.LinkComputer=h}},o={};function u(S){var i=o[S];if(i!==void 0)return i.exports;var l=o[S]={exports:{}};return r[S](l,l.exports,u),l.exports}var C={};return(()=>{var S=C;Object.defineProperty(S,"__esModule",{value:!0}),S.WebLinksAddon=void 0;const i=u(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(f,d){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}S.WebLinksAddon=class{constructor(f=h,d={}){this._handler=f,this._options=d}activate(f){this._terminal=f;const d=this._options,v=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new i.WebLinkProvider(this._terminal,v,this._handler,d))}dispose(){var f;(f=this._linkProvider)==null||f.dispose()}}})(),C})()))})(Pr)),Pr.exports}var _a=fa(),Fr={exports:{}},Qi;function ga(){return Qi||(Qi=1,(function(e,t){(function(r,o){e.exports=o()})(globalThis,(()=>(()=>{var r={4567:function(S,i,l){var h=this&&this.__decorate||function(n,c,g,y){var b,w=arguments.length,p=w<3?c:y===null?y=Object.getOwnPropertyDescriptor(c,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(n,c,g,y);else for(var k=n.length-1;k>=0;k--)(b=n[k])&&(p=(w<3?b(p):w>3?b(c,g,p):b(c,g))||p);return w>3&&p&&Object.defineProperty(c,g,p),p},f=this&&this.__param||function(n,c){return function(g,y){c(g,y,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const d=l(9042),v=l(9924),m=l(844),E=l(4725),_=l(2585),s=l(3656);let a=i.AccessibilityManager=class extends m.Disposable{constructor(n,c,g,y){super(),this._terminal=n,this._coreBrowserService=g,this._renderService=y,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let b=0;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);if(this._topBoundaryFocusListener=b=>this._handleBoundaryFocus(b,0),this._bottomBoundaryFocusListener=b=>this._handleBoundaryFocus(b,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((b=>this._handleResize(b.rows)))),this.register(this._terminal.onRender((b=>this._refreshRows(b.start,b.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((b=>this._handleChar(b)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
159
|
-
`)))),this.register(this._terminal.onA11yTab((
|
|
160
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(n){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(n)||this._charsToConsume.push(n)}_refreshRows(n,c){this._liveRegionDebouncer.refresh(n,c,this._terminal.rows)}_renderRows(n,c){const g=this._terminal.buffer,y=g.lines.length.toString();for(let b=n;b<=c;b++){const w=g.lines.get(g.ydisp+b),p=[],k=(w==null?void 0:w.translateToString(!0,void 0,void 0,p))||"",A=(g.ydisp+b+1).toString(),L=this._rowElements[b];L&&(k.length===0?(L.innerText=" ",this._rowColumns.set(L,[0,1])):(L.textContent=k,this._rowColumns.set(L,p)),L.setAttribute("aria-posinset",A),L.setAttribute("aria-setsize",y))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(n,c){const g=n.target,y=this._rowElements[c===0?1:this._rowElements.length-2];if(g.getAttribute("aria-posinset")===(c===0?"1":`${this._terminal.buffer.lines.length}`)||n.relatedTarget!==y)return;let b,w;if(c===0?(b=g,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(b=this._rowElements.shift(),w=g,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),c===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(c===0?-1:1),this._rowElements[c===0?1:this._rowElements.length-2].focus(),n.preventDefault(),n.stopImmediatePropagation()}_handleSelectionChange(){var k;if(this._rowElements.length===0)return;const n=document.getSelection();if(!n)return;if(n.isCollapsed)return void(this._rowContainer.contains(n.anchorNode)&&this._terminal.clearSelection());if(!n.anchorNode||!n.focusNode)return void console.error("anchorNode and/or focusNode are null");let c={node:n.anchorNode,offset:n.anchorOffset},g={node:n.focusNode,offset:n.focusOffset};if((c.node.compareDocumentPosition(g.node)&Node.DOCUMENT_POSITION_PRECEDING||c.node===g.node&&c.offset>g.offset)&&([c,g]=[g,c]),c.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(c={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(c.node))return;const y=this._rowElements.slice(-1)[0];if(g.node.compareDocumentPosition(y)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(g={node:y,offset:((k=y.textContent)==null?void 0:k.length)??0}),!this._rowContainer.contains(g.node))return;const b=({node:A,offset:L})=>{const T=A instanceof Text?A.parentNode:A;let R=parseInt(T==null?void 0:T.getAttribute("aria-posinset"),10)-1;if(isNaN(R))return console.warn("row is invalid. Race condition?"),null;const M=this._rowColumns.get(T);if(!M)return console.warn("columns is null. Race condition?"),null;let F=L<M.length?M[L]:M.slice(-1)[0]+1;return F>=this._terminal.cols&&(++R,F=0),{row:R,column:F}},w=b(c),p=b(g);if(w&&p){if(w.row>p.row||w.row===p.row&&w.column>=p.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(p.row-w.row)*this._terminal.cols-w.column+p.column)}}_handleResize(n){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let c=this._rowContainer.children.length;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);for(;this._rowElements.length>n;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const n=this._coreBrowserService.mainDocument.createElement("div");return n.setAttribute("role","listitem"),n.tabIndex=-1,this._refreshRowDimensions(n),n}_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 n=0;n<this._terminal.rows;n++)this._refreshRowDimensions(this._rowElements[n])}}_refreshRowDimensions(n){n.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=a=h([f(1,_.IInstantiationService),f(2,E.ICoreBrowserService),f(3,E.IRenderService)],a)},3614:(S,i)=>{function l(v){return v.replace(/\r?\n/g,"\r")}function h(v,m){return m?"\x1B[200~"+v+"\x1B[201~":v}function f(v,m,E,_){v=h(v=l(v),E.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(v,!0),m.value=""}function d(v,m,E){const _=E.getBoundingClientRect(),s=v.clientX-_.left-10,a=v.clientY-_.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${s}px`,m.style.top=`${a}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=l,i.bracketTextForPaste=h,i.copyHandler=function(v,m){v.clipboardData&&v.clipboardData.setData("text/plain",m.selectionText),v.preventDefault()},i.handlePasteEvent=function(v,m,E,_){v.stopPropagation(),v.clipboardData&&f(v.clipboardData.getData("text/plain"),m,E,_)},i.paste=f,i.moveTextAreaUnderMouseCursor=d,i.rightClickHandler=function(v,m,E,_,s){d(v,m,E),s&&_.rightClickSelect(v),m.value=_.selectionText,m.select()}},7239:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const h=l(1505);i.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(f,d,v){this._css.set(f,d,v)}getCss(f,d){return this._css.get(f,d)}setColor(f,d,v){this._color.set(f,d,v)}getColor(f,d){return this._color.get(f,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(l,h,f,d){l.addEventListener(h,f,d);let v=!1;return{dispose:()=>{v||(v=!0,l.removeEventListener(h,f,d))}}}},3551:function(S,i,l){var h=this&&this.__decorate||function(a,n,c,g){var y,b=arguments.length,w=b<3?n:g===null?g=Object.getOwnPropertyDescriptor(n,c):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(a,n,c,g);else for(var p=a.length-1;p>=0;p--)(y=a[p])&&(w=(b<3?y(w):b>3?y(n,c,w):y(n,c))||w);return b>3&&w&&Object.defineProperty(n,c,w),w},f=this&&this.__param||function(a,n){return function(c,g){n(c,g,a)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const d=l(3656),v=l(8460),m=l(844),E=l(2585),_=l(4725);let s=i.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(a,n,c,g,y){super(),this._element=a,this._mouseService=n,this._renderService=c,this._bufferService=g,this._linkProviderService=y,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var b;this._lastMouseEvent=void 0,(b=this._activeProviderReplies)==null||b.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){this._lastMouseEvent=a;const n=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!n)return;this._isMouseOut=!1;const c=a.composedPath();for(let g=0;g<c.length;g++){const y=c[g];if(y.classList.contains("xterm"))break;if(y.classList.contains("xterm-hover"))return}this._lastBufferCell&&n.x===this._lastBufferCell.x&&n.y===this._lastBufferCell.y||(this._handleHover(n),this._lastBufferCell=n)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,n){var g,y;this._activeProviderReplies&&n||((g=this._activeProviderReplies)==null||g.forEach((b=>{b==null||b.forEach((w=>{w.link.dispose&&w.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=a.y);let c=!1;for(const[b,w]of this._linkProviderService.linkProviders.entries())n?(y=this._activeProviderReplies)!=null&&y.get(b)&&(c=this._checkLinkProviderResult(b,a,c)):w.provideLinks(a.y,(p=>{var A,L;if(this._isMouseOut)return;const k=p==null?void 0:p.map((T=>({link:T})));(A=this._activeProviderReplies)==null||A.set(b,k),c=this._checkLinkProviderResult(b,a,c),((L=this._activeProviderReplies)==null?void 0:L.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)}))}_removeIntersectingLinks(a,n){const c=new Set;for(let g=0;g<n.size;g++){const y=n.get(g);if(y)for(let b=0;b<y.length;b++){const w=y[b],p=w.link.range.start.y<a?0:w.link.range.start.x,k=w.link.range.end.y>a?this._bufferService.cols:w.link.range.end.x;for(let A=p;A<=k;A++){if(c.has(A)){y.splice(b--,1);break}c.add(A)}}}}_checkLinkProviderResult(a,n,c){var b;if(!this._activeProviderReplies)return c;const g=this._activeProviderReplies.get(a);let y=!1;for(let w=0;w<a;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(y=!0);if(!y&&g){const w=g.find((p=>this._linkAtPosition(p.link,n)));w&&(c=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!c)for(let w=0;w<this._activeProviderReplies.size;w++){const p=(b=this._activeProviderReplies.get(w))==null?void 0:b.find((k=>this._linkAtPosition(k.link,n)));if(p){c=!0,this._handleNewLink(p);break}}return c}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const n=this._positionFromMouseEvent(a,this._element,this._mouseService);n&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,n){this._currentLink&&this._lastMouseEvent&&(!a||!n||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=n)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._linkAtPosition(a.link,n)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var c,g;return(g=(c=this._currentLink)==null?void 0:c.state)==null?void 0:g.decorations.pointerCursor},set:c=>{var g;(g=this._currentLink)!=null&&g.state&&this._currentLink.state.decorations.pointerCursor!==c&&(this._currentLink.state.decorations.pointerCursor=c,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",c))}},underline:{get:()=>{var c,g;return(g=(c=this._currentLink)==null?void 0:c.state)==null?void 0:g.decorations.underline},set:c=>{var g,y,b;(g=this._currentLink)!=null&&g.state&&((b=(y=this._currentLink)==null?void 0:y.state)==null?void 0:b.decorations.underline)!==c&&(this._currentLink.state.decorations.underline=c,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,c))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((c=>{if(!this._currentLink)return;const g=c.start===0?0:c.start+1+this._bufferService.buffer.ydisp,y=this._bufferService.buffer.ydisp+1+c.end;if(this._currentLink.link.range.start.y>=g&&this._currentLink.link.range.end.y<=y&&(this._clearCurrentLink(g,y),this._lastMouseEvent)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}}))))}_linkHover(a,n,c){var g;(g=this._currentLink)!=null&&g.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),n.hover&&n.hover(c,n.text)}_fireUnderlineEvent(a,n){const c=a.range,g=this._bufferService.buffer.ydisp,y=this._createLinkUnderlineEvent(c.start.x-1,c.start.y-g-1,c.end.x,c.end.y-g-1,void 0);(n?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(y)}_linkLeave(a,n,c){var g;(g=this._currentLink)!=null&&g.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),n.leave&&n.leave(c,n.text)}_linkAtPosition(a,n){const c=a.range.start.y*this._bufferService.cols+a.range.start.x,g=a.range.end.y*this._bufferService.cols+a.range.end.x,y=n.y*this._bufferService.cols+n.x;return c<=y&&y<=g}_positionFromMouseEvent(a,n,c){const g=c.getCoords(a,n,this._bufferService.cols,this._bufferService.rows);if(g)return{x:g[0],y:g[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,n,c,g,y){return{x1:a,y1:n,x2:c,y2:g,cols:this._bufferService.cols,fg:y}}};i.Linkifier=s=h([f(1,_.IMouseService),f(2,_.IRenderService),f(3,E.IBufferService),f(4,_.ILinkProviderService)],s)},9042:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(S,i,l){var h=this&&this.__decorate||function(_,s,a,n){var c,g=arguments.length,y=g<3?s:n===null?n=Object.getOwnPropertyDescriptor(s,a):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(_,s,a,n);else for(var b=_.length-1;b>=0;b--)(c=_[b])&&(y=(g<3?c(y):g>3?c(s,a,y):c(s,a))||y);return g>3&&y&&Object.defineProperty(s,a,y),y},f=this&&this.__param||function(_,s){return function(a,n){s(a,n,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const d=l(511),v=l(2585);let m=i.OscLinkProvider=class{constructor(_,s,a){this._bufferService=_,this._optionsService=s,this._oscLinkService=a}provideLinks(_,s){var k;const a=this._bufferService.buffer.lines.get(_-1);if(!a)return void s(void 0);const n=[],c=this._optionsService.rawOptions.linkHandler,g=new d.CellData,y=a.getTrimmedLength();let b=-1,w=-1,p=!1;for(let A=0;A<y;A++)if(w!==-1||a.hasContent(A)){if(a.loadCell(A,g),g.hasExtendedAttrs()&&g.extended.urlId){if(w===-1){w=A,b=g.extended.urlId;continue}p=g.extended.urlId!==b}else w!==-1&&(p=!0);if(p||w!==-1&&A===y-1){const L=(k=this._oscLinkService.getLinkData(b))==null?void 0:k.uri;if(L){const T={start:{x:w+1,y:_},end:{x:A+(p||A!==y-1?0:1),y:_}};let R=!1;if(!(c!=null&&c.allowNonHttpProtocols))try{const M=new URL(L);["http:","https:"].includes(M.protocol)||(R=!0)}catch{R=!0}R||n.push({text:L,range:T,activate:(M,F)=>c?c.activate(M,F,T):E(0,F),hover:(M,F)=>{var $;return($=c==null?void 0:c.hover)==null?void 0:$.call(c,M,F,T)},leave:(M,F)=>{var $;return($=c==null?void 0:c.leave)==null?void 0:$.call(c,M,F,T)}})}p=!1,g.hasExtendedAttrs()&&g.extended.urlId?(w=A,b=g.extended.urlId):(w=-1,b=-1)}}s(n)}};function E(_,s){if(confirm(`Do you want to navigate to ${s}?
|
|
157
|
+
`;Hn([j({type:String})],kr.prototype,"copyText",2);kr=Hn([xe("copy-button")],kr);var vr={exports:{}},vc=vr.exports,ks;function mc(){return ks||(ks=1,(function(e,t){(function(r,i){e.exports=i()})(vc,(()=>(()=>{var r={930:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const h=c(485);s.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(f,u,g){this._css.set(f,u,g)}getCss(f,u){return this._css.get(f,u)}setColor(f,u,g){this._color.set(f,u,g)}getColor(f,u){return this._color.get(f,u)}clear(){this._color.clear(),this._css.clear()}}},997:function(v,s,c){var h=this&&this.__decorate||function(w,b,k,R){var L,T=arguments.length,A=T<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(w,b,k,R);else for(var F=w.length-1;F>=0;F--)(L=w[F])&&(A=(T<3?L(A):T>3?L(b,k,A):L(b,k))||A);return T>3&&A&&Object.defineProperty(b,k,A),A},f=this&&this.__param||function(w,b){return function(k,R){b(k,R,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=c(930),g=c(160),y=c(345),E=c(859),p=c(97),n=g.css.toColor("#ffffff"),l=g.css.toColor("#000000"),o=g.css.toColor("#ffffff"),d=g.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let k=0;k<216;k++){const R=b[k/36%6|0],L=b[k/6%6|0],T=b[k%6];w.push({css:g.channels.toCss(R,L,T),rgba:g.channels.toRgba(R,L,T)})}for(let k=0;k<24;k++){const R=8+10*k;w.push({css:g.channels.toCss(R,R,R),rgba:g.channels.toRgba(R,R,R)})}return w})());let C=s.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new y.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:l,cursor:o,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:g.color.blend(l,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:g.color.blend(l,_),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(w={}){const b=this._colors;if(b.foreground=S(w.foreground,n),b.background=S(w.background,l),b.cursor=S(w.cursor,o),b.cursorAccent=S(w.cursorAccent,d),b.selectionBackgroundTransparent=S(w.selectionBackground,_),b.selectionBackgroundOpaque=g.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=S(w.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=g.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=w.selectionForeground?S(w.selectionForeground,g.NULL_COLOR):void 0,b.selectionForeground===g.NULL_COLOR&&(b.selectionForeground=void 0),g.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=g.color.opacity(b.selectionBackgroundTransparent,.3)),g.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=g.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=s.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=S(w.black,s.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=S(w.red,s.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=S(w.green,s.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=S(w.yellow,s.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=S(w.blue,s.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=S(w.magenta,s.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=S(w.cyan,s.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=S(w.white,s.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=S(w.brightBlack,s.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=S(w.brightRed,s.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=S(w.brightGreen,s.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=S(w.brightYellow,s.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=S(w.brightBlue,s.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=S(w.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=S(w.brightCyan,s.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=S(w.brightWhite,s.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const k=Math.min(b.ansi.length-16,w.extendedAnsi.length);for(let R=0;R<k;R++)b.ansi[R+16]=S(w.extendedAnsi[R],s.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}modifyColors(w){w(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 S(w,b){if(w!==void 0)try{return g.css.toColor(w)}catch{}return b}s.ThemeService=C=h([f(0,p.IOptionsService)],C)},160:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let c=0,h=0,f=0,u=0;var g,y,E,p,n;function l(d){const _=d.toString(16);return _.length<2?"0"+_:_}function o(d,_){return d<_?(_+.05)/(d+.05):(d+.05)/(_+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(_,C,S,w){return w!==void 0?`#${l(_)}${l(C)}${l(S)}${l(w)}`:`#${l(_)}${l(C)}${l(S)}`},d.toRgba=function(_,C,S,w=255){return(_<<24|C<<16|S<<8|w)>>>0},d.toColor=function(_,C,S,w){return{css:d.toCss(_,C,S,w),rgba:d.toRgba(_,C,S,w)}}})(g||(s.channels=g={})),(function(d){function _(C,S){return u=Math.round(255*S),[c,h,f]=n.toChannels(C.rgba),{css:g.toCss(c,h,f,u),rgba:g.toRgba(c,h,f,u)}}d.blend=function(C,S){if(u=(255&S.rgba)/255,u===1)return{css:S.css,rgba:S.rgba};const w=S.rgba>>24&255,b=S.rgba>>16&255,k=S.rgba>>8&255,R=C.rgba>>24&255,L=C.rgba>>16&255,T=C.rgba>>8&255;return c=R+Math.round((w-R)*u),h=L+Math.round((b-L)*u),f=T+Math.round((k-T)*u),{css:g.toCss(c,h,f),rgba:g.toRgba(c,h,f)}},d.isOpaque=function(C){return(255&C.rgba)==255},d.ensureContrastRatio=function(C,S,w){const b=n.ensureContrastRatio(C.rgba,S.rgba,w);if(b)return g.toColor(b>>24&255,b>>16&255,b>>8&255)},d.opaque=function(C){const S=(255|C.rgba)>>>0;return[c,h,f]=n.toChannels(S),{css:g.toCss(c,h,f),rgba:S}},d.opacity=_,d.multiplyOpacity=function(C,S){return u=255&C.rgba,_(C,u*S/255)},d.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}})(y||(s.color=y={})),(function(d){let _,C;try{const S=document.createElement("canvas");S.width=1,S.height=1;const w=S.getContext("2d",{willReadFrequently:!0});w&&(_=w,_.globalCompositeOperation="copy",C=_.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return c=parseInt(S.slice(1,2).repeat(2),16),h=parseInt(S.slice(2,3).repeat(2),16),f=parseInt(S.slice(3,4).repeat(2),16),g.toColor(c,h,f);case 5:return c=parseInt(S.slice(1,2).repeat(2),16),h=parseInt(S.slice(2,3).repeat(2),16),f=parseInt(S.slice(3,4).repeat(2),16),u=parseInt(S.slice(4,5).repeat(2),16),g.toColor(c,h,f,u);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const w=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return c=parseInt(w[1]),h=parseInt(w[2]),f=parseInt(w[3]),u=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(c,h,f,u);if(!_||!C)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=C,_.fillStyle=S,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[c,h,f,u]=_.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(c,h,f,u),css:S}}})(E||(s.css=E={})),(function(d){function _(C,S,w){const b=C/255,k=S/255,R=w/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}d.relativeLuminance=function(C){return _(C>>16&255,C>>8&255,255&C)},d.relativeLuminance2=_})(p||(s.rgb=p={})),(function(d){function _(S,w,b){const k=S>>24&255,R=S>>16&255,L=S>>8&255;let T=w>>24&255,A=w>>16&255,F=w>>8&255,U=o(p.relativeLuminance2(T,A,F),p.relativeLuminance2(k,R,L));for(;U<b&&(T>0||A>0||F>0);)T-=Math.max(0,Math.ceil(.1*T)),A-=Math.max(0,Math.ceil(.1*A)),F-=Math.max(0,Math.ceil(.1*F)),U=o(p.relativeLuminance2(T,A,F),p.relativeLuminance2(k,R,L));return(T<<24|A<<16|F<<8|255)>>>0}function C(S,w,b){const k=S>>24&255,R=S>>16&255,L=S>>8&255;let T=w>>24&255,A=w>>16&255,F=w>>8&255,U=o(p.relativeLuminance2(T,A,F),p.relativeLuminance2(k,R,L));for(;U<b&&(T<255||A<255||F<255);)T=Math.min(255,T+Math.ceil(.1*(255-T))),A=Math.min(255,A+Math.ceil(.1*(255-A))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=o(p.relativeLuminance2(T,A,F),p.relativeLuminance2(k,R,L));return(T<<24|A<<16|F<<8|255)>>>0}d.blend=function(S,w){if(u=(255&w)/255,u===1)return w;const b=w>>24&255,k=w>>16&255,R=w>>8&255,L=S>>24&255,T=S>>16&255,A=S>>8&255;return c=L+Math.round((b-L)*u),h=T+Math.round((k-T)*u),f=A+Math.round((R-A)*u),g.toRgba(c,h,f)},d.ensureContrastRatio=function(S,w,b){const k=p.relativeLuminance(S>>8),R=p.relativeLuminance(w>>8);if(o(k,R)<b){if(R<k){const A=_(S,w,b),F=o(k,p.relativeLuminance(A>>8));if(F<b){const U=C(S,w,b);return F>o(k,p.relativeLuminance(U>>8))?A:U}return A}const L=C(S,w,b),T=o(k,p.relativeLuminance(L>>8));if(T<b){const A=_(S,w,b);return T>o(k,p.relativeLuminance(A>>8))?L:A}return L}},d.reduceLuminance=_,d.increaseLuminance=C,d.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(n||(s.rgba=n={})),s.toPaddedHex=l,s.contrastRatio=o},345:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,h){return c((f=>h.fire(f)))},s.runAndSubscribe=function(c,h){return h(void 0),c((f=>h(f)))}},859:(v,s)=>{function c(h){for(const f of h)f.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const f=this._disposables.indexOf(h);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var f;this._isDisposed||h===this._value||((f=this._value)==null||f.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}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=c,s.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},485:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(f,u,g){this._data[f]||(this._data[f]={}),this._data[f][u]=g}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(h,f,u,g,y){this._data.get(h,f)||this._data.set(h,f,new c),this._data.get(h,f).set(u,g,y)}get(h,f,u,g){var y;return(y=this._data.get(h,f))==null?void 0:y.get(u,g)}clear(){this._data.clear()}}},726:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",h="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(f){return f[h]||[]},s.createDecorator=function(f){if(s.serviceRegistry.has(f))return s.serviceRegistry.get(f);const u=function(g,y,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,n,l){n[c]===n?n[h].push({id:p,index:l}):(n[h]=[{id:p,index:l}],n[c]=n)})(u,g,E)};return u.toString=()=>f,s.serviceRegistry.set(f,u),u}},97:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=c(726);var f;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(f||(s.LogLevelEnum=f={})),s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")}},i={};function a(v){var s=i[v];if(s!==void 0)return s.exports;var c=i[v]={exports:{}};return r[v].call(c.exports,c,c.exports,a),c.exports}var m={};return(()=>{var v=m;Object.defineProperty(v,"__esModule",{value:!0}),v.HTMLSerializeHandler=v.SerializeAddon=void 0;const s=a(997);function c(p,n,l){return Math.max(n,Math.min(p,l))}class h{constructor(n){this._buffer=n}serialize(n,l){const o=this._buffer.getNullCell(),d=this._buffer.getNullCell();let _=o;const C=n.start.y,S=n.end.y,w=n.start.x,b=n.end.x;this._beforeSerialize(S-C,C,S);for(let k=C;k<=S;k++){const R=this._buffer.getLine(k);if(R){const L=k===n.start.y?w:0,T=k===n.end.y?b:R.length;for(let A=L;A<T;A++){const F=R.getCell(A,_===o?d:o);F?(this._nextCell(F,_,k,A),_=F):console.warn(`Can't get cell at row=${k}, col=${A}`)}}this._rowEnd(k,k===S)}return this._afterSerialize(),this._serializeString(l)}_nextCell(n,l,o,d){}_rowEnd(n,l){}_beforeSerialize(n,l,o){}_afterSerialize(){}_serializeString(n){return""}}function f(p,n){return p.getFgColorMode()===n.getFgColorMode()&&p.getFgColor()===n.getFgColor()}function u(p,n){return p.getBgColorMode()===n.getBgColorMode()&&p.getBgColor()===n.getBgColor()}function g(p,n){return p.isInverse()===n.isInverse()&&p.isBold()===n.isBold()&&p.isUnderline()===n.isUnderline()&&p.isOverline()===n.isOverline()&&p.isBlink()===n.isBlink()&&p.isInvisible()===n.isInvisible()&&p.isItalic()===n.isItalic()&&p.isDim()===n.isDim()&&p.isStrikethrough()===n.isStrikethrough()}class y extends h{constructor(n,l){super(n),this._terminal=l,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(n,l,o){this._allRows=new Array(n),this._lastContentCursorRow=l,this._lastCursorRow=l,this._firstRow=l}_rowEnd(n,l){var d;this._nullCellCount>0&&!u(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let o="";if(!l){n-this._firstRow>=this._terminal.rows&&((d=this._buffer.getLine(this._cursorStyleRow))==null||d.getCell(this._cursorStyleCol,this._backgroundCell));const _=this._buffer.getLine(n),C=this._buffer.getLine(n+1);if(C.isWrapped){o="";const S=_.getCell(_.length-1,this._thisRowLastChar),w=_.getCell(_.length-2,this._thisRowLastSecondChar),b=C.getCell(0,this._nextRowFirstChar),k=b.getWidth()>1;let R=!1;(b.getChars()&&k?this._nullCellCount<=1:this._nullCellCount<=0)&&((S.getChars()||S.getWidth()===0)&&u(S,b)&&(R=!0),k&&(w.getChars()||w.getWidth()===0)&&u(S,b)&&u(w,b)&&(R=!0)),R||(o="-".repeat(this._nullCellCount+1),o+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(o+="\x1B[A",o+=`\x1B[${_.length-this._nullCellCount}C`,o+=`\x1B[${this._nullCellCount}X`,o+=`\x1B[${_.length-this._nullCellCount}D`,o+="\x1B[B"),this._lastContentCursorRow=n+1,this._lastContentCursorCol=0,this._lastCursorRow=n+1,this._lastCursorCol=0)}else o=`\r
|
|
158
|
+
`,this._lastCursorRow=n+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=o,this._currentRow="",this._nullCellCount=0}_diffStyle(n,l){const o=[],d=!f(n,l),_=!u(n,l),C=!g(n,l);if(d||_||C)if(n.isAttributeDefault())l.isAttributeDefault()||o.push(0);else{if(d){const S=n.getFgColor();n.isFgRGB()?o.push(38,2,S>>>16&255,S>>>8&255,255&S):n.isFgPalette()?S>=16?o.push(38,5,S):o.push(8&S?90+(7&S):30+(7&S)):o.push(39)}if(_){const S=n.getBgColor();n.isBgRGB()?o.push(48,2,S>>>16&255,S>>>8&255,255&S):n.isBgPalette()?S>=16?o.push(48,5,S):o.push(8&S?100+(7&S):40+(7&S)):o.push(49)}C&&(n.isInverse()!==l.isInverse()&&o.push(n.isInverse()?7:27),n.isBold()!==l.isBold()&&o.push(n.isBold()?1:22),n.isUnderline()!==l.isUnderline()&&o.push(n.isUnderline()?4:24),n.isOverline()!==l.isOverline()&&o.push(n.isOverline()?53:55),n.isBlink()!==l.isBlink()&&o.push(n.isBlink()?5:25),n.isInvisible()!==l.isInvisible()&&o.push(n.isInvisible()?8:28),n.isItalic()!==l.isItalic()&&o.push(n.isItalic()?3:23),n.isDim()!==l.isDim()&&o.push(n.isDim()?2:22),n.isStrikethrough()!==l.isStrikethrough()&&o.push(n.isStrikethrough()?9:29))}return o}_nextCell(n,l,o,d){if(n.getWidth()===0)return;const _=n.getChars()==="",C=this._diffStyle(n,this._cursorStyle);if(_?!u(this._cursorStyle,n):C.length>0){this._nullCellCount>0&&(u(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=o,this._lastContentCursorCol=this._lastCursorCol=d,this._currentRow+=`\x1B[${C.join(";")}m`;const S=this._buffer.getLine(o);S!==void 0&&(S.getCell(d,this._cursorStyle),this._cursorStyleRow=o,this._cursorStyleCol=d)}_?this._nullCellCount+=n.getWidth():(this._nullCellCount>0&&(u(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=n.getChars(),this._lastContentCursorRow=this._lastCursorRow=o,this._lastContentCursorCol=this._lastCursorCol=d+n.getWidth())}_serializeString(n){let l=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(l=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let o="";for(let S=0;S<l;S++)o+=this._allRows[S],S+1<l&&(o+=this._allRowSeparators[S]);if(!n){const S=this._buffer.baseY+this._buffer.cursorY,w=this._buffer.cursorX,b=k=>{k>0?o+=`\x1B[${k}C`:k<0&&(o+=`\x1B[${-k}D`)};(S!==this._lastCursorRow||w!==this._lastCursorCol)&&((d=S-this._lastCursorRow)>0?o+=`\x1B[${d}B`:d<0&&(o+=`\x1B[${-d}A`),b(w-this._lastCursorCol))}var d;const _=this._terminal._core._inputHandler._curAttrData,C=this._diffStyle(_,this._cursorStyle);return C.length>0&&(o+=`\x1B[${C.join(";")}m`),o}}v.SerializeAddon=class{activate(p){this._terminal=p}_serializeBufferByScrollback(p,n,l){const o=n.length,d=l===void 0?o:c(l+p.rows,0,o);return this._serializeBufferByRange(p,n,{start:o-d,end:o-1},!1)}_serializeBufferByRange(p,n,l,o){return new y(n,p).serialize({start:{x:0,y:typeof l.start=="number"?l.start:l.start.line},end:{x:p.cols,y:typeof l.end=="number"?l.end:l.end.line}},o)}_serializeBufferAsHTML(p,n){var _;const l=p.buffer.active,o=new E(l,p,n);if(!n.onlySelection){const C=l.length,S=n.scrollback,w=S===void 0?C:c(S+p.rows,0,C);return o.serialize({start:{x:0,y:C-w},end:{x:p.cols,y:C-1}})}const d=(_=this._terminal)==null?void 0:_.getSelectionPosition();return d!==void 0?o.serialize({start:{x:d.start.x,y:d.start.y},end:{x:d.end.x,y:d.end.y}}):""}_serializeModes(p){let n="";const l=p.modes;if(l.applicationCursorKeysMode&&(n+="\x1B[?1h"),l.applicationKeypadMode&&(n+="\x1B[?66h"),l.bracketedPasteMode&&(n+="\x1B[?2004h"),l.insertMode&&(n+="\x1B[4h"),l.originMode&&(n+="\x1B[?6h"),l.reverseWraparoundMode&&(n+="\x1B[?45h"),l.sendFocusMode&&(n+="\x1B[?1004h"),l.wraparoundMode===!1&&(n+="\x1B[?7l"),l.mouseTrackingMode!=="none")switch(l.mouseTrackingMode){case"x10":n+="\x1B[?9h";break;case"vt200":n+="\x1B[?1000h";break;case"drag":n+="\x1B[?1002h";break;case"any":n+="\x1B[?1003h"}return n}serialize(p){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let n=p!=null&&p.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,p.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,p==null?void 0:p.scrollback);return p!=null&&p.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(n+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),p!=null&&p.excludeModes||(n+=this._serializeModes(this._terminal)),n}serializeAsHTML(p){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,p||{})}dispose(){}};class E extends h{constructor(n,l,o){super(n),this._terminal=l,this._options=o,this._currentRow="",this._htmlContent="",l._core._themeService?this._ansiColors=l._core._themeService.colors.ansi:this._ansiColors=s.DEFAULT_ANSI_COLORS}_padStart(n,l,o){return l>>=0,o=o??" ",n.length>l?n:((l-=n.length)>o.length&&(o+=o.repeat(l/o.length)),o.slice(0,l)+n)}_beforeSerialize(n,l,o){var S,w;this._htmlContent+="<html><body><!--StartFragment--><pre>";let d="#000000",_="#ffffff";this._options.includeGlobalBackground&&(d=((S=this._terminal.options.theme)==null?void 0:S.foreground)??"#ffffff",_=((w=this._terminal.options.theme)==null?void 0:w.background)??"#000000");const C=[];C.push("color: "+d+";"),C.push("background-color: "+_+";"),C.push("font-family: "+this._terminal.options.fontFamily+";"),C.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+C.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(n,l){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(n,l){const o=l?n.getFgColor():n.getBgColor();return(l?n.isFgRGB():n.isBgRGB())?"#"+[o>>16&255,o>>8&255,255&o].map((d=>this._padStart(d.toString(16),2,"0"))).join(""):(l?n.isFgPalette():n.isBgPalette())?this._ansiColors[o].css:void 0}_diffStyle(n,l){const o=[],d=!f(n,l),_=!u(n,l),C=!g(n,l);if(d||_||C){const S=this._getHexColor(n,!0);S&&o.push("color: "+S+";");const w=this._getHexColor(n,!1);return w&&o.push("background-color: "+w+";"),n.isInverse()&&o.push("color: #000000; background-color: #BFBFBF;"),n.isBold()&&o.push("font-weight: bold;"),n.isUnderline()&&n.isOverline()?o.push("text-decoration: overline underline;"):n.isUnderline()?o.push("text-decoration: underline;"):n.isOverline()&&o.push("text-decoration: overline;"),n.isBlink()&&o.push("text-decoration: blink;"),n.isInvisible()&&o.push("visibility: hidden;"),n.isItalic()&&o.push("font-style: italic;"),n.isDim()&&o.push("opacity: 0.5;"),n.isStrikethrough()&&o.push("text-decoration: line-through;"),o}}_nextCell(n,l,o,d){if(n.getWidth()===0)return;const _=n.getChars()==="",C=this._diffStyle(n,l);C&&(this._currentRow+=C.length===0?"</span><span>":"</span><span style='"+C.join(" ")+"'>"),this._currentRow+=_?" ":n.getChars()}_serializeString(){return this._htmlContent}}v.HTMLSerializeHandler=E})(),m})()))})(vr)),vr.exports}var bc=mc(),mr={exports:{}},Sc=mr.exports,Is;function yc(){return Is||(Is=1,(function(e,t){(function(r,i){e.exports=i()})(Sc,(()=>(()=>{var r={433:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const h=c(938),f=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],u=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],g=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],y=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let E;function p(n,l){let o,d=0,_=l.length-1;if(n<l[0][0]||n>l[_][1])return!1;for(;_>=d;)if(o=d+_>>1,n>l[o][1])d=o+1;else{if(!(n<l[o][0]))return!0;_=o-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!E){E=new Uint8Array(65536),E.fill(1),E[0]=0,E.fill(0,1,32),E.fill(0,127,160);for(let n=0;n<f.length;++n)E.fill(0,f[n][0],f[n][1]+1);for(let n=0;n<g.length;++n)E.fill(2,g[n][0],g[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?E[n]:p(n,u)?0:p(n,y)?2:1}charProperties(n,l){let o=this.wcwidth(n),d=o===0&&l!==0;if(d){const _=h.UnicodeService.extractWidth(l);_===0?d=!1:_>o&&(o=_)}return h.UnicodeService.createPropertyValue(0,o,d)}}},345:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,h){return c((f=>h.fire(f)))},s.runAndSubscribe=function(c,h){return h(void 0),c((f=>h(f)))}},490:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const h=c(938),f=[[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]],u=[[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 g;s.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let y=0;y<f.length;++y)g.fill(0,f[y][0],f[y][1]+1)}}wcwidth(y){return y<32?0:y<127?1:y<65536?g[y]:(function(E,p){let n,l=0,o=p.length-1;if(E<p[0][0]||E>p[o][1])return!1;for(;o>=l;)if(n=l+o>>1,E>p[n][1])l=n+1;else{if(!(E<p[n][0]))return!0;o=n-1}return!1})(y,u)?0:y>=131072&&y<=196605||y>=196608&&y<=262141?2:1}charProperties(y,E){let p=this.wcwidth(y),n=p===0&&E!==0;if(n){const l=h.UnicodeService.extractWidth(E);l===0?n=!1:l>p&&(p=l)}return h.UnicodeService.createPropertyValue(0,p,n)}}},938:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=c(345),f=c(490);class u{static extractShouldJoin(y){return(1&y)!=0}static extractWidth(y){return y>>1&3}static extractCharKind(y){return y>>3}static createPropertyValue(y,E,p=!1){return(16777215&y)<<3|(3&E)<<1|(p?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const y=new f.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(y){if(!this._providers[y])throw new Error(`unknown Unicode version "${y}"`);this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)}register(y){this._providers[y.version]=y}wcwidth(y){return this._activeProvider.wcwidth(y)}getStringCellWidth(y){let E=0,p=0;const n=y.length;for(let l=0;l<n;++l){let o=y.charCodeAt(l);if(55296<=o&&o<=56319){if(++l>=n)return E+this.wcwidth(o);const C=y.charCodeAt(l);56320<=C&&C<=57343?o=1024*(o-55296)+C-56320+65536:E+=this.wcwidth(C)}const d=this.charProperties(o,p);let _=u.extractWidth(d);u.extractShouldJoin(d)&&(_-=u.extractWidth(p)),E+=_,p=d}return E}charProperties(y,E){return this._activeProvider.charProperties(y,E)}}s.UnicodeService=u}},i={};function a(v){var s=i[v];if(s!==void 0)return s.exports;var c=i[v]={exports:{}};return r[v](c,c.exports,a),c.exports}var m={};return(()=>{var v=m;Object.defineProperty(v,"__esModule",{value:!0}),v.Unicode11Addon=void 0;const s=a(433);v.Unicode11Addon=class{activate(c){c.unicode.register(new s.UnicodeV11)}dispose(){}}})(),m})()))})(mr)),mr.exports}var Cc=yc(),Qr={exports:{}},Bs;function wc(){return Bs||(Bs=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={6:(v,s)=>{function c(f){try{const u=new URL(f),g=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return f.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(f,u,g,y={}){this._terminal=f,this._regex=u,this._handler=g,this._options=y}provideLinks(f,u){const g=h.computeLink(f,this._regex,this._terminal,this._handler);u(this._addCallbacks(g))}_addCallbacks(f){return f.map((u=>(u.leave=this._options.leave,u.hover=(g,y)=>{if(this._options.hover){const{range:E}=u;this._options.hover(g,y,E)}},u)))}};class h{static computeLink(u,g,y,E){const p=new RegExp(g.source,(g.flags||"")+"g"),[n,l]=h._getWindowedLineStrings(u-1,y),o=n.join("");let d;const _=[];for(;d=p.exec(o);){const C=d[0];if(!c(C))continue;const[S,w]=h._mapStrIdx(y,l,0,d.index),[b,k]=h._mapStrIdx(y,S,w,C.length);if(S===-1||w===-1||b===-1||k===-1)continue;const R={start:{x:w+1,y:S+1},end:{x:k,y:b+1}};_.push({range:R,text:C,activate:E})}return _}static _getWindowedLineStrings(u,g){let y,E=u,p=u,n=0,l="";const o=[];if(y=g.buffer.active.getLine(u)){const d=y.translateToString(!0);if(y.isWrapped&&d[0]!==" "){for(n=0;(y=g.buffer.active.getLine(--E))&&n<2048&&(l=y.translateToString(!0),n+=l.length,o.push(l),y.isWrapped&&l.indexOf(" ")===-1););o.reverse()}for(o.push(d),n=0;(y=g.buffer.active.getLine(++p))&&y.isWrapped&&n<2048&&(l=y.translateToString(!0),n+=l.length,o.push(l),l.indexOf(" ")===-1););}return[o,E]}static _mapStrIdx(u,g,y,E){const p=u.buffer.active,n=p.getNullCell();let l=y;for(;E;){const o=p.getLine(g);if(!o)return[-1,-1];for(let d=l;d<o.length;++d){o.getCell(d,n);const _=n.getChars();if(n.getWidth()&&(E-=_.length||1,d===o.length-1&&_==="")){const C=p.getLine(g+1);C&&C.isWrapped&&(C.getCell(0,n),n.getWidth()===2&&(E+=1))}if(E<0)return[g,d]}g++,l=0}return[g,l]}}s.LinkComputer=h}},i={};function a(v){var s=i[v];if(s!==void 0)return s.exports;var c=i[v]={exports:{}};return r[v](c,c.exports,a),c.exports}var m={};return(()=>{var v=m;Object.defineProperty(v,"__esModule",{value:!0}),v.WebLinksAddon=void 0;const s=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(f,u){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}v.WebLinksAddon=class{constructor(f=h,u={}){this._handler=f,this._options=u}activate(f){this._terminal=f;const u=this._options,g=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,g,this._handler,u))}dispose(){var f;(f=this._linkProvider)==null||f.dispose()}}})(),m})()))})(Qr)),Qr.exports}var Ec=wc(),ei={exports:{}},As;function kc(){return As||(As=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,(()=>(()=>{var r={4567:function(v,s,c){var h=this&&this.__decorate||function(o,d,_,C){var S,w=arguments.length,b=w<3?d:C===null?C=Object.getOwnPropertyDescriptor(d,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,d,_,C);else for(var k=o.length-1;k>=0;k--)(S=o[k])&&(b=(w<3?S(b):w>3?S(d,_,b):S(d,_))||b);return w>3&&b&&Object.defineProperty(d,_,b),b},f=this&&this.__param||function(o,d){return function(_,C){d(_,C,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=c(9042),g=c(9924),y=c(844),E=c(4725),p=c(2585),n=c(3656);let l=s.AccessibilityManager=class extends y.Disposable{constructor(o,d,_,C){super(),this._terminal=o,this._coreBrowserService=_,this._renderService=C,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 S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,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 g.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((S=>this._handleResize(S.rows)))),this.register(this._terminal.onRender((S=>this._refreshRows(S.start,S.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((S=>this._handleChar(S)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
159
|
+
`)))),this.register(this._terminal.onA11yTab((S=>this._handleTab(S)))),this.register(this._terminal.onKey((S=>this._handleKey(S.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,y.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(o){for(let d=0;d<o;d++)this._handleChar(" ")}_handleChar(o){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==o&&(this._charsToAnnounce+=o):this._charsToAnnounce+=o,o===`
|
|
160
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(o){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(o)||this._charsToConsume.push(o)}_refreshRows(o,d){this._liveRegionDebouncer.refresh(o,d,this._terminal.rows)}_renderRows(o,d){const _=this._terminal.buffer,C=_.lines.length.toString();for(let S=o;S<=d;S++){const w=_.lines.get(_.ydisp+S),b=[],k=(w==null?void 0:w.translateToString(!0,void 0,void 0,b))||"",R=(_.ydisp+S+1).toString(),L=this._rowElements[S];L&&(k.length===0?(L.innerText=" ",this._rowColumns.set(L,[0,1])):(L.textContent=k,this._rowColumns.set(L,b)),L.setAttribute("aria-posinset",R),L.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(o,d){const _=o.target,C=this._rowElements[d===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(d===0?"1":`${this._terminal.buffer.lines.length}`)||o.relatedTarget!==C)return;let S,w;if(d===0?(S=_,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(S=this._rowElements.shift(),w=_,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),d===0){const b=this._createAccessibilityTreeNode();this._rowElements.unshift(b),this._rowContainer.insertAdjacentElement("afterbegin",b)}else{const b=this._createAccessibilityTreeNode();this._rowElements.push(b),this._rowContainer.appendChild(b)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(d===0?-1:1),this._rowElements[d===0?1:this._rowElements.length-2].focus(),o.preventDefault(),o.stopImmediatePropagation()}_handleSelectionChange(){var k;if(this._rowElements.length===0)return;const o=document.getSelection();if(!o)return;if(o.isCollapsed)return void(this._rowContainer.contains(o.anchorNode)&&this._terminal.clearSelection());if(!o.anchorNode||!o.focusNode)return void console.error("anchorNode and/or focusNode are null");let d={node:o.anchorNode,offset:o.anchorOffset},_={node:o.focusNode,offset:o.focusOffset};if((d.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||d.node===_.node&&d.offset>_.offset)&&([d,_]=[_,d]),d.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(d={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(d.node))return;const C=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:C,offset:((k=C.textContent)==null?void 0:k.length)??0}),!this._rowContainer.contains(_.node))return;const S=({node:R,offset:L})=>{const T=R instanceof Text?R.parentNode:R;let A=parseInt(T==null?void 0:T.getAttribute("aria-posinset"),10)-1;if(isNaN(A))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(T);if(!F)return console.warn("columns is null. Race condition?"),null;let U=L<F.length?F[L]:F.slice(-1)[0]+1;return U>=this._terminal.cols&&(++A,U=0),{row:A,column:U}},w=S(d),b=S(_);if(w&&b){if(w.row>b.row||w.row===b.row&&w.column>=b.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(b.row-w.row)*this._terminal.cols-w.column+b.column)}}_handleResize(o){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let d=this._rowContainer.children.length;d<this._terminal.rows;d++)this._rowElements[d]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[d]);for(;this._rowElements.length>o;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const o=this._coreBrowserService.mainDocument.createElement("div");return o.setAttribute("role","listitem"),o.tabIndex=-1,this._refreshRowDimensions(o),o}_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 o=0;o<this._terminal.rows;o++)this._refreshRowDimensions(this._rowElements[o])}}_refreshRowDimensions(o){o.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=l=h([f(1,p.IInstantiationService),f(2,E.ICoreBrowserService),f(3,E.IRenderService)],l)},3614:(v,s)=>{function c(g){return g.replace(/\r?\n/g,"\r")}function h(g,y){return y?"\x1B[200~"+g+"\x1B[201~":g}function f(g,y,E,p){g=h(g=c(g),E.decPrivateModes.bracketedPasteMode&&p.rawOptions.ignoreBracketedPasteMode!==!0),E.triggerDataEvent(g,!0),y.value=""}function u(g,y,E){const p=E.getBoundingClientRect(),n=g.clientX-p.left-10,l=g.clientY-p.top-10;y.style.width="20px",y.style.height="20px",y.style.left=`${n}px`,y.style.top=`${l}px`,y.style.zIndex="1000",y.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=c,s.bracketTextForPaste=h,s.copyHandler=function(g,y){g.clipboardData&&g.clipboardData.setData("text/plain",y.selectionText),g.preventDefault()},s.handlePasteEvent=function(g,y,E,p){g.stopPropagation(),g.clipboardData&&f(g.clipboardData.getData("text/plain"),y,E,p)},s.paste=f,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(g,y,E,p,n){u(g,y,E),n&&p.rightClickSelect(g),y.value=p.selectionText,y.select()}},7239:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const h=c(1505);s.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(f,u,g){this._css.set(f,u,g)}getCss(f,u){return this._css.get(f,u)}setColor(f,u,g){this._color.set(f,u,g)}getColor(f,u){return this._color.get(f,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(c,h,f,u){c.addEventListener(h,f,u);let g=!1;return{dispose:()=>{g||(g=!0,c.removeEventListener(h,f,u))}}}},3551:function(v,s,c){var h=this&&this.__decorate||function(l,o,d,_){var C,S=arguments.length,w=S<3?o:_===null?_=Object.getOwnPropertyDescriptor(o,d):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,o,d,_);else for(var b=l.length-1;b>=0;b--)(C=l[b])&&(w=(S<3?C(w):S>3?C(o,d,w):C(o,d))||w);return S>3&&w&&Object.defineProperty(o,d,w),w},f=this&&this.__param||function(l,o){return function(d,_){o(d,_,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const u=c(3656),g=c(8460),y=c(844),E=c(2585),p=c(4725);let n=s.Linkifier=class extends y.Disposable{get currentLink(){return this._currentLink}constructor(l,o,d,_,C){super(),this._element=l,this._mouseService=o,this._renderService=d,this._bufferService=_,this._linkProviderService=C,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,y.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,y.toDisposable)((()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){this._lastMouseEvent=l;const o=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const d=l.composedPath();for(let _=0;_<d.length;_++){const C=d[_];if(C.classList.contains("xterm"))break;if(C.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(l){if(this._activeLine!==l.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(l,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))}_askForLink(l,o){var _,C;this._activeProviderReplies&&o||((_=this._activeProviderReplies)==null||_.forEach((S=>{S==null||S.forEach((w=>{w.link.dispose&&w.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=l.y);let d=!1;for(const[S,w]of this._linkProviderService.linkProviders.entries())o?(C=this._activeProviderReplies)!=null&&C.get(S)&&(d=this._checkLinkProviderResult(S,l,d)):w.provideLinks(l.y,(b=>{var R,L;if(this._isMouseOut)return;const k=b==null?void 0:b.map((T=>({link:T})));(R=this._activeProviderReplies)==null||R.set(S,k),d=this._checkLinkProviderResult(S,l,d),((L=this._activeProviderReplies)==null?void 0:L.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)}))}_removeIntersectingLinks(l,o){const d=new Set;for(let _=0;_<o.size;_++){const C=o.get(_);if(C)for(let S=0;S<C.length;S++){const w=C[S],b=w.link.range.start.y<l?0:w.link.range.start.x,k=w.link.range.end.y>l?this._bufferService.cols:w.link.range.end.x;for(let R=b;R<=k;R++){if(d.has(R)){C.splice(S--,1);break}d.add(R)}}}}_checkLinkProviderResult(l,o,d){var S;if(!this._activeProviderReplies)return d;const _=this._activeProviderReplies.get(l);let C=!1;for(let w=0;w<l;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(C=!0);if(!C&&_){const w=_.find((b=>this._linkAtPosition(b.link,o)));w&&(d=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!d)for(let w=0;w<this._activeProviderReplies.size;w++){const b=(S=this._activeProviderReplies.get(w))==null?void 0:S.find((k=>this._linkAtPosition(k.link,o)));if(b){d=!0,this._handleNewLink(b);break}}return d}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._currentLink)return;const o=this._positionFromMouseEvent(l,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,o){this._currentLink&&this._lastMouseEvent&&(!l||!o||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,y.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._lastMouseEvent)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(l.link,o)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var d,_;return(_=(d=this._currentLink)==null?void 0:d.state)==null?void 0:_.decorations.pointerCursor},set:d=>{var _;(_=this._currentLink)!=null&&_.state&&this._currentLink.state.decorations.pointerCursor!==d&&(this._currentLink.state.decorations.pointerCursor=d,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",d))}},underline:{get:()=>{var d,_;return(_=(d=this._currentLink)==null?void 0:d.state)==null?void 0:_.decorations.underline},set:d=>{var _,C,S;(_=this._currentLink)!=null&&_.state&&((S=(C=this._currentLink)==null?void 0:C.state)==null?void 0:S.decorations.underline)!==d&&(this._currentLink.state.decorations.underline=d,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,d))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((d=>{if(!this._currentLink)return;const _=d.start===0?0:d.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+d.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=C&&(this._clearCurrentLink(_,C),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}}))))}_linkHover(l,o,d){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(d,o.text)}_fireUnderlineEvent(l,o){const d=l.range,_=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(d.start.x-1,d.start.y-_-1,d.end.x,d.end.y-_-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(l,o,d){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(d,o.text)}_linkAtPosition(l,o){const d=l.range.start.y*this._bufferService.cols+l.range.start.x,_=l.range.end.y*this._bufferService.cols+l.range.end.x,C=o.y*this._bufferService.cols+o.x;return d<=C&&C<=_}_positionFromMouseEvent(l,o,d){const _=d.getCoords(l,o,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,o,d,_,C){return{x1:l,y1:o,x2:d,y2:_,cols:this._bufferService.cols,fg:C}}};s.Linkifier=n=h([f(1,p.IMouseService),f(2,p.IRenderService),f(3,E.IBufferService),f(4,p.ILinkProviderService)],n)},9042:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(v,s,c){var h=this&&this.__decorate||function(p,n,l,o){var d,_=arguments.length,C=_<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(p,n,l,o);else for(var S=p.length-1;S>=0;S--)(d=p[S])&&(C=(_<3?d(C):_>3?d(n,l,C):d(n,l))||C);return _>3&&C&&Object.defineProperty(n,l,C),C},f=this&&this.__param||function(p,n){return function(l,o){n(l,o,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=c(511),g=c(2585);let y=s.OscLinkProvider=class{constructor(p,n,l){this._bufferService=p,this._optionsService=n,this._oscLinkService=l}provideLinks(p,n){var k;const l=this._bufferService.buffer.lines.get(p-1);if(!l)return void n(void 0);const o=[],d=this._optionsService.rawOptions.linkHandler,_=new u.CellData,C=l.getTrimmedLength();let S=-1,w=-1,b=!1;for(let R=0;R<C;R++)if(w!==-1||l.hasContent(R)){if(l.loadCell(R,_),_.hasExtendedAttrs()&&_.extended.urlId){if(w===-1){w=R,S=_.extended.urlId;continue}b=_.extended.urlId!==S}else w!==-1&&(b=!0);if(b||w!==-1&&R===C-1){const L=(k=this._oscLinkService.getLinkData(S))==null?void 0:k.uri;if(L){const T={start:{x:w+1,y:p},end:{x:R+(b||R!==C-1?0:1),y:p}};let A=!1;if(!(d!=null&&d.allowNonHttpProtocols))try{const F=new URL(L);["http:","https:"].includes(F.protocol)||(A=!0)}catch{A=!0}A||o.push({text:L,range:T,activate:(F,U)=>d?d.activate(F,U,T):E(0,U),hover:(F,U)=>{var $;return($=d==null?void 0:d.hover)==null?void 0:$.call(d,F,U,T)},leave:(F,U)=>{var $;return($=d==null?void 0:d.leave)==null?void 0:$.call(d,F,U,T)}})}b=!1,_.hasExtendedAttrs()&&_.extended.urlId?(w=R,S=_.extended.urlId):(w=-1,S=-1)}}n(o)}};function E(p,n){if(confirm(`Do you want to navigate to ${n}?
|
|
161
161
|
|
|
162
|
-
WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=s}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=m=h([f(0,v.IBufferService),f(1,v.IOptionsService),f(2,v.IOscLinkService)],m)},6193:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(l,h){this._renderCallback=l,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,h,f){this._rowCount=f,l=l!==void 0?l:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,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 l=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const h=l(3614),f=l(3656),d=l(3551),v=l(9042),m=l(3730),E=l(1680),_=l(3107),s=l(5744),a=l(2950),n=l(1296),c=l(428),g=l(4269),y=l(5114),b=l(8934),w=l(3230),p=l(9312),k=l(4725),A=l(6731),L=l(8055),T=l(8969),R=l(8460),M=l(844),F=l(6114),$=l(8437),Z=l(2584),W=l(7399),B=l(5941),x=l(9074),D=l(2585),O=l(5435),V=l(4567),j=l(779);class Y extends T.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(N={}){super(N),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new M.MutableDisposable),this._onCursorMove=this.register(new R.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new R.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new R.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new R.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new R.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new R.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new R.EventEmitter),this._onBlur=this.register(new R.EventEmitter),this._onA11yCharEmitter=this.register(new R.EventEmitter),this._onA11yTabEmitter=this.register(new R.EventEmitter),this._onWillOpen=this.register(new R.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(j.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((I,H)=>this.refresh(I,H)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((I=>this._reportWindowsOptions(I)))),this.register(this._inputHandler.onColor((I=>this._handleColorEvent(I)))),this.register((0,R.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,R.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((I=>this._afterResize(I.cols,I.rows)))),this.register((0,M.toDisposable)((()=>{var I,H;this._customKeyEventHandler=void 0,(H=(I=this.element)==null?void 0:I.parentNode)==null||H.removeChild(this.element)})))}_handleColorEvent(N){if(this._themeService)for(const I of N){let H,P="";switch(I.index){case 256:H="foreground",P="10";break;case 257:H="background",P="11";break;case 258:H="cursor",P="12";break;default:H="ansi",P="4;"+I.index}switch(I.type){case 0:const z=L.color.toColorRGB(H==="ansi"?this._themeService.colors.ansi[I.index]:this._themeService.colors[H]);this.coreService.triggerDataEvent(`${Z.C0.ESC}]${P};${(0,B.toRgbString)(z)}${Z.C1_ESCAPED.ST}`);break;case 1:if(H==="ansi")this._themeService.modifyColors((K=>K.ansi[I.index]=L.channels.toColor(...I.color)));else{const K=H;this._themeService.modifyColors((ee=>ee[K]=L.channels.toColor(...I.color)))}break;case 2:this._themeService.restoreColor(I.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(N){N?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(N){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var N;return(N=this.textarea)==null?void 0:N.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.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 N=this.buffer.ybase+this.buffer.y,I=this.buffer.lines.get(N);if(!I)return;const H=Math.min(this.buffer.x,this.cols-1),P=this._renderService.dimensions.css.cell.height,z=I.getWidth(H),K=this._renderService.dimensions.css.cell.width*z,ee=this.buffer.y*this._renderService.dimensions.css.cell.height,de=H*this._renderService.dimensions.css.cell.width;this.textarea.style.left=de+"px",this.textarea.style.top=ee+"px",this.textarea.style.width=K+"px",this.textarea.style.height=P+"px",this.textarea.style.lineHeight=P+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",(I=>{this.hasSelection()&&(0,h.copyHandler)(I,this._selectionService)})));const N=I=>(0,h.handlePasteEvent)(I,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",N)),this.register((0,f.addDisposableDomListener)(this.element,"paste",N)),F.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(I=>{I.button===2&&(0,h.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",(I=>{(0,h.rightClickHandler)(I,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),F.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",(I=>{I.button===1&&(0,h.moveTextAreaUnderMouseCursor)(I,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",(N=>this._keyUp(N)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",(N=>this._keyDown(N)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",(N=>this._keyPress(N)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",(N=>this._compositionHelper.compositionupdate(N)))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,f.addDisposableDomListener)(this.textarea,"input",(N=>this._inputEvent(N)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(N){var H;if(!N)throw new Error("Terminal requires a parent element.");if(N.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((H=this.element)==null?void 0:H.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=N.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"),N.appendChild(this.element);const I=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),I.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,f.addDisposableDomListener)(this.screenElement,"mousemove",(P=>this.updateCursorStyle(P)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),I.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),F.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(y.CoreBrowserService,this.textarea,N.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,f.addDisposableDomListener)(this.textarea,"focus",(P=>this._handleTextAreaFocus(P)))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(A.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(g.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((P=>this._onRender.fire(P)))),this.onResize((P=>this._renderService.resize(P.cols,P.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(I);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((P=>this.scrollLines(P.amount,P.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(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((P=>this.scrollLines(P.amount,P.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((P=>this._renderService.handleSelectionChanged(P.start,P.end,P.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((P=>{this.textarea.value=P,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((P=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(P=>this._selectionService.handleMouseDown(P)))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(P=>this._handleScreenReaderModeOptionChange(P)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(s.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(P=>{!this._overviewRulerRenderer&&P&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(s.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(n.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const N=this,I=this.element;function H(K){const ee=N._mouseService.getMouseReportCoords(K,N.screenElement);if(!ee)return!1;let de,he;switch(K.overrideType||K.type){case"mousemove":he=32,K.buttons===void 0?(de=3,K.button!==void 0&&(de=K.button<3?K.button:3)):de=1&K.buttons?0:4&K.buttons?1:2&K.buttons?2:3;break;case"mouseup":he=0,de=K.button<3?K.button:3;break;case"mousedown":he=1,de=K.button<3?K.button:3;break;case"wheel":if(N._customWheelEventHandler&&N._customWheelEventHandler(K)===!1||N.viewport.getLinesScrolled(K)===0)return!1;he=K.deltaY<0?0:1,de=4;break;default:return!1}return!(he===void 0||de===void 0||de>4)&&N.coreMouseService.triggerMouseEvent({col:ee.col,row:ee.row,x:ee.x,y:ee.y,button:de,action:he,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}const P={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:K=>(H(K),K.buttons||(this._document.removeEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.removeEventListener("mousemove",P.mousedrag)),this.cancel(K)),wheel:K=>(H(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&H(K)},mousemove:K=>{K.buttons||H(K)}};this.register(this.coreMouseService.onProtocolChange((K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),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&K?P.mousemove||(I.addEventListener("mousemove",z.mousemove),P.mousemove=z.mousemove):(I.removeEventListener("mousemove",P.mousemove),P.mousemove=null),16&K?P.wheel||(I.addEventListener("wheel",z.wheel,{passive:!1}),P.wheel=z.wheel):(I.removeEventListener("wheel",P.wheel),P.wheel=null),2&K?P.mouseup||(P.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",P.mouseup),P.mouseup=null),4&K?P.mousedrag||(P.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",P.mousedrag),P.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(I,"mousedown",(K=>{if(K.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(K))return H(K),P.mouseup&&this._document.addEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.addEventListener("mousemove",P.mousedrag),this.cancel(K)}))),this.register((0,f.addDisposableDomListener)(I,"wheel",(K=>{if(!P.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(K)===!1)return!1;if(!this.buffer.hasScrollback){const ee=this.viewport.getLinesScrolled(K);if(ee===0)return;const de=Z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");let he="";for(let we=0;we<Math.abs(ee);we++)he+=de;return this.coreService.triggerDataEvent(he,!0),this.cancel(K,!0)}return this.viewport.handleWheel(K)?this.cancel(K):void 0}}),{passive:!1})),this.register((0,f.addDisposableDomListener)(I,"touchstart",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(K),this.cancel(K)}),{passive:!0})),this.register((0,f.addDisposableDomListener)(I,"touchmove",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(K)?void 0:this.cancel(K)}),{passive:!1}))}refresh(N,I){var H;(H=this._renderService)==null||H.refreshRows(N,I)}updateCursorStyle(N){var I;(I=this._selectionService)!=null&&I.shouldColumnSelect(N)?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(N,I,H=0){var P;H===1?(super.scrollLines(N,I,H),this.refresh(0,this.rows-1)):(P=this.viewport)==null||P.scrollLines(N)}paste(N){(0,h.paste)(N,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(N){this._customKeyEventHandler=N}attachCustomWheelEventHandler(N){this._customWheelEventHandler=N}registerLinkProvider(N){return this._linkProviderService.registerLinkProvider(N)}registerCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const I=this._characterJoinerService.register(N);return this.refresh(0,this.rows-1),I}deregisterCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(N)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(N){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+N)}registerDecoration(N){return this._decorationService.registerDecoration(N)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(N,I,H){this._selectionService.setSelection(N,I,H)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var N;(N=this._selectionService)==null||N.clearSelection()}selectAll(){var N;(N=this._selectionService)==null||N.selectAll()}selectLines(N,I){var H;(H=this._selectionService)==null||H.selectLines(N,I)}_keyDown(N){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;const I=this.browser.isMac&&this.options.macOptionIsMeta&&N.altKey;if(!I&&!this._compositionHelper.keydown(N))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;I||N.key!=="Dead"&&N.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const H=(0,W.evaluateKeyboardEvent)(N,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(N),H.type===3||H.type===2){const P=this.rows-1;return this.scrollLines(H.type===2?-P:P),this.cancel(N,!0)}return H.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,N)||(H.cancel&&this.cancel(N,!0),!H.key||!!(N.key&&!N.ctrlKey&&!N.altKey&&!N.metaKey&&N.key.length===1&&N.key.charCodeAt(0)>=65&&N.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(H.key!==Z.C0.ETX&&H.key!==Z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:H.key,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(H.key,!0),!this.optionsService.rawOptions.screenReaderMode||N.altKey||N.ctrlKey?this.cancel(N,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(N,I){const H=N.isMac&&!this.options.macOptionIsMeta&&I.altKey&&!I.ctrlKey&&!I.metaKey||N.isWindows&&I.altKey&&I.ctrlKey&&!I.metaKey||N.isWindows&&I.getModifierState("AltGraph");return I.type==="keypress"?H:H&&(!I.keyCode||I.keyCode>47)}_keyUp(N){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1||((function(I){return I.keyCode===16||I.keyCode===17||I.keyCode===18})(N)||this.focus(),this.updateCursorStyle(N),this._keyPressHandled=!1)}_keyPress(N){let I;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;if(this.cancel(N),N.charCode)I=N.charCode;else if(N.which===null||N.which===void 0)I=N.keyCode;else{if(N.which===0||N.charCode===0)return!1;I=N.which}return!(!I||(N.altKey||N.ctrlKey||N.metaKey)&&!this._isThirdLevelShift(this.browser,N)||(I=String.fromCharCode(I),this._onKey.fire({key:I,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(I,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(N){if(N.data&&N.inputType==="insertText"&&(!N.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const I=N.data;return this.coreService.triggerDataEvent(I,!0),this.cancel(N),!0}return!1}resize(N,I){N!==this.cols||I!==this.rows?super.resize(N,I):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(N,I){var H,P;(H=this._charSizeService)==null||H.measure(),(P=this.viewport)==null||P.syncScrollArea(!0)}clear(){var N;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let I=1;I<this.rows;I++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(N=this.viewport)==null||N.reset(),this.refresh(0,this.rows-1)}}reset(){var I,H;this.options.rows=this.rows,this.options.cols=this.cols;const N=this._customKeyEventHandler;this._setup(),super.reset(),(I=this._selectionService)==null||I.reset(),this._decorationService.reset(),(H=this.viewport)==null||H.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1)}clearTextureAtlas(){var N;(N=this._renderService)==null||N.clearTextureAtlas()}_reportFocus(){var N;(N=this.element)!=null&&N.classList.contains("focus")?this.coreService.triggerDataEvent(Z.C0.ESC+"[I"):this.coreService.triggerDataEvent(Z.C0.ESC+"[O")}_reportWindowsOptions(N){if(this._renderService)switch(N){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const I=this._renderService.dimensions.css.canvas.width.toFixed(0),H=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Z.C0.ESC}[4;${H};${I}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const P=this._renderService.dimensions.css.cell.width.toFixed(0),z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Z.C0.ESC}[6;${z};${P}t`)}}cancel(N,I){if(this.options.cancelEvents||I)return N.preventDefault(),N.stopPropagation(),!1}}i.Terminal=Y},9924:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(l,h=1e3){this._renderCallback=l,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,h,f){this._rowCount=f,l=l!==void 0?l:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=d-this._lastRefreshMs,m=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,h)}}},1680:function(S,i,l){var h=this&&this.__decorate||function(a,n,c,g){var y,b=arguments.length,w=b<3?n:g===null?g=Object.getOwnPropertyDescriptor(n,c):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(a,n,c,g);else for(var p=a.length-1;p>=0;p--)(y=a[p])&&(w=(b<3?y(w):b>3?y(n,c,w):y(n,c))||w);return b>3&&w&&Object.defineProperty(n,c,w),w},f=this&&this.__param||function(a,n){return function(c,g){n(c,g,a)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const d=l(3656),v=l(4725),m=l(8460),E=l(844),_=l(2585);let s=i.Viewport=class extends E.Disposable{constructor(a,n,c,g,y,b,w,p){super(),this._viewportElement=a,this._scrollArea=n,this._bufferService=c,this._optionsService=g,this._charSizeService=y,this._renderService=b,this._coreBrowserService=w,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 m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((k=>this._activeBuffer=k.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((k=>this._renderDimensions=k))),this._handleThemeChange(p.colors),this.register(p.onChangeColors((k=>this._handleThemeChange(k)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(a){if(a)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const n=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==n&&(this._lastRecordedBufferHeight=n,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const n=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:n,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(a,n){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(n<0&&this._viewportElement.scrollTop!==0||n>0&&c<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const n=this._getPixelsScrolled(a);return n!==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+n:this._smoothScrollState.target+=n,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=n,this._bubbleScroll(a,n))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const n=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+n,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let n=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?n*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._currentRowHeight*this._bufferService.rows),n}getBufferElements(a,n){var p;let c,g="";const y=[],b=n??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let k=a;k<b;k++){const A=w.get(k);if(!A)continue;const L=(p=w.get(k+1))==null?void 0:p.isWrapped;if(g+=A.translateToString(!L),!L||k===w.length-1){const T=document.createElement("div");T.textContent=g,y.push(T),g.length>0&&(c=T),g=""}}return{bufferElements:y,cursorElement:c}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let n=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=this._currentRowHeight+0,this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n}_applyScrollModifier(a,n){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&n.altKey||c==="ctrl"&&n.ctrlKey||c==="shift"&&n.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const n=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,n!==0&&(this._viewportElement.scrollTop+=n,this._bubbleScroll(a,n))}};i.Viewport=s=h([f(2,_.IBufferService),f(3,_.IOptionsService),f(4,v.ICharSizeService),f(5,v.IRenderService),f(6,v.ICoreBrowserService),f(7,v.IThemeService)],s)},3107:function(S,i,l){var h=this&&this.__decorate||function(_,s,a,n){var c,g=arguments.length,y=g<3?s:n===null?n=Object.getOwnPropertyDescriptor(s,a):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(_,s,a,n);else for(var b=_.length-1;b>=0;b--)(c=_[b])&&(y=(g<3?c(y):g>3?c(s,a,y):c(s,a))||y);return g>3&&y&&Object.defineProperty(s,a,y),y},f=this&&this.__param||function(_,s){return function(a,n){s(a,n,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const d=l(4725),v=l(844),m=l(2585);let E=i.BufferDecorationRenderer=class extends v.Disposable{constructor(_,s,a,n,c){super(),this._screenElement=_,this._bufferService=s,this._coreBrowserService=a,this._decorationService=n,this._renderService=c,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((g=>this._removeDecoration(g)))),this.register((0,v.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 _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var n;const s=this._coreBrowserService.mainDocument.createElement("div");s.classList.add("xterm-decoration"),s.classList.toggle("xterm-decoration-top-layer",((n=_==null?void 0:_.options)==null?void 0:n.layer)==="top"),s.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",s.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=_.options.x??0;return a&&a>this._bufferService.cols&&(s.style.display="none"),this._refreshXPosition(_,s),s}_refreshStyle(_){const s=_.marker.line-this._bufferService.buffers.active.ydisp;if(s<0||s>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let a=this._decorationElements.get(_);a||(a=this._createElement(_),_.element=a,this._decorationElements.set(_,a),this._container.appendChild(a),_.onDispose((()=>{this._decorationElements.delete(_),a.remove()}))),a.style.top=s*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(a)}}_refreshXPosition(_,s=_.element){if(!s)return;const a=_.options.x??0;(_.options.anchor||"left")==="right"?s.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":s.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var s;(s=this._decorationElements.get(_))==null||s.remove(),this._decorationElements.delete(_),_.dispose()}};i.BufferDecorationRenderer=E=h([f(1,m.IBufferService),f(2,d.ICoreBrowserService),f(3,m.IDecorationService),f(4,d.IRenderService)],E)},5871:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(l){if(l.options.overviewRulerOptions){for(const h of this._zones)if(h.color===l.options.overviewRulerOptions.color&&h.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,l.marker.line))return;if(this._lineAdjacentToZone(h,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(h,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,h){return h>=l.startBufferLine&&h<=l.endBufferLine}_lineAdjacentToZone(l,h,f){return h>=l.startBufferLine-this._linePadding[f||"full"]&&h<=l.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(l,h){l.startBufferLine=Math.min(l.startBufferLine,h),l.endBufferLine=Math.max(l.endBufferLine,h)}}},5744:function(S,i,l){var h=this&&this.__decorate||function(c,g,y,b){var w,p=arguments.length,k=p<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(c,g,y,b);else for(var A=c.length-1;A>=0;A--)(w=c[A])&&(k=(p<3?w(k):p>3?w(g,y,k):w(g,y))||k);return p>3&&k&&Object.defineProperty(g,y,k),k},f=this&&this.__param||function(c,g){return function(y,b){g(y,b,c)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const d=l(5871),v=l(4725),m=l(844),E=l(2585),_={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let n=i.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(c,g,y,b,w,p,k){var L;super(),this._viewportElement=c,this._screenElement=g,this._bufferService=y,this._decorationService=b,this._renderService=w,this._optionsService=p,this._coreBrowserService=k,this._colorZoneStore=new d.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(),(L=this._viewportElement.parentElement)==null||L.insertBefore(this._canvas,this._viewportElement);const A=this._canvas.getContext("2d");if(!A)throw new Error("Ctx cannot be null");this._ctx=A,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var T;(T=this._canvas)==null||T.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 c=Math.floor(this._canvas.width/3),g=Math.ceil(this._canvas.width/3);s.full=this._canvas.width,s.left=c,s.center=g,s.right=c,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=s.left,a.right=s.left+s.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const c=this._canvas.height/this._bufferService.buffer.lines.length,g=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowserService.dpr);_.left=g,_.center=g,_.right=g}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.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 g of this._decorationService.decorations)this._colorZoneStore.addDecoration(g);this._ctx.lineWidth=1;const c=this._colorZoneStore.zones;for(const g of c)g.position!=="full"&&this._renderColorZone(g);for(const g of c)g.position==="full"&&this._renderColorZone(g);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(c){this._ctx.fillStyle=c.color,this._ctx.fillRect(a[c.position||"full"],Math.round((this._canvas.height-1)*(c.startBufferLine/this._bufferService.buffers.active.lines.length)-_[c.position||"full"]/2),s[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[c.position||"full"]))}_queueRefresh(c,g){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=g||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=n=h([f(2,E.IBufferService),f(3,E.IDecorationService),f(4,v.IRenderService),f(5,E.IOptionsService),f(6,v.ICoreBrowserService)],n)},2950:function(S,i,l){var h=this&&this.__decorate||function(_,s,a,n){var c,g=arguments.length,y=g<3?s:n===null?n=Object.getOwnPropertyDescriptor(s,a):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(_,s,a,n);else for(var b=_.length-1;b>=0;b--)(c=_[b])&&(y=(g<3?c(y):g>3?c(s,a,y):c(s,a))||y);return g>3&&y&&Object.defineProperty(s,a,y),y},f=this&&this.__param||function(_,s){return function(a,n){s(a,n,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const d=l(4725),v=l(2585),m=l(2584);let E=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,s,a,n,c,g){this._textarea=_,this._compositionView=s,this._bufferService=a,this._optionsService=n,this._coreService=c,this._renderService=g,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const s={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,s.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(s.start,s.end):this._textarea.value.substring(s.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}}),0)}else{this._isSendingComposition=!1;const s=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(s,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const s=this._textarea.value,a=s.replace(_,"");this._dataAlreadySent=a,s.length>_.length?this._coreService.triggerDataEvent(a,!0):s.length<_.length?this._coreService.triggerDataEvent(`${m.C0.DEL}`,!0):s.length===_.length&&s!==_&&this._coreService.triggerDataEvent(s,!0)}}),0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=s*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const g=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(g.width,1)+"px",this._textarea.style.height=Math.max(g.height,1)+"px",this._textarea.style.lineHeight=g.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=E=h([f(2,v.IBufferService),f(3,v.IOptionsService),f(4,v.ICoreService),f(5,d.IRenderService)],E)},9806:(S,i)=>{function l(h,f,d){const v=d.getBoundingClientRect(),m=h.getComputedStyle(d),E=parseInt(m.getPropertyValue("padding-left")),_=parseInt(m.getPropertyValue("padding-top"));return[f.clientX-v.left-E,f.clientY-v.top-_]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=l,i.getCoords=function(h,f,d,v,m,E,_,s,a){if(!E)return;const n=l(h,f,d);return n?(n[0]=Math.ceil((n[0]+(a?_/2:0))/_),n[1]=Math.ceil(n[1]/s),n[0]=Math.min(Math.max(n[0],1),v+(a?1:0)),n[1]=Math.min(Math.max(n[1],1),m),n):void 0}},9504:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const h=l(2584);function f(s,a,n,c){const g=s-d(s,n),y=a-d(a,n),b=Math.abs(g-y)-(function(w,p,k){let A=0;const L=w-d(w,k),T=p-d(p,k);for(let R=0;R<Math.abs(L-T);R++){const M=v(w,p)==="A"?-1:1,F=k.buffer.lines.get(L+M*R);F!=null&&F.isWrapped&&A++}return A})(s,a,n);return _(b,E(v(s,a),c))}function d(s,a){let n=0,c=a.buffer.lines.get(s),g=c==null?void 0:c.isWrapped;for(;g&&s>=0&&s<a.rows;)n++,c=a.buffer.lines.get(--s),g=c==null?void 0:c.isWrapped;return n}function v(s,a){return s>a?"A":"B"}function m(s,a,n,c,g,y){let b=s,w=a,p="";for(;b!==n||w!==c;)b+=g?1:-1,g&&b>y.cols-1?(p+=y.buffer.translateBufferLineToString(w,!1,s,b),b=0,s=0,w++):!g&&b<0&&(p+=y.buffer.translateBufferLineToString(w,!1,0,s+1),b=y.cols-1,s=b,w--);return p+y.buffer.translateBufferLineToString(w,!1,s,b)}function E(s,a){const n=a?"O":"[";return h.C0.ESC+n+s}function _(s,a){s=Math.floor(s);let n="";for(let c=0;c<s;c++)n+=a;return n}i.moveToCellSequence=function(s,a,n,c){const g=n.buffer.x,y=n.buffer.y;if(!n.buffer.hasScrollback)return(function(p,k,A,L,T,R){return f(k,L,T,R).length===0?"":_(m(p,k,p,k-d(k,T),!1,T).length,E("D",R))})(g,y,0,a,n,c)+f(y,a,n,c)+(function(p,k,A,L,T,R){let M;M=f(k,L,T,R).length>0?L-d(L,T):k;const F=L,$=(function(Z,W,B,x,D,O){let V;return V=f(B,x,D,O).length>0?x-d(x,D):W,Z<B&&V<=x||Z>=B&&V<x?"C":"D"})(p,k,A,L,T,R);return _(m(p,M,A,F,$==="C",T).length,E($,R))})(g,y,s,a,n,c);let b;if(y===a)return b=g>s?"D":"C",_(Math.abs(g-s),E(b,c));b=y>a?"D":"C";const w=Math.abs(y-a);return _((function(p,k){return k.cols-p})(y>a?s:g,n)+(w-1)*n.cols+1+((y>a?g:s)-1),E(b,c))}},1296:function(S,i,l){var h=this&&this.__decorate||function(R,M,F,$){var Z,W=arguments.length,B=W<3?M:$===null?$=Object.getOwnPropertyDescriptor(M,F):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(R,M,F,$);else for(var x=R.length-1;x>=0;x--)(Z=R[x])&&(B=(W<3?Z(B):W>3?Z(M,F,B):Z(M,F))||B);return W>3&&B&&Object.defineProperty(M,F,B),B},f=this&&this.__param||function(R,M){return function(F,$){M(F,$,R)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const d=l(3787),v=l(2550),m=l(2223),E=l(6171),_=l(6052),s=l(4725),a=l(8055),n=l(8460),c=l(844),g=l(2585),y="xterm-dom-renderer-owner-",b="xterm-rows",w="xterm-fg-",p="xterm-bg-",k="xterm-focus",A="xterm-selection";let L=1,T=i.DomRenderer=class extends c.Disposable{constructor(R,M,F,$,Z,W,B,x,D,O,V,j,Y){super(),this._terminal=R,this._document=M,this._element=F,this._screenElement=$,this._viewportElement=Z,this._helperContainer=W,this._linkifier2=B,this._charSizeService=D,this._optionsService=O,this._bufferService=V,this._coreBrowserService=j,this._themeService=Y,this._terminalClass=L++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new n.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(A),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((J=>this._injectCss(J)))),this._injectCss(this._themeService.colors),this._rowFactory=x.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(y+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((J=>this._handleLinkHover(J)))),this.register(this._linkifier2.onHideLinkUnderline((J=>this._handleLinkLeave(J)))),this.register((0,c.toDisposable)((()=>{this._element.classList.remove(y+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const R=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*R,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*R),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/R),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/R),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const M=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=M,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(R){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let M=`${this._terminalSelector} .${b} { color: ${R.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;M+=`${this._terminalSelector} .${b} .xterm-dim { color: ${a.color.multiplyOpacity(R.foreground,.5).css};}`,M+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const F=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,Z=`blink_block_${this._terminalClass}`;M+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,M+=`@keyframes ${$} { 50% { box-shadow: none; }}`,M+=`@keyframes ${Z} { 0% { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css}; } 50% { background-color: inherit; color: ${R.cursor.css}; }}`,M+=`${this._terminalSelector} .${b}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${b}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${b}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${R.cursor.css} !important; color: ${R.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${R.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${R.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${R.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,M+=`${this._terminalSelector} .${A} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${A} div { position: absolute; background-color: ${R.selectionBackgroundOpaque.css};}${this._terminalSelector} .${A} div { position: absolute; background-color: ${R.selectionInactiveBackgroundOpaque.css};}`;for(const[W,B]of R.ansi.entries())M+=`${this._terminalSelector} .${w}${W} { color: ${B.css}; }${this._terminalSelector} .${w}${W}.xterm-dim { color: ${a.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${p}${W} { background-color: ${B.css}; }`;M+=`${this._terminalSelector} .${w}${m.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(R.background).css}; }${this._terminalSelector} .${w}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(R.background),.5).css}; }${this._terminalSelector} .${p}${m.INVERTED_DEFAULT_COLOR} { background-color: ${R.foreground.css}; }`,this._themeStyleElement.textContent=M}_setDefaultSpacing(){const R=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${R}px`,this._rowFactory.defaultSpacing=R}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(R,M){for(let F=this._rowElements.length;F<=M;F++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>M;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(R,M){this._refreshRowElements(R,M),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(R,M,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(R,M,F),this.renderRows(0,this._bufferService.rows-1),!R||!M)return;this._selectionRenderModel.update(this._terminal,R,M,F);const $=this._selectionRenderModel.viewportStartRow,Z=this._selectionRenderModel.viewportEndRow,W=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(W>=this._bufferService.rows||B<0)return;const x=this._document.createDocumentFragment();if(F){const D=R[0]>M[0];x.appendChild(this._createSelectionElement(W,D?M[0]:R[0],D?R[0]:M[0],B-W+1))}else{const D=$===W?R[0]:0,O=W===Z?M[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(W,D,O));const V=B-W-1;if(x.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,V)),W!==B){const j=Z===B?M[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(B,0,j))}}this._selectionContainer.appendChild(x)}_createSelectionElement(R,M,F,$=1){const Z=this._document.createElement("div"),W=M*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(F-M);return W+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-W),Z.style.height=$*this.dimensions.css.cell.height+"px",Z.style.top=R*this.dimensions.css.cell.height+"px",Z.style.left=`${W}px`,Z.style.width=`${B}px`,Z}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const R of this._rowElements)R.replaceChildren()}renderRows(R,M){const F=this._bufferService.buffer,$=F.ybase+F.y,Z=Math.min(F.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=R;D<=M;D++){const O=D+F.ydisp,V=this._rowElements[D],j=F.lines.get(O);if(!V||!j)break;V.replaceChildren(...this._rowFactory.createRow(j,O,O===$,B,x,Z,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${y}${this._terminalClass}`}_handleLinkHover(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!0)}_handleLinkLeave(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!1)}_setCellUnderline(R,M,F,$,Z,W){F<0&&(R=0),$<0&&(M=0);const B=this._bufferService.rows-1;F=Math.max(Math.min(F,B),0),$=Math.max(Math.min($,B),0),Z=Math.min(Z,this._bufferService.cols);const x=this._bufferService.buffer,D=x.ybase+x.y,O=Math.min(x.x,Z-1),V=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=F;J<=$;++J){const N=J+x.ydisp,I=this._rowElements[J],H=x.lines.get(N);if(!I||!H)break;I.replaceChildren(...this._rowFactory.createRow(H,N,N===D,j,Y,O,V,this.dimensions.css.cell.width,this._widthCache,W?J===F?R:0:-1,W?(J===$?M:Z)-1:-1))}}};i.DomRenderer=T=h([f(7,g.IInstantiationService),f(8,s.ICharSizeService),f(9,g.IOptionsService),f(10,g.IBufferService),f(11,s.ICoreBrowserService),f(12,s.IThemeService)],T)},3787:function(S,i,l){var h=this&&this.__decorate||function(b,w,p,k){var A,L=arguments.length,T=L<3?w:k===null?k=Object.getOwnPropertyDescriptor(w,p):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(b,w,p,k);else for(var R=b.length-1;R>=0;R--)(A=b[R])&&(T=(L<3?A(T):L>3?A(w,p,T):A(w,p))||T);return L>3&&T&&Object.defineProperty(w,p,T),T},f=this&&this.__param||function(b,w){return function(p,k){w(p,k,b)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const d=l(2223),v=l(643),m=l(511),E=l(2585),_=l(8055),s=l(4725),a=l(4269),n=l(6171),c=l(3734);let g=i.DomRendererRowFactory=class{constructor(b,w,p,k,A,L,T){this._document=b,this._characterJoinerService=w,this._optionsService=p,this._coreBrowserService=k,this._coreService=A,this._decorationService=L,this._themeService=T,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,w,p){this._selectionStart=b,this._selectionEnd=w,this._columnSelectMode=p}createRow(b,w,p,k,A,L,T,R,M,F,$){const Z=[],W=this._characterJoinerService.getJoinedCharacters(w),B=this._themeService.colors;let x,D=b.getNoBgTrimmedLength();p&&D<L+1&&(D=L+1);let O=0,V="",j=0,Y=0,J=0,N=!1,I=0,H=!1,P=0;const z=[],K=F!==-1&&$!==-1;for(let ee=0;ee<D;ee++){b.loadCell(ee,this._workCell);let de=this._workCell.getWidth();if(de===0)continue;let he=!1,we=ee,q=this._workCell;if(W.length>0&&ee===W[0][0]){he=!0;const ae=W.shift();q=new a.JoinedCellData(this._workCell,b.translateToString(!0,ae[0],ae[1]),ae[1]-ae[0]),we=ae[1]-1,de=q.getWidth()}const Ct=this._isCellInSelection(ee,w),Ar=p&&ee===L,xr=K&&ee>=F&&ee<=$;let Lr=!1;this._decorationService.forEachDecorationAtCell(ee,w,void 0,(ae=>{Lr=!0}));let qt=q.getChars()||v.WHITESPACE_CELL_CHAR;if(qt===" "&&(q.isUnderline()||q.isOverline())&&(qt=" "),P=de*R-M.get(qt,q.isBold(),q.isItalic()),x){if(O&&(Ct&&H||!Ct&&!H&&q.bg===j)&&(Ct&&H&&B.selectionForeground||q.fg===Y)&&q.extended.ext===J&&xr===N&&P===I&&!Ar&&!he&&!Lr){q.isInvisible()?V+=v.WHITESPACE_CELL_CHAR:V+=qt,O++;continue}O&&(x.textContent=V),x=this._document.createElement("span"),O=0,V=""}else x=this._document.createElement("span");if(j=q.bg,Y=q.fg,J=q.extended.ext,N=xr,I=P,H=Ct,he&&L>=ee&&L<=we&&(L=ee),!this._coreService.isCursorHidden&&Ar&&this._coreService.isCursorInitialized){if(z.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&z.push("xterm-cursor-blink"),z.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(A)switch(A){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(q.isBold()&&z.push("xterm-bold"),q.isItalic()&&z.push("xterm-italic"),q.isDim()&&z.push("xterm-dim"),V=q.isInvisible()?v.WHITESPACE_CELL_CHAR:q.getChars()||v.WHITESPACE_CELL_CHAR,q.isUnderline()&&(z.push(`xterm-underline-${q.extended.underlineStyle}`),V===" "&&(V=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let ae=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&ae<8&&(ae+=8),x.style.textDecorationColor=B.ansi[ae].css}q.isOverline()&&(z.push("xterm-overline"),V===" "&&(V=" ")),q.isStrikethrough()&&z.push("xterm-strikethrough"),xr&&(x.style.textDecoration="underline");let Re=q.getFgColor(),wt=q.getFgColorMode(),Oe=q.getBgColor(),Et=q.getBgColorMode();const Tr=!!q.isInverse();if(Tr){const ae=Re;Re=Oe,Oe=ae;const Lo=wt;wt=Et,Et=Lo}let $e,Qt,We,kt=!1;switch(this._decorationService.forEachDecorationAtCell(ee,w,void 0,(ae=>{ae.options.layer!=="top"&&kt||(ae.backgroundColorRGB&&(Et=50331648,Oe=ae.backgroundColorRGB.rgba>>8&16777215,$e=ae.backgroundColorRGB),ae.foregroundColorRGB&&(wt=50331648,Re=ae.foregroundColorRGB.rgba>>8&16777215,Qt=ae.foregroundColorRGB),kt=ae.options.layer==="top")})),!kt&&Ct&&($e=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Oe=$e.rgba>>8&16777215,Et=50331648,kt=!0,B.selectionForeground&&(wt=50331648,Re=B.selectionForeground.rgba>>8&16777215,Qt=B.selectionForeground)),kt&&z.push("xterm-decoration-top"),Et){case 16777216:case 33554432:We=B.ansi[Oe],z.push(`xterm-bg-${Oe}`);break;case 50331648:We=_.channels.toColor(Oe>>16,Oe>>8&255,255&Oe),this._addStyle(x,`background-color:#${y((Oe>>>0).toString(16),"0",6)}`);break;default:Tr?(We=B.foreground,z.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):We=B.background}switch($e||q.isDim()&&($e=_.color.multiplyOpacity(We,.5)),wt){case 16777216:case 33554432:q.isBold()&&Re<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Re+=8),this._applyMinimumContrast(x,We,B.ansi[Re],q,$e,void 0)||z.push(`xterm-fg-${Re}`);break;case 50331648:const ae=_.channels.toColor(Re>>16&255,Re>>8&255,255&Re);this._applyMinimumContrast(x,We,ae,q,$e,Qt)||this._addStyle(x,`color:#${y(Re.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(x,We,B.foreground,q,$e,Qt)||Tr&&z.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}z.length&&(x.className=z.join(" "),z.length=0),Ar||he||Lr?x.textContent=V:O++,P!==this.defaultSpacing&&(x.style.letterSpacing=`${P}px`),Z.push(x),ee=we}return x&&O&&(x.textContent=V),Z}_applyMinimumContrast(b,w,p,k,A,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,n.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const T=this._getContrastCache(k);let R;if(A||L||(R=T.getColor(w.rgba,p.rgba)),R===void 0){const M=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);R=_.color.ensureContrastRatio(A||w,L||p,M),T.setColor((A||w).rgba,(L||p).rgba,R??null)}return!!R&&(this._addStyle(b,`color:${R.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,w){b.setAttribute("style",`${b.getAttribute("style")||""}${w};`)}_isCellInSelection(b,w){const p=this._selectionStart,k=this._selectionEnd;return!(!p||!k)&&(this._columnSelectMode?p[0]<=k[0]?b>=p[0]&&w>=p[1]&&b<k[0]&&w<=k[1]:b<p[0]&&w>=p[1]&&b>=k[0]&&w<=k[1]:w>p[1]&&w<k[1]||p[1]===k[1]&&w===p[1]&&b>=p[0]&&b<k[0]||p[1]<k[1]&&w===k[1]&&b<k[0]||p[1]<k[1]&&w===p[1]&&b>=p[0])}};function y(b,w,p){for(;b.length<p;)b=w+b;return b}i.DomRendererRowFactory=g=h([f(1,s.ICharacterJoinerService),f(2,E.IOptionsService),f(3,s.ICoreBrowserService),f(4,E.ICoreService),f(5,E.IDecorationService),f(6,s.IThemeService)],g)},2550:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(l,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.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 f=l.createElement("span");f.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const v=l.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[f,d,v,m],this._container.appendChild(f),this._container.appendChild(d),this._container.appendChild(v),this._container.appendChild(m),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(l,h,f,d){l===this._font&&h===this._fontSize&&f===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=h,this._weight=f,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,h,f){let d=0;if(!h&&!f&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const E=this._measure(l,0);return E>0&&(this._flat[d]=E),E}let v=l;h&&(v+="B"),f&&(v+="I");let m=this._holey.get(v);if(m===void 0){let E=0;h&&(E|=1),f&&(E|=2),m=this._measure(l,E),m>0&&this._holey.set(v,m)}return m}_measure(l,h){const f=this._measureElements[h];return f.textContent=l.repeat(32),f.offsetWidth/32}}},2223:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const h=l(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(S,i)=>{function l(f){return 57508<=f&&f<=57558}function h(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},i.isPowerlineGlyph=l,i.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},i.isEmoji=h,i.allowRescaling=function(f,d,v,m){return d===1&&v>Math.ceil(1.5*m)&&f!==void 0&&f>255&&!h(f)&&!l(f)&&!(function(E){return 57344<=E&&E<=63743})(f)},i.treatGlyphAsBackgroundColor=function(f){return l(f)||(function(d){return 9472<=d&&d<=9631})(f)},i.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}}}},i.computeNextVariantOffset=function(f,d,v=0){return(f-(2*Math.round(d)-v))%(2*Math.round(d))}},6052:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class l{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(f,d,v,m=!1){if(this.selectionStart=d,this.selectionEnd=v,!d||!v||d[0]===v[0]&&d[1]===v[1])return void this.clear();const E=f.buffers.active.ydisp,_=d[1]-E,s=v[1]-E,a=Math.max(_,0),n=Math.min(s,f.rows-1);a>=f.rows||n<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=_,this.viewportEndRow=s,this.viewportCappedStartRow=a,this.viewportCappedEndRow=n,this.startCol=d[0],this.endCol=v[0])}isCellSelected(f,d,v){return!!this.hasSelection&&(v-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&v>=this.viewportCappedStartRow&&d<this.endCol&&v<=this.viewportCappedEndRow:d<this.startCol&&v>=this.viewportCappedStartRow&&d>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&d>=this.startCol)}}i.createSelectionRenderModel=function(){return new l}},456:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(l){this._bufferService=l,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 l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,h=this.selectionEnd;return!(!l||!h)&&(l[1]>h[1]||l[1]===h[1]&&l[0]>h[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(S,i,l){var h=this&&this.__decorate||function(n,c,g,y){var b,w=arguments.length,p=w<3?c:y===null?y=Object.getOwnPropertyDescriptor(c,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(n,c,g,y);else for(var k=n.length-1;k>=0;k--)(b=n[k])&&(p=(w<3?b(p):w>3?b(c,g,p):b(c,g))||p);return w>3&&p&&Object.defineProperty(c,g,p),p},f=this&&this.__param||function(n,c){return function(g,y){c(g,y,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const d=l(2585),v=l(8460),m=l(844);let E=i.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(n,c,g){super(),this._optionsService=g,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new s(n,c,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const n=this._measureStrategy.measure();n.width===this.width&&n.height===this.height||(this.width=n.width,this.height=n.height,this._onCharSizeChange.fire())}};i.CharSizeService=E=h([f(2,d.IOptionsService)],E);class _ extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(c,g){c!==void 0&&c>0&&g!==void 0&&g>0&&(this._result.width=c,this._result.height=g)}}class s extends _{constructor(c,g,y){super(),this._document=c,this._parentElement=g,this._optionsService=y,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class a extends _{constructor(c){super(),this._optionsService=c,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const g=this._ctx.measureText("W");if(!("width"in g&&"fontBoundingBoxAscent"in g&&"fontBoundingBoxDescent"in g))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const c=this._ctx.measureText("W");return this._validateAndSet(c.width,c.fontBoundingBoxAscent+c.fontBoundingBoxDescent),this._result}}},4269:function(S,i,l){var h=this&&this.__decorate||function(a,n,c,g){var y,b=arguments.length,w=b<3?n:g===null?g=Object.getOwnPropertyDescriptor(n,c):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(a,n,c,g);else for(var p=a.length-1;p>=0;p--)(y=a[p])&&(w=(b<3?y(w):b>3?y(n,c,w):y(n,c))||w);return b>3&&w&&Object.defineProperty(n,c,w),w},f=this&&this.__param||function(a,n){return function(c,g){n(c,g,a)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const d=l(3734),v=l(643),m=l(511),E=l(2585);class _ extends d.AttributeData{constructor(n,c,g){super(),this.content=0,this.combinedData="",this.fg=n.fg,this.bg=n.bg,this.combinedData=c,this._width=g}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(n){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=_;let s=i.CharacterJoinerService=class nn{constructor(n){this._bufferService=n,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(n){const c={id:this._nextCharacterJoinerId++,handler:n};return this._characterJoiners.push(c),c.id}deregister(n){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===n)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(n){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(n);if(!c||c.length===0)return[];const g=[],y=c.translateToString(!0);let b=0,w=0,p=0,k=c.getFg(0),A=c.getBg(0);for(let L=0;L<c.getTrimmedLength();L++)if(c.loadCell(L,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==A){if(L-b>1){const T=this._getJoinedRanges(y,p,w,c,b);for(let R=0;R<T.length;R++)g.push(T[R])}b=L,p=w,k=this._workCell.fg,A=this._workCell.bg}w+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const L=this._getJoinedRanges(y,p,w,c,b);for(let T=0;T<L.length;T++)g.push(L[T])}return g}_getJoinedRanges(n,c,g,y,b){const w=n.substring(c,g);let p=[];try{p=this._characterJoiners[0].handler(w)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const A=this._characterJoiners[k].handler(w);for(let L=0;L<A.length;L++)nn._mergeRanges(p,A[L])}catch(A){console.error(A)}return this._stringRangesToCellRanges(p,y,b),p}_stringRangesToCellRanges(n,c,g){let y=0,b=!1,w=0,p=n[y];if(p){for(let k=g;k<this._bufferService.cols;k++){const A=c.getWidth(k),L=c.getString(k).length||v.WHITESPACE_CELL_CHAR.length;if(A!==0){if(!b&&p[0]<=w&&(p[0]=k,b=!0),p[1]<=w){if(p[1]=k,p=n[++y],!p)break;p[0]<=w?(p[0]=k,b=!0):b=!1}w+=L}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(n,c){let g=!1;for(let y=0;y<n.length;y++){const b=n[y];if(g){if(c[1]<=b[0])return n[y-1][1]=c[1],n;if(c[1]<=b[1])return n[y-1][1]=Math.max(c[1],b[1]),n.splice(y,1),n;n.splice(y,1),y--}else{if(c[1]<=b[0])return n.splice(y,0,c),n;if(c[1]<=b[1])return b[0]=Math.min(c[0],b[0]),n;c[0]<b[1]&&(b[0]=Math.min(c[0],b[0]),g=!0)}}return g?n[n.length-1][1]=c[1]:n.push(c),n}};i.CharacterJoinerService=s=h([f(0,E.IBufferService)],s)},5114:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const h=l(844),f=l(8460),d=l(3656);class v extends h.Disposable{constructor(_,s,a){super(),this._textarea=_,this._window=s,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new f.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((n=>this._screenDprMonitor.setWindow(n)))),this.register((0,f.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(_){this._window!==_&&(this._window=_,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}}i.CoreBrowserService=v;class m extends h.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new f.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(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.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:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const h=l(844);class f extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const m=this.linkProviders.indexOf(v);m!==-1&&this.linkProviders.splice(m,1)}}}}i.LinkProviderService=f},8934:function(S,i,l){var h=this&&this.__decorate||function(E,_,s,a){var n,c=arguments.length,g=c<3?_:a===null?a=Object.getOwnPropertyDescriptor(_,s):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(E,_,s,a);else for(var y=E.length-1;y>=0;y--)(n=E[y])&&(g=(c<3?n(g):c>3?n(_,s,g):n(_,s))||g);return c>3&&g&&Object.defineProperty(_,s,g),g},f=this&&this.__param||function(E,_){return function(s,a){_(s,a,E)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const d=l(4725),v=l(9806);let m=i.MouseService=class{constructor(E,_){this._renderService=E,this._charSizeService=_}getCoords(E,_,s,a,n){return(0,v.getCoords)(window,E,_,s,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,n)}getMouseReportCoords(E,_){const s=(0,v.getCoordsRelativeToElement)(window,E,_);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};i.MouseService=m=h([f(0,d.IRenderService),f(1,d.ICharSizeService)],m)},3230:function(S,i,l){var h=this&&this.__decorate||function(n,c,g,y){var b,w=arguments.length,p=w<3?c:y===null?y=Object.getOwnPropertyDescriptor(c,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(n,c,g,y);else for(var k=n.length-1;k>=0;k--)(b=n[k])&&(p=(w<3?b(p):w>3?b(c,g,p):b(c,g))||p);return w>3&&p&&Object.defineProperty(c,g,p),p},f=this&&this.__param||function(n,c){return function(g,y){c(g,y,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const d=l(6193),v=l(4725),m=l(8460),E=l(844),_=l(7226),s=l(2585);let a=i.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(n,c,g,y,b,w,p,k){super(),this._rowCount=n,this._charSizeService=y,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new E.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 m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((A,L)=>this._renderRows(A,L)),p),this.register(this._renderDebouncer),this.register(p.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(w.onResize((()=>this._fullRefresh()))),this.register(w.buffers.onBufferActivate((()=>{var A;return(A=this._renderer.value)==null?void 0:A.clear()}))),this.register(g.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(b.onDecorationRegistered((()=>this._fullRefresh()))),this.register(b.onDecorationRemoved((()=>this._fullRefresh()))),this.register(g.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()}))),this.register(g.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(w.buffer.y,w.buffer.y,!0)))),this.register(k.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(p.window,c),this.register(p.onWindowChange((A=>this._registerIntersectionObserver(A,c))))}_registerIntersectionObserver(n,c){if("IntersectionObserver"in n){const g=new n.IntersectionObserver((y=>this._handleIntersectionChange(y[y.length-1])),{threshold:0});g.observe(c),this._observerDisposable.value=(0,E.toDisposable)((()=>g.disconnect()))}}_handleIntersectionChange(n){this._isPaused=n.isIntersecting===void 0?n.intersectionRatio===0:!n.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(n,c,g=!1){this._isPaused?this._needsFullRefresh=!0:(g||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(n,c,this._rowCount))}_renderRows(n,c){this._renderer.value&&(n=Math.min(n,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.value.renderRows(n,c),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:n,end:c}),this._onRender.fire({start:n,end:c}),this._isNextRenderRedrawOnly=!0)}resize(n,c){this._rowCount=c,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(n){this._renderer.value=n,this._renderer.value&&(this._renderer.value.onRequestRedraw((c=>this.refreshRows(c.start,c.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(n){return this._renderDebouncer.addRefreshCallback(n)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var n,c;this._renderer.value&&((c=(n=this._renderer.value).clearTextureAtlas)==null||c.call(n),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(n,c){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var g;return(g=this._renderer.value)==null?void 0:g.handleResize(n,c)})):this._renderer.value.handleResize(n,c),this._fullRefresh())}handleCharSizeChanged(){var n;(n=this._renderer.value)==null||n.handleCharSizeChanged()}handleBlur(){var n;(n=this._renderer.value)==null||n.handleBlur()}handleFocus(){var n;(n=this._renderer.value)==null||n.handleFocus()}handleSelectionChanged(n,c,g){var y;this._selectionState.start=n,this._selectionState.end=c,this._selectionState.columnSelectMode=g,(y=this._renderer.value)==null||y.handleSelectionChanged(n,c,g)}handleCursorMove(){var n;(n=this._renderer.value)==null||n.handleCursorMove()}clear(){var n;(n=this._renderer.value)==null||n.clear()}};i.RenderService=a=h([f(2,s.IOptionsService),f(3,v.ICharSizeService),f(4,s.IDecorationService),f(5,s.IBufferService),f(6,v.ICoreBrowserService),f(7,v.IThemeService)],a)},9312:function(S,i,l){var h=this&&this.__decorate||function(p,k,A,L){var T,R=arguments.length,M=R<3?k:L===null?L=Object.getOwnPropertyDescriptor(k,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,k,A,L);else for(var F=p.length-1;F>=0;F--)(T=p[F])&&(M=(R<3?T(M):R>3?T(k,A,M):T(k,A))||M);return R>3&&M&&Object.defineProperty(k,A,M),M},f=this&&this.__param||function(p,k){return function(A,L){k(A,L,p)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const d=l(9806),v=l(9504),m=l(456),E=l(4725),_=l(8460),s=l(844),a=l(6114),n=l(4841),c=l(511),g=l(2585),y=" ",b=new RegExp(y,"g");let w=i.SelectionService=class extends s.Disposable{constructor(p,k,A,L,T,R,M,F,$){super(),this._element=p,this._screenElement=k,this._linkifier=A,this._bufferService=L,this._coreService=T,this._mouseService=R,this._optionsService=M,this._renderService=F,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Z=>this._handleMouseMove(Z),this._mouseUpListener=Z=>this._handleMouseUp(Z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Z=>this._handleTrim(Z))),this.register(this._bufferService.buffers.onBufferActivate((Z=>this._handleBufferActivate(Z)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,s.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,k=this._model.finalSelectionEnd;return!(!p||!k||p[0]===k[0]&&p[1]===k[1])}get selectionText(){const p=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!p||!k)return"";const A=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(p[0]===k[0])return"";const T=p[0]<k[0]?p[0]:k[0],R=p[0]<k[0]?k[0]:p[0];for(let M=p[1];M<=k[1];M++){const F=A.translateBufferLineToString(M,!0,T,R);L.push(F)}}else{const T=p[1]===k[1]?k[0]:void 0;L.push(A.translateBufferLineToString(p[1],!0,p[0],T));for(let R=p[1]+1;R<=k[1]-1;R++){const M=A.lines.get(R),F=A.translateBufferLineToString(R,!0);M!=null&&M.isWrapped?L[L.length-1]+=F:L.push(F)}if(p[1]!==k[1]){const R=A.lines.get(k[1]),M=A.translateBufferLineToString(k[1],!0,0,k[0]);R&&R.isWrapped?L[L.length-1]+=M:L.push(M)}}return L.map((T=>T.replace(b," "))).join(a.isWindows?`\r
|
|
162
|
+
WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=y=h([f(0,g.IBufferService),f(1,g.IOptionsService),f(2,g.IOscLinkService)],y)},6193:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,f){this._rowCount=f,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,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 c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const h=c(3614),f=c(3656),u=c(3551),g=c(9042),y=c(3730),E=c(1680),p=c(3107),n=c(5744),l=c(2950),o=c(1296),d=c(428),_=c(4269),C=c(5114),S=c(8934),w=c(3230),b=c(9312),k=c(4725),R=c(6731),L=c(8055),T=c(8969),A=c(8460),F=c(844),U=c(6114),$=c(8437),z=c(2584),W=c(7399),I=c(5941),x=c(9074),D=c(2585),O=c(5435),V=c(4567),G=c(779);class X extends T.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(N={}){super(N),this.browser=U,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(G.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(y.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,H)=>this.refresh(B,H)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),this.register((0,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((B=>this._afterResize(B.cols,B.rows)))),this.register((0,F.toDisposable)((()=>{var B,H;this._customKeyEventHandler=void 0,(H=(B=this.element)==null?void 0:B.parentNode)==null||H.removeChild(this.element)})))}_handleColorEvent(N){if(this._themeService)for(const B of N){let H,P="";switch(B.index){case 256:H="foreground",P="10";break;case 257:H="background",P="11";break;case 258:H="cursor",P="12";break;default:H="ansi",P="4;"+B.index}switch(B.type){case 0:const Z=L.color.toColorRGB(H==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[H]);this.coreService.triggerDataEvent(`${z.C0.ESC}]${P};${(0,I.toRgbString)(Z)}${z.C1_ESCAPED.ST}`);break;case 1:if(H==="ansi")this._themeService.modifyColors((K=>K.ansi[B.index]=L.channels.toColor(...B.color)));else{const K=H;this._themeService.modifyColors((ee=>ee[K]=L.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(N){N?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(N){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var N;return(N=this.textarea)==null?void 0:N.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.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 N=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(N);if(!B)return;const H=Math.min(this.buffer.x,this.cols-1),P=this._renderService.dimensions.css.cell.height,Z=B.getWidth(H),K=this._renderService.dimensions.css.cell.width*Z,ee=this.buffer.y*this._renderService.dimensions.css.cell.height,de=H*this._renderService.dimensions.css.cell.width;this.textarea.style.left=de+"px",this.textarea.style.top=ee+"px",this.textarea.style.width=K+"px",this.textarea.style.height=P+"px",this.textarea.style.lineHeight=P+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,h.copyHandler)(B,this._selectionService)})));const N=B=>(0,h.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",N)),this.register((0,f.addDisposableDomListener)(this.element,"paste",N)),U.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,h.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,h.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),U.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,h.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",(N=>this._keyUp(N)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",(N=>this._keyDown(N)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",(N=>this._keyPress(N)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",(N=>this._compositionHelper.compositionupdate(N)))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,f.addDisposableDomListener)(this.textarea,"input",(N=>this._inputEvent(N)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(N){var H;if(!N)throw new Error("Terminal requires a parent element.");if(N.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((H=this.element)==null?void 0:H.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=N.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"),N.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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,f.addDisposableDomListener)(this.screenElement,"mousemove",(P=>this.updateCursorStyle(P)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),U.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(C.CoreBrowserService,this.textarea,N.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,f.addDisposableDomListener)(this.textarea,"focus",(P=>this._handleTextAreaFocus(P)))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(d.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((P=>this._onRender.fire(P)))),this.onResize((P=>this._renderService.resize(P.cols,P.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(E.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((P=>this.scrollLines(P.amount,P.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(b.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((P=>this.scrollLines(P.amount,P.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((P=>this._renderService.handleSelectionChanged(P.start,P.end,P.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((P=>{this.textarea.value=P,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((P=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(p.BufferDecorationRenderer,this.screenElement)),this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(P=>this._selectionService.handleMouseDown(P)))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(P=>this._handleScreenReaderModeOptionChange(P)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(P=>{!this._overviewRulerRenderer&&P&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const N=this,B=this.element;function H(K){const ee=N._mouseService.getMouseReportCoords(K,N.screenElement);if(!ee)return!1;let de,he;switch(K.overrideType||K.type){case"mousemove":he=32,K.buttons===void 0?(de=3,K.button!==void 0&&(de=K.button<3?K.button:3)):de=1&K.buttons?0:4&K.buttons?1:2&K.buttons?2:3;break;case"mouseup":he=0,de=K.button<3?K.button:3;break;case"mousedown":he=1,de=K.button<3?K.button:3;break;case"wheel":if(N._customWheelEventHandler&&N._customWheelEventHandler(K)===!1||N.viewport.getLinesScrolled(K)===0)return!1;he=K.deltaY<0?0:1,de=4;break;default:return!1}return!(he===void 0||de===void 0||de>4)&&N.coreMouseService.triggerMouseEvent({col:ee.col,row:ee.row,x:ee.x,y:ee.y,button:de,action:he,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}const P={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Z={mouseup:K=>(H(K),K.buttons||(this._document.removeEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.removeEventListener("mousemove",P.mousedrag)),this.cancel(K)),wheel:K=>(H(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&H(K)},mousemove:K=>{K.buttons||H(K)}};this.register(this.coreMouseService.onProtocolChange((K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),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&K?P.mousemove||(B.addEventListener("mousemove",Z.mousemove),P.mousemove=Z.mousemove):(B.removeEventListener("mousemove",P.mousemove),P.mousemove=null),16&K?P.wheel||(B.addEventListener("wheel",Z.wheel,{passive:!1}),P.wheel=Z.wheel):(B.removeEventListener("wheel",P.wheel),P.wheel=null),2&K?P.mouseup||(P.mouseup=Z.mouseup):(this._document.removeEventListener("mouseup",P.mouseup),P.mouseup=null),4&K?P.mousedrag||(P.mousedrag=Z.mousedrag):(this._document.removeEventListener("mousemove",P.mousedrag),P.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(B,"mousedown",(K=>{if(K.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(K))return H(K),P.mouseup&&this._document.addEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.addEventListener("mousemove",P.mousedrag),this.cancel(K)}))),this.register((0,f.addDisposableDomListener)(B,"wheel",(K=>{if(!P.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(K)===!1)return!1;if(!this.buffer.hasScrollback){const ee=this.viewport.getLinesScrolled(K);if(ee===0)return;const de=z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");let he="";for(let ke=0;ke<Math.abs(ee);ke++)he+=de;return this.coreService.triggerDataEvent(he,!0),this.cancel(K,!0)}return this.viewport.handleWheel(K)?this.cancel(K):void 0}}),{passive:!1})),this.register((0,f.addDisposableDomListener)(B,"touchstart",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(K),this.cancel(K)}),{passive:!0})),this.register((0,f.addDisposableDomListener)(B,"touchmove",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(K)?void 0:this.cancel(K)}),{passive:!1}))}refresh(N,B){var H;(H=this._renderService)==null||H.refreshRows(N,B)}updateCursorStyle(N){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(N)?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(N,B,H=0){var P;H===1?(super.scrollLines(N,B,H),this.refresh(0,this.rows-1)):(P=this.viewport)==null||P.scrollLines(N)}paste(N){(0,h.paste)(N,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(N){this._customKeyEventHandler=N}attachCustomWheelEventHandler(N){this._customWheelEventHandler=N}registerLinkProvider(N){return this._linkProviderService.registerLinkProvider(N)}registerCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(N);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(N){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(N)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(N){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+N)}registerDecoration(N){return this._decorationService.registerDecoration(N)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(N,B,H){this._selectionService.setSelection(N,B,H)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var N;(N=this._selectionService)==null||N.clearSelection()}selectAll(){var N;(N=this._selectionService)==null||N.selectAll()}selectLines(N,B){var H;(H=this._selectionService)==null||H.selectLines(N,B)}_keyDown(N){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&N.altKey;if(!B&&!this._compositionHelper.keydown(N))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||N.key!=="Dead"&&N.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const H=(0,W.evaluateKeyboardEvent)(N,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(N),H.type===3||H.type===2){const P=this.rows-1;return this.scrollLines(H.type===2?-P:P),this.cancel(N,!0)}return H.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,N)||(H.cancel&&this.cancel(N,!0),!H.key||!!(N.key&&!N.ctrlKey&&!N.altKey&&!N.metaKey&&N.key.length===1&&N.key.charCodeAt(0)>=65&&N.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(H.key!==z.C0.ETX&&H.key!==z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:H.key,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(H.key,!0),!this.optionsService.rawOptions.screenReaderMode||N.altKey||N.ctrlKey?this.cancel(N,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(N,B){const H=N.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||N.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||N.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?H:H&&(!B.keyCode||B.keyCode>47)}_keyUp(N){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(N)||this.focus(),this.updateCursorStyle(N),this._keyPressHandled=!1)}_keyPress(N){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(N)===!1)return!1;if(this.cancel(N),N.charCode)B=N.charCode;else if(N.which===null||N.which===void 0)B=N.keyCode;else{if(N.which===0||N.charCode===0)return!1;B=N.which}return!(!B||(N.altKey||N.ctrlKey||N.metaKey)&&!this._isThirdLevelShift(this.browser,N)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:N}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(N){if(N.data&&N.inputType==="insertText"&&(!N.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=N.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(N),!0}return!1}resize(N,B){N!==this.cols||B!==this.rows?super.resize(N,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(N,B){var H,P;(H=this._charSizeService)==null||H.measure(),(P=this.viewport)==null||P.syncScrollArea(!0)}clear(){var N;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(N=this.viewport)==null||N.reset(),this.refresh(0,this.rows-1)}}reset(){var B,H;this.options.rows=this.rows,this.options.cols=this.cols;const N=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)==null||B.reset(),this._decorationService.reset(),(H=this.viewport)==null||H.reset(),this._customKeyEventHandler=N,this.refresh(0,this.rows-1)}clearTextureAtlas(){var N;(N=this._renderService)==null||N.clearTextureAtlas()}_reportFocus(){var N;(N=this.element)!=null&&N.classList.contains("focus")?this.coreService.triggerDataEvent(z.C0.ESC+"[I"):this.coreService.triggerDataEvent(z.C0.ESC+"[O")}_reportWindowsOptions(N){if(this._renderService)switch(N){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),H=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[4;${H};${B}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const P=this._renderService.dimensions.css.cell.width.toFixed(0),Z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[6;${Z};${P}t`)}}cancel(N,B){if(this.options.cancelEvents||B)return N.preventDefault(),N.stopPropagation(),!1}}s.Terminal=X},9924:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,f){this._rowCount=f,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=u-this._lastRefreshMs,y=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),y)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(v,s,c){var h=this&&this.__decorate||function(l,o,d,_){var C,S=arguments.length,w=S<3?o:_===null?_=Object.getOwnPropertyDescriptor(o,d):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,o,d,_);else for(var b=l.length-1;b>=0;b--)(C=l[b])&&(w=(S<3?C(w):S>3?C(o,d,w):C(o,d))||w);return S>3&&w&&Object.defineProperty(o,d,w),w},f=this&&this.__param||function(l,o){return function(d,_){o(d,_,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=c(3656),g=c(4725),y=c(8460),E=c(844),p=c(2585);let n=s.Viewport=class extends E.Disposable{constructor(l,o,d,_,C,S,w,b){super(),this._viewportElement=l,this._scrollArea=o,this._bufferService=d,this._optionsService=_,this._charSizeService=C,this._renderService=S,this._coreBrowserService=w,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 y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((k=>this._activeBuffer=k.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((k=>this._renderDimensions=k))),this._handleThemeChange(b.colors),this.register(b.onChangeColors((k=>this._handleThemeChange(k)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.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(l){if(l)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 o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){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 o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<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(l,o){const d=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&d<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const o=this._getPixelsScrolled(l);return o!==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+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(l,o))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let o=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(l,o){var b;let d,_="";const C=[],S=o??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let k=l;k<S;k++){const R=w.get(k);if(!R)continue;const L=(b=w.get(k+1))==null?void 0:b.isWrapped;if(_+=R.translateToString(!L),!L||k===w.length-1){const T=document.createElement("div");T.textContent=_,C.push(T),_.length>0&&(d=T),_=""}}return{bufferElements:C,cursorElement:d}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let o=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(l,o){const d=this._optionsService.rawOptions.fastScrollModifier;return d==="alt"&&o.altKey||d==="ctrl"&&o.ctrlKey||d==="shift"&&o.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const o=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(l,o))}};s.Viewport=n=h([f(2,p.IBufferService),f(3,p.IOptionsService),f(4,g.ICharSizeService),f(5,g.IRenderService),f(6,g.ICoreBrowserService),f(7,g.IThemeService)],n)},3107:function(v,s,c){var h=this&&this.__decorate||function(p,n,l,o){var d,_=arguments.length,C=_<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(p,n,l,o);else for(var S=p.length-1;S>=0;S--)(d=p[S])&&(C=(_<3?d(C):_>3?d(n,l,C):d(n,l))||C);return _>3&&C&&Object.defineProperty(n,l,C),C},f=this&&this.__param||function(p,n){return function(l,o){n(l,o,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=c(4725),g=c(844),y=c(2585);let E=s.BufferDecorationRenderer=class extends g.Disposable{constructor(p,n,l,o,d){super(),this._screenElement=p,this._bufferService=n,this._coreBrowserService=l,this._decorationService=o,this._renderService=d,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((_=>this._removeDecoration(_)))),this.register((0,g.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 p of this._decorationService.decorations)this._renderDecoration(p);this._dimensionsChanged=!1}_renderDecoration(p){this._refreshStyle(p),this._dimensionsChanged&&this._refreshXPosition(p)}_createElement(p){var o;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((o=p==null?void 0:p.options)==null?void 0:o.layer)==="top"),n.style.width=`${Math.round((p.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(p.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(p.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const l=p.options.x??0;return l&&l>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(p,n),n}_refreshStyle(p){const n=p.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)p.element&&(p.element.style.display="none",p.onRenderEmitter.fire(p.element));else{let l=this._decorationElements.get(p);l||(l=this._createElement(p),p.element=l,this._decorationElements.set(p,l),this._container.appendChild(l),p.onDispose((()=>{this._decorationElements.delete(p),l.remove()}))),l.style.top=n*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",p.onRenderEmitter.fire(l)}}_refreshXPosition(p,n=p.element){if(!n)return;const l=p.options.x??0;(p.options.anchor||"left")==="right"?n.style.right=l?l*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=l?l*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(p){var n;(n=this._decorationElements.get(p))==null||n.remove(),this._decorationElements.delete(p),p.dispose()}};s.BufferDecorationRenderer=E=h([f(1,y.IBufferService),f(2,u.ICoreBrowserService),f(3,y.IDecorationService),f(4,u.IRenderService)],E)},5871:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,f){return h>=c.startBufferLine-this._linePadding[f||"full"]&&h<=c.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(v,s,c){var h=this&&this.__decorate||function(d,_,C,S){var w,b=arguments.length,k=b<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,C):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,_,C,S);else for(var R=d.length-1;R>=0;R--)(w=d[R])&&(k=(b<3?w(k):b>3?w(_,C,k):w(_,C))||k);return b>3&&k&&Object.defineProperty(_,C,k),k},f=this&&this.__param||function(d,_){return function(C,S){_(C,S,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=c(5871),g=c(4725),y=c(844),E=c(2585),p={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let o=s.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(d,_,C,S,w,b,k){var L;super(),this._viewportElement=d,this._screenElement=_,this._bufferService=C,this._decorationService=S,this._renderService=w,this._optionsService=b,this._coreBrowserService=k,this._colorZoneStore=new u.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(),(L=this._viewportElement.parentElement)==null||L.insertBefore(this._canvas,this._viewportElement);const R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,y.toDisposable)((()=>{var T;(T=this._canvas)==null||T.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 d=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=d,n.center=_,n.right=d,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=n.left,l.right=n.left+n.center}_refreshDrawHeightConstants(){p.full=Math.round(2*this._coreBrowserService.dpr);const d=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(d,12),6)*this._coreBrowserService.dpr);p.left=_,p.center=_,p.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.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 _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const d=this._colorZoneStore.zones;for(const _ of d)_.position!=="full"&&this._renderColorZone(_);for(const _ of d)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(d){this._ctx.fillStyle=d.color,this._ctx.fillRect(l[d.position||"full"],Math.round((this._canvas.height-1)*(d.startBufferLine/this._bufferService.buffers.active.lines.length)-p[d.position||"full"]/2),n[d.position||"full"],Math.round((this._canvas.height-1)*((d.endBufferLine-d.startBufferLine)/this._bufferService.buffers.active.lines.length)+p[d.position||"full"]))}_queueRefresh(d,_){this._shouldUpdateDimensions=d||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=o=h([f(2,E.IBufferService),f(3,E.IDecorationService),f(4,g.IRenderService),f(5,E.IOptionsService),f(6,g.ICoreBrowserService)],o)},2950:function(v,s,c){var h=this&&this.__decorate||function(p,n,l,o){var d,_=arguments.length,C=_<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(p,n,l,o);else for(var S=p.length-1;S>=0;S--)(d=p[S])&&(C=(_<3?d(C):_>3?d(n,l,C):d(n,l))||C);return _>3&&C&&Object.defineProperty(n,l,C),C},f=this&&this.__param||function(p,n){return function(l,o){n(l,o,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=c(4725),g=c(2585),y=c(2584);let E=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(p,n,l,o,d,_){this._textarea=p,this._compositionView=n,this._bufferService=l,this._optionsService=o,this._coreService=d,this._renderService=_,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(p){this._compositionView.textContent=p.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(p){if(this._isComposing||this._isSendingComposition){if(p.keyCode===229||p.keyCode===16||p.keyCode===17||p.keyCode===18)return!1;this._finalizeComposition(!1)}return p.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(p){if(this._compositionView.classList.remove("active"),this._isComposing=!1,p){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const p=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,l=n.replace(p,"");this._dataAlreadySent=l,n.length>p.length?this._coreService.triggerDataEvent(l,!0):n.length<p.length?this._coreService.triggerDataEvent(`${y.C0.DEL}`,!0):n.length===p.length&&n!==p&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(p){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,d=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=d+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=d+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}p||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=E=h([f(2,g.IBufferService),f(3,g.IOptionsService),f(4,g.ICoreService),f(5,u.IRenderService)],E)},9806:(v,s)=>{function c(h,f,u){const g=u.getBoundingClientRect(),y=h.getComputedStyle(u),E=parseInt(y.getPropertyValue("padding-left")),p=parseInt(y.getPropertyValue("padding-top"));return[f.clientX-g.left-E,f.clientY-g.top-p]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=c,s.getCoords=function(h,f,u,g,y,E,p,n,l){if(!E)return;const o=c(h,f,u);return o?(o[0]=Math.ceil((o[0]+(l?p/2:0))/p),o[1]=Math.ceil(o[1]/n),o[0]=Math.min(Math.max(o[0],1),g+(l?1:0)),o[1]=Math.min(Math.max(o[1],1),y),o):void 0}},9504:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const h=c(2584);function f(n,l,o,d){const _=n-u(n,o),C=l-u(l,o),S=Math.abs(_-C)-(function(w,b,k){let R=0;const L=w-u(w,k),T=b-u(b,k);for(let A=0;A<Math.abs(L-T);A++){const F=g(w,b)==="A"?-1:1,U=k.buffer.lines.get(L+F*A);U!=null&&U.isWrapped&&R++}return R})(n,l,o);return p(S,E(g(n,l),d))}function u(n,l){let o=0,d=l.buffer.lines.get(n),_=d==null?void 0:d.isWrapped;for(;_&&n>=0&&n<l.rows;)o++,d=l.buffer.lines.get(--n),_=d==null?void 0:d.isWrapped;return o}function g(n,l){return n>l?"A":"B"}function y(n,l,o,d,_,C){let S=n,w=l,b="";for(;S!==o||w!==d;)S+=_?1:-1,_&&S>C.cols-1?(b+=C.buffer.translateBufferLineToString(w,!1,n,S),S=0,n=0,w++):!_&&S<0&&(b+=C.buffer.translateBufferLineToString(w,!1,0,n+1),S=C.cols-1,n=S,w--);return b+C.buffer.translateBufferLineToString(w,!1,n,S)}function E(n,l){const o=l?"O":"[";return h.C0.ESC+o+n}function p(n,l){n=Math.floor(n);let o="";for(let d=0;d<n;d++)o+=l;return o}s.moveToCellSequence=function(n,l,o,d){const _=o.buffer.x,C=o.buffer.y;if(!o.buffer.hasScrollback)return(function(b,k,R,L,T,A){return f(k,L,T,A).length===0?"":p(y(b,k,b,k-u(k,T),!1,T).length,E("D",A))})(_,C,0,l,o,d)+f(C,l,o,d)+(function(b,k,R,L,T,A){let F;F=f(k,L,T,A).length>0?L-u(L,T):k;const U=L,$=(function(z,W,I,x,D,O){let V;return V=f(I,x,D,O).length>0?x-u(x,D):W,z<I&&V<=x||z>=I&&V<x?"C":"D"})(b,k,R,L,T,A);return p(y(b,F,R,U,$==="C",T).length,E($,A))})(_,C,n,l,o,d);let S;if(C===l)return S=_>n?"D":"C",p(Math.abs(_-n),E(S,d));S=C>l?"D":"C";const w=Math.abs(C-l);return p((function(b,k){return k.cols-b})(C>l?n:_,o)+(w-1)*o.cols+1+((C>l?_:n)-1),E(S,d))}},1296:function(v,s,c){var h=this&&this.__decorate||function(A,F,U,$){var z,W=arguments.length,I=W<3?F:$===null?$=Object.getOwnPropertyDescriptor(F,U):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(A,F,U,$);else for(var x=A.length-1;x>=0;x--)(z=A[x])&&(I=(W<3?z(I):W>3?z(F,U,I):z(F,U))||I);return W>3&&I&&Object.defineProperty(F,U,I),I},f=this&&this.__param||function(A,F){return function(U,$){F(U,$,A)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=c(3787),g=c(2550),y=c(2223),E=c(6171),p=c(6052),n=c(4725),l=c(8055),o=c(8460),d=c(844),_=c(2585),C="xterm-dom-renderer-owner-",S="xterm-rows",w="xterm-fg-",b="xterm-bg-",k="xterm-focus",R="xterm-selection";let L=1,T=s.DomRenderer=class extends d.Disposable{constructor(A,F,U,$,z,W,I,x,D,O,V,G,X){super(),this._terminal=A,this._document=F,this._element=U,this._screenElement=$,this._viewportElement=z,this._helperContainer=W,this._linkifier2=I,this._charSizeService=D,this._optionsService=O,this._bufferService=V,this._coreBrowserService=G,this._themeService=X,this._terminalClass=L++,this._rowElements=[],this._selectionRenderModel=(0,p.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),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(R),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,E.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((J=>this._injectCss(J)))),this._injectCss(this._themeService.colors),this._rowFactory=x.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(C+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((J=>this._handleLinkHover(J)))),this.register(this._linkifier2.onHideLinkUnderline((J=>this._handleLinkLeave(J)))),this.register((0,d.toDisposable)((()=>{this._element.classList.remove(C+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),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/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),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 U of this._rowElements)U.style.width=`${this.dimensions.css.canvas.width}px`,U.style.height=`${this.dimensions.css.cell.height}px`,U.style.lineHeight=`${this.dimensions.css.cell.height}px`,U.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${S} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${S} .xterm-dim { color: ${l.color.multiplyOpacity(A.foreground,.5).css};}`,F+=`${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 U=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,z=`blink_block_${this._terminalClass}`;F+=`@keyframes ${U} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${$} { 50% { box-shadow: none; }}`,F+=`@keyframes ${z} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,F+=`${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[W,I]of A.ansi.entries())F+=`${this._terminalSelector} .${w}${W} { color: ${I.css}; }${this._terminalSelector} .${w}${W}.xterm-dim { color: ${l.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${b}${W} { background-color: ${I.css}; }`;F+=`${this._terminalSelector} .${w}${y.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(A.background).css}; }${this._terminalSelector} .${w}${y.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${b}${y.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,F){for(let U=this._rowElements.length;U<=F;U++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,F){this._refreshRowElements(A,F),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(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,F,U){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,F,U),this.renderRows(0,this._bufferService.rows-1),!A||!F)return;this._selectionRenderModel.update(this._terminal,A,F,U);const $=this._selectionRenderModel.viewportStartRow,z=this._selectionRenderModel.viewportEndRow,W=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(W>=this._bufferService.rows||I<0)return;const x=this._document.createDocumentFragment();if(U){const D=A[0]>F[0];x.appendChild(this._createSelectionElement(W,D?F[0]:A[0],D?A[0]:F[0],I-W+1))}else{const D=$===W?A[0]:0,O=W===z?F[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(W,D,O));const V=I-W-1;if(x.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,V)),W!==I){const G=z===I?F[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(I,0,G))}}this._selectionContainer.appendChild(x)}_createSelectionElement(A,F,U,$=1){const z=this._document.createElement("div"),W=F*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(U-F);return W+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-W),z.style.height=$*this.dimensions.css.cell.height+"px",z.style.top=A*this.dimensions.css.cell.height+"px",z.style.left=`${W}px`,z.style.width=`${I}px`,z}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 A of this._rowElements)A.replaceChildren()}renderRows(A,F){const U=this._bufferService.buffer,$=U.ybase+U.y,z=Math.min(U.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=A;D<=F;D++){const O=D+U.ydisp,V=this._rowElements[D],G=U.lines.get(O);if(!V||!G)break;V.replaceChildren(...this._rowFactory.createRow(G,O,O===$,I,x,z,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,F,U,$,z,W){U<0&&(A=0),$<0&&(F=0);const I=this._bufferService.rows-1;U=Math.max(Math.min(U,I),0),$=Math.max(Math.min($,I),0),z=Math.min(z,this._bufferService.cols);const x=this._bufferService.buffer,D=x.ybase+x.y,O=Math.min(x.x,z-1),V=this._optionsService.rawOptions.cursorBlink,G=this._optionsService.rawOptions.cursorStyle,X=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=U;J<=$;++J){const N=J+x.ydisp,B=this._rowElements[J],H=x.lines.get(N);if(!B||!H)break;B.replaceChildren(...this._rowFactory.createRow(H,N,N===D,G,X,O,V,this.dimensions.css.cell.width,this._widthCache,W?J===U?A:0:-1,W?(J===$?F:z)-1:-1))}}};s.DomRenderer=T=h([f(7,_.IInstantiationService),f(8,n.ICharSizeService),f(9,_.IOptionsService),f(10,_.IBufferService),f(11,n.ICoreBrowserService),f(12,n.IThemeService)],T)},3787:function(v,s,c){var h=this&&this.__decorate||function(S,w,b,k){var R,L=arguments.length,T=L<3?w:k===null?k=Object.getOwnPropertyDescriptor(w,b):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,w,b,k);else for(var A=S.length-1;A>=0;A--)(R=S[A])&&(T=(L<3?R(T):L>3?R(w,b,T):R(w,b))||T);return L>3&&T&&Object.defineProperty(w,b,T),T},f=this&&this.__param||function(S,w){return function(b,k){w(b,k,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=c(2223),g=c(643),y=c(511),E=c(2585),p=c(8055),n=c(4725),l=c(4269),o=c(6171),d=c(3734);let _=s.DomRendererRowFactory=class{constructor(S,w,b,k,R,L,T){this._document=S,this._characterJoinerService=w,this._optionsService=b,this._coreBrowserService=k,this._coreService=R,this._decorationService=L,this._themeService=T,this._workCell=new y.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,w,b){this._selectionStart=S,this._selectionEnd=w,this._columnSelectMode=b}createRow(S,w,b,k,R,L,T,A,F,U,$){const z=[],W=this._characterJoinerService.getJoinedCharacters(w),I=this._themeService.colors;let x,D=S.getNoBgTrimmedLength();b&&D<L+1&&(D=L+1);let O=0,V="",G=0,X=0,J=0,N=!1,B=0,H=!1,P=0;const Z=[],K=U!==-1&&$!==-1;for(let ee=0;ee<D;ee++){S.loadCell(ee,this._workCell);let de=this._workCell.getWidth();if(de===0)continue;let he=!1,ke=ee,q=this._workCell;if(W.length>0&&ee===W[0][0]){he=!0;const ae=W.shift();q=new l.JoinedCellData(this._workCell,S.translateToString(!0,ae[0],ae[1]),ae[1]-ae[0]),ke=ae[1]-1,de=q.getWidth()}const xt=this._isCellInSelection(ee,w),Kr=b&&ee===L,Zr=K&&ee>=U&&ee<=$;let zr=!1;this._decorationService.forEachDecorationAtCell(ee,w,void 0,(ae=>{zr=!0}));let cr=q.getChars()||g.WHITESPACE_CELL_CHAR;if(cr===" "&&(q.isUnderline()||q.isOverline())&&(cr=" "),P=de*A-F.get(cr,q.isBold(),q.isItalic()),x){if(O&&(xt&&H||!xt&&!H&&q.bg===G)&&(xt&&H&&I.selectionForeground||q.fg===X)&&q.extended.ext===J&&Zr===N&&P===B&&!Kr&&!he&&!zr){q.isInvisible()?V+=g.WHITESPACE_CELL_CHAR:V+=cr,O++;continue}O&&(x.textContent=V),x=this._document.createElement("span"),O=0,V=""}else x=this._document.createElement("span");if(G=q.bg,X=q.fg,J=q.extended.ext,N=Zr,B=P,H=xt,he&&L>=ee&&L<=ke&&(L=ee),!this._coreService.isCursorHidden&&Kr&&this._coreService.isCursorInitialized){if(Z.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&Z.push("xterm-cursor-blink"),Z.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){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(q.isBold()&&Z.push("xterm-bold"),q.isItalic()&&Z.push("xterm-italic"),q.isDim()&&Z.push("xterm-dim"),V=q.isInvisible()?g.WHITESPACE_CELL_CHAR:q.getChars()||g.WHITESPACE_CELL_CHAR,q.isUnderline()&&(Z.push(`xterm-underline-${q.extended.underlineStyle}`),V===" "&&(V=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${d.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let ae=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&ae<8&&(ae+=8),x.style.textDecorationColor=I.ansi[ae].css}q.isOverline()&&(Z.push("xterm-overline"),V===" "&&(V=" ")),q.isStrikethrough()&&Z.push("xterm-strikethrough"),Zr&&(x.style.textDecoration="underline");let Le=q.getFgColor(),Lt=q.getFgColorMode(),Me=q.getBgColor(),Tt=q.getBgColorMode();const Yr=!!q.isInverse();if(Yr){const ae=Le;Le=Me,Me=ae;const $a=Lt;Lt=Tt,Tt=$a}let ze,lr,Ye,Dt=!1;switch(this._decorationService.forEachDecorationAtCell(ee,w,void 0,(ae=>{ae.options.layer!=="top"&&Dt||(ae.backgroundColorRGB&&(Tt=50331648,Me=ae.backgroundColorRGB.rgba>>8&16777215,ze=ae.backgroundColorRGB),ae.foregroundColorRGB&&(Lt=50331648,Le=ae.foregroundColorRGB.rgba>>8&16777215,lr=ae.foregroundColorRGB),Dt=ae.options.layer==="top")})),!Dt&&xt&&(ze=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Me=ze.rgba>>8&16777215,Tt=50331648,Dt=!0,I.selectionForeground&&(Lt=50331648,Le=I.selectionForeground.rgba>>8&16777215,lr=I.selectionForeground)),Dt&&Z.push("xterm-decoration-top"),Tt){case 16777216:case 33554432:Ye=I.ansi[Me],Z.push(`xterm-bg-${Me}`);break;case 50331648:Ye=p.channels.toColor(Me>>16,Me>>8&255,255&Me),this._addStyle(x,`background-color:#${C((Me>>>0).toString(16),"0",6)}`);break;default:Yr?(Ye=I.foreground,Z.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ye=I.background}switch(ze||q.isDim()&&(ze=p.color.multiplyOpacity(Ye,.5)),Lt){case 16777216:case 33554432:q.isBold()&&Le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Le+=8),this._applyMinimumContrast(x,Ye,I.ansi[Le],q,ze,void 0)||Z.push(`xterm-fg-${Le}`);break;case 50331648:const ae=p.channels.toColor(Le>>16&255,Le>>8&255,255&Le);this._applyMinimumContrast(x,Ye,ae,q,ze,lr)||this._addStyle(x,`color:#${C(Le.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(x,Ye,I.foreground,q,ze,lr)||Yr&&Z.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}Z.length&&(x.className=Z.join(" "),Z.length=0),Kr||he||zr?x.textContent=V:O++,P!==this.defaultSpacing&&(x.style.letterSpacing=`${P}px`),z.push(x),ee=ke}return x&&O&&(x.textContent=V),z}_applyMinimumContrast(S,w,b,k,R,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const T=this._getContrastCache(k);let A;if(R||L||(A=T.getColor(w.rgba,b.rgba)),A===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);A=p.color.ensureContrastRatio(R||w,L||b,F),T.setColor((R||w).rgba,(L||b).rgba,A??null)}return!!A&&(this._addStyle(S,`color:${A.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,w){S.setAttribute("style",`${S.getAttribute("style")||""}${w};`)}_isCellInSelection(S,w){const b=this._selectionStart,k=this._selectionEnd;return!(!b||!k)&&(this._columnSelectMode?b[0]<=k[0]?S>=b[0]&&w>=b[1]&&S<k[0]&&w<=k[1]:S<b[0]&&w>=b[1]&&S>=k[0]&&w<=k[1]:w>b[1]&&w<k[1]||b[1]===k[1]&&w===b[1]&&S>=b[0]&&S<k[0]||b[1]<k[1]&&w===k[1]&&S<k[0]||b[1]<k[1]&&w===b[1]&&S>=b[0])}};function C(S,w,b){for(;S.length<b;)S=w+S;return S}s.DomRendererRowFactory=_=h([f(1,n.ICharacterJoinerService),f(2,E.IOptionsService),f(3,n.ICoreBrowserService),f(4,E.ICoreService),f(5,E.IDecorationService),f(6,n.IThemeService)],_)},2550:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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 f=c.createElement("span");f.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const g=c.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const y=c.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontWeight="bold",y.style.fontStyle="italic",this._measureElements=[f,u,g,y],this._container.appendChild(f),this._container.appendChild(u),this._container.appendChild(g),this._container.appendChild(y),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(c,h,f,u){c===this._font&&h===this._fontSize&&f===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=f,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,f){let u=0;if(!h&&!f&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const E=this._measure(c,0);return E>0&&(this._flat[u]=E),E}let g=c;h&&(g+="B"),f&&(g+="I");let y=this._holey.get(g);if(y===void 0){let E=0;h&&(E|=1),f&&(E|=2),y=this._measure(c,E),y>0&&this._holey.set(g,y)}return y}_measure(c,h){const f=this._measureElements[h];return f.textContent=c.repeat(32),f.offsetWidth/32}}},2223:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(v,s)=>{function c(f){return 57508<=f&&f<=57558}function h(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},s.isPowerlineGlyph=c,s.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},s.isEmoji=h,s.allowRescaling=function(f,u,g,y){return u===1&&g>Math.ceil(1.5*y)&&f!==void 0&&f>255&&!h(f)&&!c(f)&&!(function(E){return 57344<=E&&E<=63743})(f)},s.treatGlyphAsBackgroundColor=function(f){return c(f)||(function(u){return 9472<=u&&u<=9631})(f)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(f,u,g=0){return(f-(2*Math.round(u)-g))%(2*Math.round(u))}},6052:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class c{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(f,u,g,y=!1){if(this.selectionStart=u,this.selectionEnd=g,!u||!g||u[0]===g[0]&&u[1]===g[1])return void this.clear();const E=f.buffers.active.ydisp,p=u[1]-E,n=g[1]-E,l=Math.max(p,0),o=Math.min(n,f.rows-1);l>=f.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=p,this.viewportEndRow=n,this.viewportCappedStartRow=l,this.viewportCappedEndRow=o,this.startCol=u[0],this.endCol=g[0])}isCellSelected(f,u,g){return!!this.hasSelection&&(g-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&g>=this.viewportCappedStartRow&&u<this.endCol&&g<=this.viewportCappedEndRow:u<this.startCol&&g>=this.viewportCappedStartRow&&u>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new c}},456:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(v,s,c){var h=this&&this.__decorate||function(o,d,_,C){var S,w=arguments.length,b=w<3?d:C===null?C=Object.getOwnPropertyDescriptor(d,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,d,_,C);else for(var k=o.length-1;k>=0;k--)(S=o[k])&&(b=(w<3?S(b):w>3?S(d,_,b):S(d,_))||b);return w>3&&b&&Object.defineProperty(d,_,b),b},f=this&&this.__param||function(o,d){return function(_,C){d(_,C,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=c(2585),g=c(8460),y=c(844);let E=s.CharSizeService=class extends y.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(o,d,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new l(this._optionsService))}catch{this._measureStrategy=this.register(new n(o,d,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())}};s.CharSizeService=E=h([f(2,u.IOptionsService)],E);class p extends y.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(d,_){d!==void 0&&d>0&&_!==void 0&&_>0&&(this._result.width=d,this._result.height=_)}}class n extends p{constructor(d,_,C){super(),this._document=d,this._parentElement=_,this._optionsService=C,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 l extends p{constructor(d){super(),this._optionsService=d,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const d=this._ctx.measureText("W");return this._validateAndSet(d.width,d.fontBoundingBoxAscent+d.fontBoundingBoxDescent),this._result}}},4269:function(v,s,c){var h=this&&this.__decorate||function(l,o,d,_){var C,S=arguments.length,w=S<3?o:_===null?_=Object.getOwnPropertyDescriptor(o,d):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,o,d,_);else for(var b=l.length-1;b>=0;b--)(C=l[b])&&(w=(S<3?C(w):S>3?C(o,d,w):C(o,d))||w);return S>3&&w&&Object.defineProperty(o,d,w),w},f=this&&this.__param||function(l,o){return function(d,_){o(d,_,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=c(3734),g=c(643),y=c(511),E=c(2585);class p extends u.AttributeData{constructor(o,d,_){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=d,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(o){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=p;let n=s.CharacterJoinerService=class $n{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}register(o){const d={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(d),d.id}deregister(o){for(let d=0;d<this._characterJoiners.length;d++)if(this._characterJoiners[d].id===o)return this._characterJoiners.splice(d,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const d=this._bufferService.buffer.lines.get(o);if(!d||d.length===0)return[];const _=[],C=d.translateToString(!0);let S=0,w=0,b=0,k=d.getFg(0),R=d.getBg(0);for(let L=0;L<d.getTrimmedLength();L++)if(d.loadCell(L,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==R){if(L-S>1){const T=this._getJoinedRanges(C,b,w,d,S);for(let A=0;A<T.length;A++)_.push(T[A])}S=L,b=w,k=this._workCell.fg,R=this._workCell.bg}w+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const L=this._getJoinedRanges(C,b,w,d,S);for(let T=0;T<L.length;T++)_.push(L[T])}return _}_getJoinedRanges(o,d,_,C,S){const w=o.substring(d,_);let b=[];try{b=this._characterJoiners[0].handler(w)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const R=this._characterJoiners[k].handler(w);for(let L=0;L<R.length;L++)$n._mergeRanges(b,R[L])}catch(R){console.error(R)}return this._stringRangesToCellRanges(b,C,S),b}_stringRangesToCellRanges(o,d,_){let C=0,S=!1,w=0,b=o[C];if(b){for(let k=_;k<this._bufferService.cols;k++){const R=d.getWidth(k),L=d.getString(k).length||g.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!S&&b[0]<=w&&(b[0]=k,S=!0),b[1]<=w){if(b[1]=k,b=o[++C],!b)break;b[0]<=w?(b[0]=k,S=!0):S=!1}w+=L}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(o,d){let _=!1;for(let C=0;C<o.length;C++){const S=o[C];if(_){if(d[1]<=S[0])return o[C-1][1]=d[1],o;if(d[1]<=S[1])return o[C-1][1]=Math.max(d[1],S[1]),o.splice(C,1),o;o.splice(C,1),C--}else{if(d[1]<=S[0])return o.splice(C,0,d),o;if(d[1]<=S[1])return S[0]=Math.min(d[0],S[0]),o;d[0]<S[1]&&(S[0]=Math.min(d[0],S[0]),_=!0)}}return _?o[o.length-1][1]=d[1]:o.push(d),o}};s.CharacterJoinerService=n=h([f(0,E.IBufferService)],n)},5114:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const h=c(844),f=c(8460),u=c(3656);class g extends h.Disposable{constructor(p,n,l){super(),this._textarea=p,this._window=n,this.mainDocument=l,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new y(this._window),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new f.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((o=>this._screenDprMonitor.setWindow(o)))),this.register((0,f.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(p){this._window!==p&&(this._window=p,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=g;class y extends h.Disposable{constructor(p){super(),this._parentWindow=p,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new f.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(p){this._parentWindow=p,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var p;this._outerListener&&((p=this._resolutionMediaMatchList)==null||p.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:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const h=c(844);class f extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const y=this.linkProviders.indexOf(g);y!==-1&&this.linkProviders.splice(y,1)}}}}s.LinkProviderService=f},8934:function(v,s,c){var h=this&&this.__decorate||function(E,p,n,l){var o,d=arguments.length,_=d<3?p:l===null?l=Object.getOwnPropertyDescriptor(p,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(E,p,n,l);else for(var C=E.length-1;C>=0;C--)(o=E[C])&&(_=(d<3?o(_):d>3?o(p,n,_):o(p,n))||_);return d>3&&_&&Object.defineProperty(p,n,_),_},f=this&&this.__param||function(E,p){return function(n,l){p(n,l,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=c(4725),g=c(9806);let y=s.MouseService=class{constructor(E,p){this._renderService=E,this._charSizeService=p}getCoords(E,p,n,l,o){return(0,g.getCoords)(window,E,p,n,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(E,p){const n=(0,g.getCoordsRelativeToElement)(window,E,p);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};s.MouseService=y=h([f(0,u.IRenderService),f(1,u.ICharSizeService)],y)},3230:function(v,s,c){var h=this&&this.__decorate||function(o,d,_,C){var S,w=arguments.length,b=w<3?d:C===null?C=Object.getOwnPropertyDescriptor(d,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,d,_,C);else for(var k=o.length-1;k>=0;k--)(S=o[k])&&(b=(w<3?S(b):w>3?S(d,_,b):S(d,_))||b);return w>3&&b&&Object.defineProperty(d,_,b),b},f=this&&this.__param||function(o,d){return function(_,C){d(_,C,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=c(6193),g=c(4725),y=c(8460),E=c(844),p=c(7226),n=c(2585);let l=s.RenderService=class extends E.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(o,d,_,C,S,w,b,k){super(),this._rowCount=o,this._charSizeService=C,this._renderer=this.register(new E.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._observerDisposable=this.register(new E.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 y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((R,L)=>this._renderRows(R,L)),b),this.register(this._renderDebouncer),this.register(b.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(w.onResize((()=>this._fullRefresh()))),this.register(w.buffers.onBufferActivate((()=>{var R;return(R=this._renderer.value)==null?void 0:R.clear()}))),this.register(_.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(S.onDecorationRegistered((()=>this._fullRefresh()))),this.register(S.onDecorationRemoved((()=>this._fullRefresh()))),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()}))),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(w.buffer.y,w.buffer.y,!0)))),this.register(k.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(b.window,d),this.register(b.onWindowChange((R=>this._registerIntersectionObserver(R,d))))}_registerIntersectionObserver(o,d){if("IntersectionObserver"in o){const _=new o.IntersectionObserver((C=>this._handleIntersectionChange(C[C.length-1])),{threshold:0});_.observe(d),this._observerDisposable.value=(0,E.toDisposable)((()=>_.disconnect()))}}_handleIntersectionChange(o){this._isPaused=o.isIntersecting===void 0?o.intersectionRatio===0:!o.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(o,d,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(o,d,this._rowCount))}_renderRows(o,d){this._renderer.value&&(o=Math.min(o,this._rowCount-1),d=Math.min(d,this._rowCount-1),this._renderer.value.renderRows(o,d),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:o,end:d}),this._onRender.fire({start:o,end:d}),this._isNextRenderRedrawOnly=!0)}resize(o,d){this._rowCount=d,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(o){this._renderer.value=o,this._renderer.value&&(this._renderer.value.onRequestRedraw((d=>this.refreshRows(d.start,d.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(o){return this._renderDebouncer.addRefreshCallback(o)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var o,d;this._renderer.value&&((d=(o=this._renderer.value).clearTextureAtlas)==null||d.call(o),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(o,d){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var _;return(_=this._renderer.value)==null?void 0:_.handleResize(o,d)})):this._renderer.value.handleResize(o,d),this._fullRefresh())}handleCharSizeChanged(){var o;(o=this._renderer.value)==null||o.handleCharSizeChanged()}handleBlur(){var o;(o=this._renderer.value)==null||o.handleBlur()}handleFocus(){var o;(o=this._renderer.value)==null||o.handleFocus()}handleSelectionChanged(o,d,_){var C;this._selectionState.start=o,this._selectionState.end=d,this._selectionState.columnSelectMode=_,(C=this._renderer.value)==null||C.handleSelectionChanged(o,d,_)}handleCursorMove(){var o;(o=this._renderer.value)==null||o.handleCursorMove()}clear(){var o;(o=this._renderer.value)==null||o.clear()}};s.RenderService=l=h([f(2,n.IOptionsService),f(3,g.ICharSizeService),f(4,n.IDecorationService),f(5,n.IBufferService),f(6,g.ICoreBrowserService),f(7,g.IThemeService)],l)},9312:function(v,s,c){var h=this&&this.__decorate||function(b,k,R,L){var T,A=arguments.length,F=A<3?k:L===null?L=Object.getOwnPropertyDescriptor(k,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(b,k,R,L);else for(var U=b.length-1;U>=0;U--)(T=b[U])&&(F=(A<3?T(F):A>3?T(k,R,F):T(k,R))||F);return A>3&&F&&Object.defineProperty(k,R,F),F},f=this&&this.__param||function(b,k){return function(R,L){k(R,L,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=c(9806),g=c(9504),y=c(456),E=c(4725),p=c(8460),n=c(844),l=c(6114),o=c(4841),d=c(511),_=c(2585),C=" ",S=new RegExp(C,"g");let w=s.SelectionService=class extends n.Disposable{constructor(b,k,R,L,T,A,F,U,$){super(),this._element=b,this._screenElement=k,this._linkifier=R,this._bufferService=L,this._coreService=T,this._mouseService=A,this._optionsService=F,this._renderService=U,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new d.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new p.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new p.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=z=>this._handleMouseMove(z),this._mouseUpListener=z=>this._handleMouseUp(z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((z=>this._handleTrim(z))),this.register(this._bufferService.buffers.onBufferActivate((z=>this._handleBufferActivate(z)))),this.enable(),this._model=new y.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const b=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!b||!k||b[0]===k[0]&&b[1]===k[1])}get selectionText(){const b=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!b||!k)return"";const R=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(b[0]===k[0])return"";const T=b[0]<k[0]?b[0]:k[0],A=b[0]<k[0]?k[0]:b[0];for(let F=b[1];F<=k[1];F++){const U=R.translateBufferLineToString(F,!0,T,A);L.push(U)}}else{const T=b[1]===k[1]?k[0]:void 0;L.push(R.translateBufferLineToString(b[1],!0,b[0],T));for(let A=b[1]+1;A<=k[1]-1;A++){const F=R.lines.get(A),U=R.translateBufferLineToString(A,!0);F!=null&&F.isWrapped?L[L.length-1]+=U:L.push(U)}if(b[1]!==k[1]){const A=R.lines.get(k[1]),F=R.translateBufferLineToString(k[1],!0,0,k[0]);A&&A.isWrapped?L[L.length-1]+=F:L.push(F)}}return L.map((T=>T.replace(S," "))).join(l.isWindows?`\r
|
|
163
163
|
`:`
|
|
164
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(p){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),a.isLinux&&p&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(p){const k=this._getMouseBufferCoords(p),A=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(A&&L&&k)&&this._areCoordsInSelection(k,A,L)}isCellInSelection(p,k){const A=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!A||!L)&&this._areCoordsInSelection([p,k],A,L)}_areCoordsInSelection(p,k,A){return p[1]>k[1]&&p[1]<A[1]||k[1]===A[1]&&p[1]===k[1]&&p[0]>=k[0]&&p[0]<A[0]||k[1]<A[1]&&p[1]===A[1]&&p[0]<A[0]||k[1]<A[1]&&p[1]===k[1]&&p[0]>=k[0]}_selectWordAtCursor(p,k){var T,R;const A=(R=(T=this._linkifier.currentLink)==null?void 0:T.link)==null?void 0:R.range;if(A)return this._model.selectionStart=[A.start.x-1,A.start.y-1],this._model.selectionStartLength=(0,n.getRangeLength)(A,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(p);return!!L&&(this._selectWordAt(L,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(p,k){this._model.clearSelection(),p=Math.max(p,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(p){this._model.handleTrim(p)&&this.refresh()}_getMouseBufferCoords(p){const k=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(p){let k=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const A=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=A?0:(k>A&&(k-=A),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(p){return a.isMac?p.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:p.shiftKey}handleMouseDown(p){if(this._mouseDownTimeStamp=p.timeStamp,(p.button!==2||!this.hasSelection)&&p.button===0){if(!this._enabled){if(!this.shouldForceSelection(p))return;p.stopPropagation()}p.preventDefault(),this._dragScrollAmount=0,this._enabled&&p.shiftKey?this._handleIncrementalClick(p):p.detail===1?this._handleSingleClick(p):p.detail===2?this._handleDoubleClick(p):p.detail===3&&this._handleTripleClick(p),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(p){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(p))}_handleSingleClick(p){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(p)?3:0,this._model.selectionStart=this._getMouseBufferCoords(p),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(p){this._selectWordAtCursor(p,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(p){const k=this._getMouseBufferCoords(p);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(p){return p.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(p){if(p.stopImmediatePropagation(),!this._model.selectionStart)return;const k=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 A=this._bufferService.buffer;if(this._model.selectionEnd[1]<A.lines.length){const L=A.lines.get(this._model.selectionEnd[1]);L&&L.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 k=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&p.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const A=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){const L=(0,v.moveToCellSequence)(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,A=!(!p||!k||p[0]===k[0]&&p[1]===k[1]);A?p&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&p[0]===this._oldSelectionStart[0]&&p[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(p,k,A)):this._oldHasSelection&&this._fireOnSelectionChange(p,k,A)}_fireOnSelectionChange(p,k,A){this._oldSelectionStart=p,this._oldSelectionEnd=k,this._oldHasSelection=A,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim((k=>this._handleTrim(k)))}_convertViewportColToCharacterIndex(p,k){let A=k;for(let L=0;k>=L;L++){const T=p.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:T>1&&k!==L&&(A+=T-1)}return A}setSelection(p,k,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,k],this._model.selectionStartLength=A,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,k,A=!0,L=!0){if(p[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,R=T.lines.get(p[1]);if(!R)return;const M=T.translateBufferLineToString(p[1],!1);let F=this._convertViewportColToCharacterIndex(R,p[0]),$=F;const Z=p[0]-F;let W=0,B=0,x=0,D=0;if(M.charAt(F)===" "){for(;F>0&&M.charAt(F-1)===" ";)F--;for(;$<M.length&&M.charAt($+1)===" ";)$++}else{let j=p[0],Y=p[0];R.getWidth(j)===0&&(W++,j--),R.getWidth(Y)===2&&(B++,Y++);const J=R.getString(Y).length;for(J>1&&(D+=J-1,$+=J-1);j>0&&F>0&&!this._isCharWordSeparator(R.loadCell(j-1,this._workCell));){R.loadCell(j-1,this._workCell);const N=this._workCell.getChars().length;this._workCell.getWidth()===0?(W++,j--):N>1&&(x+=N-1,F-=N-1),F--,j--}for(;Y<R.length&&$+1<M.length&&!this._isCharWordSeparator(R.loadCell(Y+1,this._workCell));){R.loadCell(Y+1,this._workCell);const N=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,Y++):N>1&&(D+=N-1,$+=N-1),$++,Y++}}$++;let O=F+Z-W+x,V=Math.min(this._bufferService.cols,$-F+W+B-x-D);if(k||M.slice(F,$).trim()!==""){if(A&&O===0&&R.getCodePoint(0)!==32){const j=T.lines.get(p[1]-1);if(j&&R.isWrapped&&j.getCodePoint(this._bufferService.cols-1)!==32){const Y=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(Y){const J=this._bufferService.cols-Y.start;O-=J,V+=J}}}if(L&&O+V===this._bufferService.cols&&R.getCodePoint(this._bufferService.cols-1)!==32){const j=T.lines.get(p[1]+1);if(j!=null&&j.isWrapped&&j.getCodePoint(0)!==32){const Y=this._getWordAt([0,p[1]+1],!1,!1,!0);Y&&(V+=Y.length)}}return{start:O,length:V}}}_selectWordAt(p,k){const A=this._getWordAt(p,k);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[A.start,p[1]],this._model.selectionStartLength=A.length}}_selectToWordAt(p){const k=this._getWordAt(p,!0);if(k){let A=p[1];for(;k.start<0;)k.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,A]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const k=this._bufferService.buffer.getWrappedRangeForLine(p),A={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,n.getRangeLength)(A,this._bufferService.cols)}};i.SelectionService=w=h([f(3,g.IBufferService),f(4,g.ICoreService),f(5,E.IMouseService),f(6,g.IOptionsService),f(7,E.IRenderService),f(8,E.ICoreBrowserService)],w)},4725:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const h=l(8343);i.ICharSizeService=(0,h.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),i.IMouseService=(0,h.createDecorator)("MouseService"),i.IRenderService=(0,h.createDecorator)("RenderService"),i.ISelectionService=(0,h.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,h.createDecorator)("ThemeService"),i.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(S,i,l){var h=this&&this.__decorate||function(w,p,k,A){var L,T=arguments.length,R=T<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,k):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,p,k,A);else for(var M=w.length-1;M>=0;M--)(L=w[M])&&(R=(T<3?L(R):T>3?L(p,k,R):L(p,k))||R);return T>3&&R&&Object.defineProperty(p,k,R),R},f=this&&this.__param||function(w,p){return function(k,A){p(k,A,w)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),v=l(8055),m=l(8460),E=l(844),_=l(2585),s=v.css.toColor("#ffffff"),a=v.css.toColor("#000000"),n=v.css.toColor("#ffffff"),c=v.css.toColor("#000000"),g={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],p=[0,95,135,175,215,255];for(let k=0;k<216;k++){const A=p[k/36%6|0],L=p[k/6%6|0],T=p[k%6];w.push({css:v.channels.toCss(A,L,T),rgba:v.channels.toRgba(A,L,T)})}for(let k=0;k<24;k++){const A=8+10*k;w.push({css:v.channels.toCss(A,A,A),rgba:v.channels.toRgba(A,A,A)})}return w})());let y=i.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:s,background:a,cursor:n,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:g,selectionBackgroundOpaque:v.color.blend(a,g),selectionInactiveBackgroundTransparent:g,selectionInactiveBackgroundOpaque:v.color.blend(a,g),ansi:i.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(w={}){const p=this._colors;if(p.foreground=b(w.foreground,s),p.background=b(w.background,a),p.cursor=b(w.cursor,n),p.cursorAccent=b(w.cursorAccent,c),p.selectionBackgroundTransparent=b(w.selectionBackground,g),p.selectionBackgroundOpaque=v.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=b(w.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=v.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=w.selectionForeground?b(w.selectionForeground,v.NULL_COLOR):void 0,p.selectionForeground===v.NULL_COLOR&&(p.selectionForeground=void 0),v.color.isOpaque(p.selectionBackgroundTransparent)&&(p.selectionBackgroundTransparent=v.color.opacity(p.selectionBackgroundTransparent,.3)),v.color.isOpaque(p.selectionInactiveBackgroundTransparent)&&(p.selectionInactiveBackgroundTransparent=v.color.opacity(p.selectionInactiveBackgroundTransparent,.3)),p.ansi=i.DEFAULT_ANSI_COLORS.slice(),p.ansi[0]=b(w.black,i.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=b(w.red,i.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=b(w.green,i.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=b(w.yellow,i.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=b(w.blue,i.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=b(w.magenta,i.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=b(w.cyan,i.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=b(w.white,i.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=b(w.brightBlack,i.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=b(w.brightRed,i.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=b(w.brightGreen,i.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=b(w.brightYellow,i.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=b(w.brightBlue,i.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=b(w.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=b(w.brightCyan,i.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=b(w.brightWhite,i.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const k=Math.min(p.ansi.length-16,w.extendedAnsi.length);for(let A=0;A<k;A++)p.ansi[A+16]=b(w.extendedAnsi[A],i.DEFAULT_ANSI_COLORS[A+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}modifyColors(w){w(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function b(w,p){if(w!==void 0)try{return v.css.toColor(w)}catch{}return p}i.ThemeService=y=h([f(0,_.IOptionsService)],y)},6349:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const h=l(8460),f=l(844);class d extends f.Disposable{constructor(m){super(),this._maxLength=m,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(m){if(this._maxLength===m)return;const E=new Array(m);for(let _=0;_<Math.min(m,this.length);_++)E[_]=this._array[this._getCyclicIndex(_)];this._array=E,this._maxLength=m,this._startIndex=0}get length(){return this._length}set length(m){if(m>this._length)for(let E=this._length;E<m;E++)this._array[E]=void 0;this._length=m}get(m){return this._array[this._getCyclicIndex(m)]}set(m,E){this._array[this._getCyclicIndex(m)]=E}push(m){this._array[this._getCyclicIndex(this._length)]=m,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(m,E,..._){if(E){for(let s=m;s<this._length-E;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+E)];this._length-=E,this.onDeleteEmitter.fire({index:m,amount:E})}for(let s=this._length-1;s>=m;s--)this._array[this._getCyclicIndex(s+_.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<_.length;s++)this._array[this._getCyclicIndex(m+s)]=_[s];if(_.length&&this.onInsertEmitter.fire({index:m,amount:_.length}),this._length+_.length>this._maxLength){const s=this._length+_.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=_.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,E,_){if(!(E<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let a=E-1;a>=0;a--)this.set(m+a+_,this.get(m+a));const s=m+E+_-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<E;s++)this.set(m+s+_,this.get(m+s))}}_getCyclicIndex(m){return(this._startIndex+m)%this._maxLength}}i.CircularList=d},1439:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function l(h,f=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const v in h)d[v]=f<=1?h[v]:h[v]&&l(h[v],f-1);return d}},8055:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let l=0,h=0,f=0,d=0;var v,m,E,_,s;function a(c){const g=c.toString(16);return g.length<2?"0"+g:g}function n(c,g){return c<g?(g+.05)/(c+.05):(c+.05)/(g+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(g,y,b,w){return w!==void 0?`#${a(g)}${a(y)}${a(b)}${a(w)}`:`#${a(g)}${a(y)}${a(b)}`},c.toRgba=function(g,y,b,w=255){return(g<<24|y<<16|b<<8|w)>>>0},c.toColor=function(g,y,b,w){return{css:c.toCss(g,y,b,w),rgba:c.toRgba(g,y,b,w)}}})(v||(i.channels=v={})),(function(c){function g(y,b){return d=Math.round(255*b),[l,h,f]=s.toChannels(y.rgba),{css:v.toCss(l,h,f,d),rgba:v.toRgba(l,h,f,d)}}c.blend=function(y,b){if(d=(255&b.rgba)/255,d===1)return{css:b.css,rgba:b.rgba};const w=b.rgba>>24&255,p=b.rgba>>16&255,k=b.rgba>>8&255,A=y.rgba>>24&255,L=y.rgba>>16&255,T=y.rgba>>8&255;return l=A+Math.round((w-A)*d),h=L+Math.round((p-L)*d),f=T+Math.round((k-T)*d),{css:v.toCss(l,h,f),rgba:v.toRgba(l,h,f)}},c.isOpaque=function(y){return(255&y.rgba)==255},c.ensureContrastRatio=function(y,b,w){const p=s.ensureContrastRatio(y.rgba,b.rgba,w);if(p)return v.toColor(p>>24&255,p>>16&255,p>>8&255)},c.opaque=function(y){const b=(255|y.rgba)>>>0;return[l,h,f]=s.toChannels(b),{css:v.toCss(l,h,f),rgba:b}},c.opacity=g,c.multiplyOpacity=function(y,b){return d=255&y.rgba,g(y,d*b/255)},c.toColorRGB=function(y){return[y.rgba>>24&255,y.rgba>>16&255,y.rgba>>8&255]}})(m||(i.color=m={})),(function(c){let g,y;try{const b=document.createElement("canvas");b.width=1,b.height=1;const w=b.getContext("2d",{willReadFrequently:!0});w&&(g=w,g.globalCompositeOperation="copy",y=g.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return l=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),f=parseInt(b.slice(3,4).repeat(2),16),v.toColor(l,h,f);case 5:return l=parseInt(b.slice(1,2).repeat(2),16),h=parseInt(b.slice(2,3).repeat(2),16),f=parseInt(b.slice(3,4).repeat(2),16),d=parseInt(b.slice(4,5).repeat(2),16),v.toColor(l,h,f,d);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const w=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return l=parseInt(w[1]),h=parseInt(w[2]),f=parseInt(w[3]),d=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),v.toColor(l,h,f,d);if(!g||!y)throw new Error("css.toColor: Unsupported css format");if(g.fillStyle=y,g.fillStyle=b,typeof g.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(g.fillRect(0,0,1,1),[l,h,f,d]=g.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(l,h,f,d),css:b}}})(E||(i.css=E={})),(function(c){function g(y,b,w){const p=y/255,k=b/255,A=w/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))}c.relativeLuminance=function(y){return g(y>>16&255,y>>8&255,255&y)},c.relativeLuminance2=g})(_||(i.rgb=_={})),(function(c){function g(b,w,p){const k=b>>24&255,A=b>>16&255,L=b>>8&255;let T=w>>24&255,R=w>>16&255,M=w>>8&255,F=n(_.relativeLuminance2(T,R,M),_.relativeLuminance2(k,A,L));for(;F<p&&(T>0||R>0||M>0);)T-=Math.max(0,Math.ceil(.1*T)),R-=Math.max(0,Math.ceil(.1*R)),M-=Math.max(0,Math.ceil(.1*M)),F=n(_.relativeLuminance2(T,R,M),_.relativeLuminance2(k,A,L));return(T<<24|R<<16|M<<8|255)>>>0}function y(b,w,p){const k=b>>24&255,A=b>>16&255,L=b>>8&255;let T=w>>24&255,R=w>>16&255,M=w>>8&255,F=n(_.relativeLuminance2(T,R,M),_.relativeLuminance2(k,A,L));for(;F<p&&(T<255||R<255||M<255);)T=Math.min(255,T+Math.ceil(.1*(255-T))),R=Math.min(255,R+Math.ceil(.1*(255-R))),M=Math.min(255,M+Math.ceil(.1*(255-M))),F=n(_.relativeLuminance2(T,R,M),_.relativeLuminance2(k,A,L));return(T<<24|R<<16|M<<8|255)>>>0}c.blend=function(b,w){if(d=(255&w)/255,d===1)return w;const p=w>>24&255,k=w>>16&255,A=w>>8&255,L=b>>24&255,T=b>>16&255,R=b>>8&255;return l=L+Math.round((p-L)*d),h=T+Math.round((k-T)*d),f=R+Math.round((A-R)*d),v.toRgba(l,h,f)},c.ensureContrastRatio=function(b,w,p){const k=_.relativeLuminance(b>>8),A=_.relativeLuminance(w>>8);if(n(k,A)<p){if(A<k){const R=g(b,w,p),M=n(k,_.relativeLuminance(R>>8));if(M<p){const F=y(b,w,p);return M>n(k,_.relativeLuminance(F>>8))?R:F}return R}const L=y(b,w,p),T=n(k,_.relativeLuminance(L>>8));if(T<p){const R=g(b,w,p);return T>n(k,_.relativeLuminance(R>>8))?L:R}return L}},c.reduceLuminance=g,c.increaseLuminance=y,c.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}})(s||(i.rgba=s={})),i.toPaddedHex=a,i.contrastRatio=n},8969:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const h=l(844),f=l(2585),d=l(4348),v=l(7866),m=l(744),E=l(7302),_=l(6975),s=l(8460),a=l(1753),n=l(1480),c=l(7994),g=l(9282),y=l(5435),b=l(5981),w=l(2660);let p=!1;class k extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new s.EventEmitter),this._onScroll.event((L=>{var T;(T=this._onScrollApi)==null||T.fire(L.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(L){for(const T in L)this.optionsService.options[T]=L[T]}constructor(L){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new s.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new s.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new s.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new s.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new s.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new E.OptionsService(L)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(n.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new y.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,s.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,s.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,s.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,s.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((T=>{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((T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new b.WriteBuffer(((T,R)=>this._inputHandler.parse(T,R)))),this.register((0,s.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(L,T){this._writeBuffer.write(L,T)}writeSync(L,T){this._logService.logLevel<=f.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(L,T)}input(L,T=!0){this.coreService.triggerDataEvent(L,T)}resize(L,T){isNaN(L)||isNaN(T)||(L=Math.max(L,m.MINIMUM_COLS),T=Math.max(T,m.MINIMUM_ROWS),this._bufferService.resize(L,T))}scroll(L,T=!1){this._bufferService.scroll(L,T)}scrollLines(L,T,R){this._bufferService.scrollLines(L,T,R)}scrollPages(L){this.scrollLines(L*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(L){const T=L-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(L,T){return this._inputHandler.registerEscHandler(L,T)}registerDcsHandler(L,T){return this._inputHandler.registerDcsHandler(L,T)}registerCsiHandler(L,T){return this._inputHandler.registerCsiHandler(L,T)}registerOscHandler(L,T){return this._inputHandler.registerOscHandler(L,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let L=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?L=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(L=!0),L?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const L=[];L.push(this.onLineFeed(g.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},(()=>((0,g.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const T of L)T.dispose()}))}}}i.CoreTerminal=k},8460:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===l)return void this._listeners.splice(h,1)}}})),this._event}fire(l,h){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,l,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(l,h){return l((f=>h.fire(f)))},i.runAndSubscribe=function(l,h){return h(void 0),l((f=>h(f)))}},5435:function(S,i,l){var h=this&&this.__decorate||function(W,B,x,D){var O,V=arguments.length,j=V<3?B:D===null?D=Object.getOwnPropertyDescriptor(B,x):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(W,B,x,D);else for(var Y=W.length-1;Y>=0;Y--)(O=W[Y])&&(j=(V<3?O(j):V>3?O(B,x,j):O(B,x))||j);return V>3&&j&&Object.defineProperty(B,x,j),j},f=this&&this.__param||function(W,B){return function(x,D){B(x,D,W)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const d=l(2584),v=l(7116),m=l(2015),E=l(844),_=l(482),s=l(8437),a=l(8460),n=l(643),c=l(511),g=l(3734),y=l(2585),b=l(1480),w=l(6242),p=l(6351),k=l(5941),A={"(":0,")":1,"*":2,"+":3,"-":1,".":2},L=131072;function T(W,B){if(W>24)return B.setWinLines||!1;switch(W){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var R;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(R||(i.WindowsOptionsReportType=R={}));let M=0;class F extends E.Disposable{getAttrData(){return this._curAttrData}constructor(B,x,D,O,V,j,Y,J,N=new m.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=x,this._coreService=D,this._logService=O,this._optionsService=V,this._oscLinkService=j,this._coreMouseService=Y,this._unicodeService=J,this._parser=N,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((I=>this._activeBuffer=I.activeBuffer))),this._parser.setCsiHandlerFallback(((I,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(I),params:H.toArray()})})),this._parser.setEscHandlerFallback((I=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(I)})})),this._parser.setExecuteHandlerFallback((I=>{this._logService.debug("Unknown EXECUTE code: ",{code:I})})),this._parser.setOscHandlerFallback(((I,H,P)=>{this._logService.debug("Unknown OSC code: ",{identifier:I,action:H,data:P})})),this._parser.setDcsHandlerFallback(((I,H,P)=>{H==="HOOK"&&(P=P.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(I),action:H,payload:P})})),this._parser.setPrintHandler(((I,H,P)=>this.print(I,H,P))),this._parser.registerCsiHandler({final:"@"},(I=>this.insertChars(I))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(I=>this.scrollLeft(I))),this._parser.registerCsiHandler({final:"A"},(I=>this.cursorUp(I))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(I=>this.scrollRight(I))),this._parser.registerCsiHandler({final:"B"},(I=>this.cursorDown(I))),this._parser.registerCsiHandler({final:"C"},(I=>this.cursorForward(I))),this._parser.registerCsiHandler({final:"D"},(I=>this.cursorBackward(I))),this._parser.registerCsiHandler({final:"E"},(I=>this.cursorNextLine(I))),this._parser.registerCsiHandler({final:"F"},(I=>this.cursorPrecedingLine(I))),this._parser.registerCsiHandler({final:"G"},(I=>this.cursorCharAbsolute(I))),this._parser.registerCsiHandler({final:"H"},(I=>this.cursorPosition(I))),this._parser.registerCsiHandler({final:"I"},(I=>this.cursorForwardTab(I))),this._parser.registerCsiHandler({final:"J"},(I=>this.eraseInDisplay(I,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(I=>this.eraseInDisplay(I,!0))),this._parser.registerCsiHandler({final:"K"},(I=>this.eraseInLine(I,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(I=>this.eraseInLine(I,!0))),this._parser.registerCsiHandler({final:"L"},(I=>this.insertLines(I))),this._parser.registerCsiHandler({final:"M"},(I=>this.deleteLines(I))),this._parser.registerCsiHandler({final:"P"},(I=>this.deleteChars(I))),this._parser.registerCsiHandler({final:"S"},(I=>this.scrollUp(I))),this._parser.registerCsiHandler({final:"T"},(I=>this.scrollDown(I))),this._parser.registerCsiHandler({final:"X"},(I=>this.eraseChars(I))),this._parser.registerCsiHandler({final:"Z"},(I=>this.cursorBackwardTab(I))),this._parser.registerCsiHandler({final:"`"},(I=>this.charPosAbsolute(I))),this._parser.registerCsiHandler({final:"a"},(I=>this.hPositionRelative(I))),this._parser.registerCsiHandler({final:"b"},(I=>this.repeatPrecedingCharacter(I))),this._parser.registerCsiHandler({final:"c"},(I=>this.sendDeviceAttributesPrimary(I))),this._parser.registerCsiHandler({prefix:">",final:"c"},(I=>this.sendDeviceAttributesSecondary(I))),this._parser.registerCsiHandler({final:"d"},(I=>this.linePosAbsolute(I))),this._parser.registerCsiHandler({final:"e"},(I=>this.vPositionRelative(I))),this._parser.registerCsiHandler({final:"f"},(I=>this.hVPosition(I))),this._parser.registerCsiHandler({final:"g"},(I=>this.tabClear(I))),this._parser.registerCsiHandler({final:"h"},(I=>this.setMode(I))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(I=>this.setModePrivate(I))),this._parser.registerCsiHandler({final:"l"},(I=>this.resetMode(I))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(I=>this.resetModePrivate(I))),this._parser.registerCsiHandler({final:"m"},(I=>this.charAttributes(I))),this._parser.registerCsiHandler({final:"n"},(I=>this.deviceStatus(I))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(I=>this.deviceStatusPrivate(I))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(I=>this.softReset(I))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(I=>this.setCursorStyle(I))),this._parser.registerCsiHandler({final:"r"},(I=>this.setScrollRegion(I))),this._parser.registerCsiHandler({final:"s"},(I=>this.saveCursor(I))),this._parser.registerCsiHandler({final:"t"},(I=>this.windowOptions(I))),this._parser.registerCsiHandler({final:"u"},(I=>this.restoreCursor(I))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(I=>this.insertColumns(I))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(I=>this.deleteColumns(I))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(I=>this.selectProtected(I))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(I=>this.requestMode(I,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(I=>this.requestMode(I,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new w.OscHandler((I=>(this.setTitle(I),this.setIconName(I),!0)))),this._parser.registerOscHandler(1,new w.OscHandler((I=>this.setIconName(I)))),this._parser.registerOscHandler(2,new w.OscHandler((I=>this.setTitle(I)))),this._parser.registerOscHandler(4,new w.OscHandler((I=>this.setOrReportIndexedColor(I)))),this._parser.registerOscHandler(8,new w.OscHandler((I=>this.setHyperlink(I)))),this._parser.registerOscHandler(10,new w.OscHandler((I=>this.setOrReportFgColor(I)))),this._parser.registerOscHandler(11,new w.OscHandler((I=>this.setOrReportBgColor(I)))),this._parser.registerOscHandler(12,new w.OscHandler((I=>this.setOrReportCursorColor(I)))),this._parser.registerOscHandler(104,new w.OscHandler((I=>this.restoreIndexedColor(I)))),this._parser.registerOscHandler(110,new w.OscHandler((I=>this.restoreFgColor(I)))),this._parser.registerOscHandler(111,new w.OscHandler((I=>this.restoreBgColor(I)))),this._parser.registerOscHandler(112,new w.OscHandler((I=>this.restoreCursorColor(I)))),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 I in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:I},(()=>this.selectCharset("("+I))),this._parser.registerEscHandler({intermediates:")",final:I},(()=>this.selectCharset(")"+I))),this._parser.registerEscHandler({intermediates:"*",final:I},(()=>this.selectCharset("*"+I))),this._parser.registerEscHandler({intermediates:"+",final:I},(()=>this.selectCharset("+"+I))),this._parser.registerEscHandler({intermediates:"-",final:I},(()=>this.selectCharset("-"+I))),this._parser.registerEscHandler({intermediates:".",final:I},(()=>this.selectCharset("."+I))),this._parser.registerEscHandler({intermediates:"/",final:I},(()=>this.selectCharset("/"+I)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((I=>(this._logService.error("Parsing error: ",I),I))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new p.DcsHandler(((I,H)=>this.requestStatusString(I,H))))}_preserveStack(B,x,D,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=x,this._parseStack.decodedLength=D,this._parseStack.position=O}_logSlowResolvingAsync(B){this._logService.logLevel<=y.LogLevelEnum.WARN&&Promise.race([B,new Promise(((x,D)=>setTimeout((()=>D("#SLOW_TIMEOUT")),5e3)))]).catch((x=>{if(x!=="#SLOW_TIMEOUT")throw x;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,x){let D,O=this._activeBuffer.x,V=this._activeBuffer.y,j=0;const Y=this._parseStack.paused;if(Y){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,x))return this._logSlowResolvingAsync(D),D;O=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>L&&(j=this._parseStack.position+L)}if(this._logService.logLevel<=y.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(I=>String.fromCharCode(I))).join("")}"`),typeof B=="string"?B.split("").map((I=>I.charCodeAt(0))):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<L&&(this._parseBuffer=new Uint32Array(Math.min(B.length,L))),Y||this._dirtyRowTracker.clearRange(),B.length>L)for(let I=j;I<B.length;I+=L){const H=I+L<B.length?I+L:B.length,P=typeof B=="string"?this._stringDecoder.decode(B.substring(I,H),this._parseBuffer):this._utf8Decoder.decode(B.subarray(I,H),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,P))return this._preserveStack(O,V,P,I),this._logSlowResolvingAsync(D),D}else if(!Y){const I=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,I))return this._preserveStack(O,V,I,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===O&&this._activeBuffer.y===V||this._onCursorMove.fire();const J=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),N=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);N<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(N,this._bufferService.rows-1),Math.min(J,this._bufferService.rows-1))}print(B,x,D){let O,V;const j=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,N=this._coreService.decPrivateModes.wraparound,I=this._coreService.modes.insertMode,H=this._curAttrData;let P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-x>0&&P.getWidth(this._activeBuffer.x-1)===2&&P.setCellFromCodepoint(this._activeBuffer.x-1,0,1,H);let z=this._parser.precedingJoinState;for(let K=x;K<D;++K){if(O=B[K],O<127&&j){const we=j[String.fromCharCode(O)];we&&(O=we.charCodeAt(0))}const ee=this._unicodeService.charProperties(O,z);V=b.UnicodeService.extractWidth(ee);const de=b.UnicodeService.extractShouldJoin(ee),he=de?b.UnicodeService.extractWidth(z):0;if(z=ee,Y&&this._onA11yChar.fire((0,_.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+V-he>J){if(N){const we=P;let q=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),P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),he>0&&P instanceof s.BufferLine&&P.copyCellsFrom(we,q,0,he,!1);q<J;)we.setCellFromCodepoint(q++,0,1,H)}else if(this._activeBuffer.x=J-1,V===2)continue}if(de&&this._activeBuffer.x){const we=P.getWidth(this._activeBuffer.x-1)?1:2;P.addCodepointToCell(this._activeBuffer.x-we,O,V);for(let q=V-he;--q>=0;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}else if(I&&(P.insertCells(this._activeBuffer.x,V-he,this._activeBuffer.getNullCell(H)),P.getWidth(J-1)===2&&P.setCellFromCodepoint(J-1,n.NULL_CELL_CODE,n.NULL_CELL_WIDTH,H)),P.setCellFromCodepoint(this._activeBuffer.x++,O,V,H),V>0)for(;--V;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}this._parser.precedingJoinState=z,this._activeBuffer.x<J&&D-x>0&&P.getWidth(this._activeBuffer.x)===0&&!P.hasContent(this._activeBuffer.x)&&P.setCellFromCodepoint(this._activeBuffer.x,0,1,H),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,x){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,x):this._parser.registerCsiHandler(B,(D=>!T(D.params[0],this._optionsService.rawOptions.windowOptions)||x(D)))}registerDcsHandler(B,x){return this._parser.registerDcsHandler(B,new p.DcsHandler(x))}registerEscHandler(B,x){return this._parser.registerEscHandler(B,x)}registerOscHandler(B,x){return this._parser.registerOscHandler(B,new w.OscHandler(x))}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 B;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&&((B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&B.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);x.hasWidth(this._activeBuffer.x)&&!x.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,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(B,x){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+x):(this._activeBuffer.x=B,this._activeBuffer.y=x),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,x){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+x)}cursorUp(B){const x=this._activeBuffer.y-this._activeBuffer.scrollTop;return x>=0?this._moveCursor(0,-Math.min(x,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const x=this._activeBuffer.scrollBottom-this._activeBuffer.y;return x>=0?this._moveCursor(0,Math.min(x,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const x=B.params[0];return x===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:x===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=B.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=B.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const x=B.params[0];return x===1&&(this._curAttrData.bg|=536870912),x!==2&&x!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,x,D,O=!1,V=!1){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);j.replaceCells(x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),V),O&&(j.isWrapped=!1)}_resetBufferLine(B,x=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),x),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),D.isWrapped=!1)}eraseInDisplay(B,x=!1){let D;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);D<this._bufferService.rows;D++)this._resetBufferLine(D,x);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,x),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,x);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,x);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(B,x=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,x);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,x)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let x=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;x--;)this._activeBuffer.lines.splice(V-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let x=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;x--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let x=B.params[0]||1;for(;x--;)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(B){let x=B.params[0]||1;for(;x--;)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(s.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=B.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=B.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=B.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=B.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){const x=this._parser.precedingJoinState;if(!x)return!0;const D=B.params[0]||1,O=b.UnicodeService.extractWidth(x),V=this._activeBuffer.x-O,j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(V),Y=new Uint32Array(j.length*D);let J=0;for(let I=0;I<j.length;){const H=j.codePointAt(I)||0;Y[J++]=H,I+=H>65535?2:1}let N=J;for(let I=1;I<D;++I)Y.copyWithin(N,0,J),N+=J;return this.print(Y,0,N),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let x=0;x<B.length;x++)switch(B.params[x]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let x=0;x<B.length;x++)switch(B.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.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(B){for(let x=0;x<B.length;x++)switch(B.params[x]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let x=0;x<B.length;x++)switch(B.params[x]){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(),B.params[x]===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(B,x){const D=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:V}=this._coreMouseService,j=this._coreService,{buffers:Y,cols:J}=this._bufferService,{active:N,alt:I}=Y,H=this._optionsService.rawOptions,P=de=>de?1:2,z=B.params[0];return K=z,ee=x?z===2?4:z===4?P(j.modes.insertMode):z===12?3:z===20?P(H.convertEol):0:z===1?P(D.applicationCursorKeys):z===3?H.windowOptions.setWinLines?J===80?2:J===132?1:0:0:z===6?P(D.origin):z===7?P(D.wraparound):z===8?3:z===9?P(O==="X10"):z===12?P(H.cursorBlink):z===25?P(!j.isCursorHidden):z===45?P(D.reverseWraparound):z===66?P(D.applicationKeypad):z===67?4:z===1e3?P(O==="VT200"):z===1002?P(O==="DRAG"):z===1003?P(O==="ANY"):z===1004?P(D.sendFocus):z===1005?4:z===1006?P(V==="SGR"):z===1015?4:z===1016?P(V==="SGR_PIXELS"):z===1048?1:z===47||z===1047||z===1049?P(N===I):z===2004?P(D.bracketedPasteMode):0,j.triggerDataEvent(`${d.C0.ESC}[${x?"":"?"}${K};${ee}$y`),!0;var K,ee}_updateAttrColor(B,x,D,O,V){return x===2?(B|=50331648,B&=-16777216,B|=g.AttributeData.fromColorRGB([D,O,V])):x===5&&(B&=-50331904,B|=33554432|255&D),B}_extractColor(B,x,D){const O=[0,0,-1,0,0,0];let V=0,j=0;do{if(O[j+V]=B.params[x+j],B.hasSubParams(x+j)){const Y=B.getSubParams(x+j);let J=0;do O[1]===5&&(V=1),O[j+J+1+V]=Y[J];while(++J<Y.length&&J+j+1+V<O.length);break}if(O[1]===5&&j+V>=2||O[1]===2&&j+V>=5)break;O[1]&&(V=1)}while(++j+x<B.length&&j+V<O.length);for(let Y=2;Y<O.length;++Y)O[Y]===-1&&(O[Y]=0);switch(O[0]){case 38:D.fg=this._updateAttrColor(D.fg,O[1],O[3],O[4],O[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,O[1],O[3],O[4],O[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,O[1],O[3],O[4],O[5])}return j}_processUnderline(B,x){x.extended=x.extended.clone(),(!~B||B>5)&&(B=1),x.extended.underlineStyle=B,x.fg|=268435456,B===0&&(x.fg&=-268435457),x.updateExtended()}_processSGR0(B){B.fg=s.DEFAULT_ATTR_DATA.fg,B.bg=s.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const x=B.length;let D;const O=this._curAttrData;for(let V=0;V<x;V++)D=B.params[V],D>=30&&D<=37?(O.fg&=-50331904,O.fg|=16777216|D-30):D>=40&&D<=47?(O.bg&=-50331904,O.bg|=16777216|D-40):D>=90&&D<=97?(O.fg&=-50331904,O.fg|=16777224|D-90):D>=100&&D<=107?(O.bg&=-50331904,O.bg|=16777224|D-100):D===0?this._processSGR0(O):D===1?O.fg|=134217728:D===3?O.bg|=67108864:D===4?(O.fg|=268435456,this._processUnderline(B.hasSubParams(V)?B.getSubParams(V)[0]:1,O)):D===5?O.fg|=536870912:D===7?O.fg|=67108864:D===8?O.fg|=1073741824:D===9?O.fg|=2147483648:D===2?O.bg|=134217728:D===21?this._processUnderline(2,O):D===22?(O.fg&=-134217729,O.bg&=-134217729):D===23?O.bg&=-67108865:D===24?(O.fg&=-268435457,this._processUnderline(0,O)):D===25?O.fg&=-536870913:D===27?O.fg&=-67108865:D===28?O.fg&=-1073741825:D===29?O.fg&=2147483647:D===39?(O.fg&=-67108864,O.fg|=16777215&s.DEFAULT_ATTR_DATA.fg):D===49?(O.bg&=-67108864,O.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?V+=this._extractColor(B,V,O):D===53?O.bg|=1073741824:D===55?O.bg&=-1073741825:D===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):D===100?(O.fg&=-67108864,O.fg|=16777215&s.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const x=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${x};${D}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const x=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${x};${D}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=s.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(B){const x=B.params[0]||1;switch(x){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 D=x%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(B){const x=B.params[0]||1;let D;return(B.length<2||(D=B.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>x&&(this._activeBuffer.scrollTop=x-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(B){if(!T(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const x=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:x!==2&&this._onRequestWindowsOptionsReport.fire(R.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(R.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:x!==0&&x!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),x!==0&&x!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:x!==0&&x!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),x!==0&&x!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){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(B){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(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const x=[],D=B.split(";");for(;D.length>1;){const O=D.shift(),V=D.shift();if(/^\d+$/.exec(O)){const j=parseInt(O);if(Z(j))if(V==="?")x.push({type:0,index:j});else{const Y=(0,k.parseColor)(V);Y&&x.push({type:1,index:j,color:Y})}}}return x.length&&this._onColor.fire(x),!0}setHyperlink(B){const x=B.split(";");return!(x.length<2)&&(x[1]?this._createHyperlink(x[0],x[1]):!x[0]&&this._finishHyperlink())}_createHyperlink(B,x){this._getCurrentLinkId()&&this._finishHyperlink();const D=B.split(":");let O;const V=D.findIndex((j=>j.startsWith("id=")));return V!==-1&&(O=D[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:x}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,x){const D=B.split(";");for(let O=0;O<D.length&&!(x>=this._specialColors.length);++O,++x)if(D[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[x]}]);else{const V=(0,k.parseColor)(D[O]);V&&this._onColor.fire([{type:1,index:this._specialColors[x],color:V}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const x=[],D=B.split(";");for(let O=0;O<D.length;++O)if(/^\d+$/.exec(D[O])){const V=parseInt(D[O]);Z(V)&&x.push({type:2,index:V})}return x.length&&this._onColor.fire(x),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){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,v.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(A[B[0]],v.CHARSETS[B[1]]||v.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 B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,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=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new c.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let x=0;x<this._bufferService.rows;++x){const D=this._activeBuffer.ybase+this._activeBuffer.y+x,O=this._activeBuffer.lines.get(D);O&&(O.fill(B),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,x){const D=this._bufferService.buffer,O=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${V}${d.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,x){this._dirtyRowTracker.markRangeDirty(B,x)}}i.InputHandler=F;let $=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){W<this.start?this.start=W:W>this.end&&(this.end=W)}markRangeDirty(W,B){W>B&&(M=W,W=B,B=M),W<this.start&&(this.start=W),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Z(W){return 0<=W&&W<256}$=h([f(0,y.IBufferService)],$)},844:(S,i)=>{function l(h){for(const f of h)f.dispose();h.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.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 f=this._disposables.indexOf(h);f!==-1&&this._disposables.splice(f,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var f;this._isDisposed||h===this._value||((f=this._value)==null||f.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}},i.toDisposable=function(h){return{dispose:h}},i.disposeArray=l,i.getDisposeArrayDisposable=function(h){return{dispose:()=>l(h)}}},1505:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(f,d,v){this._data[f]||(this._data[f]={}),this._data[f][d]=v}get(f,d){return this._data[f]?this._data[f][d]:void 0}clear(){this._data={}}}i.TwoKeyMap=l,i.FourKeyMap=class{constructor(){this._data=new l}set(h,f,d,v,m){this._data.get(h,f)||this._data.set(h,f,new l),this._data.get(h,f).set(d,v,m)}get(h,f,d,v){var m;return(m=this._data.get(h,f))==null?void 0:m.get(d,v)}clear(){this._data.clear()}}},6114:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const l=i.isNode?"node":navigator.userAgent,h=i.isNode?"node":navigator.platform;i.isFirefox=l.includes("Firefox"),i.isLegacyEdge=l.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(l),i.getSafariVersion=function(){if(!i.isSafari)return 0;const f=l.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),i.isIpad=h==="iPad",i.isIphone=h==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),i.isLinux=h.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(l)},6106:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let l=0;i.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(l=this._search(this._getKey(h)),this._array.splice(l,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const f=this._getKey(h);if(f===void 0||(l=this._search(f),l===-1)||this._getKey(this._array[l])!==f)return!1;do if(this._array[l]===h)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===f);return!1}*getKeyIterator(h){if(this._array.length!==0&&(l=this._search(h),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===h))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===h)}forEachByKey(h,f){if(this._array.length!==0&&(l=this._search(h),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===h))do f(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===h)}values(){return[...this._array].values()}_search(h){let f=0,d=this._array.length-1;for(;d>=f;){let v=f+d>>1;const m=this._getKey(this._array[v]);if(m>h)d=v-1;else{if(!(m<h)){for(;v>0&&this._getKey(this._array[v-1])===h;)v--;return v}f=v+1}}return f}}},7226:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const h=l(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),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(m){this._idleCallback=void 0;let E=0,_=0,s=m.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),_=Math.max(E,_),a=m.timeRemaining(),1.5*_>a)return s-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-E))}ms`),void this._start();s=a}this.clear()}}class d extends f{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const E=Date.now()+m;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}i.PriorityTaskQueue=d,i.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:d,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const h=l(643);i.updateWindowsModeWrappedState=function(f){const d=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),v=d==null?void 0:d.get(f.cols-1),m=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);m&&v&&(m.isWrapped=v[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&v[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}i.AttributeData=l;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,v=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=v}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=h},9092:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const h=l(6349),f=l(7226),d=l(3734),v=l(8437),m=l(4634),E=l(511),_=l(643),s=l(4863),a=l(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(n,c,g){this._hasScrollback=n,this._optionsService=c,this._bufferService=g,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.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(n){return n?(this._nullCell.fg=n.fg,this._nullCell.bg=n.bg,this._nullCell.extended=n.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(n){return n?(this._whitespaceCell.fg=n.fg,this._whitespaceCell.bg=n.bg,this._whitespaceCell.extended=n.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(n,c){return new v.BufferLine(this._bufferService.cols,this.getNullCell(n),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const n=this.ybase+this.y-this.ydisp;return n>=0&&n<this._rows}_getCorrectBufferLength(n){if(!this._hasScrollback)return n;const c=n+this._optionsService.rawOptions.scrollback;return c>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:c}fillViewportRows(n){if(this.lines.length===0){n===void 0&&(n=v.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(n))}}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(n,c){const g=this.getNullCell(v.DEFAULT_ATTR_DATA);let y=0;const b=this._getCorrectBufferLength(c);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<n)for(let p=0;p<this.lines.length;p++)y+=+this.lines.get(p).resize(n,g);let w=0;if(this._rows<c)for(let p=this._rows;p<c;p++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(n,g)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(n,g)));else for(let p=this._rows;p>c;p--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const p=this.lines.length-b;p>0&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0),this.savedY=Math.max(this.savedY-p,0)),this.lines.maxLength=b}this.x=Math.min(this.x,n-1),this.y=Math.min(this.y,c-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,n-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(n,c),this._cols>n))for(let w=0;w<this.lines.length;w++)y+=+this.lines.get(w).resize(n,g);this._cols=n,this._rows=c,this._memoryCleanupQueue.clear(),y>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let n=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,n=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return n}get _isReflowEnabled(){const n=this._optionsService.rawOptions.windowsPty;return n&&n.buildNumber?this._hasScrollback&&n.backend==="conpty"&&n.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(n,c){this._cols!==n&&(n>this._cols?this._reflowLarger(n,c):this._reflowSmaller(n,c))}_reflowLarger(n,c){const g=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,n,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(g.length>0){const y=(0,m.reflowLargerCreateNewLayout)(this.lines,g);(0,m.reflowLargerApplyNewLayout)(this.lines,y.layout),this._reflowLargerAdjustViewport(n,c,y.countRemoved)}}_reflowLargerAdjustViewport(n,c,g){const y=this.getNullCell(v.DEFAULT_ATTR_DATA);let b=g;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new v.BufferLine(n,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-g,0)}_reflowSmaller(n,c){const g=this.getNullCell(v.DEFAULT_ATTR_DATA),y=[];let b=0;for(let w=this.lines.length-1;w>=0;w--){let p=this.lines.get(w);if(!p||!p.isWrapped&&p.getTrimmedLength()<=n)continue;const k=[p];for(;p.isWrapped&&w>0;)p=this.lines.get(--w),k.unshift(p);const A=this.ybase+this.y;if(A>=w&&A<w+k.length)continue;const L=k[k.length-1].getTrimmedLength(),T=(0,m.reflowSmallerGetNewLineLengths)(k,this._cols,n),R=T.length-k.length;let M;M=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+R):Math.max(0,this.lines.length-this.lines.maxLength+R);const F=[];for(let D=0;D<R;D++){const O=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);F.push(O)}F.length>0&&(y.push({start:w+k.length+b,newLines:F}),b+=F.length),k.push(...F);let $=T.length-1,Z=T[$];Z===0&&($--,Z=T[$]);let W=k.length-R-1,B=L;for(;W>=0;){const D=Math.min(B,Z);if(k[$]===void 0)break;if(k[$].copyCellsFrom(k[W],B-D,Z-D,D,!0),Z-=D,Z===0&&($--,Z=T[$]),B-=D,B===0){W--;const O=Math.max(W,0);B=(0,m.getWrappedLineTrimmedLength)(k,O,this._cols)}}for(let D=0;D<k.length;D++)T[D]<n&&k[D].setCell(T[D],g);let x=R-M;for(;x-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+R,this.ybase+c-1)}if(y.length>0){const w=[],p=[];for(let $=0;$<this.lines.length;$++)p.push(this.lines.get($));const k=this.lines.length;let A=k-1,L=0,T=y[L];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let R=0;for(let $=Math.min(this.lines.maxLength-1,k+b-1);$>=0;$--)if(T&&T.start>A+R){for(let Z=T.newLines.length-1;Z>=0;Z--)this.lines.set($--,T.newLines[Z]);$++,w.push({index:A+1,amount:T.newLines.length}),R+=T.newLines.length,T=y[++L]}else this.lines.set($,p[A--]);let M=0;for(let $=w.length-1;$>=0;$--)w[$].index+=M,this.lines.onInsertEmitter.fire(w[$]),M+=w[$].amount;const F=Math.max(0,k+b-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(n,c,g=0,y){const b=this.lines.get(n);return b?b.translateToString(c,g,y):""}getWrappedRangeForLine(n){let c=n,g=n;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;g+1<this.lines.length&&this.lines.get(g+1).isWrapped;)g++;return{first:c,last:g}}setupTabStops(n){for(n!=null?this.tabs[n]||(n=this.prevStop(n)):(this.tabs={},n=0);n<this._cols;n+=this._optionsService.rawOptions.tabStopWidth)this.tabs[n]=!0}prevStop(n){for(n==null&&(n=this.x);!this.tabs[--n]&&n>0;);return n>=this._cols?this._cols-1:n<0?0:n}nextStop(n){for(n==null&&(n=this.x);!this.tabs[++n]&&n<this._cols;);return n>=this._cols?this._cols-1:n<0?0:n}clearMarkers(n){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===n&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].dispose(),this.markers.splice(n--,1);this._isClearing=!1}addMarker(n){const c=new s.Marker(n);return this.markers.push(c),c.register(this.lines.onTrim((g=>{c.line-=g,c.line<0&&c.dispose()}))),c.register(this.lines.onInsert((g=>{c.line>=g.index&&(c.line+=g.amount)}))),c.register(this.lines.onDelete((g=>{c.line>=g.index&&c.line<g.index+g.amount&&c.dispose(),c.line>g.index&&(c.line-=g.amount)}))),c.register(c.onDispose((()=>this._removeMarker(c)))),c}_removeMarker(n){this._isClearing||this.markers.splice(this.markers.indexOf(n),1)}}},8437:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const h=l(3734),f=l(511),d=l(643),v=l(482);i.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let m=0;class E{constructor(s,a,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*s);const c=a||f.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let g=0;g<s;++g)this.setCell(g,c);this.length=s}get(s){const a=this._data[3*s+0],n=2097151&a;return[this._data[3*s+1],2097152&a?this._combined[s]:n?(0,v.stringFromCodePoint)(n):"",a>>22,2097152&a?this._combined[s].charCodeAt(this._combined[s].length-1):n]}set(s,a){this._data[3*s+1]=a[d.CHAR_DATA_ATTR_INDEX],a[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[s]=a[1],this._data[3*s+0]=2097152|s|a[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*s+0]=a[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(s){return this._data[3*s+0]>>22}hasWidth(s){return 12582912&this._data[3*s+0]}getFg(s){return this._data[3*s+1]}getBg(s){return this._data[3*s+2]}hasContent(s){return 4194303&this._data[3*s+0]}getCodePoint(s){const a=this._data[3*s+0];return 2097152&a?this._combined[s].charCodeAt(this._combined[s].length-1):2097151&a}isCombined(s){return 2097152&this._data[3*s+0]}getString(s){const a=this._data[3*s+0];return 2097152&a?this._combined[s]:2097151&a?(0,v.stringFromCodePoint)(2097151&a):""}isProtected(s){return 536870912&this._data[3*s+2]}loadCell(s,a){return m=3*s,a.content=this._data[m+0],a.fg=this._data[m+1],a.bg=this._data[m+2],2097152&a.content&&(a.combinedData=this._combined[s]),268435456&a.bg&&(a.extended=this._extendedAttrs[s]),a}setCell(s,a){2097152&a.content&&(this._combined[s]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[s]=a.extended),this._data[3*s+0]=a.content,this._data[3*s+1]=a.fg,this._data[3*s+2]=a.bg}setCellFromCodepoint(s,a,n,c){268435456&c.bg&&(this._extendedAttrs[s]=c.extended),this._data[3*s+0]=a|n<<22,this._data[3*s+1]=c.fg,this._data[3*s+2]=c.bg}addCodepointToCell(s,a,n){let c=this._data[3*s+0];2097152&c?this._combined[s]+=(0,v.stringFromCodePoint)(a):2097151&c?(this._combined[s]=(0,v.stringFromCodePoint)(2097151&c)+(0,v.stringFromCodePoint)(a),c&=-2097152,c|=2097152):c=a|4194304,n&&(c&=-12582913,c|=n<<22),this._data[3*s+0]=c}insertCells(s,a,n){if((s%=this.length)&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,n),a<this.length-s){const c=new f.CellData;for(let g=this.length-s-a-1;g>=0;--g)this.setCell(s+a+g,this.loadCell(s+g,c));for(let g=0;g<a;++g)this.setCell(s+g,n)}else for(let c=s;c<this.length;++c)this.setCell(c,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(s,a,n){if(s%=this.length,a<this.length-s){const c=new f.CellData;for(let g=0;g<this.length-s-a;++g)this.setCell(s+g,this.loadCell(s+a+g,c));for(let g=this.length-a;g<this.length;++g)this.setCell(g,n)}else for(let c=s;c<this.length;++c)this.setCell(c,n);s&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,n),this.getWidth(s)!==0||this.hasContent(s)||this.setCellFromCodepoint(s,0,1,n)}replaceCells(s,a,n,c=!1){if(c)for(s&&this.getWidth(s-1)===2&&!this.isProtected(s-1)&&this.setCellFromCodepoint(s-1,0,1,n),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,n);s<a&&s<this.length;)this.isProtected(s)||this.setCell(s,n),s++;else for(s&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,n),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,n);s<a&&s<this.length;)this.setCell(s++,n)}resize(s,a){if(s===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const n=3*s;if(s>this.length){if(this._data.buffer.byteLength>=4*n)this._data=new Uint32Array(this._data.buffer,0,n);else{const c=new Uint32Array(n);c.set(this._data),this._data=c}for(let c=this.length;c<s;++c)this.setCell(c,a)}else{this._data=this._data.subarray(0,n);const c=Object.keys(this._combined);for(let y=0;y<c.length;y++){const b=parseInt(c[y],10);b>=s&&delete this._combined[b]}const g=Object.keys(this._extendedAttrs);for(let y=0;y<g.length;y++){const b=parseInt(g[y],10);b>=s&&delete this._extendedAttrs[b]}}return this.length=s,4*n*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const s=new Uint32Array(this._data.length);return s.set(this._data),this._data=s,1}return 0}fill(s,a=!1){if(a)for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,s);else{this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,s)}}copyFrom(s){this.length!==s.length?this._data=new Uint32Array(s._data):this._data.set(s._data),this.length=s.length,this._combined={};for(const a in s._combined)this._combined[a]=s._combined[a];this._extendedAttrs={};for(const a in s._extendedAttrs)this._extendedAttrs[a]=s._extendedAttrs[a];this.isWrapped=s.isWrapped}clone(){const s=new E(0);s._data=new Uint32Array(this._data),s.length=this.length;for(const a in this._combined)s._combined[a]=this._combined[a];for(const a in this._extendedAttrs)s._extendedAttrs[a]=this._extendedAttrs[a];return s.isWrapped=this.isWrapped,s}getTrimmedLength(){for(let s=this.length-1;s>=0;--s)if(4194303&this._data[3*s+0])return s+(this._data[3*s+0]>>22);return 0}getNoBgTrimmedLength(){for(let s=this.length-1;s>=0;--s)if(4194303&this._data[3*s+0]||50331648&this._data[3*s+2])return s+(this._data[3*s+0]>>22);return 0}copyCellsFrom(s,a,n,c,g){const y=s._data;if(g)for(let w=c-1;w>=0;w--){for(let p=0;p<3;p++)this._data[3*(n+w)+p]=y[3*(a+w)+p];268435456&y[3*(a+w)+2]&&(this._extendedAttrs[n+w]=s._extendedAttrs[a+w])}else for(let w=0;w<c;w++){for(let p=0;p<3;p++)this._data[3*(n+w)+p]=y[3*(a+w)+p];268435456&y[3*(a+w)+2]&&(this._extendedAttrs[n+w]=s._extendedAttrs[a+w])}const b=Object.keys(s._combined);for(let w=0;w<b.length;w++){const p=parseInt(b[w],10);p>=a&&(this._combined[p-a+n]=s._combined[p])}}translateToString(s,a,n,c){a=a??0,n=n??this.length,s&&(n=Math.min(n,this.getTrimmedLength())),c&&(c.length=0);let g="";for(;a<n;){const y=this._data[3*a+0],b=2097151&y,w=2097152&y?this._combined[a]:b?(0,v.stringFromCodePoint)(b):d.WHITESPACE_CELL_CHAR;if(g+=w,c)for(let p=0;p<w.length;++p)c.push(a);a+=y>>22||1}return c&&c.push(a),g}}i.BufferLine=E},4841:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(l,h){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return h*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(S,i)=>{function l(h,f,d){if(f===h.length-1)return h[f].getTrimmedLength();const v=!h[f].hasContent(d-1)&&h[f].getWidth(d-1)===1,m=h[f+1].getWidth(0)===2;return v&&m?d-1:d}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(h,f,d,v,m){const E=[];for(let _=0;_<h.length-1;_++){let s=_,a=h.get(++s);if(!a.isWrapped)continue;const n=[h.get(_)];for(;s<h.length&&a.isWrapped;)n.push(a),a=h.get(++s);if(v>=_&&v<s){_+=n.length-1;continue}let c=0,g=l(n,c,f),y=1,b=0;for(;y<n.length;){const p=l(n,y,f),k=p-b,A=d-g,L=Math.min(k,A);n[c].copyCellsFrom(n[y],b,g,L,!1),g+=L,g===d&&(c++,g=0),b+=L,b===p&&(y++,b=0),g===0&&c!==0&&n[c-1].getWidth(d-1)===2&&(n[c].copyCellsFrom(n[c-1],d-1,g++,1,!1),n[c-1].setCell(d-1,m))}n[c].replaceCells(g,d,m);let w=0;for(let p=n.length-1;p>0&&(p>c||n[p].getTrimmedLength()===0);p--)w++;w>0&&(E.push(_+n.length-w),E.push(w)),_+=n.length-1}return E},i.reflowLargerCreateNewLayout=function(h,f){const d=[];let v=0,m=f[v],E=0;for(let _=0;_<h.length;_++)if(m===_){const s=f[++v];h.onDeleteEmitter.fire({index:_-E,amount:s}),_+=s-1,E+=s,m=f[++v]}else d.push(_);return{layout:d,countRemoved:E}},i.reflowLargerApplyNewLayout=function(h,f){const d=[];for(let v=0;v<f.length;v++)d.push(h.get(f[v]));for(let v=0;v<d.length;v++)h.set(v,d[v]);h.length=f.length},i.reflowSmallerGetNewLineLengths=function(h,f,d){const v=[],m=h.map(((a,n)=>l(h,n,f))).reduce(((a,n)=>a+n));let E=0,_=0,s=0;for(;s<m;){if(m-s<d){v.push(m-s);break}E+=d;const a=l(h,_,f);E>a&&(E-=a,_++);const n=h[_].getWidth(E-1)===2;n&&E--;const c=n?d-1:d;v.push(c),s+=c}return v},i.getWrappedLineTrimmedLength=l},5295:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const h=l(8460),f=l(844),d=l(9092);class v extends f.Disposable{constructor(E,_){super(),this._optionsService=E,this._bufferService=_,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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),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(E,_){this._normal.resize(E,_),this._alt.resize(E,_),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}i.BufferSet=v},511:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const h=l(482),f=l(643),d=l(3734);class v extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const _=new v;return _.setFromCharData(E),_}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(E){this.fg=E[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(E[f.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(E[f.CHAR_DATA_CHAR_INDEX].length===2){const s=E[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=s&&s<=56319){const a=E[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(s-55296)+a-56320+65536|E[f.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=E[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[f.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=E[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=v},643:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const h=l(8460),f=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._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,f.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}i.Marker=d,d._nextId=1},7116:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.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:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(S,i)=>{var l,h,f;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
165
|
-
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(l||(i.C0=l={})),(function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""})(h||(i.C1=h={})),(function(d){d.ST=`${l.ESC}\\`})(f||(i.C1_ESCAPED=f={}))},7399:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const h=l(2584),f={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:["'",'"']};i.evaluateKeyboardEvent=function(d,v,m,E){const _={type:0,cancel:!1,key:void 0},s=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?_.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?_.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?_.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(_.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:_.key=d.ctrlKey?"\b":h.C0.DEL,d.altKey&&(_.key=h.C0.ESC+_.key);break;case 9:if(d.shiftKey){_.key=h.C0.ESC+"[Z";break}_.key=h.C0.HT,_.cancel=!0;break;case 13:_.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,_.cancel=!0;break;case 27:_.key=h.C0.ESC,d.altKey&&(_.key=h.C0.ESC+h.C0.ESC),_.cancel=!0;break;case 37:if(d.metaKey)break;s?(_.key=h.C0.ESC+"[1;"+(s+1)+"D",_.key===h.C0.ESC+"[1;3D"&&(_.key=h.C0.ESC+(m?"b":"[1;5D"))):_.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;s?(_.key=h.C0.ESC+"[1;"+(s+1)+"C",_.key===h.C0.ESC+"[1;3C"&&(_.key=h.C0.ESC+(m?"f":"[1;5C"))):_.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;s?(_.key=h.C0.ESC+"[1;"+(s+1)+"A",m||_.key!==h.C0.ESC+"[1;3A"||(_.key=h.C0.ESC+"[1;5A")):_.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;s?(_.key=h.C0.ESC+"[1;"+(s+1)+"B",m||_.key!==h.C0.ESC+"[1;3B"||(_.key=h.C0.ESC+"[1;5B")):_.key=v?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(_.key=h.C0.ESC+"[2~");break;case 46:_.key=s?h.C0.ESC+"[3;"+(s+1)+"~":h.C0.ESC+"[3~";break;case 36:_.key=s?h.C0.ESC+"[1;"+(s+1)+"H":v?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:_.key=s?h.C0.ESC+"[1;"+(s+1)+"F":v?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?_.type=2:d.ctrlKey?_.key=h.C0.ESC+"[5;"+(s+1)+"~":_.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?_.type=3:d.ctrlKey?_.key=h.C0.ESC+"[6;"+(s+1)+"~":_.key=h.C0.ESC+"[6~";break;case 112:_.key=s?h.C0.ESC+"[1;"+(s+1)+"P":h.C0.ESC+"OP";break;case 113:_.key=s?h.C0.ESC+"[1;"+(s+1)+"Q":h.C0.ESC+"OQ";break;case 114:_.key=s?h.C0.ESC+"[1;"+(s+1)+"R":h.C0.ESC+"OR";break;case 115:_.key=s?h.C0.ESC+"[1;"+(s+1)+"S":h.C0.ESC+"OS";break;case 116:_.key=s?h.C0.ESC+"[15;"+(s+1)+"~":h.C0.ESC+"[15~";break;case 117:_.key=s?h.C0.ESC+"[17;"+(s+1)+"~":h.C0.ESC+"[17~";break;case 118:_.key=s?h.C0.ESC+"[18;"+(s+1)+"~":h.C0.ESC+"[18~";break;case 119:_.key=s?h.C0.ESC+"[19;"+(s+1)+"~":h.C0.ESC+"[19~";break;case 120:_.key=s?h.C0.ESC+"[20;"+(s+1)+"~":h.C0.ESC+"[20~";break;case 121:_.key=s?h.C0.ESC+"[21;"+(s+1)+"~":h.C0.ESC+"[21~";break;case 122:_.key=s?h.C0.ESC+"[23;"+(s+1)+"~":h.C0.ESC+"[23~";break;case 123:_.key=s?h.C0.ESC+"[24;"+(s+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!E||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?_.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(_.key=h.C0.US),d.key==="@"&&(_.key=h.C0.NUL)):d.keyCode===65&&(_.type=1);else{const a=f[d.keyCode],n=a==null?void 0:a[d.shiftKey?1:0];if(n)_.key=h.C0.ESC+n;else if(d.keyCode>=65&&d.keyCode<=90){const c=d.ctrlKey?d.keyCode-64:d.keyCode+32;let g=String.fromCharCode(c);d.shiftKey&&(g=g.toUpperCase()),_.key=h.C0.ESC+g}else if(d.keyCode===32)_.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let c=d.code.slice(3,4);d.shiftKey||(c=c.toLowerCase()),_.key=h.C0.ESC+c,_.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?_.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?_.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?_.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?_.key=h.C0.DEL:d.keyCode===219?_.key=h.C0.ESC:d.keyCode===220?_.key=h.C0.FS:d.keyCode===221&&(_.key=h.C0.GS)}return _}},482:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},i.utf32ToString=function(l,h=0,f=l.length){let d="";for(let v=h;v<f;++v){let m=l[v];m>65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,h){const f=l.length;if(!f)return 0;let d=0,v=0;if(this._interim){const m=l.charCodeAt(v++);56320<=m&&m<=57343?h[d++]=1024*(this._interim-55296)+m-56320+65536:(h[d++]=this._interim,h[d++]=m),this._interim=0}for(let m=v;m<f;++m){const E=l.charCodeAt(m);if(55296<=E&&E<=56319){if(++m>=f)return this._interim=E,d;const _=l.charCodeAt(m);56320<=_&&_<=57343?h[d++]=1024*(E-55296)+_-56320+65536:(h[d++]=E,h[d++]=_)}else E!==65279&&(h[d++]=E)}return d}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,h){const f=l.length;if(!f)return 0;let d,v,m,E,_=0,s=0,a=0;if(this.interim[0]){let g=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let b,w=0;for(;(b=63&this.interim[++w])&&w<4;)y<<=6,y|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=p-w;for(;a<k;){if(a>=f)return 0;if(b=l[a++],(192&b)!=128){a--,g=!0;break}this.interim[w++]=b,y<<=6,y|=63&b}g||(p===2?y<128?a--:h[_++]=y:p===3?y<2048||y>=55296&&y<=57343||y===65279||(h[_++]=y):y<65536||y>1114111||(h[_++]=y)),this.interim.fill(0)}const n=f-4;let c=a;for(;c<f;){for(;!(!(c<n)||128&(d=l[c])||128&(v=l[c+1])||128&(m=l[c+2])||128&(E=l[c+3]));)h[_++]=d,h[_++]=v,h[_++]=m,h[_++]=E,c+=4;if(d=l[c++],d<128)h[_++]=d;else if((224&d)==192){if(c>=f)return this.interim[0]=d,_;if(v=l[c++],(192&v)!=128){c--;continue}if(s=(31&d)<<6|63&v,s<128){c--;continue}h[_++]=s}else if((240&d)==224){if(c>=f)return this.interim[0]=d,_;if(v=l[c++],(192&v)!=128){c--;continue}if(c>=f)return this.interim[0]=d,this.interim[1]=v,_;if(m=l[c++],(192&m)!=128){c--;continue}if(s=(15&d)<<12|(63&v)<<6|63&m,s<2048||s>=55296&&s<=57343||s===65279)continue;h[_++]=s}else if((248&d)==240){if(c>=f)return this.interim[0]=d,_;if(v=l[c++],(192&v)!=128){c--;continue}if(c>=f)return this.interim[0]=d,this.interim[1]=v,_;if(m=l[c++],(192&m)!=128){c--;continue}if(c>=f)return this.interim[0]=d,this.interim[1]=v,this.interim[2]=m,_;if(E=l[c++],(192&E)!=128){c--;continue}if(s=(7&d)<<18|(63&v)<<12|(63&m)<<6|63&E,s<65536||s>1114111)continue;h[_++]=s}}return _}}},225:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const h=l(1480),f=[[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]],d=[[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 v;i.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let m=0;m<f.length;++m)v.fill(0,f[m][0],f[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?v[m]:(function(E,_){let s,a=0,n=_.length-1;if(E<_[0][0]||E>_[n][1])return!1;for(;n>=a;)if(s=a+n>>1,E>_[s][1])a=s+1;else{if(!(E<_[s][0]))return!0;n=s-1}return!1})(m,d)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,E){let _=this.wcwidth(m),s=_===0&&E!==0;if(s){const a=h.UnicodeService.extractWidth(E);a===0?s=!1:a>_&&(_=a)}return h.UnicodeService.createPropertyValue(0,_,s)}}},5981:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const h=l(8460),f=l(844);class d extends f.Disposable{constructor(m){super(),this._action=m,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(m,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,E){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+=m.length,this._writeBuffer.push(m),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(E)}_innerWrite(m=0,E=!0){const _=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const s=this._writeBuffer[this._bufferOffset],a=this._action(s,E);if(a){const c=g=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,g))):this._innerWrite(_,g);return void a.catch((g=>(queueMicrotask((()=>{throw g})),Promise.resolve(!1)))).then(c)}const n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=s.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}i.WriteBuffer=d},5941:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const l=/^([\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 f(d,v){const m=d.toString(16),E=m.length<2?"0"+m:m;switch(v){case 4:return m[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}i.parseColor=function(d){if(!d)return;let v=d.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const m=l.exec(v);if(m){const E=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/E*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/E*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/E*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),h.exec(v)&&[3,6,9,12].includes(v.length))){const m=v.length/3,E=[0,0,0];for(let _=0;_<3;++_){const s=parseInt(v.slice(m*_,m*_+m),16);E[_]=m===1?s<<4:m===2?s:m===3?s>>4:s>>8}return E}},i.toRgbString=function(d,v=16){const[m,E,_]=d;return`rgb:${f(m,v)}/${f(E,v)}/${f(_,v)}`}},5770:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const h=l(482),f=l(8742),d=l(5770),v=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(E,_){this._handlers[E]===void 0&&(this._handlers[E]=[]);const s=this._handlers[E];return s.push(_),{dispose:()=>{const a=s.indexOf(_);a!==-1&&s.splice(a,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(E,_){if(this.reset(),this._ident=E,this._active=this._handlers[E]||v,this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(E,_,s){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(E,_,s);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(E,_,s))}unhook(E,_=!0){if(this._active.length){let s=!1,a=this._active.length-1,n=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,s=_,n=this._stack.fallThrough,this._stack.paused=!1),!n&&s===!1){for(;a>=0&&(s=this._active[a].unhook(E),s!==!0);a--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,s;a--}for(;a>=0;a--)if(s=this._active[a].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,s}else this._handlerFb(this._ident,"UNHOOK",E);this._active=v,this._ident=0}};const m=new f.Params;m.addParam(0),i.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=m,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():m,this._data="",this._hitLimit=!1}put(E,_,s){this._hitLimit||(this._data+=(0,h.utf32ToString)(E,_,s),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let _=!1;if(this._hitLimit)_=!1;else if(E&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((s=>(this._params=m,this._data="",this._hitLimit=!1,s)));return this._params=m,this._data="",this._hitLimit=!1,_}}},2015:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const h=l(844),f=l(8742),d=l(6242),v=l(6351);class m{constructor(a){this.table=new Uint8Array(a)}setDefault(a,n){this.table.fill(a<<4|n)}add(a,n,c,g){this.table[n<<8|a]=c<<4|g}addMany(a,n,c,g){for(let y=0;y<a.length;y++)this.table[n<<8|a[y]]=c<<4|g}}i.TransitionTable=m;const E=160;i.VT500_TRANSITION_TABLE=(function(){const s=new m(4095),a=Array.apply(null,Array(256)).map(((w,p)=>p)),n=(w,p)=>a.slice(w,p),c=n(32,127),g=n(0,24);g.push(25),g.push.apply(g,n(28,32));const y=n(0,14);let b;for(b in s.setDefault(1,0),s.addMany(c,0,2,0),y)s.addMany([24,26,153,154],b,3,0),s.addMany(n(128,144),b,3,0),s.addMany(n(144,152),b,3,0),s.add(156,b,0,0),s.add(27,b,11,1),s.add(157,b,4,8),s.addMany([152,158,159],b,0,7),s.add(155,b,11,3),s.add(144,b,11,9);return s.addMany(g,0,3,0),s.addMany(g,1,3,1),s.add(127,1,0,1),s.addMany(g,8,0,8),s.addMany(g,3,3,3),s.add(127,3,0,3),s.addMany(g,4,3,4),s.add(127,4,0,4),s.addMany(g,6,3,6),s.addMany(g,5,3,5),s.add(127,5,0,5),s.addMany(g,2,3,2),s.add(127,2,0,2),s.add(93,1,4,8),s.addMany(c,8,5,8),s.add(127,8,5,8),s.addMany([156,27,24,26,7],8,6,0),s.addMany(n(28,32),8,0,8),s.addMany([88,94,95],1,0,7),s.addMany(c,7,0,7),s.addMany(g,7,0,7),s.add(156,7,0,0),s.add(127,7,0,7),s.add(91,1,11,3),s.addMany(n(64,127),3,7,0),s.addMany(n(48,60),3,8,4),s.addMany([60,61,62,63],3,9,4),s.addMany(n(48,60),4,8,4),s.addMany(n(64,127),4,7,0),s.addMany([60,61,62,63],4,0,6),s.addMany(n(32,64),6,0,6),s.add(127,6,0,6),s.addMany(n(64,127),6,0,0),s.addMany(n(32,48),3,9,5),s.addMany(n(32,48),5,9,5),s.addMany(n(48,64),5,0,6),s.addMany(n(64,127),5,7,0),s.addMany(n(32,48),4,9,5),s.addMany(n(32,48),1,9,2),s.addMany(n(32,48),2,9,2),s.addMany(n(48,127),2,10,0),s.addMany(n(48,80),1,10,0),s.addMany(n(81,88),1,10,0),s.addMany([89,90,92],1,10,0),s.addMany(n(96,127),1,10,0),s.add(80,1,11,9),s.addMany(g,9,0,9),s.add(127,9,0,9),s.addMany(n(28,32),9,0,9),s.addMany(n(32,48),9,9,12),s.addMany(n(48,60),9,8,10),s.addMany([60,61,62,63],9,9,10),s.addMany(g,11,0,11),s.addMany(n(32,128),11,0,11),s.addMany(n(28,32),11,0,11),s.addMany(g,10,0,10),s.add(127,10,0,10),s.addMany(n(28,32),10,0,10),s.addMany(n(48,60),10,8,10),s.addMany([60,61,62,63],10,0,11),s.addMany(n(32,48),10,9,12),s.addMany(g,12,0,12),s.add(127,12,0,12),s.addMany(n(28,32),12,0,12),s.addMany(n(32,48),12,9,12),s.addMany(n(48,64),12,0,11),s.addMany(n(64,127),12,12,13),s.addMany(n(64,127),10,12,13),s.addMany(n(64,127),9,12,13),s.addMany(g,13,13,13),s.addMany(c,13,13,13),s.add(127,13,0,13),s.addMany([27,156,24,26],13,14,0),s.add(E,0,2,0),s.add(E,8,5,8),s.add(E,6,0,6),s.add(E,11,0,11),s.add(E,13,13,13),s})();class _ extends h.Disposable{constructor(a=i.VT500_TRANSITION_TABLE){super(),this._transitions=a,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(n,c,g)=>{},this._executeHandlerFb=n=>{},this._csiHandlerFb=(n,c)=>{},this._escHandlerFb=n=>{},this._errorHandlerFb=n=>n,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 d.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(a,n=[64,126]){let c=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=a.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let y=0;y<a.intermediates.length;++y){const b=a.intermediates.charCodeAt(y);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=b}}if(a.final.length!==1)throw new Error("final must be a single byte");const g=a.final.charCodeAt(0);if(n[0]>g||g>n[1])throw new Error(`final must be in range ${n[0]} .. ${n[1]}`);return c<<=8,c|=g,c}identToString(a){const n=[];for(;a;)n.push(String.fromCharCode(255&a)),a>>=8;return n.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,n){const c=this._identifier(a,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const g=this._escHandlers[c];return g.push(n),{dispose:()=>{const y=g.indexOf(n);y!==-1&&g.splice(y,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,n){this._executeHandlers[a.charCodeAt(0)]=n}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,n){const c=this._identifier(a);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const g=this._csiHandlers[c];return g.push(n),{dispose:()=>{const y=g.indexOf(n);y!==-1&&g.splice(y,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,n){return this._dcsParser.registerHandler(this._identifier(a),n)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,n){return this._oscParser.registerHandler(a,n)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(a,n,c,g,y){this._parseStack.state=a,this._parseStack.handlers=n,this._parseStack.handlerPos=c,this._parseStack.transition=g,this._parseStack.chunkPos=y}parse(a,n,c){let g,y=0,b=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(c===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 k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&k>-1){for(;k>=0&&(g=p[k](this._params),g!==!0);k--)if(g instanceof Promise)return this._parseStack.handlerPos=k,g}this._parseStack.handlers=[];break;case 4:if(c===!1&&k>-1){for(;k>=0&&(g=p[k](),g!==!0);k--)if(g instanceof Promise)return this._parseStack.handlerPos=k,g}this._parseStack.handlers=[];break;case 6:if(y=a[this._parseStack.chunkPos],g=this._dcsParser.unhook(y!==24&&y!==26,c),g)return g;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(y=a[this._parseStack.chunkPos],g=this._oscParser.end(y!==24&&y!==26,c),g)return g;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let p=w;p<n;++p){switch(y=a[p],b=this._transitions.table[this.currentState<<8|(y<160?y:E)],b>>4){case 2:for(let R=p+1;;++R){if(R>=n||(y=a[R])<32||y>126&&y<E){this._printHandler(a,p,R),p=R-1;break}if(++R>=n||(y=a[R])<32||y>126&&y<E){this._printHandler(a,p,R),p=R-1;break}if(++R>=n||(y=a[R])<32||y>126&&y<E){this._printHandler(a,p,R),p=R-1;break}if(++R>=n||(y=a[R])<32||y>126&&y<E){this._printHandler(a,p,R),p=R-1;break}}break;case 3:this._executeHandlers[y]?this._executeHandlers[y]():this._executeHandlerFb(y),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:y,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|y];let A=k?k.length-1:-1;for(;A>=0&&(g=k[A](this._params),g!==!0);A--)if(g instanceof Promise)return this._preserveStack(3,k,A,b,p),g;A<0&&this._csiHandlerFb(this._collect<<8|y,this._params),this.precedingJoinState=0;break;case 8:do switch(y){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(y-48)}while(++p<n&&(y=a[p])>47&&y<60);p--;break;case 9:this._collect<<=8,this._collect|=y;break;case 10:const L=this._escHandlers[this._collect<<8|y];let T=L?L.length-1:-1;for(;T>=0&&(g=L[T](),g!==!0);T--)if(g instanceof Promise)return this._preserveStack(4,L,T,b,p),g;T<0&&this._escHandlerFb(this._collect<<8|y),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|y,this._params);break;case 13:for(let R=p+1;;++R)if(R>=n||(y=a[R])===24||y===26||y===27||y>127&&y<E){this._dcsParser.put(a,p,R),p=R-1;break}break;case 14:if(g=this._dcsParser.unhook(y!==24&&y!==26),g)return this._preserveStack(6,[],0,b,p),g;y===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let R=p+1;;R++)if(R>=n||(y=a[R])<32||y>127&&y<E){this._oscParser.put(a,p,R),p=R-1;break}break;case 6:if(g=this._oscParser.end(y!==24&&y!==26),g)return this._preserveStack(5,[],0,b,p),g;y===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&b}}}i.EscapeSequenceParser=_},6242:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const h=l(5770),f=l(482),d=[];i.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,m){this._handlers[v]===void 0&&(this._handlers[v]=[]);const E=this._handlers[v];return E.push(m),{dispose:()=>{const _=E.indexOf(m);_!==-1&&E.splice(_,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,m,E){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(v,m,E);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(v,m,E))}start(){this.reset(),this._state=1}put(v,m,E){if(this._state!==3){if(this._state===1)for(;m<E;){const _=v[m++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&E-m>0&&this._put(v,m,E)}}end(v,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,_=this._active.length-1,s=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,E=m,s=this._stack.fallThrough,this._stack.paused=!1),!s&&E===!1){for(;_>=0&&(E=this._active[_].end(v),E!==!0);_--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,E;_--}for(;_>=0;_--)if(E=this._active[_].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",v);this._active=d,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,m,E){this._hitLimit||(this._data+=(0,f.utf32ToString)(v,m,E),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let m=!1;if(this._hitLimit)m=!1;else if(v&&(m=this._handler(this._data),m instanceof Promise))return m.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,m}}},8742:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const l=2147483647;class h{static fromArray(d){const v=new h;if(!d.length)return v;for(let m=Array.isArray(d[0])?1:0;m<d.length;++m){const E=d[m];if(Array.isArray(E))for(let _=0;_<E.length;++_)v.addSubParam(E[_]);else v.addParam(E)}return v}constructor(d=32,v=32){if(this.maxLength=d,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new h(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let v=0;v<this.length;++v){d.push(this.params[v]);const m=this._subParamsIdx[v]>>8,E=255&this._subParamsIdx[v];E-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,E))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const v=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-v>0?this._subParams.subarray(v,m):null}getSubParamsAll(){const d={};for(let v=0;v<this.length;++v){const m=this._subParamsIdx[v]>>8,E=255&this._subParamsIdx[v];E-m>0&&(d[v]=this._subParams.slice(m,E))}return d}addDigit(d){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,E=m[v-1];m[v-1]=~E?Math.min(10*E+d,l):d}}i.Params=h},5741:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,h){const f={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(f),h.dispose=()=>this._wrappedAddonDispose(f),h.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let h=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===l){h=f;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(h,1)}}},8771:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const h=l(3785),f=l(511);i.BufferApiView=class{constructor(d,v){this._buffer=d,this.type=v}init(d){return this._buffer=d,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(d){const v=this._buffer.lines.get(d);if(v)return new h.BufferLineApiView(v)}getNullCell(){return new f.CellData}}},3785:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const h=l(511);i.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,d){if(!(f<0||f>=this._line.length))return d?(this._line.loadCell(f,d),d):this._line.loadCell(f,new h.CellData)}translateToString(f,d,v){return this._line.translateToString(f,d,v)}}},8285:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const h=l(8771),f=l(8460),d=l(844);class v extends d.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new f.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)}}i.BufferNamespaceApi=v},7975:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,h){return this._core.registerCsiHandler(l,(f=>h(f.toArray())))}addCsiHandler(l,h){return this.registerCsiHandler(l,h)}registerDcsHandler(l,h){return this._core.registerDcsHandler(l,((f,d)=>h(f,d.toArray())))}addDcsHandler(l,h){return this.registerDcsHandler(l,h)}registerEscHandler(l,h){return this._core.registerEscHandler(l,h)}addEscHandler(l,h){return this.registerEscHandler(l,h)}registerOscHandler(l,h){return this._core.registerOscHandler(l,h)}addOscHandler(l,h){return this.registerOscHandler(l,h)}}},7090:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(S,i,l){var h=this&&this.__decorate||function(s,a,n,c){var g,y=arguments.length,b=y<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,n):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(s,a,n,c);else for(var w=s.length-1;w>=0;w--)(g=s[w])&&(b=(y<3?g(b):y>3?g(a,n,b):g(a,n))||b);return y>3&&b&&Object.defineProperty(a,n,b),b},f=this&&this.__param||function(s,a){return function(n,c){a(n,c,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const d=l(8460),v=l(844),m=l(5295),E=l(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let _=i.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(s){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(s.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(s.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(s,this))}resize(s,a){this.cols=s,this.rows=a,this.buffers.resize(s,a),this._onResize.fire({cols:s,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(s,a=!1){const n=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===s.fg&&c.getBg(0)===s.bg||(c=n.getBlankLine(s,a),this._cachedBlankLine=c),c.isWrapped=a;const g=n.ybase+n.scrollTop,y=n.ybase+n.scrollBottom;if(n.scrollTop===0){const b=n.lines.isFull;y===n.lines.length-1?b?n.lines.recycle().copyFrom(c):n.lines.push(c.clone()):n.lines.splice(y+1,0,c.clone()),b?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{const b=y-g+1;n.lines.shiftElements(g+1,b-1,-1),n.lines.set(y,c.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(s,a,n){const c=this.buffer;if(s<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else s+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const g=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+s,c.ybase),0),g!==c.ydisp&&(a||this._onScroll.fire(c.ydisp))}};i.BufferService=_=h([f(0,E.IOptionsService)],_)},7994:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,h){this._charsets[l]=h,this.glevel===l&&(this.charset=h)}}},1753:function(S,i,l){var h=this&&this.__decorate||function(c,g,y,b){var w,p=arguments.length,k=p<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(c,g,y,b);else for(var A=c.length-1;A>=0;A--)(w=c[A])&&(k=(p<3?w(k):p>3?w(g,y,k):w(g,y))||k);return p>3&&k&&Object.defineProperty(g,y,k),k},f=this&&this.__param||function(c,g){return function(y,b){g(y,b,c)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const d=l(2585),v=l(8460),m=l(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function _(c,g){let y=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(y|=64,y|=c.action):(y|=3&c.button,4&c.button&&(y|=64),8&c.button&&(y|=128),c.action===32?y|=32:c.action!==0||g||(y|=3)),y}const s=String.fromCharCode,a={DEFAULT:c=>{const g=[_(c,!1)+32,c.col+32,c.row+32];return g[0]>255||g[1]>255||g[2]>255?"":`\x1B[M${s(g[0])}${s(g[1])}${s(g[2])}`},SGR:c=>{const g=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${_(c,!0)};${c.col};${c.row}${g}`},SGR_PIXELS:c=>{const g=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${_(c,!0)};${c.x};${c.y}${g}`}};let n=i.CoreMouseService=class extends m.Disposable{constructor(c,g){super(),this._bufferService=c,this._coreService=g,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const y of Object.keys(E))this.addProtocol(y,E[y]);for(const y of Object.keys(a))this.addEncoding(y,a[y]);this.reset()}addProtocol(c,g){this._protocols[c]=g}addEncoding(c,g){this._encodings[c]=g}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const g=this._encodings[this._activeEncoding](c);return g&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(g):this._coreService.triggerDataEvent(g,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,g,y){if(y){if(c.x!==g.x||c.y!==g.y)return!1}else if(c.col!==g.col||c.row!==g.row)return!1;return c.button===g.button&&c.action===g.action&&c.ctrl===g.ctrl&&c.alt===g.alt&&c.shift===g.shift}};i.CoreMouseService=n=h([f(0,d.IBufferService),f(1,d.ICoreService)],n)},6975:function(S,i,l){var h=this&&this.__decorate||function(n,c,g,y){var b,w=arguments.length,p=w<3?c:y===null?y=Object.getOwnPropertyDescriptor(c,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(n,c,g,y);else for(var k=n.length-1;k>=0;k--)(b=n[k])&&(p=(w<3?b(p):w>3?b(c,g,p):b(c,g))||p);return w>3&&p&&Object.defineProperty(c,g,p),p},f=this&&this.__param||function(n,c){return function(g,y){c(g,y,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const d=l(1439),v=l(8460),m=l(844),E=l(2585),_=Object.freeze({insertMode:!1}),s=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=i.CoreService=class extends m.Disposable{constructor(n,c,g){super(),this._bufferService=n,this._logService=c,this._optionsService=g,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(_),this.decPrivateModes=(0,d.clone)(s)}reset(){this.modes=(0,d.clone)(_),this.decPrivateModes=(0,d.clone)(s)}triggerDataEvent(n,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const g=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&g.ybase!==g.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${n}"`,(()=>n.split("").map((y=>y.charCodeAt(0))))),this._onData.fire(n)}triggerBinaryEvent(n){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${n}"`,(()=>n.split("").map((c=>c.charCodeAt(0))))),this._onBinary.fire(n))}};i.CoreService=a=h([f(0,E.IBufferService),f(1,E.ILogService),f(2,E.IOptionsService)],a)},9074:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const h=l(8055),f=l(8460),d=l(844),v=l(6106);let m=0,E=0;class _ extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((n=>n==null?void 0:n.marker.line)),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(n){if(n.marker.isDisposed)return;const c=new s(n);if(c){const g=c.marker.onDispose((()=>c.dispose()));c.onDispose((()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),g.dispose())})),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const n of this._decorations.values())n.dispose();this._decorations.clear()}*getDecorationsAtCell(n,c,g){let y=0,b=0;for(const w of this._decorations.getKeyIterator(c))y=w.options.x??0,b=y+(w.options.width??1),n>=y&&n<b&&(!g||(w.options.layer??"bottom")===g)&&(yield w)}forEachDecorationAtCell(n,c,g,y){this._decorations.forEachByKey(c,(b=>{m=b.options.x??0,E=m+(b.options.width??1),n>=m&&n<E&&(!g||(b.options.layer??"bottom")===g)&&y(b)}))}}i.DecorationService=_;class s extends d.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(n){super(),this.options=n,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=n.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const h=l(2585),f=l(8343);class d{constructor(...m){this._entries=new Map;for(const[E,_]of m)this.set(E,_)}set(m,E){const _=this._entries.get(m);return this._entries.set(m,E),_}forEach(m){for(const[E,_]of this._entries.entries())m(E,_)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}i.ServiceCollection=d,i.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(v,m){this._services.set(v,m)}getService(v){return this._services.get(v)}createInstance(v,...m){const E=(0,f.getServiceDependencies)(v).sort(((a,n)=>a.index-n.index)),_=[];for(const a of E){const n=this._services.get(a.id);if(!n)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${a.id}.`);_.push(n)}const s=E.length>0?E[0].index:m.length;if(m.length!==s)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${s+1} conflicts with ${m.length} static arguments`);return new v(...m,..._)}}},7866:function(S,i,l){var h=this&&this.__decorate||function(s,a,n,c){var g,y=arguments.length,b=y<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,n):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(s,a,n,c);else for(var w=s.length-1;w>=0;w--)(g=s[w])&&(b=(y<3?g(b):y>3?g(a,n,b):g(a,n))||b);return y>3&&b&&Object.defineProperty(a,n,b),b},f=this&&this.__param||function(s,a){return function(n,c){a(n,c,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const d=l(844),v=l(2585),m={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let E,_=i.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(s){super(),this._optionsService=s,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(s){for(let a=0;a<s.length;a++)typeof s[a]=="function"&&(s[a]=s[a]())}_log(s,a,n){this._evalLazyOptionalParams(n),s.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...n)}trace(s,...a){var n;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,s,a)}debug(s,...a){var n;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,s,a)}info(s,...a){var n;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,s,a)}warn(s,...a){var n;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,s,a)}error(s,...a){var n;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,s,a)}};i.LogService=_=h([f(0,v.IOptionsService)],_),i.setTraceLogger=function(s){E=s},i.traceCall=function(s,a,n){if(typeof n.value!="function")throw new Error("not supported");const c=n.value;n.value=function(...g){if(E.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,g);E.trace(`GlyphRenderer#${c.name}(${g.map((b=>JSON.stringify(b))).join(", ")})`);const y=c.apply(this,g);return E.trace(`GlyphRenderer#${c.name} return`,y),y}}},7302:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const h=l(8460),f=l(844),d=l(6114);i.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:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends f.Disposable{constructor(_){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const s={...i.DEFAULT_OPTIONS};for(const a in _)if(a in s)try{const n=_[a];s[a]=this._sanitizeAndValidateOption(a,n)}catch(n){console.error(n)}this.rawOptions=s,this.options={...s},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(_,s){return this.onOptionChange((a=>{a===_&&s(this.rawOptions[_])}))}onMultipleOptionChange(_,s){return this.onOptionChange((a=>{_.indexOf(a)!==-1&&s()}))}_setupOptions(){const _=a=>{if(!(a in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},s=(a,n)=>{if(!(a in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);n=this._sanitizeAndValidateOption(a,n),this.rawOptions[a]!==n&&(this.rawOptions[a]=n,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const n={get:_.bind(this,a),set:s.bind(this,a)};Object.defineProperty(this.options,a,n)}}_sanitizeAndValidateOption(_,s){switch(_){case"cursorStyle":if(s||(s=i.DEFAULT_OPTIONS[_]),!(function(a){return a==="block"||a==="underline"||a==="bar"})(s))throw new Error(`"${s}" is not a valid value for ${_}`);break;case"wordSeparator":s||(s=i.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof s=="number"&&1<=s&&s<=1e3)break;s=v.includes(s)?s:i.DEFAULT_OPTIONS[_];break;case"cursorWidth":s=Math.floor(s);case"lineHeight":case"tabStopWidth":if(s<1)throw new Error(`${_} cannot be less than 1, value: ${s}`);break;case"minimumContrastRatio":s=Math.max(1,Math.min(21,Math.round(10*s)/10));break;case"scrollback":if((s=Math.min(s,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${s}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(s<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${s}`);break;case"rows":case"cols":if(!s&&s!==0)throw new Error(`${_} must be numeric, value: ${s}`);break;case"windowsPty":s=s??{}}return s}}i.OptionsService=m},2660:function(S,i,l){var h=this&&this.__decorate||function(m,E,_,s){var a,n=arguments.length,c=n<3?E:s===null?s=Object.getOwnPropertyDescriptor(E,_):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(m,E,_,s);else for(var g=m.length-1;g>=0;g--)(a=m[g])&&(c=(n<3?a(c):n>3?a(E,_,c):a(E,_))||c);return n>3&&c&&Object.defineProperty(E,_,c),c},f=this&&this.__param||function(m,E){return function(_,s){E(_,s,m)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const d=l(2585);let v=i.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const E=this._bufferService.buffer;if(m.id===void 0){const g=E.addMarker(E.ybase+E.y),y={data:m,id:this._nextId++,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(y,g))),this._dataByLinkId.set(y.id,y),y.id}const _=m,s=this._getEntryIdKey(_),a=this._entriesWithId.get(s);if(a)return this.addLineToLink(a.id,E.ybase+E.y),a.id;const n=E.addMarker(E.ybase+E.y),c={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(c,n))),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(m,E){const _=this._dataByLinkId.get(m);if(_&&_.lines.every((s=>s.line!==E))){const s=this._bufferService.buffer.addMarker(E);_.lines.push(s),s.onDispose((()=>this._removeMarkerFromLink(_,s)))}}getLinkData(m){var E;return(E=this._dataByLinkId.get(m))==null?void 0:E.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,E){const _=m.lines.indexOf(E);_!==-1&&(m.lines.splice(_,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};i.OscLinkService=v=h([f(0,d.IBufferService)],v)},8343:(S,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const l="di$target",h="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(f){return f[h]||[]},i.createDecorator=function(f){if(i.serviceRegistry.has(f))return i.serviceRegistry.get(f);const d=function(v,m,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,s,a){s[l]===s?s[h].push({id:_,index:a}):(s[h]=[{id:_,index:a}],s[l]=s)})(d,v,E)};return d.toString=()=>f,i.serviceRegistry.set(f,d),d}},2585:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const h=l(8343);var f;i.IBufferService=(0,h.createDecorator)("BufferService"),i.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),i.ICoreService=(0,h.createDecorator)("CoreService"),i.ICharsetService=(0,h.createDecorator)("CharsetService"),i.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(f||(i.LogLevelEnum=f={})),i.ILogService=(0,h.createDecorator)("LogService"),i.IOptionsService=(0,h.createDecorator)("OptionsService"),i.IOscLinkService=(0,h.createDecorator)("OscLinkService"),i.IUnicodeService=(0,h.createDecorator)("UnicodeService"),i.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(S,i,l)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const h=l(8460),f=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,E,_=!1){return(16777215&m)<<3|(3&E)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const m=new f.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let E=0,_=0;const s=m.length;for(let a=0;a<s;++a){let n=m.charCodeAt(a);if(55296<=n&&n<=56319){if(++a>=s)return E+this.wcwidth(n);const y=m.charCodeAt(a);56320<=y&&y<=57343?n=1024*(n-55296)+y-56320+65536:E+=this.wcwidth(y)}const c=this.charProperties(n,_);let g=d.extractWidth(c);d.extractShouldJoin(c)&&(g-=d.extractWidth(_)),E+=g,_=c}return E}charProperties(m,E){return this._activeProvider.charProperties(m,E)}}i.UnicodeService=d}},o={};function u(S){var i=o[S];if(i!==void 0)return i.exports;var l=o[S]={exports:{}};return r[S].call(l.exports,l,l.exports,u),l.exports}var C={};return(()=>{var S=C;Object.defineProperty(S,"__esModule",{value:!0}),S.Terminal=void 0;const i=u(9042),l=u(3236),h=u(844),f=u(5741),d=u(8285),v=u(7975),m=u(7090),E=["cols","rows"];class _ extends h.Disposable{constructor(a){super(),this._core=this.register(new l.Terminal(a)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const n=g=>this._core.options[g],c=(g,y)=>{this._checkReadonlyOptions(g),this._core.options[g]=y};for(const g in this._core.options){const y={get:n.bind(this,g),set:c.bind(this,g)};Object.defineProperty(this._publicOptions,g,y)}}_checkReadonlyOptions(a){if(E.includes(a))throw new Error(`Option "${a}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let n="none";switch(this._core.coreMouseService.activeProtocol){case"X10":n="x10";break;case"VT200":n="vt200";break;case"DRAG":n="drag";break;case"ANY":n="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:n,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const n in a)this._publicOptions[n]=a[n]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,n=!0){this._core.input(a,n)}resize(a,n){this._verifyIntegers(a,n),this._core.resize(a,n)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,n,c){this._verifyIntegers(a,n,c),this._core.select(a,n,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,n){this._verifyIntegers(a,n),this._core.selectLines(a,n)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,n){this._core.write(a,n)}writeln(a,n){this._core.write(a),this._core.write(`\r
|
|
166
|
-
`,
|
|
164
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(b){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),l.isLinux&&b&&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(b){const k=this._getMouseBufferCoords(b),R=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(R&&L&&k)&&this._areCoordsInSelection(k,R,L)}isCellInSelection(b,k){const R=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!R||!L)&&this._areCoordsInSelection([b,k],R,L)}_areCoordsInSelection(b,k,R){return b[1]>k[1]&&b[1]<R[1]||k[1]===R[1]&&b[1]===k[1]&&b[0]>=k[0]&&b[0]<R[0]||k[1]<R[1]&&b[1]===R[1]&&b[0]<R[0]||k[1]<R[1]&&b[1]===k[1]&&b[0]>=k[0]}_selectWordAtCursor(b,k){var T,A;const R=(A=(T=this._linkifier.currentLink)==null?void 0:T.link)==null?void 0:A.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(b);return!!L&&(this._selectWordAt(L,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,k){this._model.clearSelection(),b=Math.max(b,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){const k=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(b){let k=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=R?0:(k>R&&(k-=R),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(b){return l.isMac?b.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:b.shiftKey}handleMouseDown(b){if(this._mouseDownTimeStamp=b.timeStamp,(b.button!==2||!this.hasSelection)&&b.button===0){if(!this._enabled){if(!this.shouldForceSelection(b))return;b.stopPropagation()}b.preventDefault(),this._dragScrollAmount=0,this._enabled&&b.shiftKey?this._handleIncrementalClick(b):b.detail===1?this._handleSingleClick(b):b.detail===2?this._handleDoubleClick(b):b.detail===3&&this._handleTripleClick(b),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(b){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(b))}_handleSingleClick(b){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(b)?3:0,this._model.selectionStart=this._getMouseBufferCoords(b),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(b){this._selectWordAtCursor(b,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(b){const k=this._getMouseBufferCoords(b);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(b){return b.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(b){if(b.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(b),!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(b),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const L=R.lines.get(this._model.selectionEnd[1]);L&&L.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 b=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(b.ydisp+this._bufferService.rows,b.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=b.ydisp),this.refresh()}}_handleMouseUp(b){const k=b.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&b.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(b,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const L=(0,g.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const b=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,R=!(!b||!k||b[0]===k[0]&&b[1]===k[1]);R?b&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&b[0]===this._oldSelectionStart[0]&&b[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(b,k,R)):this._oldHasSelection&&this._fireOnSelectionChange(b,k,R)}_fireOnSelectionChange(b,k,R){this._oldSelectionStart=b,this._oldSelectionEnd=k,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(b){this.clearSelection(),this._trimListener.dispose(),this._trimListener=b.activeBuffer.lines.onTrim((k=>this._handleTrim(k)))}_convertViewportColToCharacterIndex(b,k){let R=k;for(let L=0;k>=L;L++){const T=b.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:T>1&&k!==L&&(R+=T-1)}return R}setSelection(b,k,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[b,k],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(b){this._isClickInSelection(b)||(this._selectWordAtCursor(b,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(b,k,R=!0,L=!0){if(b[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,A=T.lines.get(b[1]);if(!A)return;const F=T.translateBufferLineToString(b[1],!1);let U=this._convertViewportColToCharacterIndex(A,b[0]),$=U;const z=b[0]-U;let W=0,I=0,x=0,D=0;if(F.charAt(U)===" "){for(;U>0&&F.charAt(U-1)===" ";)U--;for(;$<F.length&&F.charAt($+1)===" ";)$++}else{let G=b[0],X=b[0];A.getWidth(G)===0&&(W++,G--),A.getWidth(X)===2&&(I++,X++);const J=A.getString(X).length;for(J>1&&(D+=J-1,$+=J-1);G>0&&U>0&&!this._isCharWordSeparator(A.loadCell(G-1,this._workCell));){A.loadCell(G-1,this._workCell);const N=this._workCell.getChars().length;this._workCell.getWidth()===0?(W++,G--):N>1&&(x+=N-1,U-=N-1),U--,G--}for(;X<A.length&&$+1<F.length&&!this._isCharWordSeparator(A.loadCell(X+1,this._workCell));){A.loadCell(X+1,this._workCell);const N=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,X++):N>1&&(D+=N-1,$+=N-1),$++,X++}}$++;let O=U+z-W+x,V=Math.min(this._bufferService.cols,$-U+W+I-x-D);if(k||F.slice(U,$).trim()!==""){if(R&&O===0&&A.getCodePoint(0)!==32){const G=T.lines.get(b[1]-1);if(G&&A.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const X=this._getWordAt([this._bufferService.cols-1,b[1]-1],!1,!0,!1);if(X){const J=this._bufferService.cols-X.start;O-=J,V+=J}}}if(L&&O+V===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){const G=T.lines.get(b[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const X=this._getWordAt([0,b[1]+1],!1,!1,!0);X&&(V+=X.length)}}return{start:O,length:V}}}_selectWordAt(b,k){const R=this._getWordAt(b,k);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,b[1]--;this._model.selectionStart=[R.start,b[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(b){const k=this._getWordAt(b,!0);if(k){let R=b[1];for(;k.start<0;)k.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,R]}}_isCharWordSeparator(b){return b.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(b.getChars())>=0}_selectLineAt(b){const k=this._bufferService.buffer.getWrappedRangeForLine(b),R={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(R,this._bufferService.cols)}};s.SelectionService=w=h([f(3,_.IBufferService),f(4,_.ICoreService),f(5,E.IMouseService),f(6,_.IOptionsService),f(7,E.IRenderService),f(8,E.ICoreBrowserService)],w)},4725:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const h=c(8343);s.ICharSizeService=(0,h.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),s.IMouseService=(0,h.createDecorator)("MouseService"),s.IRenderService=(0,h.createDecorator)("RenderService"),s.ISelectionService=(0,h.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,h.createDecorator)("ThemeService"),s.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(v,s,c){var h=this&&this.__decorate||function(w,b,k,R){var L,T=arguments.length,A=T<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(w,b,k,R);else for(var F=w.length-1;F>=0;F--)(L=w[F])&&(A=(T<3?L(A):T>3?L(b,k,A):L(b,k))||A);return T>3&&A&&Object.defineProperty(b,k,A),A},f=this&&this.__param||function(w,b){return function(k,R){b(k,R,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),g=c(8055),y=c(8460),E=c(844),p=c(2585),n=g.css.toColor("#ffffff"),l=g.css.toColor("#000000"),o=g.css.toColor("#ffffff"),d=g.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let k=0;k<216;k++){const R=b[k/36%6|0],L=b[k/6%6|0],T=b[k%6];w.push({css:g.channels.toCss(R,L,T),rgba:g.channels.toRgba(R,L,T)})}for(let k=0;k<24;k++){const R=8+10*k;w.push({css:g.channels.toCss(R,R,R),rgba:g.channels.toRgba(R,R,R)})}return w})());let C=s.ThemeService=class extends E.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new y.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:l,cursor:o,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:g.color.blend(l,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:g.color.blend(l,_),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(w={}){const b=this._colors;if(b.foreground=S(w.foreground,n),b.background=S(w.background,l),b.cursor=S(w.cursor,o),b.cursorAccent=S(w.cursorAccent,d),b.selectionBackgroundTransparent=S(w.selectionBackground,_),b.selectionBackgroundOpaque=g.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=S(w.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=g.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=w.selectionForeground?S(w.selectionForeground,g.NULL_COLOR):void 0,b.selectionForeground===g.NULL_COLOR&&(b.selectionForeground=void 0),g.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=g.color.opacity(b.selectionBackgroundTransparent,.3)),g.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=g.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=s.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=S(w.black,s.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=S(w.red,s.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=S(w.green,s.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=S(w.yellow,s.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=S(w.blue,s.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=S(w.magenta,s.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=S(w.cyan,s.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=S(w.white,s.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=S(w.brightBlack,s.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=S(w.brightRed,s.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=S(w.brightGreen,s.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=S(w.brightYellow,s.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=S(w.brightBlue,s.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=S(w.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=S(w.brightCyan,s.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=S(w.brightWhite,s.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const k=Math.min(b.ansi.length-16,w.extendedAnsi.length);for(let R=0;R<k;R++)b.ansi[R+16]=S(w.extendedAnsi[R],s.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}modifyColors(w){w(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 S(w,b){if(w!==void 0)try{return g.css.toColor(w)}catch{}return b}s.ThemeService=C=h([f(0,p.IOptionsService)],C)},6349:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const h=c(8460),f=c(844);class u extends f.Disposable{constructor(y){super(),this._maxLength=y,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(y){if(this._maxLength===y)return;const E=new Array(y);for(let p=0;p<Math.min(y,this.length);p++)E[p]=this._array[this._getCyclicIndex(p)];this._array=E,this._maxLength=y,this._startIndex=0}get length(){return this._length}set length(y){if(y>this._length)for(let E=this._length;E<y;E++)this._array[E]=void 0;this._length=y}get(y){return this._array[this._getCyclicIndex(y)]}set(y,E){this._array[this._getCyclicIndex(y)]=E}push(y){this._array[this._getCyclicIndex(this._length)]=y,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(y,E,...p){if(E){for(let n=y;n<this._length-E;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+E)];this._length-=E,this.onDeleteEmitter.fire({index:y,amount:E})}for(let n=this._length-1;n>=y;n--)this._array[this._getCyclicIndex(n+p.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<p.length;n++)this._array[this._getCyclicIndex(y+n)]=p[n];if(p.length&&this.onInsertEmitter.fire({index:y,amount:p.length}),this._length+p.length>this._maxLength){const n=this._length+p.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=p.length}trimStart(y){y>this._length&&(y=this._length),this._startIndex+=y,this._length-=y,this.onTrimEmitter.fire(y)}shiftElements(y,E,p){if(!(E<=0)){if(y<0||y>=this._length)throw new Error("start argument out of range");if(y+p<0)throw new Error("Cannot shift elements in list beyond index 0");if(p>0){for(let l=E-1;l>=0;l--)this.set(y+l+p,this.get(y+l));const n=y+E+p-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<E;n++)this.set(y+n+p,this.get(y+n))}}_getCyclicIndex(y){return(this._startIndex+y)%this._maxLength}}s.CircularList=u},1439:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function c(h,f=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const g in h)u[g]=f<=1?h[g]:h[g]&&c(h[g],f-1);return u}},8055:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let c=0,h=0,f=0,u=0;var g,y,E,p,n;function l(d){const _=d.toString(16);return _.length<2?"0"+_:_}function o(d,_){return d<_?(_+.05)/(d+.05):(d+.05)/(_+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(_,C,S,w){return w!==void 0?`#${l(_)}${l(C)}${l(S)}${l(w)}`:`#${l(_)}${l(C)}${l(S)}`},d.toRgba=function(_,C,S,w=255){return(_<<24|C<<16|S<<8|w)>>>0},d.toColor=function(_,C,S,w){return{css:d.toCss(_,C,S,w),rgba:d.toRgba(_,C,S,w)}}})(g||(s.channels=g={})),(function(d){function _(C,S){return u=Math.round(255*S),[c,h,f]=n.toChannels(C.rgba),{css:g.toCss(c,h,f,u),rgba:g.toRgba(c,h,f,u)}}d.blend=function(C,S){if(u=(255&S.rgba)/255,u===1)return{css:S.css,rgba:S.rgba};const w=S.rgba>>24&255,b=S.rgba>>16&255,k=S.rgba>>8&255,R=C.rgba>>24&255,L=C.rgba>>16&255,T=C.rgba>>8&255;return c=R+Math.round((w-R)*u),h=L+Math.round((b-L)*u),f=T+Math.round((k-T)*u),{css:g.toCss(c,h,f),rgba:g.toRgba(c,h,f)}},d.isOpaque=function(C){return(255&C.rgba)==255},d.ensureContrastRatio=function(C,S,w){const b=n.ensureContrastRatio(C.rgba,S.rgba,w);if(b)return g.toColor(b>>24&255,b>>16&255,b>>8&255)},d.opaque=function(C){const S=(255|C.rgba)>>>0;return[c,h,f]=n.toChannels(S),{css:g.toCss(c,h,f),rgba:S}},d.opacity=_,d.multiplyOpacity=function(C,S){return u=255&C.rgba,_(C,u*S/255)},d.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}})(y||(s.color=y={})),(function(d){let _,C;try{const S=document.createElement("canvas");S.width=1,S.height=1;const w=S.getContext("2d",{willReadFrequently:!0});w&&(_=w,_.globalCompositeOperation="copy",C=_.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return c=parseInt(S.slice(1,2).repeat(2),16),h=parseInt(S.slice(2,3).repeat(2),16),f=parseInt(S.slice(3,4).repeat(2),16),g.toColor(c,h,f);case 5:return c=parseInt(S.slice(1,2).repeat(2),16),h=parseInt(S.slice(2,3).repeat(2),16),f=parseInt(S.slice(3,4).repeat(2),16),u=parseInt(S.slice(4,5).repeat(2),16),g.toColor(c,h,f,u);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const w=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return c=parseInt(w[1]),h=parseInt(w[2]),f=parseInt(w[3]),u=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(c,h,f,u);if(!_||!C)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=C,_.fillStyle=S,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[c,h,f,u]=_.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(c,h,f,u),css:S}}})(E||(s.css=E={})),(function(d){function _(C,S,w){const b=C/255,k=S/255,R=w/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}d.relativeLuminance=function(C){return _(C>>16&255,C>>8&255,255&C)},d.relativeLuminance2=_})(p||(s.rgb=p={})),(function(d){function _(S,w,b){const k=S>>24&255,R=S>>16&255,L=S>>8&255;let T=w>>24&255,A=w>>16&255,F=w>>8&255,U=o(p.relativeLuminance2(T,A,F),p.relativeLuminance2(k,R,L));for(;U<b&&(T>0||A>0||F>0);)T-=Math.max(0,Math.ceil(.1*T)),A-=Math.max(0,Math.ceil(.1*A)),F-=Math.max(0,Math.ceil(.1*F)),U=o(p.relativeLuminance2(T,A,F),p.relativeLuminance2(k,R,L));return(T<<24|A<<16|F<<8|255)>>>0}function C(S,w,b){const k=S>>24&255,R=S>>16&255,L=S>>8&255;let T=w>>24&255,A=w>>16&255,F=w>>8&255,U=o(p.relativeLuminance2(T,A,F),p.relativeLuminance2(k,R,L));for(;U<b&&(T<255||A<255||F<255);)T=Math.min(255,T+Math.ceil(.1*(255-T))),A=Math.min(255,A+Math.ceil(.1*(255-A))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=o(p.relativeLuminance2(T,A,F),p.relativeLuminance2(k,R,L));return(T<<24|A<<16|F<<8|255)>>>0}d.blend=function(S,w){if(u=(255&w)/255,u===1)return w;const b=w>>24&255,k=w>>16&255,R=w>>8&255,L=S>>24&255,T=S>>16&255,A=S>>8&255;return c=L+Math.round((b-L)*u),h=T+Math.round((k-T)*u),f=A+Math.round((R-A)*u),g.toRgba(c,h,f)},d.ensureContrastRatio=function(S,w,b){const k=p.relativeLuminance(S>>8),R=p.relativeLuminance(w>>8);if(o(k,R)<b){if(R<k){const A=_(S,w,b),F=o(k,p.relativeLuminance(A>>8));if(F<b){const U=C(S,w,b);return F>o(k,p.relativeLuminance(U>>8))?A:U}return A}const L=C(S,w,b),T=o(k,p.relativeLuminance(L>>8));if(T<b){const A=_(S,w,b);return T>o(k,p.relativeLuminance(A>>8))?L:A}return L}},d.reduceLuminance=_,d.increaseLuminance=C,d.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(n||(s.rgba=n={})),s.toPaddedHex=l,s.contrastRatio=o},8969:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const h=c(844),f=c(2585),u=c(4348),g=c(7866),y=c(744),E=c(7302),p=c(6975),n=c(8460),l=c(1753),o=c(1480),d=c(7994),_=c(9282),C=c(5435),S=c(5981),w=c(2660);let b=!1;class k extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((L=>{var T;(T=this._onScrollApi)==null||T.fire(L.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(L){for(const T in L)this.optionsService.options[T]=L[T]}constructor(L){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new E.OptionsService(L)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(y.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(p.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(d.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new C.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((T=>{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((T=>{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 S.WriteBuffer(((T,A)=>this._inputHandler.parse(T,A)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(L,T){this._writeBuffer.write(L,T)}writeSync(L,T){this._logService.logLevel<=f.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(L,T)}input(L,T=!0){this.coreService.triggerDataEvent(L,T)}resize(L,T){isNaN(L)||isNaN(T)||(L=Math.max(L,y.MINIMUM_COLS),T=Math.max(T,y.MINIMUM_ROWS),this._bufferService.resize(L,T))}scroll(L,T=!1){this._bufferService.scroll(L,T)}scrollLines(L,T,A){this._bufferService.scrollLines(L,T,A)}scrollPages(L){this.scrollLines(L*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(L){const T=L-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(L,T){return this._inputHandler.registerEscHandler(L,T)}registerDcsHandler(L,T){return this._inputHandler.registerDcsHandler(L,T)}registerCsiHandler(L,T){return this._inputHandler.registerCsiHandler(L,T)}registerOscHandler(L,T){return this._inputHandler.registerOscHandler(L,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let L=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?L=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(L=!0),L?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const L=[];L.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},(()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const T of L)T.dispose()}))}}}s.CoreTerminal=k},8460:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,h){return c((f=>h.fire(f)))},s.runAndSubscribe=function(c,h){return h(void 0),c((f=>h(f)))}},5435:function(v,s,c){var h=this&&this.__decorate||function(W,I,x,D){var O,V=arguments.length,G=V<3?I:D===null?D=Object.getOwnPropertyDescriptor(I,x):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(W,I,x,D);else for(var X=W.length-1;X>=0;X--)(O=W[X])&&(G=(V<3?O(G):V>3?O(I,x,G):O(I,x))||G);return V>3&&G&&Object.defineProperty(I,x,G),G},f=this&&this.__param||function(W,I){return function(x,D){I(x,D,W)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=c(2584),g=c(7116),y=c(2015),E=c(844),p=c(482),n=c(8437),l=c(8460),o=c(643),d=c(511),_=c(3734),C=c(2585),S=c(1480),w=c(6242),b=c(6351),k=c(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},L=131072;function T(W,I){if(W>24)return I.setWinLines||!1;switch(W){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var A;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(s.WindowsOptionsReportType=A={}));let F=0;class U extends E.Disposable{getAttrData(){return this._curAttrData}constructor(I,x,D,O,V,G,X,J,N=new y.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=x,this._coreService=D,this._logService=O,this._optionsService=V,this._oscLinkService=G,this._coreMouseService=X,this._unicodeService=J,this._parser=N,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new p.StringToUtf32,this._utf8Decoder=new p.Utf8ToUtf32,this._workCell=new d.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.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 $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:H.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,H,P)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:H,data:P})})),this._parser.setDcsHandlerFallback(((B,H,P)=>{H==="HOOK"&&(P=P.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:H,payload:P})})),this._parser.setPrintHandler(((B,H,P)=>this.print(B,H,P))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new w.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new w.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new w.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new w.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new w.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new w.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new w.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new w.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new w.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new w.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new w.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new w.OscHandler((B=>this.restoreCursorColor(B)))),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 B in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler(((B,H)=>this.requestStatusString(B,H))))}_preserveStack(I,x,D,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=x,this._parseStack.decodedLength=D,this._parseStack.position=O}_logSlowResolvingAsync(I){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([I,new Promise(((x,D)=>setTimeout((()=>D("#SLOW_TIMEOUT")),5e3)))]).catch((x=>{if(x!=="#SLOW_TIMEOUT")throw x;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,x){let D,O=this._activeBuffer.x,V=this._activeBuffer.y,G=0;const X=this._parseStack.paused;if(X){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,x))return this._logSlowResolvingAsync(D),D;O=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>L&&(G=this._parseStack.position+L)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(B=>String.fromCharCode(B))).join("")}"`),typeof I=="string"?I.split("").map((B=>B.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<L&&(this._parseBuffer=new Uint32Array(Math.min(I.length,L))),X||this._dirtyRowTracker.clearRange(),I.length>L)for(let B=G;B<I.length;B+=L){const H=B+L<I.length?B+L:I.length,P=typeof I=="string"?this._stringDecoder.decode(I.substring(B,H),this._parseBuffer):this._utf8Decoder.decode(I.subarray(B,H),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,P))return this._preserveStack(O,V,P,B),this._logSlowResolvingAsync(D),D}else if(!X){const B=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,B))return this._preserveStack(O,V,B,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===O&&this._activeBuffer.y===V||this._onCursorMove.fire();const J=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),N=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);N<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(N,this._bufferService.rows-1),Math.min(J,this._bufferService.rows-1))}print(I,x,D){let O,V;const G=this._charsetService.charset,X=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,N=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,H=this._curAttrData;let P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-x>0&&P.getWidth(this._activeBuffer.x-1)===2&&P.setCellFromCodepoint(this._activeBuffer.x-1,0,1,H);let Z=this._parser.precedingJoinState;for(let K=x;K<D;++K){if(O=I[K],O<127&&G){const ke=G[String.fromCharCode(O)];ke&&(O=ke.charCodeAt(0))}const ee=this._unicodeService.charProperties(O,Z);V=S.UnicodeService.extractWidth(ee);const de=S.UnicodeService.extractShouldJoin(ee),he=de?S.UnicodeService.extractWidth(Z):0;if(Z=ee,X&&this._onA11yChar.fire((0,p.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+V-he>J){if(N){const ke=P;let q=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),P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),he>0&&P instanceof n.BufferLine&&P.copyCellsFrom(ke,q,0,he,!1);q<J;)ke.setCellFromCodepoint(q++,0,1,H)}else if(this._activeBuffer.x=J-1,V===2)continue}if(de&&this._activeBuffer.x){const ke=P.getWidth(this._activeBuffer.x-1)?1:2;P.addCodepointToCell(this._activeBuffer.x-ke,O,V);for(let q=V-he;--q>=0;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}else if(B&&(P.insertCells(this._activeBuffer.x,V-he,this._activeBuffer.getNullCell(H)),P.getWidth(J-1)===2&&P.setCellFromCodepoint(J-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,H)),P.setCellFromCodepoint(this._activeBuffer.x++,O,V,H),V>0)for(;--V;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}this._parser.precedingJoinState=Z,this._activeBuffer.x<J&&D-x>0&&P.getWidth(this._activeBuffer.x)===0&&!P.hasContent(this._activeBuffer.x)&&P.setCellFromCodepoint(this._activeBuffer.x,0,1,H),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,x){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,x):this._parser.registerCsiHandler(I,(D=>!T(D.params[0],this._optionsService.rawOptions.windowOptions)||x(D)))}registerDcsHandler(I,x){return this._parser.registerDcsHandler(I,new b.DcsHandler(x))}registerEscHandler(I,x){return this._parser.registerEscHandler(I,x)}registerOscHandler(I,x){return this._parser.registerOscHandler(I,new w.OscHandler(x))}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 I;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&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);x.hasWidth(this._activeBuffer.x)&&!x.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,x){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+x):(this._activeBuffer.x=I,this._activeBuffer.y=x),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,x){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+x)}cursorUp(I){const x=this._activeBuffer.y-this._activeBuffer.scrollTop;return x>=0?this._moveCursor(0,-Math.min(x,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const x=this._activeBuffer.scrollBottom-this._activeBuffer.y;return x>=0?this._moveCursor(0,Math.min(x,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const x=I.params[0];return x===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:x===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=I.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=I.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const x=I.params[0];return x===1&&(this._curAttrData.bg|=536870912),x!==2&&x!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,x,D,O=!1,V=!1){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.replaceCells(x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),V),O&&(G.isWrapped=!1)}_resetBufferLine(I,x=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),x),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),D.isWrapped=!1)}eraseInDisplay(I,x=!1){let D;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);D<this._bufferService.rows;D++)this._resetBufferLine(D,x);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,x),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,x);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,x);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(I,x=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,x);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,x)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let x=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;x--;)this._activeBuffer.lines.splice(V-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let x=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;x--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let x=I.params[0]||1;for(;x--;)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(I){let x=I.params[0]||1;for(;x--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=I.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=I.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=I.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.insertCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=I.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O.deleteCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const x=this._parser.precedingJoinState;if(!x)return!0;const D=I.params[0]||1,O=S.UnicodeService.extractWidth(x),V=this._activeBuffer.x-O,G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(V),X=new Uint32Array(G.length*D);let J=0;for(let B=0;B<G.length;){const H=G.codePointAt(B)||0;X[J++]=H,B+=H>65535?2:1}let N=J;for(let B=1;B<D;++B)X.copyWithin(N,0,J),N+=J;return this.print(X,0,N),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let x=0;x<I.length;x++)switch(I.params[x]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let x=0;x<I.length;x++)switch(I.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(I){for(let x=0;x<I.length;x++)switch(I.params[x]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let x=0;x<I.length;x++)switch(I.params[x]){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(),I.params[x]===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(I,x){const D=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:V}=this._coreMouseService,G=this._coreService,{buffers:X,cols:J}=this._bufferService,{active:N,alt:B}=X,H=this._optionsService.rawOptions,P=de=>de?1:2,Z=I.params[0];return K=Z,ee=x?Z===2?4:Z===4?P(G.modes.insertMode):Z===12?3:Z===20?P(H.convertEol):0:Z===1?P(D.applicationCursorKeys):Z===3?H.windowOptions.setWinLines?J===80?2:J===132?1:0:0:Z===6?P(D.origin):Z===7?P(D.wraparound):Z===8?3:Z===9?P(O==="X10"):Z===12?P(H.cursorBlink):Z===25?P(!G.isCursorHidden):Z===45?P(D.reverseWraparound):Z===66?P(D.applicationKeypad):Z===67?4:Z===1e3?P(O==="VT200"):Z===1002?P(O==="DRAG"):Z===1003?P(O==="ANY"):Z===1004?P(D.sendFocus):Z===1005?4:Z===1006?P(V==="SGR"):Z===1015?4:Z===1016?P(V==="SGR_PIXELS"):Z===1048?1:Z===47||Z===1047||Z===1049?P(N===B):Z===2004?P(D.bracketedPasteMode):0,G.triggerDataEvent(`${u.C0.ESC}[${x?"":"?"}${K};${ee}$y`),!0;var K,ee}_updateAttrColor(I,x,D,O,V){return x===2?(I|=50331648,I&=-16777216,I|=_.AttributeData.fromColorRGB([D,O,V])):x===5&&(I&=-50331904,I|=33554432|255&D),I}_extractColor(I,x,D){const O=[0,0,-1,0,0,0];let V=0,G=0;do{if(O[G+V]=I.params[x+G],I.hasSubParams(x+G)){const X=I.getSubParams(x+G);let J=0;do O[1]===5&&(V=1),O[G+J+1+V]=X[J];while(++J<X.length&&J+G+1+V<O.length);break}if(O[1]===5&&G+V>=2||O[1]===2&&G+V>=5)break;O[1]&&(V=1)}while(++G+x<I.length&&G+V<O.length);for(let X=2;X<O.length;++X)O[X]===-1&&(O[X]=0);switch(O[0]){case 38:D.fg=this._updateAttrColor(D.fg,O[1],O[3],O[4],O[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,O[1],O[3],O[4],O[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,O[1],O[3],O[4],O[5])}return G}_processUnderline(I,x){x.extended=x.extended.clone(),(!~I||I>5)&&(I=1),x.extended.underlineStyle=I,x.fg|=268435456,I===0&&(x.fg&=-268435457),x.updateExtended()}_processSGR0(I){I.fg=n.DEFAULT_ATTR_DATA.fg,I.bg=n.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const x=I.length;let D;const O=this._curAttrData;for(let V=0;V<x;V++)D=I.params[V],D>=30&&D<=37?(O.fg&=-50331904,O.fg|=16777216|D-30):D>=40&&D<=47?(O.bg&=-50331904,O.bg|=16777216|D-40):D>=90&&D<=97?(O.fg&=-50331904,O.fg|=16777224|D-90):D>=100&&D<=107?(O.bg&=-50331904,O.bg|=16777224|D-100):D===0?this._processSGR0(O):D===1?O.fg|=134217728:D===3?O.bg|=67108864:D===4?(O.fg|=268435456,this._processUnderline(I.hasSubParams(V)?I.getSubParams(V)[0]:1,O)):D===5?O.fg|=536870912:D===7?O.fg|=67108864:D===8?O.fg|=1073741824:D===9?O.fg|=2147483648:D===2?O.bg|=134217728:D===21?this._processUnderline(2,O):D===22?(O.fg&=-134217729,O.bg&=-134217729):D===23?O.bg&=-67108865:D===24?(O.fg&=-268435457,this._processUnderline(0,O)):D===25?O.fg&=-536870913:D===27?O.fg&=-67108865:D===28?O.fg&=-1073741825:D===29?O.fg&=2147483647:D===39?(O.fg&=-67108864,O.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):D===49?(O.bg&=-67108864,O.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?V+=this._extractColor(I,V,O):D===53?O.bg|=1073741824:D===55?O.bg&=-1073741825:D===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):D===100?(O.fg&=-67108864,O.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const x=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${x};${D}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const x=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${x};${D}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const x=I.params[0]||1;switch(x){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 D=x%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(I){const x=I.params[0]||1;let D;return(I.length<2||(D=I.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>x&&(this._activeBuffer.scrollTop=x-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(I){if(!T(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const x=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:x!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:x!==0&&x!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),x!==0&&x!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:x!==0&&x!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),x!==0&&x!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const x=[],D=I.split(";");for(;D.length>1;){const O=D.shift(),V=D.shift();if(/^\d+$/.exec(O)){const G=parseInt(O);if(z(G))if(V==="?")x.push({type:0,index:G});else{const X=(0,k.parseColor)(V);X&&x.push({type:1,index:G,color:X})}}}return x.length&&this._onColor.fire(x),!0}setHyperlink(I){const x=I.split(";");return!(x.length<2)&&(x[1]?this._createHyperlink(x[0],x[1]):!x[0]&&this._finishHyperlink())}_createHyperlink(I,x){this._getCurrentLinkId()&&this._finishHyperlink();const D=I.split(":");let O;const V=D.findIndex((G=>G.startsWith("id=")));return V!==-1&&(O=D[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:x}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,x){const D=I.split(";");for(let O=0;O<D.length&&!(x>=this._specialColors.length);++O,++x)if(D[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[x]}]);else{const V=(0,k.parseColor)(D[O]);V&&this._onColor.fire([{type:1,index:this._specialColors[x],color:V}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const x=[],D=I.split(";");for(let O=0;O<D.length;++O)if(/^\d+$/.exec(D[O])){const V=parseInt(D[O]);z(V)&&x.push({type:2,index:V})}return x.length&&this._onColor.fire(x),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){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,g.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(R[I[0]],g.CHARSETS[I[1]]||g.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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new d.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let x=0;x<this._bufferService.rows;++x){const D=this._activeBuffer.ybase+this._activeBuffer.y+x,O=this._activeBuffer.lines.get(D);O&&(O.fill(I),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,x){const D=this._bufferService.buffer,O=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${V}${u.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,x){this._dirtyRowTracker.markRangeDirty(I,x)}}s.InputHandler=U;let $=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){W<this.start?this.start=W:W>this.end&&(this.end=W)}markRangeDirty(W,I){W>I&&(F=W,W=I,I=F),W<this.start&&(this.start=W),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function z(W){return 0<=W&&W<256}$=h([f(0,C.IBufferService)],$)},844:(v,s)=>{function c(h){for(const f of h)f.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const f=this._disposables.indexOf(h);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var f;this._isDisposed||h===this._value||((f=this._value)==null||f.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}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=c,s.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(f,u,g){this._data[f]||(this._data[f]={}),this._data[f][u]=g}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(h,f,u,g,y){this._data.get(h,f)||this._data.set(h,f,new c),this._data.get(h,f).set(u,g,y)}get(h,f,u,g){var y;return(y=this._data.get(h,f))==null?void 0:y.get(u,g)}clear(){this._data.clear()}}},6114:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const c=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=c.includes("Firefox"),s.isLegacyEdge=c.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(c),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=c.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad=h==="iPad",s.isIphone=h==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(c)},6106:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let c=0;s.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const f=this._getKey(h);if(f===void 0||(c=this._search(f),c===-1)||this._getKey(this._array[c])!==f)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===f);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,f){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do f(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let f=0,u=this._array.length-1;for(;u>=f;){let g=f+u>>1;const y=this._getKey(this._array[g]);if(y>h)u=g-1;else{if(!(y<h)){for(;g>0&&this._getKey(this._array[g-1])===h;)g--;return g}f=g+1}}return f}}},7226:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=c(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let E=0,p=0,n=y.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(E=Date.now(),this._tasks[this._i]()||this._i++,E=Math.max(1,Date.now()-E),p=Math.max(E,p),l=y.timeRemaining(),1.5*p>l)return n-E<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-E))}ms`),void this._start();n=l}this.clear()}}class u extends f{_requestCallback(y){return setTimeout((()=>y(this._createDeadline(16))))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const E=Date.now()+y;return{timeRemaining:()=>Math.max(0,E-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const h=c(643);s.updateWindowsModeWrappedState=function(f){const u=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),g=u==null?void 0:u.get(f.cols-1),y=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);y&&g&&(y.isWrapped=g[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&g[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,g=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=g}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=h},9092:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const h=c(6349),f=c(7226),u=c(3734),g=c(8437),y=c(4634),E=c(511),p=c(643),n=c(4863),l=c(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(o,d,_){this._hasScrollback=o,this._optionsService=d,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=E.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]),this._whitespaceCell=E.CellData.fromCharData([0,p.WHITESPACE_CELL_CHAR,p.WHITESPACE_CELL_WIDTH,p.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.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(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,d){return new g.BufferLine(this._bufferService.cols,this.getNullCell(o),d)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const d=o+this._optionsService.rawOptions.scrollback;return d>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:d}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=g.DEFAULT_ATTR_DATA);let d=this._rows;for(;d--;)this.lines.push(this.getBlankLine(o))}}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(o,d){const _=this.getNullCell(g.DEFAULT_ATTR_DATA);let C=0;const S=this._getCorrectBufferLength(d);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<o)for(let b=0;b<this.lines.length;b++)C+=+this.lines.get(b).resize(o,_);let w=0;if(this._rows<d)for(let b=this._rows;b<d;b++)this.lines.length<d+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(o,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(o,_)));else for(let b=this._rows;b>d;b--)this.lines.length>d+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const b=this.lines.length-S;b>0&&(this.lines.trimStart(b),this.ybase=Math.max(this.ybase-b,0),this.ydisp=Math.max(this.ydisp-b,0),this.savedY=Math.max(this.savedY-b,0)),this.lines.maxLength=S}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,d-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=d-1,this._isReflowEnabled&&(this._reflow(o,d),this._cols>o))for(let w=0;w<this.lines.length;w++)C+=+this.lines.get(w).resize(o,_);this._cols=o,this._rows=d,this._memoryCleanupQueue.clear(),C>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let d=0;for(;this._memoryCleanupPosition<this.lines.length;)if(d+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),d>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,d){this._cols!==o&&(o>this._cols?this._reflowLarger(o,d):this._reflowSmaller(o,d))}_reflowLarger(o,d){const _=(0,y.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(_.length>0){const C=(0,y.reflowLargerCreateNewLayout)(this.lines,_);(0,y.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(o,d,C.countRemoved)}}_reflowLargerAdjustViewport(o,d,_){const C=this.getNullCell(g.DEFAULT_ATTR_DATA);let S=_;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<d&&this.lines.push(new g.BufferLine(o,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(o,d){const _=this.getNullCell(g.DEFAULT_ATTR_DATA),C=[];let S=0;for(let w=this.lines.length-1;w>=0;w--){let b=this.lines.get(w);if(!b||!b.isWrapped&&b.getTrimmedLength()<=o)continue;const k=[b];for(;b.isWrapped&&w>0;)b=this.lines.get(--w),k.unshift(b);const R=this.ybase+this.y;if(R>=w&&R<w+k.length)continue;const L=k[k.length-1].getTrimmedLength(),T=(0,y.reflowSmallerGetNewLineLengths)(k,this._cols,o),A=T.length-k.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);const U=[];for(let D=0;D<A;D++){const O=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);U.push(O)}U.length>0&&(C.push({start:w+k.length+S,newLines:U}),S+=U.length),k.push(...U);let $=T.length-1,z=T[$];z===0&&($--,z=T[$]);let W=k.length-A-1,I=L;for(;W>=0;){const D=Math.min(I,z);if(k[$]===void 0)break;if(k[$].copyCellsFrom(k[W],I-D,z-D,D,!0),z-=D,z===0&&($--,z=T[$]),I-=D,I===0){W--;const O=Math.max(W,0);I=(0,y.getWrappedLineTrimmedLength)(k,O,this._cols)}}for(let D=0;D<k.length;D++)T[D]<o&&k[D].setCell(T[D],_);let x=A-F;for(;x-- >0;)this.ybase===0?this.y<d-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-d&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+d-1)}if(C.length>0){const w=[],b=[];for(let $=0;$<this.lines.length;$++)b.push(this.lines.get($));const k=this.lines.length;let R=k-1,L=0,T=C[L];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let A=0;for(let $=Math.min(this.lines.maxLength-1,k+S-1);$>=0;$--)if(T&&T.start>R+A){for(let z=T.newLines.length-1;z>=0;z--)this.lines.set($--,T.newLines[z]);$++,w.push({index:R+1,amount:T.newLines.length}),A+=T.newLines.length,T=C[++L]}else this.lines.set($,b[R--]);let F=0;for(let $=w.length-1;$>=0;$--)w[$].index+=F,this.lines.onInsertEmitter.fire(w[$]),F+=w[$].amount;const U=Math.max(0,k+S-this.lines.maxLength);U>0&&this.lines.onTrimEmitter.fire(U)}}translateBufferLineToString(o,d,_=0,C){const S=this.lines.get(o);return S?S.translateToString(d,_,C):""}getWrappedRangeForLine(o){let d=o,_=o;for(;d>0&&this.lines.get(d).isWrapped;)d--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:d,last:_}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].line===o&&(this.markers[d].dispose(),this.markers.splice(d--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const d=new n.Marker(o);return this.markers.push(d),d.register(this.lines.onTrim((_=>{d.line-=_,d.line<0&&d.dispose()}))),d.register(this.lines.onInsert((_=>{d.line>=_.index&&(d.line+=_.amount)}))),d.register(this.lines.onDelete((_=>{d.line>=_.index&&d.line<_.index+_.amount&&d.dispose(),d.line>_.index&&(d.line-=_.amount)}))),d.register(d.onDispose((()=>this._removeMarker(d)))),d}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const h=c(3734),f=c(511),u=c(643),g=c(482);s.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let y=0;class E{constructor(n,l,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const d=l||f.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let _=0;_<n;++_)this.setCell(_,d);this.length=n}get(n){const l=this._data[3*n+0],o=2097151&l;return[this._data[3*n+1],2097152&l?this._combined[n]:o?(0,g.stringFromCodePoint)(o):"",l>>22,2097152&l?this._combined[n].charCodeAt(this._combined[n].length-1):o]}set(n,l){this._data[3*n+1]=l[u.CHAR_DATA_ATTR_INDEX],l[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=l[1],this._data[3*n+0]=2097152|n|l[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=l[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const l=this._data[3*n+0];return 2097152&l?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&l}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const l=this._data[3*n+0];return 2097152&l?this._combined[n]:2097151&l?(0,g.stringFromCodePoint)(2097151&l):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,l){return y=3*n,l.content=this._data[y+0],l.fg=this._data[y+1],l.bg=this._data[y+2],2097152&l.content&&(l.combinedData=this._combined[n]),268435456&l.bg&&(l.extended=this._extendedAttrs[n]),l}setCell(n,l){2097152&l.content&&(this._combined[n]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[n]=l.extended),this._data[3*n+0]=l.content,this._data[3*n+1]=l.fg,this._data[3*n+2]=l.bg}setCellFromCodepoint(n,l,o,d){268435456&d.bg&&(this._extendedAttrs[n]=d.extended),this._data[3*n+0]=l|o<<22,this._data[3*n+1]=d.fg,this._data[3*n+2]=d.bg}addCodepointToCell(n,l,o){let d=this._data[3*n+0];2097152&d?this._combined[n]+=(0,g.stringFromCodePoint)(l):2097151&d?(this._combined[n]=(0,g.stringFromCodePoint)(2097151&d)+(0,g.stringFromCodePoint)(l),d&=-2097152,d|=2097152):d=l|4194304,o&&(d&=-12582913,d|=o<<22),this._data[3*n+0]=d}insertCells(n,l,o){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),l<this.length-n){const d=new f.CellData;for(let _=this.length-n-l-1;_>=0;--_)this.setCell(n+l+_,this.loadCell(n+_,d));for(let _=0;_<l;++_)this.setCell(n+_,o)}else for(let d=n;d<this.length;++d)this.setCell(d,o);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,o)}deleteCells(n,l,o){if(n%=this.length,l<this.length-n){const d=new f.CellData;for(let _=0;_<this.length-n-l;++_)this.setCell(n+_,this.loadCell(n+l+_,d));for(let _=this.length-l;_<this.length;++_)this.setCell(_,o)}else for(let d=n;d<this.length;++d)this.setCell(d,o);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,o)}replaceCells(n,l,o,d=!1){if(d)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,o),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodepoint(l,0,1,o);n<l&&n<this.length;)this.isProtected(n)||this.setCell(n,o),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l,0,1,o);n<l&&n<this.length;)this.setCell(n++,o)}resize(n,l){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const d=new Uint32Array(o);d.set(this._data),this._data=d}for(let d=this.length;d<n;++d)this.setCell(d,l)}else{this._data=this._data.subarray(0,o);const d=Object.keys(this._combined);for(let C=0;C<d.length;C++){const S=parseInt(d[C],10);S>=n&&delete this._combined[S]}const _=Object.keys(this._extendedAttrs);for(let C=0;C<_.length;C++){const S=parseInt(_[C],10);S>=n&&delete this._extendedAttrs[S]}}return this.length=n,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,l=!1){if(l)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,n);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const l in n._combined)this._combined[l]=n._combined[l];this._extendedAttrs={};for(const l in n._extendedAttrs)this._extendedAttrs[l]=n._extendedAttrs[l];this.isWrapped=n.isWrapped}clone(){const n=new E(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const l in this._combined)n._combined[l]=this._combined[l];for(const l in this._extendedAttrs)n._extendedAttrs[l]=this._extendedAttrs[l];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,l,o,d,_){const C=n._data;if(_)for(let w=d-1;w>=0;w--){for(let b=0;b<3;b++)this._data[3*(o+w)+b]=C[3*(l+w)+b];268435456&C[3*(l+w)+2]&&(this._extendedAttrs[o+w]=n._extendedAttrs[l+w])}else for(let w=0;w<d;w++){for(let b=0;b<3;b++)this._data[3*(o+w)+b]=C[3*(l+w)+b];268435456&C[3*(l+w)+2]&&(this._extendedAttrs[o+w]=n._extendedAttrs[l+w])}const S=Object.keys(n._combined);for(let w=0;w<S.length;w++){const b=parseInt(S[w],10);b>=l&&(this._combined[b-l+o]=n._combined[b])}}translateToString(n,l,o,d){l=l??0,o=o??this.length,n&&(o=Math.min(o,this.getTrimmedLength())),d&&(d.length=0);let _="";for(;l<o;){const C=this._data[3*l+0],S=2097151&C,w=2097152&C?this._combined[l]:S?(0,g.stringFromCodePoint)(S):u.WHITESPACE_CELL_CHAR;if(_+=w,d)for(let b=0;b<w.length;++b)d.push(l);l+=C>>22||1}return d&&d.push(l),_}}s.BufferLine=E},4841:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(v,s)=>{function c(h,f,u){if(f===h.length-1)return h[f].getTrimmedLength();const g=!h[f].hasContent(u-1)&&h[f].getWidth(u-1)===1,y=h[f+1].getWidth(0)===2;return g&&y?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(h,f,u,g,y){const E=[];for(let p=0;p<h.length-1;p++){let n=p,l=h.get(++n);if(!l.isWrapped)continue;const o=[h.get(p)];for(;n<h.length&&l.isWrapped;)o.push(l),l=h.get(++n);if(g>=p&&g<n){p+=o.length-1;continue}let d=0,_=c(o,d,f),C=1,S=0;for(;C<o.length;){const b=c(o,C,f),k=b-S,R=u-_,L=Math.min(k,R);o[d].copyCellsFrom(o[C],S,_,L,!1),_+=L,_===u&&(d++,_=0),S+=L,S===b&&(C++,S=0),_===0&&d!==0&&o[d-1].getWidth(u-1)===2&&(o[d].copyCellsFrom(o[d-1],u-1,_++,1,!1),o[d-1].setCell(u-1,y))}o[d].replaceCells(_,u,y);let w=0;for(let b=o.length-1;b>0&&(b>d||o[b].getTrimmedLength()===0);b--)w++;w>0&&(E.push(p+o.length-w),E.push(w)),p+=o.length-1}return E},s.reflowLargerCreateNewLayout=function(h,f){const u=[];let g=0,y=f[g],E=0;for(let p=0;p<h.length;p++)if(y===p){const n=f[++g];h.onDeleteEmitter.fire({index:p-E,amount:n}),p+=n-1,E+=n,y=f[++g]}else u.push(p);return{layout:u,countRemoved:E}},s.reflowLargerApplyNewLayout=function(h,f){const u=[];for(let g=0;g<f.length;g++)u.push(h.get(f[g]));for(let g=0;g<u.length;g++)h.set(g,u[g]);h.length=f.length},s.reflowSmallerGetNewLineLengths=function(h,f,u){const g=[],y=h.map(((l,o)=>c(h,o,f))).reduce(((l,o)=>l+o));let E=0,p=0,n=0;for(;n<y;){if(y-n<u){g.push(y-n);break}E+=u;const l=c(h,p,f);E>l&&(E-=l,p++);const o=h[p].getWidth(E-1)===2;o&&E--;const d=o?u-1:u;g.push(d),n+=d}return g},s.getWrappedLineTrimmedLength=c},5295:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const h=c(8460),f=c(844),u=c(9092);class g extends f.Disposable{constructor(E,p){super(),this._optionsService=E,this._bufferService=p,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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.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(E){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(E),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(E,p){this._normal.resize(E,p),this._alt.resize(E,p),this.setupTabStops(E)}setupTabStops(E){this._normal.setupTabStops(E),this._alt.setupTabStops(E)}}s.BufferSet=g},511:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=c(482),f=c(643),u=c(3734);class g extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(E){const p=new g;return p.setFromCharData(E),p}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(E){this.fg=E[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(E[f.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(E[f.CHAR_DATA_CHAR_INDEX].length===2){const n=E[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const l=E[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(n-55296)+l-56320+65536|E[f.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=E[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[f.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=E[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=g},643:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const h=c(8460),f=c(844);class u{get id(){return this._id}constructor(y){this.line=y,this.isDisposed=!1,this._disposables=[],this._id=u._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,f.disposeArray)(this._disposables),this._disposables.length=0)}register(y){return this._disposables.push(y),y}}s.Marker=u,u._nextId=1},7116:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(v,s)=>{var c,h,f;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
165
|
+
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(c||(s.C0=c={})),(function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""})(h||(s.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(f||(s.C1_ESCAPED=f={}))},7399:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const h=c(2584),f={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(u,g,y,E){const p={type:0,cancel:!1,key:void 0},n=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?p.key=g?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?p.key=g?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?p.key=g?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(p.key=g?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:p.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(p.key=h.C0.ESC+p.key);break;case 9:if(u.shiftKey){p.key=h.C0.ESC+"[Z";break}p.key=h.C0.HT,p.cancel=!0;break;case 13:p.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,p.cancel=!0;break;case 27:p.key=h.C0.ESC,u.altKey&&(p.key=h.C0.ESC+h.C0.ESC),p.cancel=!0;break;case 37:if(u.metaKey)break;n?(p.key=h.C0.ESC+"[1;"+(n+1)+"D",p.key===h.C0.ESC+"[1;3D"&&(p.key=h.C0.ESC+(y?"b":"[1;5D"))):p.key=g?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;n?(p.key=h.C0.ESC+"[1;"+(n+1)+"C",p.key===h.C0.ESC+"[1;3C"&&(p.key=h.C0.ESC+(y?"f":"[1;5C"))):p.key=g?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;n?(p.key=h.C0.ESC+"[1;"+(n+1)+"A",y||p.key!==h.C0.ESC+"[1;3A"||(p.key=h.C0.ESC+"[1;5A")):p.key=g?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;n?(p.key=h.C0.ESC+"[1;"+(n+1)+"B",y||p.key!==h.C0.ESC+"[1;3B"||(p.key=h.C0.ESC+"[1;5B")):p.key=g?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(p.key=h.C0.ESC+"[2~");break;case 46:p.key=n?h.C0.ESC+"[3;"+(n+1)+"~":h.C0.ESC+"[3~";break;case 36:p.key=n?h.C0.ESC+"[1;"+(n+1)+"H":g?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:p.key=n?h.C0.ESC+"[1;"+(n+1)+"F":g?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?p.type=2:u.ctrlKey?p.key=h.C0.ESC+"[5;"+(n+1)+"~":p.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?p.type=3:u.ctrlKey?p.key=h.C0.ESC+"[6;"+(n+1)+"~":p.key=h.C0.ESC+"[6~";break;case 112:p.key=n?h.C0.ESC+"[1;"+(n+1)+"P":h.C0.ESC+"OP";break;case 113:p.key=n?h.C0.ESC+"[1;"+(n+1)+"Q":h.C0.ESC+"OQ";break;case 114:p.key=n?h.C0.ESC+"[1;"+(n+1)+"R":h.C0.ESC+"OR";break;case 115:p.key=n?h.C0.ESC+"[1;"+(n+1)+"S":h.C0.ESC+"OS";break;case 116:p.key=n?h.C0.ESC+"[15;"+(n+1)+"~":h.C0.ESC+"[15~";break;case 117:p.key=n?h.C0.ESC+"[17;"+(n+1)+"~":h.C0.ESC+"[17~";break;case 118:p.key=n?h.C0.ESC+"[18;"+(n+1)+"~":h.C0.ESC+"[18~";break;case 119:p.key=n?h.C0.ESC+"[19;"+(n+1)+"~":h.C0.ESC+"[19~";break;case 120:p.key=n?h.C0.ESC+"[20;"+(n+1)+"~":h.C0.ESC+"[20~";break;case 121:p.key=n?h.C0.ESC+"[21;"+(n+1)+"~":h.C0.ESC+"[21~";break;case 122:p.key=n?h.C0.ESC+"[23;"+(n+1)+"~":h.C0.ESC+"[23~";break;case 123:p.key=n?h.C0.ESC+"[24;"+(n+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(y&&!E||!u.altKey||u.metaKey)!y||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?p.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(p.key=h.C0.US),u.key==="@"&&(p.key=h.C0.NUL)):u.keyCode===65&&(p.type=1);else{const l=f[u.keyCode],o=l==null?void 0:l[u.shiftKey?1:0];if(o)p.key=h.C0.ESC+o;else if(u.keyCode>=65&&u.keyCode<=90){const d=u.ctrlKey?u.keyCode-64:u.keyCode+32;let _=String.fromCharCode(d);u.shiftKey&&(_=_.toUpperCase()),p.key=h.C0.ESC+_}else if(u.keyCode===32)p.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let d=u.code.slice(3,4);u.shiftKey||(d=d.toLowerCase()),p.key=h.C0.ESC+d,p.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?p.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?p.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?p.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?p.key=h.C0.DEL:u.keyCode===219?p.key=h.C0.ESC:u.keyCode===220?p.key=h.C0.FS:u.keyCode===221&&(p.key=h.C0.GS)}return p}},482:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},s.utf32ToString=function(c,h=0,f=c.length){let u="";for(let g=h;g<f;++g){let y=c[g];y>65535?(y-=65536,u+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):u+=String.fromCharCode(y)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const f=c.length;if(!f)return 0;let u=0,g=0;if(this._interim){const y=c.charCodeAt(g++);56320<=y&&y<=57343?h[u++]=1024*(this._interim-55296)+y-56320+65536:(h[u++]=this._interim,h[u++]=y),this._interim=0}for(let y=g;y<f;++y){const E=c.charCodeAt(y);if(55296<=E&&E<=56319){if(++y>=f)return this._interim=E,u;const p=c.charCodeAt(y);56320<=p&&p<=57343?h[u++]=1024*(E-55296)+p-56320+65536:(h[u++]=E,h[u++]=p)}else E!==65279&&(h[u++]=E)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const f=c.length;if(!f)return 0;let u,g,y,E,p=0,n=0,l=0;if(this.interim[0]){let _=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let S,w=0;for(;(S=63&this.interim[++w])&&w<4;)C<<=6,C|=S;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=b-w;for(;l<k;){if(l>=f)return 0;if(S=c[l++],(192&S)!=128){l--,_=!0;break}this.interim[w++]=S,C<<=6,C|=63&S}_||(b===2?C<128?l--:h[p++]=C:b===3?C<2048||C>=55296&&C<=57343||C===65279||(h[p++]=C):C<65536||C>1114111||(h[p++]=C)),this.interim.fill(0)}const o=f-4;let d=l;for(;d<f;){for(;!(!(d<o)||128&(u=c[d])||128&(g=c[d+1])||128&(y=c[d+2])||128&(E=c[d+3]));)h[p++]=u,h[p++]=g,h[p++]=y,h[p++]=E,d+=4;if(u=c[d++],u<128)h[p++]=u;else if((224&u)==192){if(d>=f)return this.interim[0]=u,p;if(g=c[d++],(192&g)!=128){d--;continue}if(n=(31&u)<<6|63&g,n<128){d--;continue}h[p++]=n}else if((240&u)==224){if(d>=f)return this.interim[0]=u,p;if(g=c[d++],(192&g)!=128){d--;continue}if(d>=f)return this.interim[0]=u,this.interim[1]=g,p;if(y=c[d++],(192&y)!=128){d--;continue}if(n=(15&u)<<12|(63&g)<<6|63&y,n<2048||n>=55296&&n<=57343||n===65279)continue;h[p++]=n}else if((248&u)==240){if(d>=f)return this.interim[0]=u,p;if(g=c[d++],(192&g)!=128){d--;continue}if(d>=f)return this.interim[0]=u,this.interim[1]=g,p;if(y=c[d++],(192&y)!=128){d--;continue}if(d>=f)return this.interim[0]=u,this.interim[1]=g,this.interim[2]=y,p;if(E=c[d++],(192&E)!=128){d--;continue}if(n=(7&u)<<18|(63&g)<<12|(63&y)<<6|63&E,n<65536||n>1114111)continue;h[p++]=n}}return p}}},225:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const h=c(1480),f=[[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]],u=[[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 g;s.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let y=0;y<f.length;++y)g.fill(0,f[y][0],f[y][1]+1)}}wcwidth(y){return y<32?0:y<127?1:y<65536?g[y]:(function(E,p){let n,l=0,o=p.length-1;if(E<p[0][0]||E>p[o][1])return!1;for(;o>=l;)if(n=l+o>>1,E>p[n][1])l=n+1;else{if(!(E<p[n][0]))return!0;o=n-1}return!1})(y,u)?0:y>=131072&&y<=196605||y>=196608&&y<=262141?2:1}charProperties(y,E){let p=this.wcwidth(y),n=p===0&&E!==0;if(n){const l=h.UnicodeService.extractWidth(E);l===0?n=!1:l>p&&(p=l)}return h.UnicodeService.createPropertyValue(0,p,n)}}},5981:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const h=c(8460),f=c(844);class u extends f.Disposable{constructor(y){super(),this._action=y,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(y,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let p;for(this._isSyncWriting=!0;p=this._writeBuffer.shift();){this._action(p);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(y,E){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+=y.length,this._writeBuffer.push(y),this._callbacks.push(E),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(E)}_innerWrite(y=0,E=!0){const p=y||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],l=this._action(n,E);if(l){const d=_=>Date.now()-p>=12?setTimeout((()=>this._innerWrite(0,_))):this._innerWrite(p,_);return void l.catch((_=>(queueMicrotask((()=>{throw _})),Promise.resolve(!1)))).then(d)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-p>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=u},5941:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const c=/^([\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 f(u,g){const y=u.toString(16),E=y.length<2?"0"+y:y;switch(g){case 4:return y[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}s.parseColor=function(u){if(!u)return;let g=u.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const y=c.exec(g);if(y){const E=y[1]?15:y[4]?255:y[7]?4095:65535;return[Math.round(parseInt(y[1]||y[4]||y[7]||y[10],16)/E*255),Math.round(parseInt(y[2]||y[5]||y[8]||y[11],16)/E*255),Math.round(parseInt(y[3]||y[6]||y[9]||y[12],16)/E*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),h.exec(g)&&[3,6,9,12].includes(g.length))){const y=g.length/3,E=[0,0,0];for(let p=0;p<3;++p){const n=parseInt(g.slice(y*p,y*p+y),16);E[p]=y===1?n<<4:y===2?n:y===3?n>>4:n>>8}return E}},s.toRgbString=function(u,g=16){const[y,E,p]=u;return`rgb:${f(y,g)}/${f(E,g)}/${f(p,g)}`}},5770:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const h=c(482),f=c(8742),u=c(5770),g=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(E,p){this._handlers[E]===void 0&&(this._handlers[E]=[]);const n=this._handlers[E];return n.push(p),{dispose:()=>{const l=n.indexOf(p);l!==-1&&n.splice(l,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(E,p){if(this.reset(),this._ident=E,this._active=this._handlers[E]||g,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(p);else this._handlerFb(this._ident,"HOOK",p)}put(E,p,n){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(E,p,n);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(E,p,n))}unhook(E,p=!0){if(this._active.length){let n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=p,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].unhook(E),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",E);this._active=g,this._ident=0}};const y=new f.Params;y.addParam(0),s.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=y,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():y,this._data="",this._hitLimit=!1}put(E,p,n){this._hitLimit||(this._data+=(0,h.utf32ToString)(E,p,n),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let p=!1;if(this._hitLimit)p=!1;else if(E&&(p=this._handler(this._data,this._params),p instanceof Promise))return p.then((n=>(this._params=y,this._data="",this._hitLimit=!1,n)));return this._params=y,this._data="",this._hitLimit=!1,p}}},2015:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const h=c(844),f=c(8742),u=c(6242),g=c(6351);class y{constructor(l){this.table=new Uint8Array(l)}setDefault(l,o){this.table.fill(l<<4|o)}add(l,o,d,_){this.table[o<<8|l]=d<<4|_}addMany(l,o,d,_){for(let C=0;C<l.length;C++)this.table[o<<8|l[C]]=d<<4|_}}s.TransitionTable=y;const E=160;s.VT500_TRANSITION_TABLE=(function(){const n=new y(4095),l=Array.apply(null,Array(256)).map(((w,b)=>b)),o=(w,b)=>l.slice(w,b),d=o(32,127),_=o(0,24);_.push(25),_.push.apply(_,o(28,32));const C=o(0,14);let S;for(S in n.setDefault(1,0),n.addMany(d,0,2,0),C)n.addMany([24,26,153,154],S,3,0),n.addMany(o(128,144),S,3,0),n.addMany(o(144,152),S,3,0),n.add(156,S,0,0),n.add(27,S,11,1),n.add(157,S,4,8),n.addMany([152,158,159],S,0,7),n.add(155,S,11,3),n.add(144,S,11,9);return n.addMany(_,0,3,0),n.addMany(_,1,3,1),n.add(127,1,0,1),n.addMany(_,8,0,8),n.addMany(_,3,3,3),n.add(127,3,0,3),n.addMany(_,4,3,4),n.add(127,4,0,4),n.addMany(_,6,3,6),n.addMany(_,5,3,5),n.add(127,5,0,5),n.addMany(_,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(d,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(o(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(d,7,0,7),n.addMany(_,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(o(64,127),3,7,0),n.addMany(o(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(o(48,60),4,8,4),n.addMany(o(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(o(32,64),6,0,6),n.add(127,6,0,6),n.addMany(o(64,127),6,0,0),n.addMany(o(32,48),3,9,5),n.addMany(o(32,48),5,9,5),n.addMany(o(48,64),5,0,6),n.addMany(o(64,127),5,7,0),n.addMany(o(32,48),4,9,5),n.addMany(o(32,48),1,9,2),n.addMany(o(32,48),2,9,2),n.addMany(o(48,127),2,10,0),n.addMany(o(48,80),1,10,0),n.addMany(o(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(o(96,127),1,10,0),n.add(80,1,11,9),n.addMany(_,9,0,9),n.add(127,9,0,9),n.addMany(o(28,32),9,0,9),n.addMany(o(32,48),9,9,12),n.addMany(o(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(_,11,0,11),n.addMany(o(32,128),11,0,11),n.addMany(o(28,32),11,0,11),n.addMany(_,10,0,10),n.add(127,10,0,10),n.addMany(o(28,32),10,0,10),n.addMany(o(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(o(32,48),10,9,12),n.addMany(_,12,0,12),n.add(127,12,0,12),n.addMany(o(28,32),12,0,12),n.addMany(o(32,48),12,9,12),n.addMany(o(48,64),12,0,11),n.addMany(o(64,127),12,12,13),n.addMany(o(64,127),10,12,13),n.addMany(o(64,127),9,12,13),n.addMany(_,13,13,13),n.addMany(d,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(E,0,2,0),n.add(E,8,5,8),n.add(E,6,0,6),n.add(E,11,0,11),n.add(E,13,13,13),n})();class p extends h.Disposable{constructor(l=s.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(o,d,_)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,d)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,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 u.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(l,o=[64,126]){let d=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(d=l.prefix.charCodeAt(0),d&&60>d||d>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<l.intermediates.length;++C){const S=l.intermediates.charCodeAt(C);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");d<<=8,d|=S}}if(l.final.length!==1)throw new Error("final must be a single byte");const _=l.final.charCodeAt(0);if(o[0]>_||_>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return d<<=8,d|=_,d}identToString(l){const o=[];for(;l;)o.push(String.fromCharCode(255&l)),l>>=8;return o.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,o){const d=this._identifier(l,[48,126]);this._escHandlers[d]===void 0&&(this._escHandlers[d]=[]);const _=this._escHandlers[d];return _.push(o),{dispose:()=>{const C=_.indexOf(o);C!==-1&&_.splice(C,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,o){this._executeHandlers[l.charCodeAt(0)]=o}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,o){const d=this._identifier(l);this._csiHandlers[d]===void 0&&(this._csiHandlers[d]=[]);const _=this._csiHandlers[d];return _.push(o),{dispose:()=>{const C=_.indexOf(o);C!==-1&&_.splice(C,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,o){return this._dcsParser.registerHandler(this._identifier(l),o)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,o){return this._oscParser.registerHandler(l,o)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}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(l,o,d,_,C){this._parseStack.state=l,this._parseStack.handlers=o,this._parseStack.handlerPos=d,this._parseStack.transition=_,this._parseStack.chunkPos=C}parse(l,o,d){let _,C=0,S=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(d===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const b=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(d===!1&&k>-1){for(;k>=0&&(_=b[k](this._params),_!==!0);k--)if(_ instanceof Promise)return this._parseStack.handlerPos=k,_}this._parseStack.handlers=[];break;case 4:if(d===!1&&k>-1){for(;k>=0&&(_=b[k](),_!==!0);k--)if(_ instanceof Promise)return this._parseStack.handlerPos=k,_}this._parseStack.handlers=[];break;case 6:if(C=l[this._parseStack.chunkPos],_=this._dcsParser.unhook(C!==24&&C!==26,d),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=l[this._parseStack.chunkPos],_=this._oscParser.end(C!==24&&C!==26,d),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let b=w;b<o;++b){switch(C=l[b],S=this._transitions.table[this.currentState<<8|(C<160?C:E)],S>>4){case 2:for(let A=b+1;;++A){if(A>=o||(C=l[A])<32||C>126&&C<E){this._printHandler(l,b,A),b=A-1;break}if(++A>=o||(C=l[A])<32||C>126&&C<E){this._printHandler(l,b,A),b=A-1;break}if(++A>=o||(C=l[A])<32||C>126&&C<E){this._printHandler(l,b,A),b=A-1;break}if(++A>=o||(C=l[A])<32||C>126&&C<E){this._printHandler(l,b,A),b=A-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:b,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|C];let R=k?k.length-1:-1;for(;R>=0&&(_=k[R](this._params),_!==!0);R--)if(_ instanceof Promise)return this._preserveStack(3,k,R,S,b),_;R<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++b<o&&(C=l[b])>47&&C<60);b--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const L=this._escHandlers[this._collect<<8|C];let T=L?L.length-1:-1;for(;T>=0&&(_=L[T](),_!==!0);T--)if(_ instanceof Promise)return this._preserveStack(4,L,T,S,b),_;T<0&&this._escHandlerFb(this._collect<<8|C),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|C,this._params);break;case 13:for(let A=b+1;;++A)if(A>=o||(C=l[A])===24||C===26||C===27||C>127&&C<E){this._dcsParser.put(l,b,A),b=A-1;break}break;case 14:if(_=this._dcsParser.unhook(C!==24&&C!==26),_)return this._preserveStack(6,[],0,S,b),_;C===27&&(S|=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 A=b+1;;A++)if(A>=o||(C=l[A])<32||C>127&&C<E){this._oscParser.put(l,b,A),b=A-1;break}break;case 6:if(_=this._oscParser.end(C!==24&&C!==26),_)return this._preserveStack(5,[],0,S,b),_;C===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}s.EscapeSequenceParser=p},6242:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const h=c(5770),f=c(482),u=[];s.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,y){this._handlers[g]===void 0&&(this._handlers[g]=[]);const E=this._handlers[g];return E.push(y),{dispose:()=>{const p=E.indexOf(y);p!==-1&&E.splice(p,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,y,E){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(g,y,E);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(g,y,E))}start(){this.reset(),this._state=1}put(g,y,E){if(this._state!==3){if(this._state===1)for(;y<E;){const p=g[y++];if(p===59){this._state=2,this._start();break}if(p<48||57<p)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+p-48}this._state===2&&E-y>0&&this._put(g,y,E)}}end(g,y=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,p=this._active.length-1,n=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,E=y,n=this._stack.fallThrough,this._stack.paused=!1),!n&&E===!1){for(;p>=0&&(E=this._active[p].end(g),E!==!0);p--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,E;p--}for(;p>=0;p--)if(E=this._active[p].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",g);this._active=u,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,y,E){this._hitLimit||(this._data+=(0,f.utf32ToString)(g,y,E),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let y=!1;if(this._hitLimit)y=!1;else if(g&&(y=this._handler(this._data),y instanceof Promise))return y.then((E=>(this._data="",this._hitLimit=!1,E)));return this._data="",this._hitLimit=!1,y}}},8742:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const c=2147483647;class h{static fromArray(u){const g=new h;if(!u.length)return g;for(let y=Array.isArray(u[0])?1:0;y<u.length;++y){const E=u[y];if(Array.isArray(E))for(let p=0;p<E.length;++p)g.addSubParam(E[p]);else g.addParam(E)}return g}constructor(u=32,g=32){if(this.maxLength=u,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let g=0;g<this.length;++g){u.push(this.params[g]);const y=this._subParamsIdx[g]>>8,E=255&this._subParamsIdx[g];E-y>0&&u.push(Array.prototype.slice.call(this._subParams,y,E))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>c?c:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>c?c:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const g=this._subParamsIdx[u]>>8,y=255&this._subParamsIdx[u];return y-g>0?this._subParams.subarray(g,y):null}getSubParamsAll(){const u={};for(let g=0;g<this.length;++g){const y=this._subParamsIdx[g]>>8,E=255&this._subParamsIdx[g];E-y>0&&(u[g]=this._subParams.slice(y,E))}return u}addDigit(u){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const y=this._digitIsSub?this._subParams:this.params,E=y[g-1];y[g-1]=~E?Math.min(10*E+u,c):u}}s.Params=h},5741:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const f={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(f),h.dispose=()=>this._wrappedAddonDispose(f),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===c){h=f;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const h=c(3785),f=c(511);s.BufferApiView=class{constructor(u,g){this._buffer=u,this.type=g}init(u){return this._buffer=u,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(u){const g=this._buffer.lines.get(u);if(g)return new h.BufferLineApiView(g)}getNullCell(){return new f.CellData}}},3785:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const h=c(511);s.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,u){if(!(f<0||f>=this._line.length))return u?(this._line.loadCell(f,u),u):this._line.loadCell(f,new h.CellData)}translateToString(f,u,g){return this._line.translateToString(f,u,g)}}},8285:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const h=c(8771),f=c(8460),u=c(844);class g extends u.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new f.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)}}s.BufferNamespaceApi=g},7975:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(f=>h(f.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((f,u)=>h(f,u.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(v,s,c){var h=this&&this.__decorate||function(n,l,o,d){var _,C=arguments.length,S=C<3?l:d===null?d=Object.getOwnPropertyDescriptor(l,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(n,l,o,d);else for(var w=n.length-1;w>=0;w--)(_=n[w])&&(S=(C<3?_(S):C>3?_(l,o,S):_(l,o))||S);return C>3&&S&&Object.defineProperty(l,o,S),S},f=this&&this.__param||function(n,l){return function(o,d){l(o,d,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const u=c(8460),g=c(844),y=c(5295),E=c(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let p=s.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new y.BufferSet(n,this))}resize(n,l){this.cols=n,this.rows=l,this.buffers.resize(n,l),this._onResize.fire({cols:n,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,l=!1){const o=this.buffer;let d;d=this._cachedBlankLine,d&&d.length===this.cols&&d.getFg(0)===n.fg&&d.getBg(0)===n.bg||(d=o.getBlankLine(n,l),this._cachedBlankLine=d),d.isWrapped=l;const _=o.ybase+o.scrollTop,C=o.ybase+o.scrollBottom;if(o.scrollTop===0){const S=o.lines.isFull;C===o.lines.length-1?S?o.lines.recycle().copyFrom(d):o.lines.push(d.clone()):o.lines.splice(C+1,0,d.clone()),S?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const S=C-_+1;o.lines.shiftElements(_+1,S-1,-1),o.lines.set(C,d.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(n,l,o){const d=this.buffer;if(n<0){if(d.ydisp===0)return;this.isUserScrolling=!0}else n+d.ydisp>=d.ybase&&(this.isUserScrolling=!1);const _=d.ydisp;d.ydisp=Math.max(Math.min(d.ydisp+n,d.ybase),0),_!==d.ydisp&&(l||this._onScroll.fire(d.ydisp))}};s.BufferService=p=h([f(0,E.IOptionsService)],p)},7994:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(v,s,c){var h=this&&this.__decorate||function(d,_,C,S){var w,b=arguments.length,k=b<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,C):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,_,C,S);else for(var R=d.length-1;R>=0;R--)(w=d[R])&&(k=(b<3?w(k):b>3?w(_,C,k):w(_,C))||k);return b>3&&k&&Object.defineProperty(_,C,k),k},f=this&&this.__param||function(d,_){return function(C,S){_(C,S,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const u=c(2585),g=c(8460),y=c(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:d=>d.button!==4&&d.action===1&&(d.ctrl=!1,d.alt=!1,d.shift=!1,!0)},VT200:{events:19,restrict:d=>d.action!==32},DRAG:{events:23,restrict:d=>d.action!==32||d.button!==3},ANY:{events:31,restrict:d=>!0}};function p(d,_){let C=(d.ctrl?16:0)|(d.shift?4:0)|(d.alt?8:0);return d.button===4?(C|=64,C|=d.action):(C|=3&d.button,4&d.button&&(C|=64),8&d.button&&(C|=128),d.action===32?C|=32:d.action!==0||_||(C|=3)),C}const n=String.fromCharCode,l={DEFAULT:d=>{const _=[p(d,!1)+32,d.col+32,d.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${n(_[0])}${n(_[1])}${n(_[2])}`},SGR:d=>{const _=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${p(d,!0)};${d.col};${d.row}${_}`},SGR_PIXELS:d=>{const _=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${p(d,!0)};${d.x};${d.y}${_}`}};let o=s.CoreMouseService=class extends y.Disposable{constructor(d,_){super(),this._bufferService=d,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(E))this.addProtocol(C,E[C]);for(const C of Object.keys(l))this.addEncoding(C,l[C]);this.reset()}addProtocol(d,_){this._protocols[d]=_}addEncoding(d,_){this._encodings[d]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(d){if(!this._protocols[d])throw new Error(`unknown protocol "${d}"`);this._activeProtocol=d,this._onProtocolChange.fire(this._protocols[d].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(d){if(!this._encodings[d])throw new Error(`unknown encoding "${d}"`);this._activeEncoding=d}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(d){if(d.col<0||d.col>=this._bufferService.cols||d.row<0||d.row>=this._bufferService.rows||d.button===4&&d.action===32||d.button===3&&d.action!==32||d.button!==4&&(d.action===2||d.action===3)||(d.col++,d.row++,d.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,d,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(d))return!1;const _=this._encodings[this._activeEncoding](d);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=d,!0}explainEvents(d){return{down:!!(1&d),up:!!(2&d),drag:!!(4&d),move:!!(8&d),wheel:!!(16&d)}}_equalEvents(d,_,C){if(C){if(d.x!==_.x||d.y!==_.y)return!1}else if(d.col!==_.col||d.row!==_.row)return!1;return d.button===_.button&&d.action===_.action&&d.ctrl===_.ctrl&&d.alt===_.alt&&d.shift===_.shift}};s.CoreMouseService=o=h([f(0,u.IBufferService),f(1,u.ICoreService)],o)},6975:function(v,s,c){var h=this&&this.__decorate||function(o,d,_,C){var S,w=arguments.length,b=w<3?d:C===null?C=Object.getOwnPropertyDescriptor(d,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,d,_,C);else for(var k=o.length-1;k>=0;k--)(S=o[k])&&(b=(w<3?S(b):w>3?S(d,_,b):S(d,_))||b);return w>3&&b&&Object.defineProperty(d,_,b),b},f=this&&this.__param||function(o,d){return function(_,C){d(_,C,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const u=c(1439),g=c(8460),y=c(844),E=c(2585),p=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=s.CoreService=class extends y.Disposable{constructor(o,d,_){super(),this._bufferService=o,this._logService=d,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(p),this.decPrivateModes=(0,u.clone)(n)}reset(){this.modes=(0,u.clone)(p),this.decPrivateModes=(0,u.clone)(n)}triggerDataEvent(o,d=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;d&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),d&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,(()=>o.split("").map((C=>C.charCodeAt(0))))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,(()=>o.split("").map((d=>d.charCodeAt(0))))),this._onBinary.fire(o))}};s.CoreService=l=h([f(0,E.IBufferService),f(1,E.ILogService),f(2,E.IOptionsService)],l)},9074:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const h=c(8055),f=c(8460),u=c(844),g=c(6106);let y=0,E=0;class p extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((o=>o==null?void 0:o.marker.line)),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(o){if(o.marker.isDisposed)return;const d=new n(o);if(d){const _=d.marker.onDispose((()=>d.dispose()));d.onDispose((()=>{d&&(this._decorations.delete(d)&&this._onDecorationRemoved.fire(d),_.dispose())})),this._decorations.insert(d),this._onDecorationRegistered.fire(d)}return d}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,d,_){let C=0,S=0;for(const w of this._decorations.getKeyIterator(d))C=w.options.x??0,S=C+(w.options.width??1),o>=C&&o<S&&(!_||(w.options.layer??"bottom")===_)&&(yield w)}forEachDecorationAtCell(o,d,_,C){this._decorations.forEachByKey(d,(S=>{y=S.options.x??0,E=y+(S.options.width??1),o>=y&&o<E&&(!_||(S.options.layer??"bottom")===_)&&C(S)}))}}s.DecorationService=p;class n extends u.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(o){super(),this.options=o,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const h=c(2585),f=c(8343);class u{constructor(...y){this._entries=new Map;for(const[E,p]of y)this.set(E,p)}set(y,E){const p=this._entries.get(y);return this._entries.set(y,E),p}forEach(y){for(const[E,p]of this._entries.entries())y(E,p)}has(y){return this._entries.has(y)}get(y){return this._entries.get(y)}}s.ServiceCollection=u,s.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(g,y){this._services.set(g,y)}getService(g){return this._services.get(g)}createInstance(g,...y){const E=(0,f.getServiceDependencies)(g).sort(((l,o)=>l.index-o.index)),p=[];for(const l of E){const o=this._services.get(l.id);if(!o)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${l.id}.`);p.push(o)}const n=E.length>0?E[0].index:y.length;if(y.length!==n)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${n+1} conflicts with ${y.length} static arguments`);return new g(...y,...p)}}},7866:function(v,s,c){var h=this&&this.__decorate||function(n,l,o,d){var _,C=arguments.length,S=C<3?l:d===null?d=Object.getOwnPropertyDescriptor(l,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(n,l,o,d);else for(var w=n.length-1;w>=0;w--)(_=n[w])&&(S=(C<3?_(S):C>3?_(l,o,S):_(l,o))||S);return C>3&&S&&Object.defineProperty(l,o,S),S},f=this&&this.__param||function(n,l){return function(o,d){l(o,d,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=c(844),g=c(2585),y={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let E,p=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),E=this}_updateLogLevel(){this._logLevel=y[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let l=0;l<n.length;l++)typeof n[l]=="function"&&(n[l]=n[l]())}_log(n,l,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...o)}trace(n,...l){var o;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,n,l)}debug(n,...l){var o;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,n,l)}info(n,...l){var o;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,n,l)}warn(n,...l){var o;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,n,l)}error(n,...l){var o;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,n,l)}};s.LogService=p=h([f(0,g.IOptionsService)],p),s.setTraceLogger=function(n){E=n},s.traceCall=function(n,l,o){if(typeof o.value!="function")throw new Error("not supported");const d=o.value;o.value=function(..._){if(E.logLevel!==g.LogLevelEnum.TRACE)return d.apply(this,_);E.trace(`GlyphRenderer#${d.name}(${_.map((S=>JSON.stringify(S))).join(", ")})`);const C=d.apply(this,_);return E.trace(`GlyphRenderer#${d.name} return`,C),C}}},7302:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const h=c(8460),f=c(844),u=c(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class y extends f.Disposable{constructor(p){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...s.DEFAULT_OPTIONS};for(const l in p)if(l in n)try{const o=p[l];n[l]=this._sanitizeAndValidateOption(l,o)}catch(o){console.error(o)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(p,n){return this.onOptionChange((l=>{l===p&&n(this.rawOptions[p])}))}onMultipleOptionChange(p,n){return this.onOptionChange((l=>{p.indexOf(l)!==-1&&n()}))}_setupOptions(){const p=l=>{if(!(l in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},n=(l,o)=>{if(!(l in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);o=this._sanitizeAndValidateOption(l,o),this.rawOptions[l]!==o&&(this.rawOptions[l]=o,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const o={get:p.bind(this,l),set:n.bind(this,l)};Object.defineProperty(this.options,l,o)}}_sanitizeAndValidateOption(p,n){switch(p){case"cursorStyle":if(n||(n=s.DEFAULT_OPTIONS[p]),!(function(l){return l==="block"||l==="underline"||l==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${p}`);break;case"wordSeparator":n||(n=s.DEFAULT_OPTIONS[p]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=g.includes(n)?n:s.DEFAULT_OPTIONS[p];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${p} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${p} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${p} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${p} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}s.OptionsService=y},2660:function(v,s,c){var h=this&&this.__decorate||function(y,E,p,n){var l,o=arguments.length,d=o<3?E:n===null?n=Object.getOwnPropertyDescriptor(E,p):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(y,E,p,n);else for(var _=y.length-1;_>=0;_--)(l=y[_])&&(d=(o<3?l(d):o>3?l(E,p,d):l(E,p))||d);return o>3&&d&&Object.defineProperty(E,p,d),d},f=this&&this.__param||function(y,E){return function(p,n){E(p,n,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const u=c(2585);let g=s.OscLinkService=class{constructor(y){this._bufferService=y,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(y){const E=this._bufferService.buffer;if(y.id===void 0){const _=E.addMarker(E.ybase+E.y),C={data:y,id:this._nextId++,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(C,_))),this._dataByLinkId.set(C.id,C),C.id}const p=y,n=this._getEntryIdKey(p),l=this._entriesWithId.get(n);if(l)return this.addLineToLink(l.id,E.ybase+E.y),l.id;const o=E.addMarker(E.ybase+E.y),d={id:this._nextId++,key:this._getEntryIdKey(p),data:p,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(d,o))),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(y,E){const p=this._dataByLinkId.get(y);if(p&&p.lines.every((n=>n.line!==E))){const n=this._bufferService.buffer.addMarker(E);p.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(p,n)))}}getLinkData(y){var E;return(E=this._dataByLinkId.get(y))==null?void 0:E.data}_getEntryIdKey(y){return`${y.id};;${y.uri}`}_removeMarkerFromLink(y,E){const p=y.lines.indexOf(E);p!==-1&&(y.lines.splice(p,1),y.lines.length===0&&(y.data.id!==void 0&&this._entriesWithId.delete(y.key),this._dataByLinkId.delete(y.id)))}};s.OscLinkService=g=h([f(0,u.IBufferService)],g)},8343:(v,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",h="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(f){return f[h]||[]},s.createDecorator=function(f){if(s.serviceRegistry.has(f))return s.serviceRegistry.get(f);const u=function(g,y,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,n,l){n[c]===n?n[h].push({id:p,index:l}):(n[h]=[{id:p,index:l}],n[c]=n)})(u,g,E)};return u.toString=()=>f,s.serviceRegistry.set(f,u),u}},2585:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=c(8343);var f;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(f||(s.LogLevelEnum=f={})),s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(v,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=c(8460),f=c(225);class u{static extractShouldJoin(y){return(1&y)!=0}static extractWidth(y){return y>>1&3}static extractCharKind(y){return y>>3}static createPropertyValue(y,E,p=!1){return(16777215&y)<<3|(3&E)<<1|(p?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const y=new f.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(y){if(!this._providers[y])throw new Error(`unknown Unicode version "${y}"`);this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)}register(y){this._providers[y.version]=y}wcwidth(y){return this._activeProvider.wcwidth(y)}getStringCellWidth(y){let E=0,p=0;const n=y.length;for(let l=0;l<n;++l){let o=y.charCodeAt(l);if(55296<=o&&o<=56319){if(++l>=n)return E+this.wcwidth(o);const C=y.charCodeAt(l);56320<=C&&C<=57343?o=1024*(o-55296)+C-56320+65536:E+=this.wcwidth(C)}const d=this.charProperties(o,p);let _=u.extractWidth(d);u.extractShouldJoin(d)&&(_-=u.extractWidth(p)),E+=_,p=d}return E}charProperties(y,E){return this._activeProvider.charProperties(y,E)}}s.UnicodeService=u}},i={};function a(v){var s=i[v];if(s!==void 0)return s.exports;var c=i[v]={exports:{}};return r[v].call(c.exports,c,c.exports,a),c.exports}var m={};return(()=>{var v=m;Object.defineProperty(v,"__esModule",{value:!0}),v.Terminal=void 0;const s=a(9042),c=a(3236),h=a(844),f=a(5741),u=a(8285),g=a(7975),y=a(7090),E=["cols","rows"];class p extends h.Disposable{constructor(l){super(),this._core=this.register(new c.Terminal(l)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const o=_=>this._core.options[_],d=(_,C)=>{this._checkReadonlyOptions(_),this._core.options[_]=C};for(const _ in this._core.options){const C={get:o.bind(this,_),set:d.bind(this,_)};Object.defineProperty(this._publicOptions,_,C)}}_checkReadonlyOptions(l){if(E.includes(l))throw new Error(`Option "${l}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new y.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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const l=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const o in l)this._publicOptions[o]=l[o]}blur(){this._core.blur()}focus(){this._core.focus()}input(l,o=!0){this._core.input(l,o)}resize(l,o){this._verifyIntegers(l,o),this._core.resize(l,o)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}attachCustomWheelEventHandler(l){this._core.attachCustomWheelEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){return this._checkProposedApi(),this._verifyPositiveIntegers(l.x??0,l.width??0,l.height??0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,o,d){this._verifyIntegers(l,o,d),this._core.select(l,o,d)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,o){this._verifyIntegers(l,o),this._core.selectLines(l,o)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,o){this._core.write(l,o)}writeln(l,o){this._core.write(l),this._core.write(`\r
|
|
166
|
+
`,o)}paste(l){this._core.paste(l)}refresh(l,o){this._verifyIntegers(l,o),this._core.refresh(l,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return s}_verifyIntegers(...l){for(const o of l)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const o of l)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}v.Terminal=p})(),m})()))})(ei)),ei.exports}var Ic=kc();/**
|
|
167
167
|
* @license
|
|
168
168
|
* Copyright 2021 Google LLC
|
|
169
169
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
170
|
-
*/function ue(e,t,r){return e?t(e):r==null?void 0:r(e)}function
|
|
171
|
-
`+r.map(function(
|
|
172
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function vr(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var zt=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,o,u,C;if(!this.closed){this.closed=!0;var S=this._parentage;if(S)if(this._parentage=null,Array.isArray(S))try{for(var i=ut(S),l=i.next();!l.done;l=i.next()){var h=l.value;h.remove(this)}}catch(_){t={error:_}}finally{try{l&&!l.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}else S.remove(this);var f=this.initialTeardown;if(ne(f))try{f()}catch(_){C=_ instanceof Ur?_.errors:[_]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var v=ut(d),m=v.next();!m.done;m=v.next()){var E=m.value;try{es(E)}catch(_){C=C??[],_ instanceof Ur?C=Ze(Ze([],Ve(C)),Ve(_.errors)):C.push(_)}}}catch(_){o={error:_}}finally{try{m&&!m.done&&(u=v.return)&&u.call(v)}finally{if(o)throw o.error}}}if(C)throw new Ur(C)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)es(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&vr(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&vr(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),an=zt.EMPTY;function cn(e){return e instanceof zt||e&&"closed"in e&&ne(e.remove)&&ne(e.add)&&ne(e.unsubscribe)}function es(e){ne(e)?e():e.unsubscribe()}var pa={Promise:void 0},ma={setTimeout:function(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];return setTimeout.apply(void 0,Ze([e,t],Ve(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function ln(e){ma.setTimeout(function(){throw e})}function Pt(){}function lr(e){e()}var vi=(function(e){Ye(t,e);function t(r){var o=e.call(this)||this;return o.isStopped=!1,r?(o.destination=r,cn(r)&&r.add(o)):o.destination=ya,o}return t.create=function(r,o,u){return new Ft(r,o,u)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(zt),ba=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(o){er(o)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(o){er(o)}else er(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){er(r)}},e})(),Ft=(function(e){Ye(t,e);function t(r,o,u){var C=e.call(this)||this,S;return ne(r)||!r?S={next:r??void 0,error:o??void 0,complete:u??void 0}:S=r,C.destination=new ba(S),C}return t})(vi);function er(e){ln(e)}function Sa(e){throw e}var ya={closed:!0,next:Pt,error:Sa,complete:Pt},pi=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Zt(e){return e}function Ca(e){return e.length===0?Zt:e.length===1?e[0]:function(r){return e.reduce(function(o,u){return u(o)},r)}}var _e=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,o){var u=this,C=Ea(t)?t:new Ft(t,r,o);return lr(function(){var S=u,i=S.operator,l=S.source;C.add(i?i.call(C,l):l?u._subscribe(C):u._trySubscribe(C))}),C},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var o=this;return r=ts(r),new r(function(u,C){var S=new Ft({next:function(i){try{t(i)}catch(l){C(l),S.unsubscribe()}},error:C,complete:u});o.subscribe(S)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[pi]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Ca(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=ts(t),new t(function(o,u){var C;r.subscribe(function(S){return C=S},function(S){return u(S)},function(){return o(C)})})},e.create=function(t){return new e(t)},e})();function ts(e){var t;return(t=e??pa.Promise)!==null&&t!==void 0?t:Promise}function wa(e){return e&&ne(e.next)&&ne(e.error)&&ne(e.complete)}function Ea(e){return e&&e instanceof vi||wa(e)&&cn(e)}function ka(e){return ne(e==null?void 0:e.lift)}function ge(e){return function(t){if(ka(t))return t.lift(function(r){try{return e(r,this)}catch(o){this.error(o)}});throw new TypeError("Unable to lift unknown Observable type")}}function ce(e,t,r,o,u){return new Ba(e,t,r,o,u)}var Ba=(function(e){Ye(t,e);function t(r,o,u,C,S,i){var l=e.call(this,r)||this;return l.onFinalize=S,l.shouldUnsubscribe=i,l._next=o?function(h){try{o(h)}catch(f){r.error(f)}}:e.prototype._next,l._error=C?function(h){try{C(h)}catch(f){r.error(f)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=u?function(){try{u()}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var o=this.closed;e.prototype.unsubscribe.call(this),!o&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(vi),Ia=on(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ae=(function(e){Ye(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var o=new rs(this,this);return o.operator=r,o},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ia},t.prototype.next=function(r){var o=this;lr(function(){var u,C;if(o._throwIfClosed(),!o.isStopped){o.currentObservers||(o.currentObservers=Array.from(o.observers));try{for(var S=ut(o.currentObservers),i=S.next();!i.done;i=S.next()){var l=i.value;l.next(r)}}catch(h){u={error:h}}finally{try{i&&!i.done&&(C=S.return)&&C.call(S)}finally{if(u)throw u.error}}}})},t.prototype.error=function(r){var o=this;lr(function(){if(o._throwIfClosed(),!o.isStopped){o.hasError=o.isStopped=!0,o.thrownError=r;for(var u=o.observers;u.length;)u.shift().error(r)}})},t.prototype.complete=function(){var r=this;lr(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var o=r.observers;o.length;)o.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var o=this,u=this,C=u.hasError,S=u.isStopped,i=u.observers;return C||S?an:(this.currentObservers=null,i.push(r),new zt(function(){o.currentObservers=null,vr(i,r)}))},t.prototype._checkFinalizedStatuses=function(r){var o=this,u=o.hasError,C=o.thrownError,S=o.isStopped;u?r.error(C):S&&r.complete()},t.prototype.asObservable=function(){var r=new _e;return r.source=this,r},t.create=function(r,o){return new rs(r,o)},t})(_e),rs=(function(e){Ye(t,e);function t(r,o){var u=e.call(this)||this;return u.destination=r,u.source=o,u}return t.prototype.next=function(r){var o,u;(u=(o=this.destination)===null||o===void 0?void 0:o.next)===null||u===void 0||u.call(o,r)},t.prototype.error=function(r){var o,u;(u=(o=this.destination)===null||o===void 0?void 0:o.error)===null||u===void 0||u.call(o,r)},t.prototype.complete=function(){var r,o;(o=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||o===void 0||o.call(r)},t.prototype._subscribe=function(r){var o,u;return(u=(o=this.source)===null||o===void 0?void 0:o.subscribe(r))!==null&&u!==void 0?u:an},t})(Ae),Ra={now:function(){return Date.now()}},Aa=(function(e){Ye(t,e);function t(r,o){return e.call(this)||this}return t.prototype.schedule=function(r,o){return this},t})(zt),is={setInterval:function(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];return setInterval.apply(void 0,Ze([e,t],Ve(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},xa=(function(e){Ye(t,e);function t(r,o){var u=e.call(this,r,o)||this;return u.scheduler=r,u.work=o,u.pending=!1,u}return t.prototype.schedule=function(r,o){var u;if(o===void 0&&(o=0),this.closed)return this;this.state=r;var C=this.id,S=this.scheduler;return C!=null&&(this.id=this.recycleAsyncId(S,C,o)),this.pending=!0,this.delay=o,this.id=(u=this.id)!==null&&u!==void 0?u:this.requestAsyncId(S,this.id,o),this},t.prototype.requestAsyncId=function(r,o,u){return u===void 0&&(u=0),is.setInterval(r.flush.bind(r,this),u)},t.prototype.recycleAsyncId=function(r,o,u){if(u===void 0&&(u=0),u!=null&&this.delay===u&&this.pending===!1)return o;o!=null&&is.clearInterval(o)},t.prototype.execute=function(r,o){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var u=this._execute(r,o);if(u)return u;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,o){var u=!1,C;try{this.work(r)}catch(S){u=!0,C=S||new Error("Scheduled action threw falsy error")}if(u)return this.unsubscribe(),C},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,o=r.id,u=r.scheduler,C=u.actions;this.work=this.state=this.scheduler=null,this.pending=!1,vr(C,this),o!=null&&(this.id=this.recycleAsyncId(u,o,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Aa),ss=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,o){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(o,r)},e.now=Ra.now,e})(),La=(function(e){Ye(t,e);function t(r,o){o===void 0&&(o=ss.now);var u=e.call(this,r,o)||this;return u.actions=[],u._active=!1,u}return t.prototype.flush=function(r){var o=this.actions;if(this._active){o.push(r);return}var u;this._active=!0;do if(u=r.execute(r.state,r.delay))break;while(r=o.shift());if(this._active=!1,u){for(;r=o.shift();)r.unsubscribe();throw u}},t})(ss),Xt=new La(xa),Ta=Xt,dn=new _e(function(e){return e.complete()});function hn(e){return e&&ne(e.schedule)}function mi(e){return e[e.length-1]}function Da(e){return ne(mi(e))?e.pop():void 0}function un(e){return hn(mi(e))?e.pop():void 0}function Oa(e,t){return typeof mi(e)=="number"?e.pop():t}var bi=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function fn(e){return ne(e==null?void 0:e.then)}function _n(e){return ne(e[pi])}function gn(e){return Symbol.asyncIterator&&ne(e==null?void 0:e[Symbol.asyncIterator])}function vn(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Na(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var pn=Na();function mn(e){return ne(e==null?void 0:e[pn])}function bn(e){return Oo(this,arguments,function(){var r,o,u,C;return Ys(this,function(S){switch(S.label){case 0:r=e.getReader(),S.label=1;case 1:S.trys.push([1,,9,10]),S.label=2;case 2:return[4,dt(r.read())];case 3:return o=S.sent(),u=o.value,C=o.done,C?[4,dt(void 0)]:[3,5];case 4:return[2,S.sent()];case 5:return[4,dt(u)];case 6:return[4,S.sent()];case 7:return S.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Sn(e){return ne(e==null?void 0:e.getReader)}function ve(e){if(e instanceof _e)return e;if(e!=null){if(_n(e))return Ma(e);if(bi(e))return Pa(e);if(fn(e))return Fa(e);if(gn(e))return yn(e);if(mn(e))return Ua(e);if(Sn(e))return Va(e)}throw vn(e)}function Ma(e){return new _e(function(t){var r=e[pi]();if(ne(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Pa(e){return new _e(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Fa(e){return new _e(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,ln)})}function Ua(e){return new _e(function(t){var r,o;try{for(var u=ut(e),C=u.next();!C.done;C=u.next()){var S=C.value;if(t.next(S),t.closed)return}}catch(i){r={error:i}}finally{try{C&&!C.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}t.complete()})}function yn(e){return new _e(function(t){Ha(e,t).catch(function(r){return t.error(r)})})}function Va(e){return yn(bn(e))}function Ha(e,t){var r,o,u,C;return Do(this,void 0,void 0,function(){var S,i;return Ys(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),r=No(e),l.label=1;case 1:return[4,r.next()];case 2:if(o=l.sent(),!!o.done)return[3,4];if(S=o.value,t.next(S),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return i=l.sent(),u={error:i},[3,11];case 6:return l.trys.push([6,,9,10]),o&&!o.done&&(C=r.return)?[4,C.call(r)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function it(e,t,r,o,u){o===void 0&&(o=0),u===void 0&&(u=!1);var C=t.schedule(function(){r(),u?e.add(this.schedule(null,o)):this.unsubscribe()},o);if(e.add(C),!u)return C}function Cn(e,t){return t===void 0&&(t=0),ge(function(r,o){r.subscribe(ce(o,function(u){return it(o,e,function(){return o.next(u)},t)},function(){return it(o,e,function(){return o.complete()},t)},function(u){return it(o,e,function(){return o.error(u)},t)}))})}function wn(e,t){return t===void 0&&(t=0),ge(function(r,o){o.add(e.schedule(function(){return r.subscribe(o)},t))})}function $a(e,t){return ve(e).pipe(wn(t),Cn(t))}function Wa(e,t){return ve(e).pipe(wn(t),Cn(t))}function Ga(e,t){return new _e(function(r){var o=0;return t.schedule(function(){o===e.length?r.complete():(r.next(e[o++]),r.closed||this.schedule())})})}function ja(e,t){return new _e(function(r){var o;return it(r,t,function(){o=e[pn](),it(r,t,function(){var u,C,S;try{u=o.next(),C=u.value,S=u.done}catch(i){r.error(i);return}S?r.complete():r.next(C)},0,!0)}),function(){return ne(o==null?void 0:o.return)&&o.return()}})}function En(e,t){if(!e)throw new Error("Iterable cannot be null");return new _e(function(r){it(r,t,function(){var o=e[Symbol.asyncIterator]();it(r,t,function(){o.next().then(function(u){u.done?r.complete():r.next(u.value)})},0,!0)})})}function Ka(e,t){return En(bn(e),t)}function za(e,t){if(e!=null){if(_n(e))return $a(e,t);if(bi(e))return Ga(e,t);if(fn(e))return Wa(e,t);if(gn(e))return En(e,t);if(mn(e))return ja(e,t);if(Sn(e))return Ka(e,t)}throw vn(e)}function kn(e,t){return t?za(e,t):ve(e)}function Za(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=un(e);return kn(e,r)}function Xa(e){return e instanceof Date&&!isNaN(e)}function ke(e,t){return ge(function(r,o){var u=0;r.subscribe(ce(o,function(C){o.next(e.call(t,C,u++))}))})}var Ya=Array.isArray;function Ja(e,t){return Ya(t)?e.apply(void 0,Ze([],Ve(t))):e(t)}function qa(e){return ke(function(t){return Ja(e,t)})}function Qa(e,t,r,o,u,C,S,i){var l=[],h=0,f=0,d=!1,v=function(){d&&!l.length&&!h&&t.complete()},m=function(_){return h<o?E(_):l.push(_)},E=function(_){h++;var s=!1;ve(r(_,f++)).subscribe(ce(t,function(a){t.next(a)},function(){s=!0},void 0,function(){if(s)try{h--;for(var a=function(){var n=l.shift();S||E(n)};l.length&&h<o;)a();v()}catch(n){t.error(n)}}))};return e.subscribe(ce(t,m,function(){d=!0,v()})),function(){}}function et(e,t,r){return r===void 0&&(r=1/0),ne(t)?et(function(o,u){return ke(function(C,S){return t(o,C,u,S)})(ve(e(o,u)))},r):(typeof t=="number"&&(r=t),ge(function(o,u){return Qa(o,u,e,r)}))}function ec(e){return e===void 0&&(e=1/0),et(Zt,e)}function tc(e){return new _e(function(t){ve(e()).subscribe(t)})}var rc={connector:function(){return new Ae},resetOnDisconnect:!0};function qe(e,t){t===void 0&&(t=rc);var r=null,o=t.connector,u=t.resetOnDisconnect,C=u===void 0?!0:u,S=o(),i=new _e(function(l){return S.subscribe(l)});return i.connect=function(){return(!r||r.closed)&&(r=tc(function(){return e}).subscribe(S),C&&r.add(function(){return S=o()})),r},i}var ic=["addListener","removeListener"],sc=["addEventListener","removeEventListener"],nc=["on","off"];function Jr(e,t,r,o){if(ne(r)&&(o=r,r=void 0),o)return Jr(e,t,r).pipe(qa(o));var u=Ve(cc(e)?sc.map(function(i){return function(l){return e[i](t,l,r)}}):oc(e)?ic.map(ns(e,t)):ac(e)?nc.map(ns(e,t)):[],2),C=u[0],S=u[1];if(!C&&bi(e))return et(function(i){return Jr(i,t,r)})(ve(e));if(!C)throw new TypeError("Invalid event target");return new _e(function(i){var l=function(){for(var h=[],f=0;f<arguments.length;f++)h[f]=arguments[f];return i.next(1<h.length?h:h[0])};return C(l),function(){return S(l)}})}function ns(e,t){return function(r){return function(o){return e[r](t,o)}}}function oc(e){return ne(e.addListener)&&ne(e.removeListener)}function ac(e){return ne(e.on)&&ne(e.off)}function cc(e){return ne(e.addEventListener)&&ne(e.removeEventListener)}function Tt(e,t,r){e===void 0&&(e=0),r===void 0&&(r=Ta);var o=-1;return t!=null&&(hn(t)?r=t:o=t),new _e(function(u){var C=Xa(e)?+e-r.now():e;C<0&&(C=0);var S=0;return r.schedule(function(){u.closed||(u.next(S++),0<=o?this.schedule(void 0,o):u.complete())},C)})}function lc(e,t){return t===void 0&&(t=Xt),Tt(e,e,t)}function dc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=un(e),o=Oa(e,1/0),u=e;return u.length?u.length===1?ve(u[0]):ec(o)(kn(u,r)):dn}var hc=Array.isArray;function uc(e){return e.length===1&&hc(e[0])?e[0]:e}function Ne(e,t){return ge(function(r,o){var u=0;r.subscribe(ce(o,function(C){return e.call(t,C,u++)&&o.next(C)}))})}function fc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=uc(e),e.length===1?ve(e[0]):new _e(_c(e))}function _c(e){return function(t){for(var r=[],o=function(C){r.push(ve(e[C]).subscribe(ce(t,function(S){if(r){for(var i=0;i<r.length;i++)i!==C&&r[i].unsubscribe();r=null}t.next(S)})))},u=0;r&&!t.closed&&u<e.length;u++)o(u)}}function gc(e){return ge(function(t,r){var o=null,u=null,C=function(){u==null||u.unsubscribe();var S=o;o=[],S&&r.next(S),ve(e()).subscribe(u=ce(r,C,Pt))};C(),t.subscribe(ce(r,function(S){return o==null?void 0:o.push(S)},function(){o&&r.next(o),r.complete()},void 0,function(){return o=u=null}))})}function Bn(e){return ge(function(t,r){var o=null,u=!1,C;o=t.subscribe(ce(r,void 0,void 0,function(S){C=ve(e(S,Bn(e)(t))),o?(o.unsubscribe(),o=null,C.subscribe(r)):u=!0})),u&&(o.unsubscribe(),o=null,C.subscribe(r))})}function vc(e,t,r,o,u){return function(C,S){var i=r,l=t,h=0;C.subscribe(ce(S,function(f){var d=h++;l=i?e(l,f,d):(i=!0,f),S.next(l)},u))}}function In(e,t){return t===void 0&&(t=Xt),ge(function(r,o){var u=null,C=null,S=null,i=function(){if(u){u.unsubscribe(),u=null;var h=C;C=null,o.next(h)}};function l(){var h=S+e,f=t.now();if(f<h){u=this.schedule(void 0,h-f),o.add(u);return}i()}r.subscribe(ce(o,function(h){C=h,S=t.now(),u||(u=t.schedule(l,e),o.add(u))},function(){i(),o.complete()},void 0,function(){C=u=null}))})}function os(e){return e<=0?function(){return dn}:ge(function(t,r){var o=0;t.subscribe(ce(r,function(u){++o<=e&&(r.next(u),e<=o&&r.complete())}))})}function Rn(e,t){return t===void 0&&(t=Zt),e=e??pc,ge(function(r,o){var u,C=!0;r.subscribe(ce(o,function(S){var i=t(S);(C||!e(u,i))&&(C=!1,u=i,o.next(S))}))})}function pc(e,t){return e===t}function mc(e){return ge(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function bc(e,t){return ge(vc(e,t,arguments.length>=2,!0))}function An(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new Ae}:t,o=e.resetOnError,u=o===void 0?!0:o,C=e.resetOnComplete,S=C===void 0?!0:C,i=e.resetOnRefCountZero,l=i===void 0?!0:i;return function(h){var f,d,v,m=0,E=!1,_=!1,s=function(){d==null||d.unsubscribe(),d=void 0},a=function(){s(),f=v=void 0,E=_=!1},n=function(){var c=f;a(),c==null||c.unsubscribe()};return ge(function(c,g){m++,!_&&!E&&s();var y=v=v??r();g.add(function(){m--,m===0&&!_&&!E&&(d=Vr(n,l))}),y.subscribe(g),!f&&m>0&&(f=new Ft({next:function(b){return y.next(b)},error:function(b){_=!0,s(),d=Vr(a,u,b),y.error(b)},complete:function(){E=!0,s(),d=Vr(a,S),y.complete()}}),ve(c).subscribe(f))})(h)}}function Vr(e,t){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];if(t===!0){e();return}if(t!==!1){var u=new Ft({next:function(){u.unsubscribe(),e()}});return ve(t.apply(void 0,Ze([],Ve(r)))).subscribe(u)}}function Sc(e){return ge(function(t,r){var o=!1,u=ce(r,function(){u==null||u.unsubscribe(),o=!0},Pt);ve(e).subscribe(u),t.subscribe(ce(r,function(C){return o&&r.next(C)}))})}function as(e,t){return ge(function(r,o){var u=null,C=0,S=!1,i=function(){return S&&!u&&o.complete()};r.subscribe(ce(o,function(l){u==null||u.unsubscribe();var h=0,f=C++;ve(e(l,f)).subscribe(u=ce(o,function(d){return o.next(t?t(l,d,f,h++):d)},function(){u=null,i()}))},function(){S=!0,i()}))})}function tr(e,t){return t===void 0&&(t=!1),ge(function(r,o){var u=0;r.subscribe(ce(o,function(C){var S=e(C,u++);(S||t)&&o.next(C),!S&&o.complete()}))})}function yc(e,t,r){var o=ne(e)||t||r?{next:e,error:t,complete:r}:e;return o?ge(function(u,C){var S;(S=o.subscribe)===null||S===void 0||S.call(o);var i=!0;u.subscribe(ce(C,function(l){var h;(h=o.next)===null||h===void 0||h.call(o,l),C.next(l)},function(){var l;i=!1,(l=o.complete)===null||l===void 0||l.call(o),C.complete()},function(l){var h;i=!1,(h=o.error)===null||h===void 0||h.call(o,l),C.error(l)},function(){var l,h;i&&((l=o.unsubscribe)===null||l===void 0||l.call(o)),(h=o.finalize)===null||h===void 0||h.call(o)}))}):Zt}function Cc(e,t){return ge(function(r,o){var u=t??{},C=u.leading,S=C===void 0?!0:C,i=u.trailing,l=i===void 0?!1:i,h=!1,f=null,d=null,v=!1,m=function(){d==null||d.unsubscribe(),d=null,l&&(s(),v&&o.complete())},E=function(){d=null,v&&o.complete()},_=function(a){return d=ve(e(a)).subscribe(ce(o,m,E))},s=function(){if(h){h=!1;var a=f;f=null,o.next(a),!v&&_(a)}};r.subscribe(ce(o,function(a){h=!0,f=a,!(d&&!d.closed)&&(S?s():_(a))},function(){v=!0,!(l&&h&&d&&!d.closed)&&o.complete()}))})}function cs(e,t,r){t===void 0&&(t=Xt);var o=Tt(e,t);return Cc(function(){return o},r)}function Hr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Da(e);return ge(function(o,u){for(var C=e.length,S=new Array(C),i=e.map(function(){return!1}),l=!1,h=function(d){ve(e[d]).subscribe(ce(u,function(v){S[d]=v,!l&&!i[d]&&(i[d]=!0,(l=i.every(Zt))&&(i=null))},Pt))},f=0;f<C;f++)h(f);o.subscribe(ce(u,function(d){if(l){var v=Ze([d],Ve(S));u.next(r?r.apply(void 0,Ze([],Ve(v))):v)}}))})}/**
|
|
170
|
+
*/function ue(e,t,r){return e?t(e):r==null?void 0:r(e)}function ie(e){return typeof e=="function"}function Wn(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var ti=Wn(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
171
|
+
`+r.map(function(i,a){return a+1+") "+i.toString()}).join(`
|
|
172
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function Ir(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var rr=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,a,m;if(!this.closed){this.closed=!0;var v=this._parentage;if(v)if(this._parentage=null,Array.isArray(v))try{for(var s=Ct(v),c=s.next();!c.done;c=s.next()){var h=c.value;h.remove(this)}}catch(p){t={error:p}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else v.remove(this);var f=this.initialTeardown;if(ie(f))try{f()}catch(p){m=p instanceof ti?p.errors:[p]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var g=Ct(u),y=g.next();!y.done;y=g.next()){var E=y.value;try{Rs(E)}catch(p){m=m??[],p instanceof ti?m=Qe(Qe([],Ge(m)),Ge(p.errors)):m.push(p)}}}catch(p){i={error:p}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}}if(m)throw new ti(m)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Rs(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Ir(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Ir(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Gn=rr.EMPTY;function Kn(e){return e instanceof rr||e&&"closed"in e&&ie(e.remove)&&ie(e.add)&&ie(e.unsubscribe)}function Rs(e){ie(e)?e():e.unsubscribe()}var Bc={Promise:void 0},Ac={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Qe([e,t],Ge(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Zn(e){Ac.setTimeout(function(){throw e})}function Zt(){}function br(e){e()}var Mi=(function(e){rt(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,Kn(r)&&r.add(i)):i.destination=Lc,i}return t.create=function(r,i,a){return new zt(r,i,a)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(rr),Rc=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){dr(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){dr(i)}else dr(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){dr(r)}},e})(),zt=(function(e){rt(t,e);function t(r,i,a){var m=e.call(this)||this,v;return ie(r)||!r?v={next:r??void 0,error:i??void 0,complete:a??void 0}:v=r,m.destination=new Rc(v),m}return t})(Mi);function dr(e){Zn(e)}function xc(e){throw e}var Lc={closed:!0,next:Zt,error:xc,complete:Zt},Fi=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ir(e){return e}function Tc(e){return e.length===0?ir:e.length===1?e[0]:function(r){return e.reduce(function(i,a){return a(i)},r)}}var pe=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var a=this,m=Oc(t)?t:new zt(t,r,i);return br(function(){var v=a,s=v.operator,c=v.source;m.add(s?s.call(m,c):c?a._subscribe(m):a._trySubscribe(m))}),m},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=xs(r),new r(function(a,m){var v=new zt({next:function(s){try{t(s)}catch(c){m(c),v.unsubscribe()}},error:m,complete:a});i.subscribe(v)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Fi]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return Tc(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=xs(t),new t(function(i,a){var m;r.subscribe(function(v){return m=v},function(v){return a(v)},function(){return i(m)})})},e.create=function(t){return new e(t)},e})();function xs(e){var t;return(t=e??Bc.Promise)!==null&&t!==void 0?t:Promise}function Dc(e){return e&&ie(e.next)&&ie(e.error)&&ie(e.complete)}function Oc(e){return e&&e instanceof Mi||Dc(e)&&Kn(e)}function Nc(e){return ie(e==null?void 0:e.lift)}function _e(e){return function(t){if(Nc(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function ce(e,t,r,i,a){return new Mc(e,t,r,i,a)}var Mc=(function(e){rt(t,e);function t(r,i,a,m,v,s){var c=e.call(this,r)||this;return c.onFinalize=v,c.shouldUnsubscribe=s,c._next=i?function(h){try{i(h)}catch(f){r.error(f)}}:e.prototype._next,c._error=m?function(h){try{m(h)}catch(f){r.error(f)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=a?function(){try{a()}catch(h){r.error(h)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(Mi),Fc=Wn(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Te=(function(e){rt(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new Ls(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new Fc},t.prototype.next=function(r){var i=this;br(function(){var a,m;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var v=Ct(i.currentObservers),s=v.next();!s.done;s=v.next()){var c=s.value;c.next(r)}}catch(h){a={error:h}}finally{try{s&&!s.done&&(m=v.return)&&m.call(v)}finally{if(a)throw a.error}}}})},t.prototype.error=function(r){var i=this;br(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var a=i.observers;a.length;)a.shift().error(r)}})},t.prototype.complete=function(){var r=this;br(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,a=this,m=a.hasError,v=a.isStopped,s=a.observers;return m||v?Gn:(this.currentObservers=null,s.push(r),new rr(function(){i.currentObservers=null,Ir(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,a=i.hasError,m=i.thrownError,v=i.isStopped;a?r.error(m):v&&r.complete()},t.prototype.asObservable=function(){var r=new pe;return r.source=this,r},t.create=function(r,i){return new Ls(r,i)},t})(pe),Ls=(function(e){rt(t,e);function t(r,i){var a=e.call(this)||this;return a.destination=r,a.source=i,a}return t.prototype.next=function(r){var i,a;(a=(i=this.destination)===null||i===void 0?void 0:i.next)===null||a===void 0||a.call(i,r)},t.prototype.error=function(r){var i,a;(a=(i=this.destination)===null||i===void 0?void 0:i.error)===null||a===void 0||a.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,a;return(a=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&a!==void 0?a:Gn},t})(Te),Pc={now:function(){return Date.now()}},Uc=(function(e){rt(t,e);function t(r,i){return e.call(this)||this}return t.prototype.schedule=function(r,i){return this},t})(rr),Ts={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setInterval.apply(void 0,Qe([e,t],Ge(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},Vc=(function(e){rt(t,e);function t(r,i){var a=e.call(this,r,i)||this;return a.scheduler=r,a.work=i,a.pending=!1,a}return t.prototype.schedule=function(r,i){var a;if(i===void 0&&(i=0),this.closed)return this;this.state=r;var m=this.id,v=this.scheduler;return m!=null&&(this.id=this.recycleAsyncId(v,m,i)),this.pending=!0,this.delay=i,this.id=(a=this.id)!==null&&a!==void 0?a:this.requestAsyncId(v,this.id,i),this},t.prototype.requestAsyncId=function(r,i,a){return a===void 0&&(a=0),Ts.setInterval(r.flush.bind(r,this),a)},t.prototype.recycleAsyncId=function(r,i,a){if(a===void 0&&(a=0),a!=null&&this.delay===a&&this.pending===!1)return i;i!=null&&Ts.clearInterval(i)},t.prototype.execute=function(r,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var a=this._execute(r,i);if(a)return a;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,i){var a=!1,m;try{this.work(r)}catch(v){a=!0,m=v||new Error("Scheduled action threw falsy error")}if(a)return this.unsubscribe(),m},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,i=r.id,a=r.scheduler,m=a.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ir(m,this),i!=null&&(this.id=this.recycleAsyncId(a,i,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Uc),Ds=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,i){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(i,r)},e.now=Pc.now,e})(),Hc=(function(e){rt(t,e);function t(r,i){i===void 0&&(i=Ds.now);var a=e.call(this,r,i)||this;return a.actions=[],a._active=!1,a}return t.prototype.flush=function(r){var i=this.actions;if(this._active){i.push(r);return}var a;this._active=!0;do if(a=r.execute(r.state,r.delay))break;while(r=i.shift());if(this._active=!1,a){for(;r=i.shift();)r.unsubscribe();throw a}},t})(Ds),sr=new Hc(Vc),$c=sr,zn=new pe(function(e){return e.complete()});function Yn(e){return e&&ie(e.schedule)}function Pi(e){return e[e.length-1]}function Wc(e){return ie(Pi(e))?e.pop():void 0}function jn(e){return Yn(Pi(e))?e.pop():void 0}function Gc(e,t){return typeof Pi(e)=="number"?e.pop():t}var Ui=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function Xn(e){return ie(e==null?void 0:e.then)}function Jn(e){return ie(e[Fi])}function qn(e){return Symbol.asyncIterator&&ie(e==null?void 0:e[Symbol.asyncIterator])}function Qn(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Kc(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var eo=Kc();function to(e){return ie(e==null?void 0:e[eo])}function ro(e){return Ga(this,arguments,function(){var r,i,a,m;return On(this,function(v){switch(v.label){case 0:r=e.getReader(),v.label=1;case 1:v.trys.push([1,,9,10]),v.label=2;case 2:return[4,St(r.read())];case 3:return i=v.sent(),a=i.value,m=i.done,m?[4,St(void 0)]:[3,5];case 4:return[2,v.sent()];case 5:return[4,St(a)];case 6:return[4,v.sent()];case 7:return v.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function io(e){return ie(e==null?void 0:e.getReader)}function be(e){if(e instanceof pe)return e;if(e!=null){if(Jn(e))return Zc(e);if(Ui(e))return zc(e);if(Xn(e))return Yc(e);if(qn(e))return so(e);if(to(e))return jc(e);if(io(e))return Xc(e)}throw Qn(e)}function Zc(e){return new pe(function(t){var r=e[Fi]();if(ie(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function zc(e){return new pe(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Yc(e){return new pe(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Zn)})}function jc(e){return new pe(function(t){var r,i;try{for(var a=Ct(e),m=a.next();!m.done;m=a.next()){var v=m.value;if(t.next(v),t.closed)return}}catch(s){r={error:s}}finally{try{m&&!m.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}t.complete()})}function so(e){return new pe(function(t){Jc(e,t).catch(function(r){return t.error(r)})})}function Xc(e){return so(ro(e))}function Jc(e,t){var r,i,a,m;return Wa(this,void 0,void 0,function(){var v,s;return On(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Ka(e),c.label=1;case 1:return[4,r.next()];case 2:if(i=c.sent(),!!i.done)return[3,4];if(v=i.value,t.next(v),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),a={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(m=r.return)?[4,m.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function ut(e,t,r,i,a){i===void 0&&(i=0),a===void 0&&(a=!1);var m=t.schedule(function(){r(),a?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(m),!a)return m}function no(e,t){return t===void 0&&(t=0),_e(function(r,i){r.subscribe(ce(i,function(a){return ut(i,e,function(){return i.next(a)},t)},function(){return ut(i,e,function(){return i.complete()},t)},function(a){return ut(i,e,function(){return i.error(a)},t)}))})}function oo(e,t){return t===void 0&&(t=0),_e(function(r,i){i.add(e.schedule(function(){return r.subscribe(i)},t))})}function qc(e,t){return be(e).pipe(oo(t),no(t))}function Qc(e,t){return be(e).pipe(oo(t),no(t))}function el(e,t){return new pe(function(r){var i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}function tl(e,t){return new pe(function(r){var i;return ut(r,t,function(){i=e[eo](),ut(r,t,function(){var a,m,v;try{a=i.next(),m=a.value,v=a.done}catch(s){r.error(s);return}v?r.complete():r.next(m)},0,!0)}),function(){return ie(i==null?void 0:i.return)&&i.return()}})}function ao(e,t){if(!e)throw new Error("Iterable cannot be null");return new pe(function(r){ut(r,t,function(){var i=e[Symbol.asyncIterator]();ut(r,t,function(){i.next().then(function(a){a.done?r.complete():r.next(a.value)})},0,!0)})})}function rl(e,t){return ao(ro(e),t)}function il(e,t){if(e!=null){if(Jn(e))return qc(e,t);if(Ui(e))return el(e,t);if(Xn(e))return Qc(e,t);if(qn(e))return ao(e,t);if(to(e))return tl(e,t);if(io(e))return rl(e,t)}throw Qn(e)}function co(e,t){return t?il(e,t):be(e)}function sl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=jn(e);return co(e,r)}function nl(e){return e instanceof Date&&!isNaN(e)}function Ae(e,t){return _e(function(r,i){var a=0;r.subscribe(ce(i,function(m){i.next(e.call(t,m,a++))}))})}var ol=Array.isArray;function al(e,t){return ol(t)?e.apply(void 0,Qe([],Ge(t))):e(t)}function cl(e){return Ae(function(t){return al(e,t)})}function ll(e,t,r,i,a,m,v,s){var c=[],h=0,f=0,u=!1,g=function(){u&&!c.length&&!h&&t.complete()},y=function(p){return h<i?E(p):c.push(p)},E=function(p){h++;var n=!1;be(r(p,f++)).subscribe(ce(t,function(l){t.next(l)},function(){n=!0},void 0,function(){if(n)try{h--;for(var l=function(){var o=c.shift();v||E(o)};c.length&&h<i;)l();g()}catch(o){t.error(o)}}))};return e.subscribe(ce(t,y,function(){u=!0,g()})),function(){}}function ct(e,t,r){return r===void 0&&(r=1/0),ie(t)?ct(function(i,a){return Ae(function(m,v){return t(i,m,a,v)})(be(e(i,a)))},r):(typeof t=="number"&&(r=t),_e(function(i,a){return ll(i,a,e,r)}))}function dl(e){return e===void 0&&(e=1/0),ct(ir,e)}function hl(e){return new pe(function(t){be(e()).subscribe(t)})}var ul={connector:function(){return new Te},resetOnDisconnect:!0};function nt(e,t){t===void 0&&(t=ul);var r=null,i=t.connector,a=t.resetOnDisconnect,m=a===void 0?!0:a,v=i(),s=new pe(function(c){return v.subscribe(c)});return s.connect=function(){return(!r||r.closed)&&(r=hl(function(){return e}).subscribe(v),m&&r.add(function(){return v=i()})),r},s}var fl=["addListener","removeListener"],gl=["addEventListener","removeEventListener"],pl=["on","off"];function pi(e,t,r,i){if(ie(r)&&(i=r,r=void 0),i)return pi(e,t,r).pipe(cl(i));var a=Ge(ml(e)?gl.map(function(s){return function(c){return e[s](t,c,r)}}):_l(e)?fl.map(Os(e,t)):vl(e)?pl.map(Os(e,t)):[],2),m=a[0],v=a[1];if(!m&&Ui(e))return ct(function(s){return pi(s,t,r)})(be(e));if(!m)throw new TypeError("Invalid event target");return new pe(function(s){var c=function(){for(var h=[],f=0;f<arguments.length;f++)h[f]=arguments[f];return s.next(1<h.length?h:h[0])};return m(c),function(){return v(c)}})}function Os(e,t){return function(r){return function(i){return e[r](t,i)}}}function _l(e){return ie(e.addListener)&&ie(e.removeListener)}function vl(e){return ie(e.on)&&ie(e.off)}function ml(e){return ie(e.addEventListener)&&ie(e.removeEventListener)}function Ht(e,t,r){e===void 0&&(e=0),r===void 0&&(r=$c);var i=-1;return t!=null&&(Yn(t)?r=t:i=t),new pe(function(a){var m=nl(e)?+e-r.now():e;m<0&&(m=0);var v=0;return r.schedule(function(){a.closed||(a.next(v++),0<=i?this.schedule(void 0,i):a.complete())},m)})}function bl(e,t){return t===void 0&&(t=sr),Ht(e,e,t)}function Sl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=jn(e),i=Gc(e,1/0),a=e;return a.length?a.length===1?be(a[0]):dl(i)(co(a,r)):zn}var yl=Array.isArray;function Cl(e){return e.length===1&&yl(e[0])?e[0]:e}function Fe(e,t){return _e(function(r,i){var a=0;r.subscribe(ce(i,function(m){return e.call(t,m,a++)&&i.next(m)}))})}function wl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=Cl(e),e.length===1?be(e[0]):new pe(El(e))}function El(e){return function(t){for(var r=[],i=function(m){r.push(be(e[m]).subscribe(ce(t,function(v){if(r){for(var s=0;s<r.length;s++)s!==m&&r[s].unsubscribe();r=null}t.next(v)})))},a=0;r&&!t.closed&&a<e.length;a++)i(a)}}function kl(e){return _e(function(t,r){var i=null,a=null,m=function(){a==null||a.unsubscribe();var v=i;i=[],v&&r.next(v),be(e()).subscribe(a=ce(r,m,Zt))};m(),t.subscribe(ce(r,function(v){return i==null?void 0:i.push(v)},function(){i&&r.next(i),r.complete()},void 0,function(){return i=a=null}))})}function lo(e){return _e(function(t,r){var i=null,a=!1,m;i=t.subscribe(ce(r,void 0,void 0,function(v){m=be(e(v,lo(e)(t))),i?(i.unsubscribe(),i=null,m.subscribe(r)):a=!0})),a&&(i.unsubscribe(),i=null,m.subscribe(r))})}function Il(e,t,r,i,a){return function(m,v){var s=r,c=t,h=0;m.subscribe(ce(v,function(f){var u=h++;c=s?e(c,f,u):(s=!0,f),v.next(c)},a))}}function ho(e,t){return t===void 0&&(t=sr),_e(function(r,i){var a=null,m=null,v=null,s=function(){if(a){a.unsubscribe(),a=null;var h=m;m=null,i.next(h)}};function c(){var h=v+e,f=t.now();if(f<h){a=this.schedule(void 0,h-f),i.add(a);return}s()}r.subscribe(ce(i,function(h){m=h,v=t.now(),a||(a=t.schedule(c,e),i.add(a))},function(){s(),i.complete()},void 0,function(){m=a=null}))})}function Ns(e){return e<=0?function(){return zn}:_e(function(t,r){var i=0;t.subscribe(ce(r,function(a){++i<=e&&(r.next(a),e<=i&&r.complete())}))})}function uo(e,t){return t===void 0&&(t=ir),e=e??Bl,_e(function(r,i){var a,m=!0;r.subscribe(ce(i,function(v){var s=t(v);(m||!e(a,s))&&(m=!1,a=s,i.next(v))}))})}function Bl(e,t){return e===t}function Al(e){return _e(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function Rl(e,t){return _e(Il(e,t,arguments.length>=2,!0))}function fo(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new Te}:t,i=e.resetOnError,a=i===void 0?!0:i,m=e.resetOnComplete,v=m===void 0?!0:m,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(h){var f,u,g,y=0,E=!1,p=!1,n=function(){u==null||u.unsubscribe(),u=void 0},l=function(){n(),f=g=void 0,E=p=!1},o=function(){var d=f;l(),d==null||d.unsubscribe()};return _e(function(d,_){y++,!p&&!E&&n();var C=g=g??r();_.add(function(){y--,y===0&&!p&&!E&&(u=ri(o,c))}),C.subscribe(_),!f&&y>0&&(f=new zt({next:function(S){return C.next(S)},error:function(S){p=!0,n(),u=ri(l,a,S),C.error(S)},complete:function(){E=!0,n(),u=ri(l,v),C.complete()}}),be(d).subscribe(f))})(h)}}function ri(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t===!0){e();return}if(t!==!1){var a=new zt({next:function(){a.unsubscribe(),e()}});return be(t.apply(void 0,Qe([],Ge(r)))).subscribe(a)}}function xl(e){return _e(function(t,r){var i=!1,a=ce(r,function(){a==null||a.unsubscribe(),i=!0},Zt);be(e).subscribe(a),t.subscribe(ce(r,function(m){return i&&r.next(m)}))})}function Ms(e,t){return _e(function(r,i){var a=null,m=0,v=!1,s=function(){return v&&!a&&i.complete()};r.subscribe(ce(i,function(c){a==null||a.unsubscribe();var h=0,f=m++;be(e(c,f)).subscribe(a=ce(i,function(u){return i.next(t?t(c,u,f,h++):u)},function(){a=null,s()}))},function(){v=!0,s()}))})}function hr(e,t){return t===void 0&&(t=!1),_e(function(r,i){var a=0;r.subscribe(ce(i,function(m){var v=e(m,a++);(v||t)&&i.next(m),!v&&i.complete()}))})}function Ll(e,t,r){var i=ie(e)||t||r?{next:e,error:t,complete:r}:e;return i?_e(function(a,m){var v;(v=i.subscribe)===null||v===void 0||v.call(i);var s=!0;a.subscribe(ce(m,function(c){var h;(h=i.next)===null||h===void 0||h.call(i,c),m.next(c)},function(){var c;s=!1,(c=i.complete)===null||c===void 0||c.call(i),m.complete()},function(c){var h;s=!1,(h=i.error)===null||h===void 0||h.call(i,c),m.error(c)},function(){var c,h;s&&((c=i.unsubscribe)===null||c===void 0||c.call(i)),(h=i.finalize)===null||h===void 0||h.call(i)}))}):ir}function Tl(e,t){return _e(function(r,i){var a=t??{},m=a.leading,v=m===void 0?!0:m,s=a.trailing,c=s===void 0?!1:s,h=!1,f=null,u=null,g=!1,y=function(){u==null||u.unsubscribe(),u=null,c&&(n(),g&&i.complete())},E=function(){u=null,g&&i.complete()},p=function(l){return u=be(e(l)).subscribe(ce(i,y,E))},n=function(){if(h){h=!1;var l=f;f=null,i.next(l),!g&&p(l)}};r.subscribe(ce(i,function(l){h=!0,f=l,!(u&&!u.closed)&&(v?n():p(l))},function(){g=!0,!(c&&h&&u&&!u.closed)&&i.complete()}))})}function Fs(e,t,r){t===void 0&&(t=sr);var i=Ht(e,t);return Tl(function(){return i},r)}function ii(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Wc(e);return _e(function(i,a){for(var m=e.length,v=new Array(m),s=e.map(function(){return!1}),c=!1,h=function(u){be(e[u]).subscribe(ce(a,function(g){v[u]=g,!c&&!s[u]&&(s[u]=!0,(c=s.every(ir))&&(s=null))},Zt))},f=0;f<m;f++)h(f);i.subscribe(ce(a,function(u){if(c){var g=Qe([u],Ge(v));a.next(r?r.apply(void 0,Qe([],Ge(g))):g)}}))})}/**
|
|
173
173
|
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
|
|
174
174
|
* @license MIT
|
|
175
|
-
*/const
|
|
175
|
+
*/const Dl=2,Ol=1;class Nl{constructor(){}activate(t){this._terminal=t}dispose(){}fit(t){const r=this.proposeDimensions();if(t!==void 0&&r&&(r.rows=t),!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;const i=this._terminal._core;return(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(i._renderService.clear(),this._terminal.resize(r.cols,r.rows)),r}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const t=this.getCore(),r=t._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:t.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),m=parseInt(a.getPropertyValue("height")),v=Math.max(0,parseInt(a.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),c={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},h=c.top+c.bottom,f=c.right+c.left,u=m-h,g=v-f-i,{width:y,height:E}=this.getCellSize();return{cols:Math.max(Dl,Math.floor(g/y)),rows:Math.max(Ol,Math.floor(u/E))}}getCellSize(){const{value:t}=this.getCore()._renderService._renderer;return{width:t._charSizeService.width+Math.round(t._optionsService.rawOptions.letterSpacing),height:Math.floor(t._charSizeService.height*t._optionsService.rawOptions.lineHeight)}}getCore(){return this._terminal._core}}let _i;async function ye(e,t,r){var a;const i={type:t,output:r};return await((a=e.postMessage)==null?void 0:a.call(e,i))}function Ml(e,t){var r;return((r=e.onDidReceiveMessage)==null?void 0:r.call(e,t))??{dispose:()=>{}}}function Be(){if(!_i)throw new Error("Renderer context not defined");return _i}function go(e){_i=e}var Q=(e=>(e.infoMessage="common:infoMessage",e.errorMessage="common:errorMessage",e.closeCellOutput="common:closeCellOutput",e.displayPrompt="common:displayPrompt",e.onPrompt="common:onPrompt",e.setState="common:setState",e.getState="common:getState",e.onGetState="common:onGetState",e.onCategoryChange="common:onCategoryChange",e.platformApiRequest="common:platformApiRequest",e.platformApiResponse="common:platformApiResponse",e.optionsMessage="common:optionsMessage",e.optionsModal="common:optionsModal",e.openExternalLink="common:openExternalLink",e.onOptionsMessage="common:onOptionsMessage",e.copyTextToClipboard="common:copyTextToClipboard",e.onCopyTextToClipboard="common:onCopyTextToClipboard",e.onProgramClose="common:onProgramClose",e.denoUpdate="deno:deploymentUpdate",e.denoPromote="deno:promoteDeployment",e.vercelProd="vercel:promotePreview",e.mutateAnnotations="annotations:mutate",e.terminalStdout="terminal:stdout",e.terminalStderr="terminal:stderr",e.terminalStdin="terminal:stdin",e.terminalResize="terminal:resize",e.terminalFocus="terminal:focus",e.terminalOpen="terminal:open",e.openLink="terminal:openLink",e.activeThemeChanged="theme:changed",e.githubWorkflowDispatch="github:workflowDispatch",e.githubWorkflowDeploy="github:workflowDeploy",e.githubWorkflowStatusUpdate="github:workflowStatusUpdate",e.tangleEvent="tangle:event",e.gcpResourceStatusChanged="gcp:resourceStatusChanged",e.gcpClusterCheckStatus="gcp:clusterCheckStatus",e.gcpClusterDetails="gcp:clusterDetails",e.gcpClusterDetailsNewCell="gcp:clusterDetailsNewCell",e.gcpClusterDetailsResponse="gcp:clusterDetailsResponse",e.gcpVMInstanceAction="gcp:gceVMInstanceAction",e.awsEC2Instances="aws:ec2Instances",e.awsEC2InstanceAction="aws:ec2InstanceAction",e.awsEKSClusterAction="aws:eksClusterAction",e.onAuthorModeChange="common:onAuthorModeChange",e.gistCell="gist:cell",e.gcpCloudRunAction="gcp:cloudRunAction",e.gcpLoadServices="gcp:loadServices",e.gcpServicesLoaded="gcp:servicesLoaded",e.daggerSyncState="dagger:syncState",e.daggerCliAction="dagger:cliAction",e.featuresUpdateAction="features:updateAction",e.featuresRequest="features:request",e.featuresResponse="features:response",e))(Q||{}),po=(e=>(e.vercel="stateful.runme/vercel-stdout",e.deno="stateful.runme/deno-stdout",e.outputItems="stateful.runme/output-items",e.annotations="stateful.runme/annotations",e.terminal="stateful.runme/terminal",e.error="stateful.runme/error",e.github="stateful.runme/github-stdout",e.stdout="application/vnd.code.notebook.stdout",e.gcp="stateful.runme/gcp",e.aws="stateful.runme/aws",e.daggerCall="stateful.runme/dagger",e.daggerShell="stateful.runme/dagger",e))(po||{}),_o=(e=>(e.RunmeCloud="runme.cloud",e.RunmeChat="runme.chat",e.RunmeSearch="runme.search",e.NotebookEnvStore="runme.notebook.envStore",e))(_o||{});function Fl({}){}function Pl(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function Ul(e){const r=new Date().getTime()-e.getTime(),i=Math.floor(r/1e3)*-1,a=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(i)<60?a.format(Math.round(i),"second"):Math.abs(i)<3600?a.format(Math.round(i/60),"minute"):Math.abs(i)<86400?a.format(Math.round(i/3600),"hour"):a.format(Math.round(i/86400),"day")}const Vl=Y`
|
|
176
176
|
<svg
|
|
177
177
|
class="icon"
|
|
178
178
|
width="16"
|
|
@@ -187,7 +187,7 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
187
187
|
d="M13.353 1.146L14.853 2.646L15 3V14.5L14.5 15H1.5L1 14.5V1.5L1.5 1H13L13.353 1.146ZM2 2V14H14V3.208L12.793 2H11V6H4V2H2ZM8 2V5H10V2H8Z"
|
|
188
188
|
/>
|
|
189
189
|
</svg>
|
|
190
|
-
`,
|
|
190
|
+
`,Hl=Y`<svg
|
|
191
191
|
class="icon"
|
|
192
192
|
width="16"
|
|
193
193
|
height="16"
|
|
@@ -200,18 +200,18 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
200
200
|
clip-rule="evenodd"
|
|
201
201
|
d="M11.9564 6H12.0063C12.8003 6 13.5617 6.31607 14.1231 6.87868C14.6845 7.44129 14.9999 8.20435 14.9999 9C14.9999 9.79565 14.6845 10.5587 14.1231 11.1213C13.5617 11.6839 12.8003 12 12.0063 12H10.0106V11H12.0063C12.5356 11 13.0432 10.7893 13.4175 10.4142C13.7918 10.0391 14.002 9.53044 14.002 9C14.002 8.46957 13.7918 7.96086 13.4175 7.58579C13.0432 7.21072 12.5356 7 12.0063 7H11.0923L10.9686 6.143C10.8937 5.60541 10.6455 5.10711 10.2617 4.72407C9.87792 4.34103 9.37968 4.09427 8.84295 4.02143C8.30621 3.94859 7.76044 4.05365 7.28883 4.3206C6.81723 4.58754 6.44567 5.00173 6.23082 5.5L5.89754 6.262L5.08929 6.073C4.90378 6.02699 4.71361 6.0025 4.52251 6C3.8609 6 3.22639 6.2634 2.75856 6.73224C2.29073 7.20108 2.02791 7.83696 2.02791 8.5C2.02791 9.16304 2.29073 9.79893 2.75856 10.2678C3.22639 10.7366 3.8609 11 4.52251 11H7.01712V12H4.52251C4.02742 12.0043 3.53708 11.903 3.08401 11.7029C2.63095 11.5028 2.22551 11.2084 1.8946 10.8394C1.56369 10.4703 1.31487 10.0349 1.16465 9.56211C1.01442 9.08932 0.966218 8.58992 1.02324 8.09704C1.08026 7.60416 1.24121 7.12906 1.49539 6.70326C1.74958 6.27745 2.0912 5.91068 2.4976 5.62727C2.904 5.34385 3.36588 5.15027 3.85261 5.05937C4.33935 4.96847 4.8398 4.98232 5.32079 5.1C5.62405 4.40501 6.14506 3.82799 6.8049 3.45635C7.46474 3.08472 8.22745 2.9387 8.97752 3.04044C9.72759 3.14217 10.4241 3.4861 10.9617 4.02014C11.4992 4.55418 11.8484 5.24923 11.9564 6ZM10.2928 9.85348L8.97879 8.53944L8.97879 13.9749H7.98492L7.98493 8.57568L6.7071 9.85347L5.99999 9.14636L8.14643 6.99998H8.85354L10.9999 9.14637L10.2928 9.85348Z"
|
|
202
202
|
/>
|
|
203
|
-
</svg>`;var
|
|
203
|
+
</svg>`;var $l=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,pt=(e,t,r,i)=>{for(var a=i>1?void 0:i?Wl(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&$l(t,r,a),a};let Ke=class extends we{constructor(){super(...arguments),this.text="Copy",this.loadingText="Saving...",this.loading=!1,this.disabled=!1}onClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent(this.disabled?"onClickDisabled":"onClick");this.dispatchEvent(t)}render(){const e=this.text.toLocaleLowerCase();return Y`
|
|
204
204
|
<vscode-button
|
|
205
205
|
?disabled=${this.loading}
|
|
206
206
|
class=${e}
|
|
207
207
|
appearance="secondary"
|
|
208
208
|
@click=${this.onClick}
|
|
209
209
|
>
|
|
210
|
-
${ue(this.shareIcon,()=>
|
|
211
|
-
${ue(this.saveIcon,()=>
|
|
212
|
-
${ue(this.loading,()=>
|
|
210
|
+
${ue(this.shareIcon,()=>Hl)}
|
|
211
|
+
${ue(this.saveIcon,()=>Vl)}
|
|
212
|
+
${ue(this.loading,()=>Y`${this.loadingText}`,()=>Y`${this.text}`)}
|
|
213
213
|
</vscode-button>
|
|
214
|
-
`}};
|
|
214
|
+
`}};Ke.styles=Ne`
|
|
215
215
|
vscode-button {
|
|
216
216
|
color: var(--vscode-button-foreground);
|
|
217
217
|
background-color: var(--vscode-button-background);
|
|
@@ -231,7 +231,7 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
231
231
|
margin: 0 5px 0 -5px;
|
|
232
232
|
padding: 0;
|
|
233
233
|
}
|
|
234
|
-
`;
|
|
234
|
+
`;pt([j({type:String})],Ke.prototype,"text",2);pt([j({type:String})],Ke.prototype,"loadingText",2);pt([j({type:Boolean,reflect:!0})],Ke.prototype,"loading",2);pt([j({type:Boolean,reflect:!0})],Ke.prototype,"disabled",2);pt([j({type:Boolean,reflect:!0})],Ke.prototype,"shareIcon",2);pt([j({type:Boolean,reflect:!0})],Ke.prototype,"saveIcon",2);Ke=pt([xe("action-button")],Ke);const Ps=Y`
|
|
235
235
|
<svg
|
|
236
236
|
height="16"
|
|
237
237
|
aria-hidden="true"
|
|
@@ -246,19 +246,19 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
246
246
|
d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"
|
|
247
247
|
></path>
|
|
248
248
|
</svg>
|
|
249
|
-
`;var
|
|
249
|
+
`;var Gl=Object.defineProperty,Kl=Object.getOwnPropertyDescriptor,Vi=(e,t,r,i)=>{for(var a=i>1?void 0:i?Kl(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&Gl(t,r,a),a};let Yt=class extends we{constructor(){super(...arguments),this.text="Preview & Gist",this.disabled=!1}onGistClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onGist");this.dispatchEvent(t)}render(){const e=this.text.toLocaleLowerCase();return ue(this.disabled,()=>Y`
|
|
250
250
|
<vscode-button class=${e} disabled appearance="secondary">
|
|
251
|
-
${
|
|
251
|
+
${Ps} ${this.text}
|
|
252
252
|
</vscode-button>
|
|
253
|
-
`,()=>
|
|
253
|
+
`,()=>Y`
|
|
254
254
|
<vscode-button
|
|
255
255
|
class=${e}
|
|
256
256
|
appearance="secondary"
|
|
257
257
|
@click=${this.onGistClick}
|
|
258
258
|
>
|
|
259
|
-
${
|
|
259
|
+
${Ps} ${this.text}
|
|
260
260
|
</vscode-button>
|
|
261
|
-
`)}};
|
|
261
|
+
`)}};Yt.styles=Ne`
|
|
262
262
|
vscode-button {
|
|
263
263
|
color: var(--vscode-button-foreground);
|
|
264
264
|
background-color: var(--vscode-button-background);
|
|
@@ -278,7 +278,7 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
278
278
|
margin: 0 5px 0 -5px;
|
|
279
279
|
padding: 0;
|
|
280
280
|
}
|
|
281
|
-
`;
|
|
281
|
+
`;Vi([j({type:String})],Yt.prototype,"text",2);Vi([j({type:Boolean,reflect:!0})],Yt.prototype,"disabled",2);Yt=Vi([xe("gist-cell")],Yt);const vo=Y`
|
|
282
282
|
<svg
|
|
283
283
|
width="16"
|
|
284
284
|
height="16"
|
|
@@ -294,15 +294,15 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
294
294
|
fill="currentColor"
|
|
295
295
|
/>
|
|
296
296
|
</svg>
|
|
297
|
-
`;var
|
|
297
|
+
`;var Zl=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,Hi=(e,t,r,i)=>{for(var a=i>1?void 0:i?zl(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&Zl(t,r,a),a};let jt=class extends we{constructor(){super(...arguments),this.openText="Open",this.disabled=!1}onOpenClick(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onOpen");this.dispatchEvent(t)}render(){const e=this.openText.toLocaleLowerCase();return ue(this.disabled,()=>{},()=>Y`
|
|
298
298
|
<vscode-button
|
|
299
299
|
class=${e}
|
|
300
300
|
appearance="secondary"
|
|
301
301
|
@click=${this.onOpenClick}
|
|
302
302
|
>
|
|
303
|
-
${
|
|
303
|
+
${vo} ${this.openText}
|
|
304
304
|
</vscode-button>
|
|
305
|
-
`)}};
|
|
305
|
+
`)}};jt.styles=Ne`
|
|
306
306
|
vscode-button {
|
|
307
307
|
color: var(--vscode-button-foreground);
|
|
308
308
|
background-color: var(--vscode-button-background);
|
|
@@ -319,7 +319,7 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
319
319
|
margin: 0 5px 0 -5px;
|
|
320
320
|
padding: 0;
|
|
321
321
|
}
|
|
322
|
-
`;
|
|
322
|
+
`;Hi([j({type:String})],jt.prototype,"openText",2);Hi([j({type:Boolean,reflect:!0})],jt.prototype,"disabled",2);jt=Hi([xe("open-cell")],jt);var Yl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,$i=(e,t,r,i)=>{for(var a=i>1?void 0:i?jl(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&Yl(t,r,a),a};let Br=class extends we{constructor(){super(...arguments),this.loading=!1,this.signedIn=!1}handleClick(e){e.defaultPrevented&&e.preventDefault(),this.dispatchEvent(new CustomEvent("onClick"))}render(){let e=this.signedIn?"Save":"Save to Cloud";return Y`
|
|
323
323
|
<action-button
|
|
324
324
|
?loading=${this.loading}
|
|
325
325
|
text="${e}"
|
|
@@ -327,7 +327,7 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
327
327
|
@onClick="${this.handleClick}"
|
|
328
328
|
>
|
|
329
329
|
</action-button>
|
|
330
|
-
`}}
|
|
330
|
+
`}};$i([j({type:Boolean,reflect:!0})],Br.prototype,"loading",2);$i([j({type:Boolean,reflect:!0})],Br.prototype,"signedIn",2);Br=$i([xe("save-button")],Br);var Xl=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,mo=(e,t,r,i)=>{for(var a=i>1?void 0:i?Jl(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&Xl(t,r,a),a};let vi=class extends we{constructor(){super(...arguments),this.loading=!1}handleClick(e){e.defaultPrevented&&e.preventDefault(),this.dispatchEvent(new CustomEvent("onClick"))}render(){return Y`
|
|
331
331
|
<action-button
|
|
332
332
|
?loading=${this.loading}
|
|
333
333
|
text="Share"
|
|
@@ -335,7 +335,7 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
335
335
|
@onClick="${this.handleClick}"
|
|
336
336
|
>
|
|
337
337
|
</action-button>
|
|
338
|
-
`}};
|
|
338
|
+
`}};mo([j({type:Boolean,reflect:!0})],vi.prototype,"loading",2);vi=mo([xe("share-button")],vi);const ql=Ne`
|
|
339
339
|
:host {
|
|
340
340
|
--vscode-font-weight: normal;
|
|
341
341
|
--vscode-font-size: 13px;
|
|
@@ -943,7 +943,7 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
943
943
|
--vscode-widget-border: #303031;
|
|
944
944
|
--vscode-activityBarBadge-background: #007acc;
|
|
945
945
|
}
|
|
946
|
-
`,
|
|
946
|
+
`,Ql=Ne`
|
|
947
947
|
:host {
|
|
948
948
|
--vscode-font-weight: normal;
|
|
949
949
|
--vscode-font-size: 13px;
|
|
@@ -1486,53 +1486,53 @@ WARNING: This link could potentially be dangerous`)){const a=window.open();if(a)
|
|
|
1486
1486
|
--vscode-widget-border: #e5e5e5;
|
|
1487
1487
|
--vscode-activityBarBadge-background: #005fb8;
|
|
1488
1488
|
}
|
|
1489
|
-
`;var
|
|
1489
|
+
`;var ed=Object.defineProperty,td=Object.getOwnPropertyDescriptor,bo=e=>{throw TypeError(e)},le=(e,t,r,i)=>{for(var a=i>1?void 0:i?td(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&ed(t,r,a),a},rd=(e,t,r)=>t.has(e)||bo("Cannot "+r),id=(e,t,r)=>t.has(e)?bo("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),re=(e,t,r)=>(rd(e,t,"access private method"),r),te,Nr,So,yo,Sr,je,mi,Co,wo,bi,Eo,Si,ko,Io,Bo,Ao,Ro,xo,Lo,To,Do=(e=>(e.OpenLink="Open",e.CopyToClipboard="Copy to clipboard",e.Cancel="Cancel",e))(Do||{});const yt=(...e)=>`--vscode-${e.join("-")}`,bt=e=>yt("terminal",e),sd=e=>`ansi${e.charAt(0).toUpperCase()+e.slice(1)}`,nd=["terminal:","theme:",Q.platformApiRequest,Q.platformApiResponse,Q.onOptionsMessage,Q.optionsMessage,Q.onCopyTextToClipboard,Q.onProgramClose,Q.featuresResponse,Q.featuresUpdateAction],od=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],ad="console-view";let se=class extends we{constructor(){super(),id(this,te),this.copyText="Copy",this.disposables=[],this.rows=10,this.isShareReady=!1,this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.windowSize={height:window.innerHeight,width:window.innerWidth}}applyThemeStyles(){if(this.shadowRoot){if(this.themeStyleSheet){const e=this.shadowRoot.adoptedStyleSheets.indexOf(this.themeStyleSheet);e!==-1&&(this.shadowRoot.adoptedStyleSheets=this.shadowRoot.adoptedStyleSheets.filter((t,r)=>r!==e)),this.themeStyleSheet=void 0}this.theme==="dark"?(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(ql.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet]):this.theme==="light"&&(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(Ql.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet])}}connectedCallback(){var h;if(super.connectedCallback(),this.applyThemeStyles(),!this.id)throw new Error("No id provided to terminal!");this.rows=this.initialRows??this.rows;const{rows:e,cursorBlink:t,fontSize:r,cursorStyle:i,cursorWidth:a,fontFamily:m,smoothScrollDuration:v,scrollback:s}=this;this.terminal=new Ic.Terminal({rows:e,fontSize:r,fontFamily:m,scrollback:s,cursorWidth:a,cursorBlink:t,cursorStyle:i,smoothScrollDuration:v,disableStdin:!1,convertEol:!0,allowProposedApi:!0,drawBoldTextInBrightColors:!1}),this.initialContent&&((h=this.terminal)==null||h.write(this.initialContent)),this.fitAddon=new Nl,this.fitAddon.activate(this.terminal),this.serializer=new bc.SerializeAddon,this.terminal.loadAddon(this.serializer),this.terminal.loadAddon(new Cc.Unicode11Addon),this.terminal.loadAddon(new Ec.WebLinksAddon(re(this,te,Ro).bind(this))),this.terminal.attachCustomKeyEventHandler(f=>{var u;if(f.shiftKey&&f.ctrlKey&&f.code==="KeyC"){const g=(u=this==null?void 0:this.terminal)==null?void 0:u.getSelection();if(g)return navigator.clipboard.writeText(g),!1}return!0}),this.terminal.unicode.activeVersion="11",this.terminal.options.drawBoldTextInBrightColors;const c=Be();this.disposables.push(Ml(c,async f=>{var u;if(nd.some(g=>f.type.startsWith(g)))switch(f.type){case Q.activeThemeChanged:re(this,te,Sr).call(this);break;case Q.terminalStdout:case Q.terminalStderr:{const{"runme.dev/id":g,data:y}=f.output;if(g!==this.id)return;this.isShareReady=!1,this.terminal.write(y),this.requestUpdate()}break;case Q.platformApiResponse:{if(f.output.id!==this.id)return;if(this.isLoading=!1,f.output.hasErrors)return ye(c,Q.errorMessage,f.output.data);if(f.output.data.hasOwnProperty("displayShare")&&f.output.data.displayShare===!1)return;const g=((u=f.output.data)==null?void 0:u.data)||{};if(g.createExtensionCellOutput||g.createCellExecution){const y=g.createCellExecution||g.createExtensionCellOutput||{},{exitCode:E,id:p,htmlUrl:n,isSlackReady:l}=y;return this.platformId=p,this.shareUrl=n||"",this.exitCode=E,this.isSlackReady=!!l,this.isShareReady=!0,ye(c,Q.tangleEvent,{webviewId:_o.RunmeCloud,data:{cellId:p}})}if(g.updateCellOutput){const{updateCellOutput:{exitCode:y,isSlackReady:E}}=g;this.isUpdatedReady=!0,this.exitCode=y,this.isSlackReady=!!E,re(this,te,Eo).call(this)}g.createEscalation&&(this.escalationUrl=g.createEscalation.escalationUrl)}break;case Q.onOptionsMessage:{if(f.output.id!==this.id)return;const g=f.output.option;switch(this.isLoading=!1,g){case"Open":return ye(c,Q.openExternalLink,{link:this.shareUrl,telemetryEvent:"app.openLink"});case"Copy to clipboard":return ye(c,Q.copyTextToClipboard,{id:this.id,text:this.shareUrl})}}break;case Q.onCopyTextToClipboard:return f.output.id!==this.id?void 0:ye(c,Q.infoMessage,"Link copied!");case Q.onProgramClose:{const{"runme.dev/id":g,code:y}=f.output;if(g!==this.id)return;this.exitCode=y;return}}}),this.terminal.onData(f=>ye(c,Q.terminalStdin,{"runme.dev/id":this.id,input:f}))),ye(c,Q.featuresRequest,{})}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}updated(e){super.updated(e),e.has("theme")&&(this.applyThemeStyles(),re(this,te,Sr).call(this))}firstUpdated(e){var m;super.firstUpdated(e);const t=re(this,te,yo).call(this);this.takeFocus&&window.addEventListener("focus",()=>{re(this,te,bi).call(this)}),window.addEventListener("click",()=>{re(this,te,bi).call(this,!1)}),this.terminal.open(t),this.takeFocus&&this.terminal.focus(),re(this,te,Nr).call(this),re(this,te,Sr).call(this);const r=re(this,te,So).call(this),i=new pe(v=>{window.addEventListener("resize",()=>v.next(re(this,te,mi).call(this,!0))),t.addEventListener("mouseup",()=>v.next(re(this,te,mi).call(this,!1)))}).pipe(fo());re(this,te,Co).call(this,i),re(this,te,wo).call(this,i),t.appendChild(r);const a=Be();a.postMessage&&ye(a,Q.terminalOpen,{"runme.dev/id":this.id,terminalDimensions:Oo((m=this.fitAddon)==null?void 0:m.proposeDimensions())}),this.lastLine&&this.terminal.scrollToLine(this.lastLine)}render(){const i=Y`
|
|
1490
1490
|
<close-cell-button
|
|
1491
|
-
@closed="${()=>
|
|
1491
|
+
@closed="${()=>Fl({id:this.id,outputType:po.terminal})}"
|
|
1492
1492
|
></close-cell-button>
|
|
1493
1493
|
<div class="button-group">
|
|
1494
1494
|
<copy-button
|
|
1495
1495
|
copyText="${this.copyText}"
|
|
1496
|
-
@onCopy="${async()=>re(this,te,
|
|
1496
|
+
@onCopy="${async()=>re(this,te,To).call(this)}"
|
|
1497
1497
|
></copy-button>
|
|
1498
|
-
${ue(!0,()=>
|
|
1499
|
-
@onGist="${re(this,te,
|
|
1498
|
+
${ue(!0,()=>Y`<gist-cell
|
|
1499
|
+
@onGist="${re(this,te,Bo)}"
|
|
1500
1500
|
></gist-cell>`,()=>{})}
|
|
1501
|
-
${ue(this.shouldRenderSaveButton(),()=>
|
|
1501
|
+
${ue(this.shouldRenderSaveButton(),()=>Y`<save-button
|
|
1502
1502
|
?loading=${this.isLoading}
|
|
1503
1503
|
?signedIn=${!1}
|
|
1504
|
-
@onClick="${re(this,te,
|
|
1504
|
+
@onClick="${re(this,te,Si)}"
|
|
1505
1505
|
>
|
|
1506
1506
|
</save-button>`,()=>{})}
|
|
1507
|
-
${ue(this.shouldRenderShareButton(),()=>
|
|
1507
|
+
${ue(this.shouldRenderShareButton(),()=>Y`<share-button
|
|
1508
1508
|
?loading=${this.isLoading}
|
|
1509
|
-
@onClick="${re(this,te,
|
|
1509
|
+
@onClick="${re(this,te,Si)}"
|
|
1510
1510
|
>
|
|
1511
1511
|
</share-button>`,()=>{})}
|
|
1512
|
-
${ue(!1,()=>
|
|
1512
|
+
${ue(!1,()=>Y`<action-button
|
|
1513
1513
|
?loading=${this.isCreatingEscalation}
|
|
1514
1514
|
?saveIcon="${!0}"
|
|
1515
1515
|
text="Escalate"
|
|
1516
|
-
@onClick="${re(this,te,
|
|
1517
|
-
@onClickDisabled=${re(this,te,
|
|
1516
|
+
@onClick="${re(this,te,ko)}"
|
|
1517
|
+
@onClickDisabled=${re(this,te,Lo)}
|
|
1518
1518
|
>
|
|
1519
1519
|
</action-button>`,()=>{})}
|
|
1520
|
-
${ue(!1,()=>
|
|
1520
|
+
${ue(!1,()=>Y`<action-button
|
|
1521
1521
|
?saveIcon="${!0}"
|
|
1522
1522
|
text="Open Escalation"
|
|
1523
|
-
@onClick="${re(this,te
|
|
1523
|
+
@onClick="${re(this,te,Io)}"
|
|
1524
1524
|
>
|
|
1525
1525
|
</action-button>`,()=>{})}
|
|
1526
|
-
${ue(this.platformId&&!this.isLoading,()=>
|
|
1526
|
+
${ue(this.platformId&&!this.isLoading,()=>Y`<open-cell
|
|
1527
1527
|
?disabled=${!this.isPlatformAuthEnabled}
|
|
1528
|
-
@onOpen="${re(this,te,
|
|
1528
|
+
@onOpen="${re(this,te,xo)}"
|
|
1529
1529
|
></open-cell>`,()=>{})}
|
|
1530
1530
|
</div>
|
|
1531
|
-
`;return
|
|
1531
|
+
`;return Y`<section>
|
|
1532
1532
|
<div id="terminal"></div>
|
|
1533
|
-
${ue(this.buttons,()=>
|
|
1534
|
-
</section>`}dispose(){this.disposables.forEach(({dispose:
|
|
1535
|
-
Open Dashboard to configure it`)};
|
|
1533
|
+
${ue(this.buttons,()=>i)}
|
|
1534
|
+
</section>`}dispose(){this.disposables.forEach(({dispose:e})=>e())}shouldRenderSaveButton(){return!1}shouldRenderShareButton(){return!1}};te=new WeakSet;Nr=function(e){var t;return e!==void 0&&(this.rows=e),(t=this.fitAddon)==null?void 0:t.fit(this.rows)};So=function(){const e=document.createElement("div");e.setAttribute("class","xterm-drag-handle");let t;const r=m=>{var v;t={initialClientY:m.clientY,initialRows:this.rows},m.preventDefault(),(v=this.terminal)==null||v.focus()},i=()=>{t!==void 0&&(t=void 0)},a=m=>{var h;if(t===void 0||!this.fitAddon)return;const s=(m.clientY-t.initialClientY)/this.fitAddon.getCellSize().height,c=Math.round(t.initialRows+s);c!==this.rows&&(re(this,te,Nr).call(this,c),(h=this.terminal)==null||h.focus())};return e.addEventListener("mousedown",r),window.addEventListener("mouseup",i),window.addEventListener("mousemove",a),this.disposables.push({dispose:()=>{e.removeEventListener("mousedown",r),window.removeEventListener("mouseup",i),window.removeEventListener("mousemove",a)}}),e};yo=function(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("#terminal")};Sr=function(){const e=re(this,te,je).call(this,bt("foreground")),t={foreground:e,cursor:re(this,te,je).call(this,yt("terminalCursor","foreground"))||e,cursorAccent:re(this,te,je).call(this,yt("terminalCursor","background")),selectionForeground:re(this,te,je).call(this,bt("selectionForeground")),selectionBackground:re(this,te,je).call(this,bt("selectionBackground")),selectionInactiveBackground:re(this,te,je).call(this,bt("inactiveSelectionBackground")),...Object.fromEntries(od.map(r=>[r,re(this,te,je).call(this,bt(sd(r)))]))};this.terminal.options.theme=t};je=function(e){var r;const t=(r=this.shadowRoot)==null?void 0:r.querySelector("#terminal");return getComputedStyle(t).getPropertyValue(e)??void 0};mi=function(e){if(!this.fitAddon)return;const{innerWidth:t,innerHeight:r}=window;if(e&&Math.abs(this.windowSize.width-t)<=Number.EPSILON&&Math.abs(this.windowSize.height-r)<=Number.EPSILON)return;this.windowSize.width=t;const i=re(this,te,Nr).call(this);if(i)return Oo(i)};Co=async function(e){const r=e.pipe(Fe(i=>!!i),uo(),ho(100)).subscribe(async i=>{const a=Be();a.postMessage&&await ye(a,Q.terminalResize,{"runme.dev/id":this.id,terminalDimensions:i})});this.disposables.push({dispose:()=>r.unsubscribe()})};wo=async function(e){const r=e.pipe(Ae(i=>i==null?void 0:i.rows),Fe(i=>!!i),uo(),ho(100)).subscribe(async i=>{const a=Be();a.postMessage&&a.postMessage({type:Q.mutateAnnotations,output:{annotations:{"runme.dev/id":this.id,terminalRows:i}}})});this.disposables.push({dispose:()=>r.unsubscribe()})};bi=async function(e=!0){var r;e&&((r=this.terminal)==null||r.focus());const t=Be();t.postMessage&&await ye(t,Q.terminalFocus,{"runme.dev/id":this.id})};Eo=async function(){const e=Be();if(!(!e.postMessage||!this.shareUrl))return ye(e,Q.optionsMessage,{title:'Please share link with caution. Anyone with the link has access. Click "Open" to toggle visibility.',options:Object.values(Do),id:this.id,telemetryEvent:"app.share"})};Si=async function(){return re(this,te,Ao).call(this,!0)};ko=async function(){this.isCreatingEscalation=!0};Io=async function(){const e=Be();if(this.escalationUrl)return ye(e,Q.openLink,this.escalationUrl)};Bo=function(){const e=Be();if(e.postMessage)return ye(e,Q.gistCell,{cellId:this.id,telemetryEvent:"app.cellGist"})};Ao=async function(e){Be().postMessage};Ro=function(e,t){ye(Be(),Q.openLink,t)};xo=function(){ye(Be(),Q.openLink,this.shareUrl)};Lo=function(){ye(Be(),Q.errorMessage,`There is no Slack integration configured yet.
|
|
1535
|
+
Open Dashboard to configure it`)};To=function(){var r;const e=Be();if(!e.postMessage)return;const t=cd(((r=this.serializer)==null?void 0:r.serialize({excludeModes:!0,excludeAltBuffer:!0}))??"");return navigator.clipboard.writeText(t).then(()=>{this.copyText="Copied!",this.requestUpdate()}).catch(i=>ye(e,Q.infoMessage,`Failed to copy to clipboard: ${i.message}!`))};se.styles=Ne`
|
|
1536
1536
|
.xterm {
|
|
1537
1537
|
cursor: text;
|
|
1538
1538
|
position: relative;
|
|
@@ -1588,7 +1588,7 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
1588
1588
|
}
|
|
1589
1589
|
|
|
1590
1590
|
.xterm .xterm-viewport {
|
|
1591
|
-
background-color: var(${
|
|
1591
|
+
background-color: var(${Mt(bt("background"))}) !important;
|
|
1592
1592
|
border: solid 1px var(--vscode-terminal-border);
|
|
1593
1593
|
/* On OS X this is required in order for the scroll bar to appear fully opaque */
|
|
1594
1594
|
overflow-y: scroll;
|
|
@@ -1621,19 +1621,19 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
1621
1621
|
|
|
1622
1622
|
.xterm:hover .xterm-viewport::-webkit-scrollbar-thumb {
|
|
1623
1623
|
background-color: var(
|
|
1624
|
-
${
|
|
1624
|
+
${Mt(yt("scrollbarSlider","background"))}
|
|
1625
1625
|
);
|
|
1626
1626
|
}
|
|
1627
1627
|
|
|
1628
1628
|
.xterm:hover .xterm-viewport::-webkit-scrollbar-thumb:hover {
|
|
1629
1629
|
background-color: var(
|
|
1630
|
-
${
|
|
1630
|
+
${Mt(yt("scrollbarSlider","hoverBackground"))}
|
|
1631
1631
|
);
|
|
1632
1632
|
}
|
|
1633
1633
|
|
|
1634
1634
|
.xterm:hover .xterm-viewport::-webkit-scrollbar-thumb:active {
|
|
1635
1635
|
background-color: var(
|
|
1636
|
-
${
|
|
1636
|
+
${Mt(yt("scrollbarSlider","activeBackground"))}
|
|
1637
1637
|
);
|
|
1638
1638
|
}
|
|
1639
1639
|
|
|
@@ -1772,24 +1772,24 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
1772
1772
|
.xterm-bg-7 {
|
|
1773
1773
|
background-color: var(--vscode-editor-selectionBackground) !important;
|
|
1774
1774
|
}
|
|
1775
|
-
`;le([G({type:String})],exports.ConsoleView.prototype,"id",2);le([G({type:Boolean,converter:e=>e!=="false"})],exports.ConsoleView.prototype,"buttons",2);le([G({type:Boolean,converter:e=>e!=="false"})],exports.ConsoleView.prototype,"takeFocus",2);le([G({type:String})],exports.ConsoleView.prototype,"theme",2);le([G({type:String})],exports.ConsoleView.prototype,"fontFamily",2);le([G({type:Number})],exports.ConsoleView.prototype,"fontSize",2);le([G({type:String})],exports.ConsoleView.prototype,"cursorStyle",2);le([G({type:Boolean})],exports.ConsoleView.prototype,"cursorBlink",2);le([G({type:Number})],exports.ConsoleView.prototype,"cursorWidth",2);le([G({type:Number})],exports.ConsoleView.prototype,"smoothScrollDuration",2);le([G({type:Number})],exports.ConsoleView.prototype,"scrollback",2);le([G({type:String})],exports.ConsoleView.prototype,"initialContent",2);le([G({type:Number})],exports.ConsoleView.prototype,"initialRows",2);le([G({type:Number})],exports.ConsoleView.prototype,"lastLine",2);le([G({type:Boolean})],exports.ConsoleView.prototype,"isLoading",2);le([G({type:Boolean})],exports.ConsoleView.prototype,"isCreatingEscalation",2);le([G()],exports.ConsoleView.prototype,"shareUrl",2);le([G()],exports.ConsoleView.prototype,"escalationUrl",2);le([G({type:Boolean})],exports.ConsoleView.prototype,"isUpdatedReady",2);le([G({type:Boolean})],exports.ConsoleView.prototype,"isAutoSaveEnabled",2);le([G({type:Boolean})],exports.ConsoleView.prototype,"isPlatformAuthEnabled",2);le([G({type:Boolean})],exports.ConsoleView.prototype,"isDaggerOutput",2);exports.ConsoleView=le([Ie(Jc)],exports.ConsoleView);function Yn(e){if(!e)return;const{rows:t,cols:r}=e;return{columns:r,rows:t}}function qc(e){return e.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"")}function mr(e){let t=!1;const r=[];for(let o=0;o<e.length;o++){let u=e.charAt(o);switch(u){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(u),t=!1;break;default:t&&(t=!1,u=u.toUpperCase()),r.push(u);break}}return r.join("")}const Qc=new Set(["constructor","toString","toJSON","valueOf"]);function Ht(e){return Qc.has(e)?e+"$":e}function el(){let e=0,t=0;for(let o=0;o<28;o+=7){let u=this.buf[this.pos++];if(e|=(u&127)<<o,(u&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let o=3;o<=31;o+=7){let u=this.buf[this.pos++];if(t|=(u&127)<<o,(u&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}const hr=4294967296;function ds(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let o=0,u=0;function C(S,i){const l=Number(e.slice(S,i));u*=r,o=o*r+l,o>=hr&&(u=u+(o/hr|0),o=o%hr)}return C(-24,-18),C(-18,-12),C(-12,-6),C(-6),t?qn(o,u):wi(o,u)}function tl(e,t){let r=wi(e,t);const o=r.hi&2147483648;o&&(r=qn(r.lo,r.hi));const u=Jn(r.lo,r.hi);return o?"-"+u:u}function Jn(e,t){if({lo:e,hi:t}=rl(e,t),t<=2097151)return String(hr*t+e);const r=e&16777215,o=(e>>>24|t<<8)&16777215,u=t>>16&65535;let C=r+o*6777216+u*6710656,S=o+u*8147497,i=u*2;const l=1e7;return C>=l&&(S+=Math.floor(C/l),C%=l),S>=l&&(i+=Math.floor(S/l),S%=l),i.toString()+hs(S)+hs(C)}function rl(e,t){return{lo:e>>>0,hi:t>>>0}}function wi(e,t){return{lo:e|0,hi:t|0}}function qn(e,t){return t=~t,e?e=~e+1:t+=1,wi(e,t)}const hs=e=>{const t=String(e);return"0000000".slice(t.length)+t};function il(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function sl(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const Se=nl();function nl(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const r=BigInt("-9223372036854775808"),o=BigInt("9223372036854775807"),u=BigInt("0"),C=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(S){const i=typeof S=="bigint"?S:BigInt(S);if(i>o||i<r)throw new Error(`invalid int64: ${S}`);return i},uParse(S){const i=typeof S=="bigint"?S:BigInt(S);if(i>C||i<u)throw new Error(`invalid uint64: ${S}`);return i},enc(S){return e.setBigInt64(0,this.parse(S),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(S){return e.setBigInt64(0,this.uParse(S),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(S,i){return e.setInt32(0,S,!0),e.setInt32(4,i,!0),e.getBigInt64(0,!0)},uDec(S,i){return e.setInt32(0,S,!0),e.setInt32(4,i,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),us(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),fs(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),us(r),ds(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),fs(r),ds(r)},dec(r,o){return tl(r,o)},uDec(r,o){return Jn(r,o)}}}function us(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function fs(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var U;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(U||(U={}));function $t(e,t){switch(e){case U.STRING:return"";case U.BOOL:return!1;case U.DOUBLE:case U.FLOAT:return 0;case U.INT64:case U.UINT64:case U.SFIXED64:case U.FIXED64:case U.SINT64:return t?"0":Se.zero;case U.BYTES:return new Uint8Array(0);default:return 0}}function ol(e,t){switch(e){case U.BOOL:return t===!1;case U.STRING:return t==="";case U.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const Qn=2,Ue=Symbol.for("reflect unsafe local");function al(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(o=>o.localName===r)}function cl(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=Qn)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!ol(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function Wt(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function ll(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function dl(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function hl(e,t){const r=t.localName;if(t.oneof){const o=t.oneof.localName;e[o].case===r&&(e[o]={case:void 0})}else if(t.presence!=Qn)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=$t(t.scalar,t.longAsString);break}}function Ei(e){for(const t of e.field)Wt(t,"jsonName")||(t.jsonName=mr(t.name));e.nestedType.forEach(Ei)}function ul(e,t){const r=e.values.find(o=>o.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function fl(e,t){switch(e){case U.STRING:return t;case U.BYTES:{const r=_l(t);if(r===!1)throw new Error(`cannot parse ${U[e]} default value: ${t}`);return r}case U.INT64:case U.SFIXED64:case U.SINT64:return Se.parse(t);case U.UINT64:case U.FIXED64:return Se.uParse(t);case U.DOUBLE:case U.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case U.BOOL:return t==="true";case U.INT32:case U.UINT32:case U.SINT32:case U.FIXED32:case U.SFIXED32:return parseInt(t,10)}}function _l(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(o){if(this.tail.length>=o){const u=this.tail.substring(0,o);return this.tail=this.tail.substring(o),u}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const o=r.c,u=r.take(2);if(u===!1)return!1;const C=parseInt(o+u,8);if(Number.isNaN(C))return!1;t.push(C);break}case"x":{const o=r.c,u=r.take(2);if(u===!1)return!1;const C=parseInt(o+u,16);if(Number.isNaN(C))return!1;t.push(C);break}case"u":{const o=r.c,u=r.take(4);if(u===!1)return!1;const C=parseInt(o+u,16);if(Number.isNaN(C))return!1;const S=new Uint8Array(4);new DataView(S.buffer).setInt32(0,C,!0),t.push(S[0],S[1],S[2],S[3]);break}case"U":{const o=r.c,u=r.take(8);if(u===!1)return!1;const C=Se.uEnc(o+u),S=new Uint8Array(8),i=new DataView(S.buffer);i.setInt32(0,C.lo,!0),i.setInt32(4,C.hi,!0),t.push(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*ii(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*ii(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*ii(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function eo(...e){const t=gl();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)ps(r,t);return t}if("$typeName"in e[0]){let C=function(S){const i=[];for(const l of S.dependency){if(t.getFile(l)!=null||u.has(l))continue;const h=o(l);if(!h)throw new Error(`Unable to resolve ${l}, imported by ${S.name}`);"kind"in h?t.addFile(h,!1,!0):(u.add(h.name),i.push(h))}return i.concat(...i.map(C))};const r=e[0],o=e[1],u=new Set;for(const S of[r,...C(r)].reverse())ps(S,t)}else for(const r of e)for(const o of r.files)t.addFile(o);return t}function gl(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(o,u,C){if(r.set(o.proto.name,o),!u)for(const S of ii(o))this.add(S);if(C)for(const S of o.dependencies)this.addFile(S,u,C)},add(o){if(o.kind=="extension"){let u=t.get(o.extendee.typeName);u||t.set(o.extendee.typeName,u=new Map),u.set(o.number,o)}e.set(o.typeName,o)},get(o){return e.get(o)},getFile(o){return r.get(o)},getMessage(o){const u=e.get(o);return(u==null?void 0:u.kind)=="message"?u:void 0},getEnum(o){const u=e.get(o);return(u==null?void 0:u.kind)=="enum"?u:void 0},getExtension(o){const u=e.get(o);return(u==null?void 0:u.kind)=="extension"?u:void 0},getExtensionFor(o,u){var C;return(C=t.get(o.typeName))===null||C===void 0?void 0:C.get(u)},getService(o){const u=e.get(o);return(u==null?void 0:u.kind)=="service"?u:void 0}}}const vl=998,pl=999,ml=9,Gt=10,Dt=11,bl=12,_s=14,ki=3,Sl=2,gs=1,yl=0,$r=1,vs=2,Cl=3,wl=1,El=2,kl=1,to={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function ps(e,t){var r,o;const u={kind:"file",proto:e,deprecated:(o=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&o!==void 0?o:!1,edition:Al(e),name:e.name.replace(/\.proto$/,""),dependencies:xl(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},C=new Map,S={get(i){return C.get(i)},add(i){var l;xe(((l=i.proto.options)===null||l===void 0?void 0:l.mapEntry)===!0),C.set(i.typeName,i)}};for(const i of e.enumType)ro(i,u,void 0,t);for(const i of e.messageType)io(i,u,void 0,t,S);for(const i of e.service)Bl(i,u,t);si(u,t);for(const i of C.values())ni(i,t,S);for(const i of u.messages)ni(i,t,S),si(i,t);t.addFile(u,!0)}function si(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const o=oi(r,e,t);e.extensions.push(o),t.add(o)}break;case"message":for(const r of e.proto.extension){const o=oi(r,e,t);e.nestedExtensions.push(o),t.add(o)}for(const r of e.nestedMessages)si(r,t);break}}function ni(e,t,r){const o=e.proto.oneofDecl.map(C=>Rl(C,e)),u=new Set;for(const C of e.proto.field){const S=Dl(C,o),i=oi(C,e,t,S,r);e.fields.push(i),e.field[i.localName]=i,S===void 0?e.members.push(i):(S.fields.push(i),u.has(S)||(u.add(S),e.members.push(S)))}for(const C of o.filter(S=>u.has(S)))e.oneofs.push(C);for(const C of e.nestedMessages)ni(C,t,r)}function ro(e,t,r,o){var u,C,S,i,l;const h=Ll(e.name,e.value),f={kind:"enum",proto:e,deprecated:(C=(u=e.options)===null||u===void 0?void 0:u.deprecated)!==null&&C!==void 0?C:!1,file:t,parent:r,open:!0,name:e.name,typeName:kr(e,r,t),value:{},values:[],sharedPrefix:h,toString(){return`enum ${this.typeName}`}};f.open=Pl(f),o.add(f);for(const d of e.value){const v=d.name;f.values.push(f.value[d.number]={kind:"enum_value",proto:d,deprecated:(i=(S=d.options)===null||S===void 0?void 0:S.deprecated)!==null&&i!==void 0?i:!1,parent:f,name:v,localName:Ht(h==null?v:v.substring(h.length)),number:d.number,toString(){return`enum value ${f.typeName}.${v}`}})}((l=r==null?void 0:r.nestedEnums)!==null&&l!==void 0?l:t.enums).push(f)}function io(e,t,r,o,u){var C,S,i,l;const h={kind:"message",proto:e,deprecated:(S=(C=e.options)===null||C===void 0?void 0:C.deprecated)!==null&&S!==void 0?S:!1,file:t,parent:r,name:e.name,typeName:kr(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((i=e.options)===null||i===void 0?void 0:i.mapEntry)===!0?u.add(h):(((l=r==null?void 0:r.nestedMessages)!==null&&l!==void 0?l:t.messages).push(h),o.add(h));for(const f of e.enumType)ro(f,t,h,o);for(const f of e.nestedType)io(f,t,h,o,u)}function Bl(e,t,r){var o,u;const C={kind:"service",proto:e,deprecated:(u=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&u!==void 0?u:!1,file:t,name:e.name,typeName:kr(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(C),r.add(C);for(const S of e.method){const i=Il(S,C,r);C.methods.push(i),C.method[i.localName]=i}}function Il(e,t,r){var o,u,C,S;let i;e.clientStreaming&&e.serverStreaming?i="bidi_streaming":e.clientStreaming?i="client_streaming":e.serverStreaming?i="server_streaming":i="unary";const l=r.getMessage(Pe(e.inputType)),h=r.getMessage(Pe(e.outputType));xe(l,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),xe(h,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const f=e.name;return{kind:"rpc",proto:e,deprecated:(u=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&u!==void 0?u:!1,parent:t,name:f,localName:Ht(f.length?Ht(f[0].toLowerCase()+f.substring(1)):f),methodKind:i,input:l,output:h,idempotency:(S=(C=e.options)===null||C===void 0?void 0:C.idempotencyLevel)!==null&&S!==void 0?S:yl,toString(){return`rpc ${t.typeName}.${f}`}}}function Rl(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Ht(mr(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function oi(e,t,r,o,u){var C,S,i;const l=u===void 0,h={kind:"field",proto:e,deprecated:(S=(C=e.options)===null||C===void 0?void 0:C.deprecated)!==null&&S!==void 0?S:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:Ol(e,o,l,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(l){const m=t.kind=="file"?t:t.file,E=t.kind=="file"?void 0:t,_=kr(e,E,m);h.kind="extension",h.file=m,h.parent=E,h.oneof=void 0,h.typeName=_,h.jsonName=`[${_}]`,h.toString=()=>`extension ${_}`;const s=r.getMessage(Pe(e.extendee));xe(s,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),h.extendee=s}else{const m=t;xe(m.kind=="message"),h.parent=m,h.oneof=o,h.localName=o?mr(e.name):Ht(mr(e.name)),h.jsonName=e.jsonName,h.toString=()=>`field ${m.typeName}.${e.name}`}const f=e.label,d=e.type,v=(i=e.options)===null||i===void 0?void 0:i.jstype;if(f===ki){const m=d==Dt?u==null?void 0:u.get(Pe(e.typeName)):void 0;if(m){h.fieldKind="map";const{key:E,value:_}=Ml(m);return h.mapKey=E.scalar,h.mapKind=_.fieldKind,h.message=_.message,h.delimitedEncoding=!1,h.enum=_.enum,h.scalar=_.scalar,h}switch(h.fieldKind="list",d){case Dt:case Gt:h.listKind="message",h.message=r.getMessage(Pe(e.typeName)),xe(h.message),h.delimitedEncoding=ms(e,t);break;case _s:h.listKind="enum",h.enum=r.getEnum(Pe(e.typeName)),xe(h.enum);break;default:h.listKind="scalar",h.scalar=d,h.longAsString=v==gs;break}return h.packed=Nl(e,t),h}switch(d){case Dt:case Gt:h.fieldKind="message",h.message=r.getMessage(Pe(e.typeName)),xe(h.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),h.delimitedEncoding=ms(e,t),h.getDefaultValue=()=>{};break;case _s:{const m=r.getEnum(Pe(e.typeName));xe(m!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),h.fieldKind="enum",h.enum=r.getEnum(Pe(e.typeName)),h.getDefaultValue=()=>Wt(e,"defaultValue")?ul(m,e.defaultValue):void 0;break}default:{h.fieldKind="scalar",h.scalar=d,h.longAsString=v==gs,h.getDefaultValue=()=>Wt(e,"defaultValue")?fl(d,e.defaultValue):void 0;break}}return h}function Al(e){switch(e.syntax){case"":case"proto2":return vl;case"proto3":return pl;case"editions":if(e.edition in to)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function xl(e,t){return e.dependency.map(r=>{const o=t.getFile(r);if(!o)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return o})}function Ll(e,t){const r=Tl(e)+"_";for(const o of t){if(!o.name.toLowerCase().startsWith(r))return;const u=o.name.substring(r.length);if(u.length==0||/^\d/.test(u))return}return r}function Tl(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function kr(e,t,r){let o;return t?o=`${t.typeName}.${e.name}`:r.proto.package.length>0?o=`${r.proto.package}.${e.name}`:o=`${e.name}`,o}function Pe(e){return e.startsWith(".")?e.substring(1):e}function Dl(e,t){if(!Wt(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return xe(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function Ol(e,t,r,o){if(e.label==Sl)return Cl;if(e.label==ki)return vs;if(t||e.proto3Optional||r)return $r;const u=gt("fieldPresence",{proto:e,parent:o});return u==vs&&(e.type==Dt||e.type==Gt)?$r:u}function Nl(e,t){if(e.label!=ki)return!1;switch(e.type){case ml:case bl:case Gt:case Dt:return!1}const r=e.options;return r&&Wt(r,"packed")?r.packed:wl==gt("repeatedFieldEncoding",{proto:e,parent:t})}function Ml(e){const t=e.fields.find(o=>o.number===1),r=e.fields.find(o=>o.number===2);return xe(t&&t.fieldKind=="scalar"&&t.scalar!=U.BYTES&&t.scalar!=U.FLOAT&&t.scalar!=U.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function Pl(e){var t;return kl==gt("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function ms(e,t){return e.type==Gt?!0:El==gt("messageEncoding",{proto:e,parent:t})}function gt(e,t){var r,o;const u=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(u){const C=u[e];if(C!=0)return C}if("kind"in t){if(t.kind=="message")return gt(e,(o=t.parent)!==null&&o!==void 0?o:t.file);const C=to[t.edition];if(!C)throw new Error(`feature default for edition ${t.edition} not found`);return C[e]}return gt(e,t.parent)}function xe(e,t){if(!e)throw new Error(t)}function Fl(e){const t=Ul(e);return t.messageType.forEach(Ei),eo(t,()=>{}).getFile(t.name)}function Ul(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(so),enumType:e.enumType.map(no)}))}function so(e){var t,r,o,u,C,S,i,l;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(Vl))!==null&&r!==void 0?r:[],extension:[],nestedType:(u=(o=e.nestedType)===null||o===void 0?void 0:o.map(so))!==null&&u!==void 0?u:[],enumType:(S=(C=e.enumType)===null||C===void 0?void 0:C.map(no))!==null&&S!==void 0?S:[],extensionRange:(l=(i=e.extensionRange)===null||i===void 0?void 0:i.map(f=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},f)))!==null&&l!==void 0?l:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function Vl(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?Hl(e.options):void 0}))}function Hl(e){var t,r,o;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(o=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(C=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},C)))!==null&&o!==void 0?o:[],uninterpretedOption:[]}))}function no(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(r=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},r))})}function $l(e){const t=Gl();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let o=new Uint8Array(r),u=0,C=0,S,i=0;for(let l=0;l<e.length;l++){if(S=t[e.charCodeAt(l)],S===void 0)switch(e[l]){case"=":C=0;case`
|
|
1776
|
-
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(C){case 0:i=S,C=1;break;case 1:o[u++]=i<<2|(S&48)>>4,i=S,C=2;break;case 2:o[u++]=(i&15)<<4|(S&60)>>2,i=S,C=3;break;case 3:o[u++]=(i&3)<<6|S,C=0;break}}if(C==1)throw Error("invalid base64 string");return o.subarray(0,u)}let rr,ot;function Wl(e){return rr||(rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),rr.slice(0,-2).concat("-","_")),rr}function Gl(){if(!ot){ot=[];const e=Wl();for(let t=0;t<e.length;t++)ot[e[t].charCodeAt(0)]=t;ot[45]=e.indexOf("+"),ot[95]=e.indexOf("/")}return ot}function oo(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}class vt extends Error{constructor(t,r,o="FieldValueInvalidError"){super(r),this.name=o,this.field=()=>t}}function pt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Bi(e,t){var r,o,u,C;if(pt(e)&&Ue in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const S=t,i=e.field();return S.listKind==i.listKind&&S.scalar===i.scalar&&((r=S.message)===null||r===void 0?void 0:r.typeName)===((o=i.message)===null||o===void 0?void 0:o.typeName)&&((u=S.enum)===null||u===void 0?void 0:u.typeName)===((C=i.enum)===null||C===void 0?void 0:C.typeName)}return!0}return!1}function Ii(e,t){var r,o,u,C;if(pt(e)&&Ue in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const S=t,i=e.field();return S.mapKey===i.mapKey&&S.mapKind==i.mapKind&&S.scalar===i.scalar&&((r=S.message)===null||r===void 0?void 0:r.typeName)===((o=i.message)===null||o===void 0?void 0:o.typeName)&&((u=S.enum)===null||u===void 0?void 0:u.typeName)===((C=i.enum)===null||C===void 0?void 0:C.typeName)}return!0}return!1}function Ri(e,t){return pt(e)&&Ue in e&&"desc"in e&&pt(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const Wr=Symbol.for("@bufbuild/protobuf/text-encoding");function ao(){if(globalThis[Wr]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[Wr]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[Wr]}var Le;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(Le||(Le={}));const jl=34028234663852886e22,Kl=-34028234663852886e22,zl=4294967295,Zl=2147483647,Xl=-2147483648;class Yl{constructor(t,r=ao().decodeUtf8){this.decodeUtf8=r,this.varint64=el,this.uint32=sl,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,o=t&7;if(r<=0||o<0||o>5)throw new Error("illegal tag: field no "+r+" wire type "+o);return[r,o]}skip(t,r){let o=this.pos;switch(t){case Le.Varint:for(;this.buf[this.pos++]&128;);break;case Le.Bit64:this.pos+=4;case Le.Bit32:this.pos+=4;break;case Le.LengthDelimited:let u=this.uint32();this.pos+=u;break;case Le.StartGroup:for(;;){const[C,S]=this.tag();if(S===Le.EndGroup){if(r!==void 0&&C!==r)throw new Error("invalid end group tag");break}this.skip(S,C)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(o,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return Se.dec(...this.varint64())}uint64(){return Se.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),o=-(t&1);return t=(t>>>1|(r&1)<<31)^o,r=r>>>1^o,Se.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Se.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Se.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function Jl(e,t){const r=e.fieldKind=="list"?Bi(t,e):e.fieldKind=="map"?Ii(t,e):Ai(e,t);if(r===!0)return;let o;switch(e.fieldKind){case"list":o=`expected ${ho(e)}, got ${Sr(t)}`;break;case"map":o=`expected ${uo(e)}, got ${Sr(t)}`;break;default:o=br(e,t,r)}return new vt(e,o)}function bs(e,t,r){const o=Ai(e,r);if(o!==!0)return new vt(e,`list item #${t+1}: ${br(e,r,o)}`)}function ql(e,t,r){const o=co(t,e.mapKey);if(o!==!0)return new vt(e,`invalid map key: ${br({scalar:e.mapKey},t,o)}`);const u=Ai(e,r);if(u!==!0)return new vt(e,`map entry ${Sr(t)}: ${br(e,r,u)}`)}function Ai(e,t){return e.scalar!==void 0?co(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):Ri(t,e.message)}function co(e,t){switch(t){case U.DOUBLE:return typeof e=="number";case U.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>jl||e<Kl?`${e.toFixed()} out of range`:!0;case U.INT32:case U.SFIXED32:case U.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Zl||e<Xl?`${e.toFixed()} out of range`:!0;case U.FIXED32:case U.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>zl||e<0?`${e.toFixed()} out of range`:!0;case U.BOOL:return typeof e=="boolean";case U.STRING:return typeof e!="string"?!1:ao().checkUtf8(e)||"invalid UTF8";case U.BYTES:return e instanceof Uint8Array;case U.INT64:case U.SFIXED64:case U.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return Se.parse(e),!0}catch{return`${e} out of range`}return!1;case U.FIXED64:case U.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return Se.uParse(e),!0}catch{return`${e} out of range`}return!1}}function br(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${Sr(t)}`,e.scalar!==void 0?`expected ${Ql(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${lo(e.message)}`+r}function Sr(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:Bi(e)?ho(e.field()):Ii(e)?uo(e.field()):Ri(e)?lo(e.desc):oo(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function lo(e){return`ReflectMessage (${e.typeName})`}function ho(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${U[e.scalar]})`}}function uo(e){switch(e.mapKind){case"message":return`ReflectMap (${U[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${U[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${U[e.mapKey]}, ${U[e.scalar]})`}}function Ql(e){switch(e){case U.STRING:return"string";case U.BOOL:return"boolean";case U.INT64:case U.SINT64:case U.SFIXED64:return"bigint (int64)";case U.UINT64:case U.FIXED64:return"bigint (uint64)";case U.BYTES:return"Uint8Array";case U.DOUBLE:return"number (float64)";case U.FLOAT:return"number (float32)";case U.FIXED32:case U.UINT32:return"number (uint32)";case U.INT32:case U.SFIXED32:case U.SINT32:return"number (int32)"}}function ed(e){return fo(e.$typeName)}function td(e){const t=e.fields[0];return fo(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function fo(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const rd=999,id=998,ur=2;function sd(e,t){return oo(t,e)?t:od(e)}const nd=Symbol(),Ss=new WeakMap;function od(e){let t;if(ad(e)){const r=Ss.get(e);let o,u;if(r)({prototype:o,members:u}=r);else{o={},u=new Set;for(const C of e.members)C.kind!="oneof"&&(C.fieldKind!="scalar"&&C.fieldKind!="enum"||C.presence!=ur&&(u.add(C),o[C.localName]=Gr(C)));Ss.set(e,{prototype:o,members:u})}t=Object.create(o),t.$typeName=e.typeName;for(const C of e.members)u.has(C)||C.kind=="field"&&(C.fieldKind=="message"||(C.fieldKind=="scalar"||C.fieldKind=="enum")&&C.presence!=ur)||(t[C.localName]=Gr(C))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==ur)&&(t[r.localName]=Gr(r))}return t}function ad(e){switch(e.file.edition){case rd:return!1;case id:return!0;default:return e.fields.some(t=>t.presence!=ur&&t.fieldKind!="message"&&!t.oneof)}}function Gr(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return nd;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?$t(e.scalar,e.longAsString):e.enum.values[0].number}function xi(e,t,r=!0){return new _o(e,t,r)}class _o{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,o)=>r.number-o.number)}constructor(t,r,o=!0){this.lists=new Map,this.maps=new Map,this.check=o,this.desc=t,this.message=this[Ue]=r??sd(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return It(this.message,t),al(this.message,t)}isSet(t){return It(this.message,t),cl(this.message,t)}clear(t){It(this.message,t),hl(this.message,t)}get(t){It(this.message,t);const r=ll(this.message,t);switch(t.fieldKind){case"list":let o=this.lists.get(t);return(!o||o[Ue]!==r)&&this.lists.set(t,o=new cd(t,r,this.check)),o;case"map":let u=this.maps.get(t);return(!u||u[Ue]!==r)&&this.maps.set(t,u=new ld(t,r,this.check)),u;case"message":return Ti(t,r,this.check);case"scalar":return r===void 0?$t(t.scalar,!1):Di(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(It(this.message,t),this.check){const u=Jl(t,r);if(u)throw u}let o;t.fieldKind=="message"?o=Li(t,r):Ii(r)||Bi(r)?o=r[Ue]:o=Oi(t,r),dl(this.message,t,o)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function It(e,t){if(t.parent.typeName!==e.$typeName)throw new vt(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class cd{field(){return this._field}get size(){return this._arr.length}constructor(t,r,o){this._field=t,this._arr=this[Ue]=r,this.check=o}get(t){const r=this._arr[t];return r===void 0?void 0:jr(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new vt(this._field,`list item #${t+1}: out of range`);if(this.check){const o=bs(this._field,t,r);if(o)throw o}this._arr[t]=ys(this._field,r)}add(t){if(this.check){const r=bs(this._field,this._arr.length,t);if(r)throw r}this._arr.push(ys(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield jr(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,jr(this._field,this._arr[t],this.check)]}}class ld{constructor(t,r,o=!0){this.obj=this[Ue]=r??{},this.check=o,this._field=t}field(){return this._field}set(t,r){if(this.check){const o=ql(this._field,t,r);if(o)throw o}return this.obj[ir(t)]=dd(this._field,r),this}delete(t){const r=ir(t),o=Object.prototype.hasOwnProperty.call(this.obj,r);return o&&delete this.obj[r],o}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[ir(t)];return r!==void 0&&(r=Kr(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,ir(t))}*keys(){for(const t of Object.keys(this.obj))yield Cs(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[Cs(t[0],this._field.mapKey),Kr(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield Kr(this._field,t,this.check)}forEach(t,r){for(const o of this.entries())t.call(r,o[1],o[0],this)}}function Li(e,t){return Ri(t)?ed(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?vo(t.message):t.message:t}function Ti(e,t,r){return t!==void 0&&(td(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:Di(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&pt(t)&&(t=go(t))),new _o(e.message,t,r)}function ys(e,t){return e.listKind=="message"?Li(e,t):Oi(e,t)}function jr(e,t,r){return e.listKind=="message"?Ti(e,t,r):Di(e,t)}function dd(e,t){return e.mapKind=="message"?Li(e,t):Oi(e,t)}function Kr(e,t,r){return e.mapKind=="message"?Ti(e,t,r):t}function ir(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function Cs(e,t){switch(t){case U.STRING:return e;case U.INT32:case U.FIXED32:case U.UINT32:case U.SFIXED32:case U.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case U.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case U.UINT64:case U.FIXED64:try{return Se.uParse(e)}catch{}break;default:try{return Se.parse(e)}catch{}break}return e}function Di(e,t){switch(e.scalar){case U.INT64:case U.SFIXED64:case U.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=Se.parse(t));break;case U.FIXED64:case U.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=Se.uParse(t));break}return t}function Oi(e,t){switch(e.scalar){case U.INT64:case U.SFIXED64:case U.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=Se.parse(t));break;case U.FIXED64:case U.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=Se.uParse(t));break}return t}function go(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(pt(e))for(const[r,o]of Object.entries(e))t.fields[r]=mo(o);return t}function vo(e){const t={};for(const[r,o]of Object.entries(e.fields))t[r]=po(o);return t}function po(e){switch(e.kind.case){case"structValue":return vo(e.kind.value);case"listValue":return e.kind.value.values.map(po);case"nullValue":case void 0:return null;default:return e.kind.value}}function mo(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const o of e)r.values.push(mo(o));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:go(e)};break}return t}function St(e,t,...r){return r.reduce((o,u)=>o.nestedMessages[u],e.messages[t])}function Br(e,t,...r){if(r.length==0)return e.enums[t];const o=r.pop();return r.reduce((u,C)=>u.nestedMessages[C],e.messages[t]).nestedEnums[o]}function Ir(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const hd=Fl({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),ud=St(hd,1);var ws;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(ws||(ws={}));var Es;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(Es||(Es={}));var ks;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(ks||(ks={}));var Bs;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(Bs||(Bs={}));var Is;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(Is||(Is={}));var Rs;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(Rs||(Rs={}));var As;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(As||(As={}));var xs;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(xs||(xs={}));var Ls;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(Ls||(Ls={}));var Ts;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(Ts||(Ts={}));var Ds;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Ds||(Ds={}));var Os;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(Os||(Os={}));var Ns;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(Ns||(Ns={}));var Ms;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(Ms||(Ms={}));var Ps;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(Ps||(Ps={}));var Fs;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(Fs||(Fs={}));var Us;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(Us||(Us={}));var Vs;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(Vs||(Vs={}));var Hs;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(Hs||(Hs={}));var $s;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})($s||($s={}));const Ws={readUnknownFields:!0};function fd(e){return e?Object.assign(Object.assign({},Ws),e):Ws}function _d(e,t,r){const o=xi(e,void 0,!1);return bo(o,new Yl(t),fd(r),!1,t.byteLength),o.message}function bo(e,t,r,o,u){var C;const S=o?t.len:t.pos+u;let i,l;const h=(C=e.getUnknown())!==null&&C!==void 0?C:[];for(;t.pos<S&&([i,l]=t.tag(),!(o&&l==Le.EndGroup));){const f=e.findNumber(i);if(!f){const d=t.skip(l,i);r.readUnknownFields&&h.push({no:i,wireType:l,data:d});continue}gd(e,t,f,l,r)}if(o&&(l!=Le.EndGroup||i!==u))throw new Error("invalid end group tag");h.length>0&&e.setUnknown(h)}function gd(e,t,r,o,u){var C;switch(r.fieldKind){case"scalar":e.set(r,mt(t,r.scalar));break;case"enum":const S=mt(t,U.INT32);if(r.enum.open)e.set(r,S);else if(r.enum.values.some(l=>l.number===S))e.set(r,S);else if(u.readUnknownFields){const l=[];il(S,l);const h=(C=e.getUnknown())!==null&&C!==void 0?C:[];h.push({no:r.number,wireType:o,data:new Uint8Array(l)}),e.setUnknown(h)}break;case"message":e.set(r,Ni(t,u,r,e.get(r)));break;case"list":pd(t,o,e.get(r),u);break;case"map":vd(t,e.get(r),u);break}}function vd(e,t,r){const o=t.field();let u,C;const S=e.uint32(),i=e.pos+S;for(;e.pos<i;){const[l]=e.tag();switch(l){case 1:u=mt(e,o.mapKey);break;case 2:switch(o.mapKind){case"scalar":C=mt(e,o.scalar);break;case"enum":C=e.int32();break;case"message":C=Ni(e,r,o);break}break}}if(u===void 0&&(u=$t(o.mapKey,!1)),C===void 0)switch(o.mapKind){case"scalar":C=$t(o.scalar,!1);break;case"enum":C=o.enum.values[0].number;break;case"message":C=xi(o.message,void 0,!1);break}t.set(u,C)}function pd(e,t,r,o){var u;const C=r.field();if(C.listKind==="message"){r.add(Ni(e,o,C));return}const S=(u=C.scalar)!==null&&u!==void 0?u:U.INT32;if(!(t==Le.LengthDelimited&&S!=U.STRING&&S!=U.BYTES)){r.add(mt(e,S));return}const l=e.uint32()+e.pos;for(;e.pos<l;)r.add(mt(e,S))}function Ni(e,t,r,o){const u=r.delimitedEncoding,C=o??xi(r.message,void 0,!1);return bo(C,e,t,u,u?r.number:e.uint32()),C}function mt(e,t){switch(t){case U.STRING:return e.string();case U.BOOL:return e.bool();case U.DOUBLE:return e.double();case U.FLOAT:return e.float();case U.INT32:return e.int32();case U.INT64:return e.int64();case U.UINT64:return e.uint64();case U.FIXED64:return e.fixed64();case U.BYTES:return e.bytes();case U.FIXED32:return e.fixed32();case U.SFIXED32:return e.sfixed32();case U.SFIXED64:return e.sfixed64();case U.SINT64:return e.sint64();case U.UINT32:return e.uint32();case U.SINT32:return e.sint32()}}function Yt(e,t){var r;const o=_d(ud,$l(e));return o.messageType.forEach(Ei),o.dependency=(r=t==null?void 0:t.map(C=>C.proto.name))!==null&&r!==void 0?r:[],eo(o,C=>t==null?void 0:t.find(S=>S.proto.name===C)).getFile(o.name)}const Mi=Yt("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),Gs=St(Mi,0,0),md=Br(Mi,0),zr=Ir(md),Jt=Yt("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[To.file_google_protobuf_wrappers,Mi]),So=St(Jt,12),ai=St(Jt,13),bd=Br(Jt,19,0),Fe=Ir(bd),Sd=Br(Jt,2),yd=Ir(Sd),Cd=Yt("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),wd=Br(Cd,0),Ed=Ir(wd),kd=Yt("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),yo=Yt("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[kd,Jt]),ci=St(yo,3),Bd=St(yo,4),pe=[];for(let e=0;e<256;++e)pe.push((e+256).toString(16).slice(1));function Id(e,t=0){return(pe[e[t+0]]+pe[e[t+1]]+pe[e[t+2]]+pe[e[t+3]]+"-"+pe[e[t+4]]+pe[e[t+5]]+"-"+pe[e[t+6]]+pe[e[t+7]]+"-"+pe[e[t+8]]+pe[e[t+9]]+"-"+pe[e[t+10]]+pe[e[t+11]]+pe[e[t+12]]+pe[e[t+13]]+pe[e[t+14]]+pe[e[t+15]]).toLowerCase()}let Zr;const Rd=new Uint8Array(16);function Ad(){if(!Zr){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Zr=crypto.getRandomValues.bind(crypto)}return Zr(Rd)}const xd=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),js={randomUUID:xd};function Ld(e,t,r){var u;if(js.randomUUID&&!e)return js.randomUUID();e=e||{};const o=e.random??((u=e.rng)==null?void 0:u.call(e))??Ad();if(o.length<16)throw new Error("Random bytes length must be >= 16");return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Id(o)}const Td=5e3,Dd=1e3,sr=4e3,Ks=1e3;class Od{constructor({knownID:t,runID:r,sequence:o,options:u}){this.queue=new Ae,this.subscriptions=[],this.reconnect=new Ae,this.client=new _e,this._latencies=new Ae,this._latenciesConnectable=qe(this._latencies.asObservable().pipe(bc((C,S)=>{if(S.latency<0){const i=C.get(S.streamID);i&&C.set(S.streamID,{...i,readyState:S.readyState})}else C.set(S.streamID,S);return C},new Map))),this._errors=new Ae,this._errorsConnectable=qe(this._errors.asObservable()),this._stdout=new Ae,this._stderr=new Ae,this._exitCode=new Ae,this._pid=new Ae,this._mimeType=new Ae,this._stdoutConnectable=qe(this._stdout.asObservable()),this._stderrConnectable=qe(this._stderr.asObservable()),this._exitCodeConnectable=qe(this._exitCode.asObservable()),this._pidConnectable=qe(this._pid.asObservable()),this._mimeTypeConnectable=qe(this._mimeType.asObservable()),this.knownID=t,this.runID=r,this.sequence=o,this.runnerEndpoint=u.runnerEndpoint,this.interceptors=u.interceptors,this.autoReconnect=u.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(cs(Ks,Xt,{leading:!0,trailing:!0}),as(C=>this.useSocketClient(C.streamID).pipe(as(S=>this.useHeartbeat(S,C))))).pipe(An()),this.subscriptions.push(this.monitor()),this.subscriptions.push(this.process())}get latencies(){return this._latenciesConnectable}get errors(){return this._errorsConnectable}get stdout(){return this._stdoutConnectable}get stderr(){return this._stderrConnectable}get exitCode(){return this._exitCodeConnectable}get pid(){return this._pidConnectable}get mimeType(){return this._mimeTypeConnectable}monitor(){return lc(Dd).pipe(Ne(()=>this.autoReconnect),Hr(this.reconnect),Ne(([,r])=>r.heartbeat==="CONTINUOUS"),Hr(this.latencies),ke(([,r])=>Array.from(r.values()).filter(o=>o.readyState===WebSocket.OPEN&&o.latency>=sr)),Ne(r=>r.length>0),cs(Ks)).subscribe({next:r=>{console.log(new Date,"Triggering reconnect",r),this.connect()},complete:()=>{console.log("Monitor complete")},error:r=>{console.error("Error in monitor",r)}})}process(){const t=this.client.pipe(Ne(S=>(S==null?void 0:S.readyState)===WebSocket.OPEN),os(1)),r=this.queue.pipe(gc(()=>t),Ne(S=>S.length>0),ke(S=>S.sort((i,l)=>{const h=f=>{var d;return!!((d=f.payload.value)!=null&&d.config)};return h(l)?1:h(i)?-1:0}))),o=this.queue.pipe(Sc(t));return dc(r.pipe(et(S=>S)),o).pipe(Hr(this.client),tr(([,S])=>S.readyState===WebSocket.OPEN),et(async([S,i])=>{await Zs({req:S,interceptors:this.interceptors,socket:i,knownID:this.knownID,runID:this.runID})})).subscribe({error:S=>{this._errors.next(S)}})}useSocketClient(t){return new _e(r=>{const o=new URL(this.runnerEndpoint);o.searchParams.set("id",t),o.searchParams.set("runID",this.runID);const u=new WebSocket(o.toString()),C=h=>{if(console.log(new Date,`WebSocket transport ${t} closed`,h),h.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},S=h=>{console.log(new Date,`WebSocket transport ${t} error`,h),this.autoReconnect||r.error(h)},i=h=>{var m,E;if(typeof h.data!="string"){console.warn("Unexpected WebSocket message type:",typeof h.data);return}let f;try{f=zs(h.data),console.log("Received WebsocketResponse:",f)}catch(_){console.error("Failed to parse WebsocketResponse:",_)}const d=f.status;if(d&&d.code!==Ed.OK){r.error(d);return}if(f.pong)return;const v=f.payload.value;if(v.stdoutData&&v.stdoutData.length>0&&((m=this.callback)==null||m.call(this,{type:Q.terminalStdout,output:{"runme.dev/id":this.knownID,data:v.stdoutData}}),this._stdout.next(v.stdoutData)),v.stderrData&&v.stderrData.length>0&&((E=this.callback)==null||E.call(this,{type:Q.terminalStderr,output:{"runme.dev/id":this.knownID,data:v.stderrData}}),this._stderr.next(v.stderrData)),v.exitCode!==void 0&&(this._exitCode.next(v.exitCode),r.complete()),v.pid!==void 0&&this._pid.next(v.pid),v.mimeType){const s=v.mimeType.split(";")[0];this._mimeType.next(s)}},l=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(u)};return u.addEventListener("close",C),u.addEventListener("error",S),u.addEventListener("message",i),u.addEventListener("open",l),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),u.removeEventListener("close",C),u.removeEventListener("error",S),u.removeEventListener("message",i),u.removeEventListener("open",l),u.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(Te.create(ci,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:o}){return new _e(u=>{const C=Jr(t,"message").pipe(tr(()=>t.readyState===WebSocket.OPEN),ke(f=>zs(f.data)),ke(f=>f.pong),Ne(f=>f!==void 0),ke(f=>({receivedAt:BigInt(Date.now()),pong:f}))),l=(o==="INITIAL"?Tt(0):Tt(0,Td)).pipe(tr(()=>t.readyState===WebSocket.OPEN),ke(()=>{const f={timestamp:BigInt(Date.now())};return Te.create(ci,{ping:f})}),et(async f=>(await Zs({req:f,interceptors:this.interceptors,socket:t}),f)),ke(f=>f.ping)).pipe(Ne(f=>(f==null?void 0:f.timestamp)!==void 0),et(f=>fc(C.pipe(Ne(d=>d.pong.timestamp===f.timestamp),os(1),ke(d=>{const v=f.timestamp,m=d.receivedAt;return Number(m-v)})),Tt(sr).pipe(ke(()=>{throw new Error(`Pong not received within ${sr}ms for stream ${r}`)}))).pipe(Bn(d=>(this._latencies.next({streamID:r,latency:sr,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",d.message),Za(null))))),mc(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),yc(f=>{f!==null&&this._latencies.next({streamID:r,latency:f,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),h=[];return h.push(l.subscribe({error:f=>{console.error("Unexpected error sending heartbeat",f)}})),u.next(t),()=>{h.forEach(f=>f.unsubscribe())}})}connect(t="CONTINUOUS"){const r=Nd(),o=this.latencies.pipe(ke(u=>{const C=u.get(r);return C===void 0?null:C}),tr(u=>(u==null?void 0:u.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),o}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function zs(e){const t=JSON.parse(e);return Te.fromJson(Bd,t)}async function Zs({req:e,interceptors:t,socket:r,knownID:o,runID:u}){o&&(e.knownId=o),u&&(e.runId=u);const C={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let S=async h=>({stream:!1,message:{},method:{},service:{},header:h.header});for(const h of t.concat().reverse())S=h(S);const l=(await S(C)).header.get("Authorization");l&&e&&(e.authorization=l),r.send(JSON.stringify(Te.toJson(ci,e)))}function Nd(){return Ld().replace(/-/g,"")}var Md=Object.defineProperty,Pd=Object.getOwnPropertyDescriptor,Co=e=>{throw TypeError(e)},se=(e,t,r,o)=>{for(var u=o>1?void 0:o?Pd(t,r):t,C=e.length-1,S;C>=0;C--)(S=e[C])&&(u=(o?S(t,r,u):S(u))||u);return o&&u&&Md(t,r,u),u},Pi=(e,t,r)=>t.has(e)||Co("Cannot "+r),oe=(e,t,r)=>(Pi(e,t,"read from private field"),t.get(e)),nr=(e,t,r)=>t.has(e)?Co("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),yr=(e,t,r,o)=>(Pi(e,t,"write to private field"),t.set(e,r),r),Be=(e,t,r)=>(Pi(e,t,"access private method"),r),be,Me,tt,Ce,wo,Fi,Eo,li,Cr,di,ko,Bo;const Fd="runme-console";let ie=class extends ye{constructor(){super(),nr(this,Ce),this.disposables=[],nr(this,be),nr(this,Me,[]),nr(this,tt,{rows:34,cols:100,x:0,y:0}),this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.reconnect=!0,this.interceptors=[],Be(this,Ce,Bo).call(this)}applyThemeStyles(){this.consoleView&&this.consoleView.applyThemeStyles()}connectedCallback(){if(super.connectedCallback(),!this.id)throw new Error("No id provided to terminal!");Be(this,Ce,wo).call(this),Be(this,Ce,li).call(this),Be(this,Ce,di).call(this)}disconnectedCallback(){super.disconnectedCallback(),Be(this,Ce,Cr).call(this),this.disposables.forEach(({dispose:e})=>e())}updated(e){super.updated(e),this.consoleView&&Be(this,Ce,Fi).call(this),(e.has("knownId")||e.has("runId")||e.has("sequence")||e.has("runnerEndpoint")||e.has("interceptors")||e.has("commands")||e.has("languageId"))&&(Be(this,Ce,li).call(this),Be(this,Ce,di).call(this))}firstUpdated(e){super.firstUpdated(e)}render(){return X`<div></div>`}dispose(){Be(this,Ce,Cr).call(this),this.disposables.forEach(({dispose:e})=>e())}};be=new WeakMap;Me=new WeakMap;tt=new WeakMap;Ce=new WeakSet;wo=function(){this.shadowRoot&&(this.consoleView=document.createElement("console-view"),Be(this,Ce,Fi).call(this),this.shadowRoot.appendChild(this.consoleView),Be(this,Ce,Eo).call(this))};Fi=function(){this.consoleView&&(this.consoleView.setAttribute("id",this.id),this.consoleView.setAttribute("buttons",this.buttons.toString()),this.consoleView.setAttribute("takeFocus",this.takeFocus.toString()),this.consoleView.setAttribute("theme",this.theme),this.fontFamily&&this.consoleView.setAttribute("fontFamily",this.fontFamily),this.fontSize!==void 0&&this.consoleView.setAttribute("fontSize",this.fontSize.toString()),this.cursorStyle&&this.consoleView.setAttribute("cursorStyle",this.cursorStyle),this.cursorBlink!==void 0&&this.consoleView.setAttribute("cursorBlink",this.cursorBlink.toString()),this.cursorWidth!==void 0&&this.consoleView.setAttribute("cursorWidth",this.cursorWidth.toString()),this.smoothScrollDuration!==void 0&&this.consoleView.setAttribute("smoothScrollDuration",this.smoothScrollDuration.toString()),this.scrollback!==void 0&&this.consoleView.setAttribute("scrollback",this.scrollback.toString()),this.initialContent&&this.consoleView.setAttribute("initialContent",this.initialContent),this.initialRows!==void 0&&this.consoleView.setAttribute("initialRows",this.initialRows.toString()),this.lastLine!==void 0&&this.consoleView.setAttribute("lastLine",this.lastLine.toString()),this.isLoading!==void 0&&this.consoleView.setAttribute("isLoading",this.isLoading.toString()),this.isCreatingEscalation!==void 0&&this.consoleView.setAttribute("isCreatingEscalation",this.isCreatingEscalation.toString()),this.shareUrl&&this.consoleView.setAttribute("shareUrl",this.shareUrl),this.escalationUrl&&this.consoleView.setAttribute("escalationUrl",this.escalationUrl),this.isUpdatedReady!==void 0&&this.consoleView.setAttribute("isUpdatedReady",this.isUpdatedReady.toString()),this.isAutoSaveEnabled!==void 0&&this.consoleView.setAttribute("isAutoSaveEnabled",this.isAutoSaveEnabled.toString()),this.isPlatformAuthEnabled!==void 0&&this.consoleView.setAttribute("isPlatformAuthEnabled",this.isPlatformAuthEnabled.toString()),this.isDaggerOutput!==void 0&&this.consoleView.setAttribute("isDaggerOutput",this.isDaggerOutput.toString()))};Eo=function(){if(!this.consoleView)return;const e=t=>r=>{this.dispatchEvent(new CustomEvent(t,{detail:r.detail}))};this.consoleView.addEventListener("stdout",e("stdout")),this.consoleView.addEventListener("stderr",e("stderr")),this.consoleView.addEventListener("exitcode",e("exitcode")),this.consoleView.addEventListener("pid",e("pid")),this.consoleView.addEventListener("mimetype",e("mimetype"))};li=function(){if(oe(this,be))return;const e=this.knownId??this.id;if(!e||!this.runId||!this.runnerEndpoint)return;yr(this,be,new Od({knownID:e,runID:this.runId,sequence:this.sequence??0,options:{runnerEndpoint:this.runnerEndpoint,interceptors:this.interceptors??[],autoReconnect:this.reconnect}}));const t=oe(this,be).connect().subscribe();oe(this,Me).push(()=>t.unsubscribe());const r=oe(this,be).stdout.subscribe(i=>{this.dispatchEvent(new CustomEvent("stdout",{detail:i})),this.consoleView&&this.consoleView.terminal&&this.consoleView.terminal.write(i)}),o=oe(this,be).stderr.subscribe(i=>{this.dispatchEvent(new CustomEvent("stderr",{detail:i}))}),u=oe(this,be).exitCode.subscribe(i=>{this.dispatchEvent(new CustomEvent("exitcode",{detail:i})),Be(this,Ce,Cr).call(this)}),C=oe(this,be).pid.subscribe(i=>{this.dispatchEvent(new CustomEvent("pid",{detail:i}))}),S=oe(this,be).mimeType.subscribe(i=>{this.dispatchEvent(new CustomEvent("mimetype",{detail:i}))});oe(this,Me).push(()=>r.unsubscribe()),oe(this,Me).push(()=>o.unsubscribe()),oe(this,Me).push(()=>u.unsubscribe()),oe(this,Me).push(()=>C.unsubscribe()),oe(this,Me).push(()=>S.unsubscribe())};Cr=function(){var e;oe(this,Me).forEach(t=>{try{t()}catch{}}),yr(this,Me,[]),(e=oe(this,be))==null||e.close(),yr(this,be,void 0)};di=function(){if(!oe(this,be)||!this.commands||!this.runId)return;const e=Be(this,Ce,ko).call(this);e&&oe(this,be).sendExecuteRequest(e)};ko=function(){var u;const e=this.languageId||"sh",r=new Set(["sh","shell","bash","zsh","fish","ksh","csh","tcsh","dash","powershell","pwsh","cmd","ash","elvish","xonsh"]).has(e),o=Te.create(ai,{sessionStrategy:yd.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:e,background:!1,fileExtension:"",env:[`RUNME_ID=${this.knownId??this.id}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],interactive:!0,runId:this.runId,knownId:this.knownId??this.id},winsize:Te.create(So,oe(this,tt))});return((u=this.commands)==null?void 0:u.length)===0?(o.config.mode=zr.INLINE,o.config.source={case:"commands",value:Te.create(Gs,{items:["zsh -l"]})}):r?(o.config.source={case:"commands",value:Te.create(Gs,{items:this.commands??[]})},o.config.mode=zr.INLINE):(o.config.source={case:"script",value:(this.commands??[]).join(`
|
|
1777
|
-
`)},
|
|
1775
|
+
`;le([j({type:String})],se.prototype,"id",2);le([j({type:Boolean,converter:e=>e!=="false"})],se.prototype,"buttons",2);le([j({type:Boolean,converter:e=>e!=="false"})],se.prototype,"takeFocus",2);le([j({type:String})],se.prototype,"theme",2);le([j({type:String})],se.prototype,"fontFamily",2);le([j({type:Number})],se.prototype,"fontSize",2);le([j({type:String})],se.prototype,"cursorStyle",2);le([j({type:Boolean})],se.prototype,"cursorBlink",2);le([j({type:Number})],se.prototype,"cursorWidth",2);le([j({type:Number})],se.prototype,"smoothScrollDuration",2);le([j({type:Number})],se.prototype,"scrollback",2);le([j({type:String})],se.prototype,"initialContent",2);le([j({type:Number})],se.prototype,"initialRows",2);le([j({type:Number})],se.prototype,"lastLine",2);le([j({type:Boolean})],se.prototype,"isLoading",2);le([j({type:Boolean})],se.prototype,"isCreatingEscalation",2);le([j()],se.prototype,"shareUrl",2);le([j()],se.prototype,"escalationUrl",2);le([j({type:Boolean})],se.prototype,"isUpdatedReady",2);le([j({type:Boolean})],se.prototype,"isAutoSaveEnabled",2);le([j({type:Boolean})],se.prototype,"isPlatformAuthEnabled",2);le([j({type:Boolean})],se.prototype,"isDaggerOutput",2);se=le([xe(ad)],se);function Oo(e){if(!e)return;const{rows:t,cols:r}=e;return{columns:r,rows:t}}function cd(e){return e.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"")}function Xt(e){let t=!1;const r=[];for(let i=0;i<e.length;i++){let a=e.charAt(i);switch(a){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r.push(a),t=!1;break;default:t&&(t=!1,a=a.toUpperCase()),r.push(a);break}}return r.join("")}const ld=new Set(["constructor","toString","toJSON","valueOf"]);function Jt(e){return ld.has(e)?e+"$":e}function dd(){let e=0,t=0;for(let i=0;i<28;i+=7){let a=this.buf[this.pos++];if(e|=(a&127)<<i,(a&128)==0)return this.assertBounds(),[e,t]}let r=this.buf[this.pos++];if(e|=(r&15)<<28,t=(r&112)>>4,(r&128)==0)return this.assertBounds(),[e,t];for(let i=3;i<=31;i+=7){let a=this.buf[this.pos++];if(t|=(a&127)<<i,(a&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function si(e,t,r){for(let m=0;m<28;m=m+7){const v=e>>>m,s=!(!(v>>>7)&&t==0),c=(s?v|128:v)&255;if(r.push(c),!s)return}const i=e>>>28&15|(t&7)<<4,a=t>>3!=0;if(r.push((a?i|128:i)&255),!!a){for(let m=3;m<31;m=m+7){const v=t>>>m,s=!!(v>>>7),c=(s?v|128:v)&255;if(r.push(c),!s)return}r.push(t>>>31&1)}}const yr=4294967296;function Us(e){const t=e[0]==="-";t&&(e=e.slice(1));const r=1e6;let i=0,a=0;function m(v,s){const c=Number(e.slice(v,s));a*=r,i=i*r+c,i>=yr&&(a=a+(i/yr|0),i=i%yr)}return m(-24,-18),m(-18,-12),m(-12,-6),m(-6),t?Mo(i,a):Wi(i,a)}function hd(e,t){let r=Wi(e,t);const i=r.hi&2147483648;i&&(r=Mo(r.lo,r.hi));const a=No(r.lo,r.hi);return i?"-"+a:a}function No(e,t){if({lo:e,hi:t}=ud(e,t),t<=2097151)return String(yr*t+e);const r=e&16777215,i=(e>>>24|t<<8)&16777215,a=t>>16&65535;let m=r+i*6777216+a*6710656,v=i+a*8147497,s=a*2;const c=1e7;return m>=c&&(v+=Math.floor(m/c),m%=c),v>=c&&(s+=Math.floor(v/c),v%=c),s.toString()+Vs(v)+Vs(m)}function ud(e,t){return{lo:e>>>0,hi:t>>>0}}function Wi(e,t){return{lo:e|0,hi:t|0}}function Mo(e,t){return t=~t,e?e=~e+1:t+=1,Wi(e,t)}const Vs=e=>{const t=String(e);return"0000000".slice(t.length)+t};function yi(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let r=0;r<9;r++)t.push(e&127|128),e=e>>7;t.push(1)}}function fd(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let r=5;(e&128)!==0&&r<10;r++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const oe=gd();function gd(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const r=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),a=BigInt("0"),m=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(v){const s=typeof v=="bigint"?v:BigInt(v);if(s>i||s<r)throw new Error(`invalid int64: ${v}`);return s},uParse(v){const s=typeof v=="bigint"?v:BigInt(v);if(s>m||s<a)throw new Error(`invalid uint64: ${v}`);return s},enc(v){return e.setBigInt64(0,this.parse(v),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(v){return e.setBigInt64(0,this.uParse(v),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec(v,s){return e.setInt32(0,v,!0),e.setInt32(4,s,!0),e.getBigInt64(0,!0)},uDec(v,s){return e.setInt32(0,v,!0),e.setInt32(4,s,!0),e.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),Hs(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),$s(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),Hs(r),Us(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),$s(r),Us(r)},dec(r,i){return hd(r,i)},uDec(r,i){return No(r,i)}}}function Hs(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function $s(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var M;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(M||(M={}));function gt(e,t){switch(e){case M.STRING:return"";case M.BOOL:return!1;case M.DOUBLE:case M.FLOAT:return 0;case M.INT64:case M.UINT64:case M.SFIXED64:case M.FIXED64:case M.SINT64:return t?"0":oe.zero;case M.BYTES:return new Uint8Array(0);default:return 0}}function pd(e,t){switch(e){case M.BOOL:return t===!1;case M.STRING:return t==="";case M.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return t==0}}const Fo=2,We=Symbol.for("reflect unsafe local");function Po(e,t){const r=e[t.localName].case;return r===void 0?r:t.fields.find(i=>i.localName===r)}function _d(e,t){const r=t.localName;if(t.oneof)return e[t.oneof.localName].case===r;if(t.presence!=Fo)return e[r]!==void 0&&Object.prototype.hasOwnProperty.call(e,r);switch(t.fieldKind){case"list":return e[r].length>0;case"map":return Object.keys(e[r]).length>0;case"scalar":return!pd(t.scalar,e[r]);case"enum":return e[r]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function qt(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function Uo(e,t){if(t.oneof){const r=e[t.oneof.localName];return r.case===t.localName?r.value:void 0}return e[t.localName]}function Vo(e,t,r){t.oneof?e[t.oneof.localName]={case:t.localName,value:r}:e[t.localName]=r}function vd(e,t){const r=t.localName;if(t.oneof){const i=t.oneof.localName;e[i].case===r&&(e[i]={case:void 0})}else if(t.presence!=Fo)delete e[r];else switch(t.fieldKind){case"map":e[r]={};break;case"list":e[r]=[];break;case"enum":e[r]=t.enum.values[0].number;break;case"scalar":e[r]=gt(t.scalar,t.longAsString);break}}function Gi(e){for(const t of e.field)qt(t,"jsonName")||(t.jsonName=Xt(t.name));e.nestedType.forEach(Gi)}function md(e,t){const r=e.values.find(i=>i.name===t);if(!r)throw new Error(`cannot parse ${e} default value: ${t}`);return r.number}function bd(e,t){switch(e){case M.STRING:return t;case M.BYTES:{const r=Sd(t);if(r===!1)throw new Error(`cannot parse ${M[e]} default value: ${t}`);return r}case M.INT64:case M.SFIXED64:case M.SINT64:return oe.parse(t);case M.UINT64:case M.FIXED64:return oe.uParse(t);case M.DOUBLE:case M.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case M.BOOL:return t==="true";case M.INT32:case M.UINT32:case M.SINT32:case M.FIXED32:case M.SFIXED32:return parseInt(t,10)}}function Sd(e){const t=[],r={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(i){if(this.tail.length>=i){const a=this.tail.substring(0,i);return this.tail=this.tail.substring(i),a}return!1}};for(;r.next();)switch(r.c){case"\\":if(r.next())switch(r.c){case"\\":t.push(r.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const i=r.c,a=r.take(2);if(a===!1)return!1;const m=parseInt(i+a,8);if(Number.isNaN(m))return!1;t.push(m);break}case"x":{const i=r.c,a=r.take(2);if(a===!1)return!1;const m=parseInt(i+a,16);if(Number.isNaN(m))return!1;t.push(m);break}case"u":{const i=r.c,a=r.take(4);if(a===!1)return!1;const m=parseInt(i+a,16);if(Number.isNaN(m))return!1;const v=new Uint8Array(4);new DataView(v.buffer).setInt32(0,m,!0),t.push(v[0],v[1],v[2],v[3]);break}case"U":{const i=r.c,a=r.take(8);if(a===!1)return!1;const m=oe.uEnc(i+a),v=new Uint8Array(8),s=new DataView(v.buffer);s.setInt32(0,m.lo,!0),s.setInt32(4,m.hi,!0),t.push(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7]);break}}break;default:t.push(r.c.charCodeAt(0))}return new Uint8Array(t)}function*Ci(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*Ci(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*Ci(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function Ho(...e){const t=yd();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of e[0].file)Zs(r,t);return t}if("$typeName"in e[0]){let m=function(v){const s=[];for(const c of v.dependency){if(t.getFile(c)!=null||a.has(c))continue;const h=i(c);if(!h)throw new Error(`Unable to resolve ${c}, imported by ${v.name}`);"kind"in h?t.addFile(h,!1,!0):(a.add(h.name),s.push(h))}return s.concat(...s.map(m))};const r=e[0],i=e[1],a=new Set;for(const v of[r,...m(r)].reverse())Zs(v,t)}else for(const r of e)for(const i of r.files)t.addFile(i);return t}function yd(){const e=new Map,t=new Map,r=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return r.values()},addFile(i,a,m){if(r.set(i.proto.name,i),!a)for(const v of Ci(i))this.add(v);if(m)for(const v of i.dependencies)this.addFile(v,a,m)},add(i){if(i.kind=="extension"){let a=t.get(i.extendee.typeName);a||t.set(i.extendee.typeName,a=new Map),a.set(i.number,i)}e.set(i.typeName,i)},get(i){return e.get(i)},getFile(i){return r.get(i)},getMessage(i){const a=e.get(i);return(a==null?void 0:a.kind)=="message"?a:void 0},getEnum(i){const a=e.get(i);return(a==null?void 0:a.kind)=="enum"?a:void 0},getExtension(i){const a=e.get(i);return(a==null?void 0:a.kind)=="extension"?a:void 0},getExtensionFor(i,a){var m;return(m=t.get(i.typeName))===null||m===void 0?void 0:m.get(a)},getService(i){const a=e.get(i);return(a==null?void 0:a.kind)=="service"?a:void 0}}}const Cd=998,wd=999,Ed=9,Qt=10,$t=11,kd=12,Ws=14,Ki=3,Id=2,Gs=1,Bd=0,ni=1,Ks=2,Ad=3,Rd=1,xd=2,Ld=1,$o={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function Zs(e,t){var r,i;const a={kind:"file",proto:e,deprecated:(i=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,edition:Nd(e),name:e.name.replace(/\.proto$/,""),dependencies:Md(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},m=new Map,v={get(s){return m.get(s)},add(s){var c;Oe(((c=s.proto.options)===null||c===void 0?void 0:c.mapEntry)===!0),m.set(s.typeName,s)}};for(const s of e.enumType)Wo(s,a,void 0,t);for(const s of e.messageType)Go(s,a,void 0,t,v);for(const s of e.service)Td(s,a,t);wi(a,t);for(const s of m.values())Ei(s,t,v);for(const s of a.messages)Ei(s,t,v),wi(s,t);t.addFile(a,!0)}function wi(e,t){switch(e.kind){case"file":for(const r of e.proto.extension){const i=ki(r,e,t);e.extensions.push(i),t.add(i)}break;case"message":for(const r of e.proto.extension){const i=ki(r,e,t);e.nestedExtensions.push(i),t.add(i)}for(const r of e.nestedMessages)wi(r,t);break}}function Ei(e,t,r){const i=e.proto.oneofDecl.map(m=>Od(m,e)),a=new Set;for(const m of e.proto.field){const v=Ud(m,i),s=ki(m,e,t,v,r);e.fields.push(s),e.field[s.localName]=s,v===void 0?e.members.push(s):(v.fields.push(s),a.has(v)||(a.add(v),e.members.push(v)))}for(const m of i.filter(v=>a.has(v)))e.oneofs.push(m);for(const m of e.nestedMessages)Ei(m,t,r)}function Wo(e,t,r,i){var a,m,v,s,c;const h=Fd(e.name,e.value),f={kind:"enum",proto:e,deprecated:(m=(a=e.options)===null||a===void 0?void 0:a.deprecated)!==null&&m!==void 0?m:!1,file:t,parent:r,open:!0,name:e.name,typeName:Mr(e,r,t),value:{},values:[],sharedPrefix:h,toString(){return`enum ${this.typeName}`}};f.open=Wd(f),i.add(f);for(const u of e.value){const g=u.name;f.values.push(f.value[u.number]={kind:"enum_value",proto:u,deprecated:(s=(v=u.options)===null||v===void 0?void 0:v.deprecated)!==null&&s!==void 0?s:!1,parent:f,name:g,localName:Jt(h==null?g:g.substring(h.length)),number:u.number,toString(){return`enum value ${f.typeName}.${g}`}})}((c=r==null?void 0:r.nestedEnums)!==null&&c!==void 0?c:t.enums).push(f)}function Go(e,t,r,i,a){var m,v,s,c;const h={kind:"message",proto:e,deprecated:(v=(m=e.options)===null||m===void 0?void 0:m.deprecated)!==null&&v!==void 0?v:!1,file:t,parent:r,name:e.name,typeName:Mr(e,r,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((s=e.options)===null||s===void 0?void 0:s.mapEntry)===!0?a.add(h):(((c=r==null?void 0:r.nestedMessages)!==null&&c!==void 0?c:t.messages).push(h),i.add(h));for(const f of e.enumType)Wo(f,t,h,i);for(const f of e.nestedType)Go(f,t,h,i,a)}function Td(e,t,r){var i,a;const m={kind:"service",proto:e,deprecated:(a=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&a!==void 0?a:!1,file:t,name:e.name,typeName:Mr(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(m),r.add(m);for(const v of e.method){const s=Dd(v,m,r);m.methods.push(s),m.method[s.localName]=s}}function Dd(e,t,r){var i,a,m,v;let s;e.clientStreaming&&e.serverStreaming?s="bidi_streaming":e.clientStreaming?s="client_streaming":e.serverStreaming?s="server_streaming":s="unary";const c=r.getMessage(He(e.inputType)),h=r.getMessage(He(e.outputType));Oe(c,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),Oe(h,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const f=e.name;return{kind:"rpc",proto:e,deprecated:(a=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&a!==void 0?a:!1,parent:t,name:f,localName:Jt(f.length?Jt(f[0].toLowerCase()+f.substring(1)):f),methodKind:s,input:c,output:h,idempotency:(v=(m=e.options)===null||m===void 0?void 0:m.idempotencyLevel)!==null&&v!==void 0?v:Bd,toString(){return`rpc ${t.typeName}.${f}`}}}function Od(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:Jt(Xt(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function ki(e,t,r,i,a){var m,v,s;const c=a===void 0,h={kind:"field",proto:e,deprecated:(v=(m=e.options)===null||m===void 0?void 0:m.deprecated)!==null&&v!==void 0?v:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:Vd(e,i,c,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(c){const y=t.kind=="file"?t:t.file,E=t.kind=="file"?void 0:t,p=Mr(e,E,y);h.kind="extension",h.file=y,h.parent=E,h.oneof=void 0,h.typeName=p,h.jsonName=`[${p}]`,h.toString=()=>`extension ${p}`;const n=r.getMessage(He(e.extendee));Oe(n,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),h.extendee=n}else{const y=t;Oe(y.kind=="message"),h.parent=y,h.oneof=i,h.localName=i?Xt(e.name):Jt(Xt(e.name)),h.jsonName=e.jsonName,h.toString=()=>`field ${y.typeName}.${e.name}`}const f=e.label,u=e.type,g=(s=e.options)===null||s===void 0?void 0:s.jstype;if(f===Ki){const y=u==$t?a==null?void 0:a.get(He(e.typeName)):void 0;if(y){h.fieldKind="map";const{key:E,value:p}=$d(y);return h.mapKey=E.scalar,h.mapKind=p.fieldKind,h.message=p.message,h.delimitedEncoding=!1,h.enum=p.enum,h.scalar=p.scalar,h}switch(h.fieldKind="list",u){case $t:case Qt:h.listKind="message",h.message=r.getMessage(He(e.typeName)),Oe(h.message),h.delimitedEncoding=zs(e,t);break;case Ws:h.listKind="enum",h.enum=r.getEnum(He(e.typeName)),Oe(h.enum);break;default:h.listKind="scalar",h.scalar=u,h.longAsString=g==Gs;break}return h.packed=Hd(e,t),h}switch(u){case $t:case Qt:h.fieldKind="message",h.message=r.getMessage(He(e.typeName)),Oe(h.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),h.delimitedEncoding=zs(e,t),h.getDefaultValue=()=>{};break;case Ws:{const y=r.getEnum(He(e.typeName));Oe(y!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),h.fieldKind="enum",h.enum=r.getEnum(He(e.typeName)),h.getDefaultValue=()=>qt(e,"defaultValue")?md(y,e.defaultValue):void 0;break}default:{h.fieldKind="scalar",h.scalar=u,h.longAsString=g==Gs,h.getDefaultValue=()=>qt(e,"defaultValue")?bd(u,e.defaultValue):void 0;break}}return h}function Nd(e){switch(e.syntax){case"":case"proto2":return Cd;case"proto3":return wd;case"editions":if(e.edition in $o)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function Md(e,t){return e.dependency.map(r=>{const i=t.getFile(r);if(!i)throw new Error(`Cannot find ${r}, imported by ${e.name}`);return i})}function Fd(e,t){const r=Pd(e)+"_";for(const i of t){if(!i.name.toLowerCase().startsWith(r))return;const a=i.name.substring(r.length);if(a.length==0||/^\d/.test(a))return}return r}function Pd(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function Mr(e,t,r){let i;return t?i=`${t.typeName}.${e.name}`:r.proto.package.length>0?i=`${r.proto.package}.${e.name}`:i=`${e.name}`,i}function He(e){return e.startsWith(".")?e.substring(1):e}function Ud(e,t){if(!qt(e,"oneofIndex")||e.proto3Optional)return;const r=t[e.oneofIndex];return Oe(r,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),r}function Vd(e,t,r,i){if(e.label==Id)return Ad;if(e.label==Ki)return Ks;if(t||e.proto3Optional||r)return ni;const a=kt("fieldPresence",{proto:e,parent:i});return a==Ks&&(e.type==$t||e.type==Qt)?ni:a}function Hd(e,t){if(e.label!=Ki)return!1;switch(e.type){case Ed:case kd:case Qt:case $t:return!1}const r=e.options;return r&&qt(r,"packed")?r.packed:Rd==kt("repeatedFieldEncoding",{proto:e,parent:t})}function $d(e){const t=e.fields.find(i=>i.number===1),r=e.fields.find(i=>i.number===2);return Oe(t&&t.fieldKind=="scalar"&&t.scalar!=M.BYTES&&t.scalar!=M.FLOAT&&t.scalar!=M.DOUBLE&&r&&r.fieldKind!="list"&&r.fieldKind!="map"),{key:t,value:r}}function Wd(e){var t;return Ld==kt("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function zs(e,t){return e.type==Qt?!0:xd==kt("messageEncoding",{proto:e,parent:t})}function kt(e,t){var r,i;const a=(r=t.proto.options)===null||r===void 0?void 0:r.features;if(a){const m=a[e];if(m!=0)return m}if("kind"in t){if(t.kind=="message")return kt(e,(i=t.parent)!==null&&i!==void 0?i:t.file);const m=$o[t.edition];if(!m)throw new Error(`feature default for edition ${t.edition} not found`);return m[e]}return kt(e,t.parent)}function Oe(e,t){if(!e)throw new Error(t)}function Gd(e){const t=Kd(e);return t.messageType.forEach(Gi),Ho(t,()=>{}).getFile(t.name)}function Kd(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(Ko),enumType:e.enumType.map(Zo)}))}function Ko(e){var t,r,i,a,m,v,s,c;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(r=(t=e.field)===null||t===void 0?void 0:t.map(Zd))!==null&&r!==void 0?r:[],extension:[],nestedType:(a=(i=e.nestedType)===null||i===void 0?void 0:i.map(Ko))!==null&&a!==void 0?a:[],enumType:(v=(m=e.enumType)===null||m===void 0?void 0:m.map(Zo))!==null&&v!==void 0?v:[],extensionRange:(c=(s=e.extensionRange)===null||s===void 0?void 0:s.map(f=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},f)))!==null&&c!==void 0?c:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function Zd(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?zd(e.options):void 0}))}function zd(e){var t,r,i;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(i=(r=e.editionDefaults)===null||r===void 0?void 0:r.map(m=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},m)))!==null&&i!==void 0?i:[],uninterpretedOption:[]}))}function Zo(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(r=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},r))})}function zo(e){const t=jd();let r=e.length*3/4;e[e.length-2]=="="?r-=2:e[e.length-1]=="="&&(r-=1);let i=new Uint8Array(r),a=0,m=0,v,s=0;for(let c=0;c<e.length;c++){if(v=t[e.charCodeAt(c)],v===void 0)switch(e[c]){case"=":m=0;case`
|
|
1776
|
+
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(m){case 0:s=v,m=1;break;case 1:i[a++]=s<<2|(v&48)>>4,s=v,m=2;break;case 2:i[a++]=(s&15)<<4|(v&60)>>2,s=v,m=3;break;case 3:i[a++]=(s&3)<<6|v,m=0;break}}if(m==1)throw Error("invalid base64 string");return i.subarray(0,a)}function Yd(e,t="std"){const r=Yo(t),i=t=="std";let a="",m=0,v,s=0;for(let c=0;c<e.length;c++)switch(v=e[c],m){case 0:a+=r[v>>2],s=(v&3)<<4,m=1;break;case 1:a+=r[s|v>>4],s=(v&15)<<2,m=2;break;case 2:a+=r[s|v>>6],a+=r[v&63],m=0;break}return m&&(a+=r[s],i&&(a+="=",m==1&&(a+="="))),a}let ur,Ys,_t;function Yo(e){return ur||(ur="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ys=ur.slice(0,-2).concat("-","_")),e=="url"?Ys:ur}function jd(){if(!_t){_t=[];const e=Yo("std");for(let t=0;t<e.length;t++)_t[e[t].charCodeAt(0)]=t;_t[45]=e.indexOf("+"),_t[95]=e.indexOf("/")}return _t}function Zi(e,t){return e!==null&&typeof e=="object"&&"$typeName"in e&&typeof e.$typeName=="string"?t===void 0?!0:t.typeName===e.$typeName:!1}const Xd=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class Ie extends Error{constructor(t,r,i="FieldValueInvalidError"){super(r),this.name=i,this.field=()=>t}}function Jd(e){return e instanceof Error&&Xd.includes(e.name)&&"field"in e&&typeof e.field=="function"}function et(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function zi(e,t){var r,i,a,m;if(et(e)&&We in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const v=t,s=e.field();return v.listKind==s.listKind&&v.scalar===s.scalar&&((r=v.message)===null||r===void 0?void 0:r.typeName)===((i=s.message)===null||i===void 0?void 0:i.typeName)&&((a=v.enum)===null||a===void 0?void 0:a.typeName)===((m=s.enum)===null||m===void 0?void 0:m.typeName)}return!0}return!1}function Yi(e,t){var r,i,a,m;if(et(e)&&We in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const v=t,s=e.field();return v.mapKey===s.mapKey&&v.mapKind==s.mapKind&&v.scalar===s.scalar&&((r=v.message)===null||r===void 0?void 0:r.typeName)===((i=s.message)===null||i===void 0?void 0:i.typeName)&&((a=v.enum)===null||a===void 0?void 0:a.typeName)===((m=s.enum)===null||m===void 0?void 0:m.typeName)}return!0}return!1}function ji(e,t){return et(e)&&We in e&&"desc"in e&&et(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const oi=Symbol.for("@bufbuild/protobuf/text-encoding");function Xi(){if(globalThis[oi]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[oi]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r){return t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[oi]}var ge;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(ge||(ge={}));const jo=34028234663852886e22,Xo=-34028234663852886e22,Jo=4294967295,qo=2147483647,Qo=-2147483648;class ea{constructor(t=Xi().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let a=0;a<this.chunks.length;a++)t+=this.chunks[a].length;let r=new Uint8Array(t),i=0;for(let a=0;a<this.chunks.length;a++)r.set(this.chunks[a],i),i+=this.chunks[a].length;return this.chunks=[],r}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),r=this.stack.pop();if(!r)throw new Error("invalid state, fork stack empty");return this.chunks=r.chunks,this.buf=r.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,r){return this.uint32((t<<3|r)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(js(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return ai(t),yi(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let r=this.encodeUtf8(t);return this.uint32(r.byteLength),this.raw(r)}float(t){qd(t);let r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,t,!0),this.raw(r)}double(t){let r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,t,!0),this.raw(r)}fixed32(t){js(t);let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!0),this.raw(r)}sfixed32(t){ai(t);let r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,t,!0),this.raw(r)}sint32(t){return ai(t),t=(t<<1^t>>31)>>>0,yi(t,this.buf),this}sfixed64(t){let r=new Uint8Array(8),i=new DataView(r.buffer),a=oe.enc(t);return i.setInt32(0,a.lo,!0),i.setInt32(4,a.hi,!0),this.raw(r)}fixed64(t){let r=new Uint8Array(8),i=new DataView(r.buffer),a=oe.uEnc(t);return i.setInt32(0,a.lo,!0),i.setInt32(4,a.hi,!0),this.raw(r)}int64(t){let r=oe.enc(t);return si(r.lo,r.hi,this.buf),this}sint64(t){const r=oe.enc(t),i=r.hi>>31,a=r.lo<<1^i,m=(r.hi<<1|r.lo>>>31)^i;return si(a,m,this.buf),this}uint64(t){const r=oe.uEnc(t);return si(r.lo,r.hi,this.buf),this}}class Ji{constructor(t,r=Xi().decodeUtf8){this.decodeUtf8=r,this.varint64=dd,this.uint32=fd,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),r=t>>>3,i=t&7;if(r<=0||i<0||i>5)throw new Error("illegal tag: field no "+r+" wire type "+i);return[r,i]}skip(t,r){let i=this.pos;switch(t){case ge.Varint:for(;this.buf[this.pos++]&128;);break;case ge.Bit64:this.pos+=4;case ge.Bit32:this.pos+=4;break;case ge.LengthDelimited:let a=this.uint32();this.pos+=a;break;case ge.StartGroup:for(;;){const[m,v]=this.tag();if(v===ge.EndGroup){if(r!==void 0&&m!==r)throw new Error("invalid end group tag");break}this.skip(v,m)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return oe.dec(...this.varint64())}uint64(){return oe.uDec(...this.varint64())}sint64(){let[t,r]=this.varint64(),i=-(t&1);return t=(t>>>1|(r&1)<<31)^i,r=r>>>1^i,oe.dec(t,r)}bool(){let[t,r]=this.varint64();return t!==0||r!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return oe.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return oe.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),r=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(r,r+t)}string(){return this.decodeUtf8(this.bytes())}}function ai(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>qo||e<Qo)throw new Error("invalid int32: "+e)}function js(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>Jo||e<0)throw new Error("invalid uint32: "+e)}function qd(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>jo||e<Xo))throw new Error("invalid float32: "+e)}function ot(e,t){const r=e.fieldKind=="list"?zi(t,e):e.fieldKind=="map"?Yi(t,e):qi(e,t);if(r===!0)return;let i;switch(e.fieldKind){case"list":i=`expected ${ia(e)}, got ${me(t)}`;break;case"map":i=`expected ${sa(e)}, got ${me(t)}`;break;default:i=Ar(e,t,r)}return new Ie(e,i)}function Xs(e,t,r){const i=qi(e,r);if(i!==!0)return new Ie(e,`list item #${t+1}: ${Ar(e,r,i)}`)}function Qd(e,t,r){const i=ta(t,e.mapKey);if(i!==!0)return new Ie(e,`invalid map key: ${Ar({scalar:e.mapKey},t,i)}`);const a=qi(e,r);if(a!==!0)return new Ie(e,`map entry ${me(t)}: ${Ar(e,r,a)}`)}function qi(e,t){return e.scalar!==void 0?ta(t,e.scalar):e.enum!==void 0?e.enum.open?Number.isInteger(t):e.enum.values.some(r=>r.number===t):ji(t,e.message)}function ta(e,t){switch(t){case M.DOUBLE:return typeof e=="number";case M.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>jo||e<Xo?`${e.toFixed()} out of range`:!0;case M.INT32:case M.SFIXED32:case M.SINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>qo||e<Qo?`${e.toFixed()} out of range`:!0;case M.FIXED32:case M.UINT32:return typeof e!="number"||!Number.isInteger(e)?!1:e>Jo||e<0?`${e.toFixed()} out of range`:!0;case M.BOOL:return typeof e=="boolean";case M.STRING:return typeof e!="string"?!1:Xi().checkUtf8(e)||"invalid UTF8";case M.BYTES:return e instanceof Uint8Array;case M.INT64:case M.SFIXED64:case M.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return oe.parse(e),!0}catch{return`${e} out of range`}return!1;case M.FIXED64:case M.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return oe.uParse(e),!0}catch{return`${e} out of range`}return!1}}function Ar(e,t,r){return r=typeof r=="string"?`: ${r}`:`, got ${me(t)}`,e.scalar!==void 0?`expected ${eh(e.scalar)}`+r:e.enum!==void 0?`expected ${e.enum.toString()}`+r:`expected ${ra(e.message)}`+r}function me(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:zi(e)?ia(e.field()):Yi(e)?sa(e.field()):ji(e)?ra(e.desc):Zi(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function ra(e){return`ReflectMessage (${e.typeName})`}function ia(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${M[e.scalar]})`}}function sa(e){switch(e.mapKind){case"message":return`ReflectMap (${M[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${M[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${M[e.mapKey]}, ${M[e.scalar]})`}}function eh(e){switch(e){case M.STRING:return"string";case M.BOOL:return"boolean";case M.INT64:case M.SINT64:case M.SFIXED64:return"bigint (int64)";case M.UINT64:case M.FIXED64:return"bigint (uint64)";case M.BYTES:return"Uint8Array";case M.DOUBLE:return"number (float64)";case M.FLOAT:return"number (float32)";case M.FIXED32:case M.UINT32:return"number (uint32)";case M.INT32:case M.SFIXED32:case M.SINT32:return"number (int32)"}}function th(e){return na(e.$typeName)}function nr(e){const t=e.fields[0];return na(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function na(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const rh=999,ih=998,Cr=2;function ve(e,t){if(Zi(t,e))return t;const r=ch(e);return t!==void 0&&sh(e,r,t),r}function sh(e,t,r){for(const i of e.members){let a=r[i.localName];if(a==null)continue;let m;if(i.kind=="oneof"){const v=Po(r,i);if(!v)continue;m=v,a=Uo(r,v)}else m=i;switch(m.fieldKind){case"message":a=Qi(m,a);break;case"scalar":a=oa(m,a);break;case"list":a=oh(m,a);break;case"map":a=nh(m,a);break}Vo(t,m,a)}return t}function oa(e,t){return e.scalar==M.BYTES?es(t):t}function nh(e,t){if(et(t)){if(e.scalar==M.BYTES)return Js(t,es);if(e.mapKind=="message")return Js(t,r=>Qi(e,r))}return t}function oh(e,t){if(Array.isArray(t)){if(e.scalar==M.BYTES)return t.map(es);if(e.listKind=="message")return t.map(r=>Qi(e,r))}return t}function Qi(e,t){if(e.fieldKind=="message"&&!e.oneof&&nr(e.message))return oa(e.message.fields[0],t);if(et(t)){if(e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!=="google.protobuf.Value")return t;if(!Zi(t,e.message))return ve(e.message,t)}return t}function es(e){return Array.isArray(e)?new Uint8Array(e):e}function Js(e,t){const r={};for(const i of Object.entries(e))r[i[0]]=t(i[1]);return r}const ah=Symbol(),qs=new WeakMap;function ch(e){let t;if(lh(e)){const r=qs.get(e);let i,a;if(r)({prototype:i,members:a}=r);else{i={},a=new Set;for(const m of e.members)m.kind!="oneof"&&(m.fieldKind!="scalar"&&m.fieldKind!="enum"||m.presence!=Cr&&(a.add(m),i[m.localName]=ci(m)));qs.set(e,{prototype:i,members:a})}t=Object.create(i),t.$typeName=e.typeName;for(const m of e.members)a.has(m)||m.kind=="field"&&(m.fieldKind=="message"||(m.fieldKind=="scalar"||m.fieldKind=="enum")&&m.presence!=Cr)||(t[m.localName]=ci(m))}else{t={$typeName:e.typeName};for(const r of e.members)(r.kind=="oneof"||r.presence==Cr)&&(t[r.localName]=ci(r))}return t}function lh(e){switch(e.file.edition){case rh:return!1;case ih:return!0;default:return e.fields.some(t=>t.presence!=Cr&&t.fieldKind!="message"&&!t.oneof)}}function ci(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return ah;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?gt(e.scalar,e.longAsString):e.enum.values[0].number}function De(e,t,r=!0){return new aa(e,t,r)}class aa{get sortedFields(){var t;return(t=this._sortedFields)!==null&&t!==void 0?t:this._sortedFields=this.desc.fields.concat().sort((r,i)=>r.number-i.number)}constructor(t,r,i=!0){this.lists=new Map,this.maps=new Map,this.check=i,this.desc=t,this.message=this[We]=r??ve(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(r=>[r.number,r]))),this._fieldsByNumber.get(t)}oneofCase(t){return Nt(this.message,t),Po(this.message,t)}isSet(t){return Nt(this.message,t),_d(this.message,t)}clear(t){Nt(this.message,t),vd(this.message,t)}get(t){Nt(this.message,t);const r=Uo(this.message,t);switch(t.fieldKind){case"list":let i=this.lists.get(t);return(!i||i[We]!==r)&&this.lists.set(t,i=new dh(t,r,this.check)),i;case"map":let a=this.maps.get(t);return(!a||a[We]!==r)&&this.maps.set(t,a=new hh(t,r,this.check)),a;case"message":return rs(t,r,this.check);case"scalar":return r===void 0?gt(t.scalar,!1):is(t,r);case"enum":return r??t.enum.values[0].number}}set(t,r){if(Nt(this.message,t),this.check){const a=ot(t,r);if(a)throw a}let i;t.fieldKind=="message"?i=ts(t,r):Yi(r)||zi(r)?i=r[We]:i=ss(t,r),Vo(this.message,t,i)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function Nt(e,t){if(t.parent.typeName!==e.$typeName)throw new Ie(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class dh{field(){return this._field}get size(){return this._arr.length}constructor(t,r,i){this._field=t,this._arr=this[We]=r,this.check=i}get(t){const r=this._arr[t];return r===void 0?void 0:li(this._field,r,this.check)}set(t,r){if(t<0||t>=this._arr.length)throw new Ie(this._field,`list item #${t+1}: out of range`);if(this.check){const i=Xs(this._field,t,r);if(i)throw i}this._arr[t]=Qs(this._field,r)}add(t){if(this.check){const r=Xs(this._field,this._arr.length,t);if(r)throw r}this._arr.push(Qs(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield li(this._field,t,this.check)}*entries(){for(let t=0;t<this._arr.length;t++)yield[t,li(this._field,this._arr[t],this.check)]}}class hh{constructor(t,r,i=!0){this.obj=this[We]=r??{},this.check=i,this._field=t}field(){return this._field}set(t,r){if(this.check){const i=Qd(this._field,t,r);if(i)throw i}return this.obj[fr(t)]=uh(this._field,r),this}delete(t){const r=fr(t),i=Object.prototype.hasOwnProperty.call(this.obj,r);return i&&delete this.obj[r],i}clear(){for(const t of Object.keys(this.obj))delete this.obj[t]}get(t){let r=this.obj[fr(t)];return r!==void 0&&(r=di(this._field,r,this.check)),r}has(t){return Object.prototype.hasOwnProperty.call(this.obj,fr(t))}*keys(){for(const t of Object.keys(this.obj))yield en(t,this._field.mapKey)}*entries(){for(const t of Object.entries(this.obj))yield[en(t[0],this._field.mapKey),di(this._field,t[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const t of Object.values(this.obj))yield di(this._field,t,this.check)}forEach(t,r){for(const i of this.entries())t.call(r,i[1],i[0],this)}}function ts(e,t){return ji(t)?th(t.message)&&!e.oneof&&e.fieldKind=="message"?t.message.value:t.desc.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"?la(t.message):t.message:t}function rs(e,t,r){return t!==void 0&&(nr(e.message)&&!e.oneof&&e.fieldKind=="message"?t={$typeName:e.message.typeName,value:is(e.message.fields[0],t)}:e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!="google.protobuf.Value"&&et(t)&&(t=ca(t))),new aa(e.message,t,r)}function Qs(e,t){return e.listKind=="message"?ts(e,t):ss(e,t)}function li(e,t,r){return e.listKind=="message"?rs(e,t,r):is(e,t)}function uh(e,t){return e.mapKind=="message"?ts(e,t):ss(e,t)}function di(e,t,r){return e.mapKind=="message"?rs(e,t,r):t}function fr(e){return typeof e=="string"||typeof e=="number"?e:String(e)}function en(e,t){switch(t){case M.STRING:return e;case M.INT32:case M.FIXED32:case M.UINT32:case M.SFIXED32:case M.SINT32:{const r=Number.parseInt(e);if(Number.isFinite(r))return r;break}case M.BOOL:switch(e){case"true":return!0;case"false":return!1}break;case M.UINT64:case M.FIXED64:try{return oe.uParse(e)}catch{}break;default:try{return oe.parse(e)}catch{}break}return e}function is(e,t){switch(e.scalar){case M.INT64:case M.SFIXED64:case M.SINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=oe.parse(t));break;case M.FIXED64:case M.UINT64:"longAsString"in e&&e.longAsString&&typeof t=="string"&&(t=oe.uParse(t));break}return t}function ss(e,t){switch(e.scalar){case M.INT64:case M.SFIXED64:case M.SINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=oe.parse(t));break;case M.FIXED64:case M.UINT64:"longAsString"in e&&e.longAsString?t=String(t):(typeof t=="string"||typeof t=="number")&&(t=oe.uParse(t));break}return t}function ca(e){const t={$typeName:"google.protobuf.Struct",fields:{}};if(et(e))for(const[r,i]of Object.entries(e))t.fields[r]=ha(i);return t}function la(e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=da(i);return t}function da(e){switch(e.kind.case){case"structValue":return la(e.kind.value);case"listValue":return e.kind.value.values.map(da);case"nullValue":case void 0:return null;default:return e.kind.value}}function ha(e){const t={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:0};else if(Array.isArray(e)){const r={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(e))for(const i of e)r.values.push(ha(i));t.kind={case:"listValue",value:r}}else t.kind={case:"structValue",value:ca(e)};break}return t}const fh=3,tn={writeUnknownFields:!0};function gh(e){return e?Object.assign(Object.assign({},tn),e):tn}function ph(e,t,r){return Rr(new ea,gh(r),De(e,t)).finish()}function Rr(e,t,r){var i;for(const a of r.sortedFields){if(!r.isSet(a)){if(a.presence==fh)throw new Error(`cannot encode ${a} to binary: required field not set`);continue}ua(e,t,r,a)}if(t.writeUnknownFields)for(const{no:a,wireType:m,data:v}of(i=r.getUnknown())!==null&&i!==void 0?i:[])e.tag(a,m).raw(v);return e}function ua(e,t,r,i){var a;switch(i.fieldKind){case"scalar":case"enum":xr(e,r.desc.typeName,i.name,(a=i.scalar)!==null&&a!==void 0?a:M.INT32,i.number,r.get(i));break;case"list":_h(e,t,i,r.get(i));break;case"message":fa(e,t,i,r.get(i));break;case"map":for(const[m,v]of r.get(i))vh(e,t,i,m,v);break}}function xr(e,t,r,i,a,m){ga(e.tag(a,mh(i)),t,r,i,m)}function fa(e,t,r,i){r.delimitedEncoding?Rr(e.tag(r.number,ge.StartGroup),t,i).tag(r.number,ge.EndGroup):Rr(e.tag(r.number,ge.LengthDelimited).fork(),t,i).join()}function _h(e,t,r,i){var a;if(r.listKind=="message"){for(const v of i)fa(e,t,r,v);return}const m=(a=r.scalar)!==null&&a!==void 0?a:M.INT32;if(r.packed){if(!i.size)return;e.tag(r.number,ge.LengthDelimited).fork();for(const v of i)ga(e,r.parent.typeName,r.name,m,v);e.join();return}for(const v of i)xr(e,r.parent.typeName,r.name,m,r.number,v)}function vh(e,t,r,i,a){var m;switch(e.tag(r.number,ge.LengthDelimited).fork(),xr(e,r.parent.typeName,r.name,r.mapKey,1,i),r.mapKind){case"scalar":case"enum":xr(e,r.parent.typeName,r.name,(m=r.scalar)!==null&&m!==void 0?m:M.INT32,2,a);break;case"message":Rr(e.tag(2,ge.LengthDelimited).fork(),t,a).join();break}e.join()}function ga(e,t,r,i,a){try{switch(i){case M.STRING:e.string(a);break;case M.BOOL:e.bool(a);break;case M.DOUBLE:e.double(a);break;case M.FLOAT:e.float(a);break;case M.INT32:e.int32(a);break;case M.INT64:e.int64(a);break;case M.UINT64:e.uint64(a);break;case M.FIXED64:e.fixed64(a);break;case M.BYTES:e.bytes(a);break;case M.FIXED32:e.fixed32(a);break;case M.SFIXED32:e.sfixed32(a);break;case M.SFIXED64:e.sfixed64(a);break;case M.SINT64:e.sint64(a);break;case M.UINT32:e.uint32(a);break;case M.SINT32:e.sint32(a);break}}catch(m){throw m instanceof Error?new Error(`cannot encode field ${t}.${r} to binary: ${m.message}`):m}}function mh(e){switch(e){case M.BYTES:case M.STRING:return ge.LengthDelimited;case M.DOUBLE:case M.FIXED64:case M.SFIXED64:return ge.Bit64;case M.FIXED32:case M.SFIXED32:case M.FLOAT:return ge.Bit32;default:return ge.Varint}}function Ve(e,t,...r){return r.reduce((i,a)=>i.nestedMessages[a],e.messages[t])}function Fr(e,t,...r){if(r.length==0)return e.enums[t];const i=r.pop();return r.reduce((a,m)=>a.nestedMessages[m],e.messages[t]).nestedEnums[i]}function Pr(e){const t={};for(const r of e.values)t[r.localName]=r.number,t[r.number]=r.localName;return t}const bh=Gd({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false"},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),Sh=Ve(bh,1);var rn;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(rn||(rn={}));var sn;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(sn||(sn={}));var nn;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(nn||(nn={}));var on;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(on||(on={}));var an;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(an||(an={}));var cn;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(cn||(cn={}));var ln;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(ln||(ln={}));var dn;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(dn||(dn={}));var hn;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(hn||(hn={}));var un;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})(un||(un={}));var fn;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(fn||(fn={}));var gn;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(gn||(gn={}));var pn;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(pn||(pn={}));var _n;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(_n||(_n={}));var vn;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(vn||(vn={}));var mn;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(mn||(mn={}));var bn;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(bn||(bn={}));var Sn;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(Sn||(Sn={}));var yn;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(yn||(yn={}));var Cn;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(Cn||(Cn={}));const yh={readUnknownFields:!0};function Ch(e){return yh}function pa(e,t,r){const i=De(e,void 0,!1);return _a(i,new Ji(t),Ch(),!1,t.byteLength),i.message}function _a(e,t,r,i,a){var m;const v=i?t.len:t.pos+a;let s,c;const h=(m=e.getUnknown())!==null&&m!==void 0?m:[];for(;t.pos<v&&([s,c]=t.tag(),!(i&&c==ge.EndGroup));){const f=e.findNumber(s);if(!f){const u=t.skip(c,s);r.readUnknownFields&&h.push({no:s,wireType:c,data:u});continue}va(e,t,f,c,r)}if(i&&(c!=ge.EndGroup||s!==a))throw new Error("invalid end group tag");h.length>0&&e.setUnknown(h)}function va(e,t,r,i,a){var m;switch(r.fieldKind){case"scalar":e.set(r,It(t,r.scalar));break;case"enum":const v=It(t,M.INT32);if(r.enum.open)e.set(r,v);else if(r.enum.values.some(c=>c.number===v))e.set(r,v);else if(a.readUnknownFields){const c=[];yi(v,c);const h=(m=e.getUnknown())!==null&&m!==void 0?m:[];h.push({no:r.number,wireType:i,data:new Uint8Array(c)}),e.setUnknown(h)}break;case"message":e.set(r,ns(t,a,r,e.get(r)));break;case"list":Eh(t,i,e.get(r),a);break;case"map":wh(t,e.get(r),a);break}}function wh(e,t,r){const i=t.field();let a,m;const v=e.uint32(),s=e.pos+v;for(;e.pos<s;){const[c]=e.tag();switch(c){case 1:a=It(e,i.mapKey);break;case 2:switch(i.mapKind){case"scalar":m=It(e,i.scalar);break;case"enum":m=e.int32();break;case"message":m=ns(e,r,i);break}break}}if(a===void 0&&(a=gt(i.mapKey,!1)),m===void 0)switch(i.mapKind){case"scalar":m=gt(i.scalar,!1);break;case"enum":m=i.enum.values[0].number;break;case"message":m=De(i.message,void 0,!1);break}t.set(a,m)}function Eh(e,t,r,i){var a;const m=r.field();if(m.listKind==="message"){r.add(ns(e,i,m));return}const v=(a=m.scalar)!==null&&a!==void 0?a:M.INT32;if(!(t==ge.LengthDelimited&&v!=M.STRING&&v!=M.BYTES)){r.add(It(e,v));return}const c=e.uint32()+e.pos;for(;e.pos<c;)r.add(It(e,v))}function ns(e,t,r,i){const a=r.delimitedEncoding,m=i??De(r.message,void 0,!1);return _a(m,e,t,a,a?r.number:e.uint32()),m}function It(e,t){switch(t){case M.STRING:return e.string();case M.BOOL:return e.bool();case M.DOUBLE:return e.double();case M.FLOAT:return e.float();case M.INT32:return e.int32();case M.INT64:return e.int64();case M.UINT64:return e.uint64();case M.FIXED64:return e.fixed64();case M.BYTES:return e.bytes();case M.FIXED32:return e.fixed32();case M.SFIXED32:return e.sfixed32();case M.SFIXED64:return e.sfixed64();case M.SINT64:return e.sint64();case M.UINT32:return e.uint32();case M.SINT32:return e.sint32()}}function it(e,t){var r;const i=pa(Sh,zo(e));return i.messageType.forEach(Gi),i.dependency=(r=t==null?void 0:t.map(m=>m.proto.name))!==null&&r!==void 0?r:[],Ho(i,m=>t==null?void 0:t.find(v=>v.proto.name===m)).getFile(i.name)}const os=it("ChxydW5tZS9ydW5uZXIvdjIvY29uZmlnLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiigMKDVByb2dyYW1Db25maWcSFAoMcHJvZ3JhbV9uYW1lGAEgASgJEhEKCWFyZ3VtZW50cxgCIAMoCRIRCglkaXJlY3RvcnkYAyABKAkSEwoLbGFuZ3VhZ2VfaWQYBCABKAkSEgoKYmFja2dyb3VuZBgFIAEoCBIWCg5maWxlX2V4dGVuc2lvbhgGIAEoCRILCgNlbnYYByADKAkSPgoIY29tbWFuZHMYCCABKAsyKi5ydW5tZS5ydW5uZXIudjIuUHJvZ3JhbUNvbmZpZy5Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgJIAEoCUgAEhMKC2ludGVyYWN0aXZlGAogASgIEioKBG1vZGUYCyABKA4yHC5ydW5tZS5ydW5uZXIudjIuQ29tbWFuZE1vZGUSEAoIa25vd25faWQYDCABKAkSEgoKa25vd25fbmFtZRgNIAEoCRIOCgZydW5faWQYDiABKAkaHAoLQ29tbWFuZExpc3QSDQoFaXRlbXMYASADKAlCCAoGc291cmNlKowBCgtDb21tYW5kTW9kZRIcChhDT01NQU5EX01PREVfVU5TUEVDSUZJRUQQABIXChNDT01NQU5EX01PREVfSU5MSU5FEAESFQoRQ09NTUFORF9NT0RFX0ZJTEUQAhIZChVDT01NQU5EX01PREVfVEVSTUlOQUwQAxIUChBDT01NQU5EX01PREVfQ0xJEARCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z"),wn=Ve(os,0,0),kh=Fr(os,0),hi=Pr(kh),Ih=it("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Bh=Ve(Ih,0);function Ah(e,t,r){let i=!1;return r||(r=ve(Bh),i=!0),r.value=ph(e,t),r.typeUrl=Lh(t.$typeName),i?r:void 0}function Rh(e,t){if(e.typeUrl==="")return!1;const r=typeof t=="string"?t:t.typeName,i=ma(e.typeUrl);return r===i}function xh(e,t){if(e.typeUrl==="")return;const r=t.kind=="message"?t:t.getMessage(ma(e.typeUrl));if(!(!r||!Rh(e,r)))return pa(r,e.value)}function Lh(e){return`type.googleapis.com/${e}`}function ma(e){const t=e.lastIndexOf("/"),r=t>=0?e.substring(t+1):e;if(!r.length)throw new Error(`invalid type url: ${e}`);return r}const as=it("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Th=Ve(as,0),ba=Ve(as,1),Dh=Ve(as,2);var Ii;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(Ii||(Ii={}));const Oh=it("Ch5nb29nbGUvcHJvdG9idWYvd3JhcHBlcnMucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIcCgtEb3VibGVWYWx1ZRINCgV2YWx1ZRgBIAEoASIbCgpGbG9hdFZhbHVlEg0KBXZhbHVlGAEgASgCIhsKCkludDY0VmFsdWUSDQoFdmFsdWUYASABKAMiHAoLVUludDY0VmFsdWUSDQoFdmFsdWUYASABKAQiGwoKSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoBSIcCgtVSW50MzJWYWx1ZRINCgV2YWx1ZRgBIAEoDSIaCglCb29sVmFsdWUSDQoFdmFsdWUYASABKAgiHAoLU3RyaW5nVmFsdWUSDQoFdmFsdWUYASABKAkiGwoKQnl0ZXNWYWx1ZRINCgV2YWx1ZRgBIAEoDEKDAQoTY29tLmdvb2dsZS5wcm90b2J1ZkINV3JhcHBlcnNQcm90b1ABWjFnb29nbGUuZ29sYW5nLm9yZy9wcm90b2J1Zi90eXBlcy9rbm93bi93cmFwcGVyc3Bi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),or=it("ChxydW5tZS9ydW5uZXIvdjIvcnVubmVyLnByb3RvEg9ydW5tZS5ydW5uZXIudjIiLwoHUHJvamVjdBIMCgRyb290GAEgASgJEhYKDmVudl9sb2FkX29yZGVyGAIgAygJIo0BCgdTZXNzaW9uEgoKAmlkGAEgASgJEgsKA2VudhgCIAMoCRI4CghtZXRhZGF0YRgDIAMoCzImLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uLk1ldGFkYXRhRW50cnkaLwoNTWV0YWRhdGFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIrIFChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJFCghtZXRhZGF0YRgBIAMoCzIzLnJ1bm1lLnJ1bm5lci52Mi5DcmVhdGVTZXNzaW9uUmVxdWVzdC5NZXRhZGF0YUVudHJ5EgsKA2VudhgCIAMoCRIuCgdwcm9qZWN0GAMgASgLMhgucnVubWUucnVubmVyLnYyLlByb2plY3RIAIgBARJBCg5lbnZfc3RvcmVfdHlwZRgEIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSAGIAQESPAoGY29uZmlnGAUgASgLMiwucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LkNvbmZpZxovCg1NZXRhZGF0YUVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaxAIKBkNvbmZpZxJBCg5lbnZfc3RvcmVfdHlwZRgBIAEoDjIkLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uRW52U3RvcmVUeXBlSACIAQESYwoRZW52X3N0b3JlX3NlZWRpbmcYAiABKA4yQy5ydW5tZS5ydW5uZXIudjIuQ3JlYXRlU2Vzc2lvblJlcXVlc3QuQ29uZmlnLlNlc3Npb25FbnZTdG9yZVNlZWRpbmdIAYgBASJpChZTZXNzaW9uRW52U3RvcmVTZWVkaW5nEikKJVNFU1NJT05fRU5WX1NUT1JFX1NFRURJTkdfVU5TUEVDSUZJRUQQABIkCiBTRVNTSU9OX0VOVl9TVE9SRV9TRUVESU5HX1NZU1RFTRABQhEKD19lbnZfc3RvcmVfdHlwZUIUChJfZW52X3N0b3JlX3NlZWRpbmdCCgoIX3Byb2plY3RCEQoPX2Vudl9zdG9yZV90eXBlIkIKFUNyZWF0ZVNlc3Npb25SZXNwb25zZRIpCgdzZXNzaW9uGAEgASgLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24iHwoRR2V0U2Vzc2lvblJlcXVlc3QSCgoCaWQYASABKAkiPwoSR2V0U2Vzc2lvblJlc3BvbnNlEikKB3Nlc3Npb24YASABKAsyGC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvbiIVChNMaXN0U2Vzc2lvbnNSZXF1ZXN0IkIKFExpc3RTZXNzaW9uc1Jlc3BvbnNlEioKCHNlc3Npb25zGAEgAygLMhgucnVubWUucnVubmVyLnYyLlNlc3Npb24i4wEKFFVwZGF0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJEkUKCG1ldGFkYXRhGAIgAygLMjMucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0Lk1ldGFkYXRhRW50cnkSCwoDZW52GAMgAygJEi4KB3Byb2plY3QYBCABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgAiAEBGi8KDU1ldGFkYXRhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIKCghfcHJvamVjdCJCChVVcGRhdGVTZXNzaW9uUmVzcG9uc2USKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIiIKFERlbGV0ZVNlc3Npb25SZXF1ZXN0EgoKAmlkGAEgASgJIhcKFURlbGV0ZVNlc3Npb25SZXNwb25zZSI7CgdXaW5zaXplEgwKBHJvd3MYASABKA0SDAoEY29scxgCIAEoDRIJCgF4GAMgASgNEgkKAXkYBCABKA0i5QIKDkV4ZWN1dGVSZXF1ZXN0Ei4KBmNvbmZpZxgBIAEoCzIeLnJ1bm1lLnJ1bm5lci52Mi5Qcm9ncmFtQ29uZmlnEhIKCmlucHV0X2RhdGEYCCABKAwSKgoEc3RvcBgJIAEoDjIcLnJ1bm1lLnJ1bm5lci52Mi5FeGVjdXRlU3RvcBIuCgd3aW5zaXplGAogASgLMhgucnVubWUucnVubmVyLnYyLldpbnNpemVIAIgBARISCgpzZXNzaW9uX2lkGBQgASgJEjoKEHNlc3Npb25fc3RyYXRlZ3kYFSABKA4yIC5ydW5tZS5ydW5uZXIudjIuU2Vzc2lvblN0cmF0ZWd5Ei4KB3Byb2plY3QYFiABKAsyGC5ydW5tZS5ydW5uZXIudjIuUHJvamVjdEgBiAEBEhsKE3N0b3JlX3N0ZG91dF9pbl9lbnYYFyABKAhCCgoIX3dpbnNpemVCCgoIX3Byb2plY3QiqgEKD0V4ZWN1dGVSZXNwb25zZRIvCglleGl0X2NvZGUYASABKAsyHC5nb29nbGUucHJvdG9idWYuVUludDMyVmFsdWUSEwoLc3Rkb3V0X2RhdGEYAiABKAwSEwoLc3RkZXJyX2RhdGEYAyABKAwSKQoDcGlkGAQgASgLMhwuZ29vZ2xlLnByb3RvYnVmLlVJbnQzMlZhbHVlEhEKCW1pbWVfdHlwZRgFIAEoCSIqChlSZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Eg0KBWxpbmVzGAEgAygJIsAEChVSZXNvbHZlUHJvZ3JhbVJlcXVlc3QSPgoIY29tbWFuZHMYASABKAsyKi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1Db21tYW5kTGlzdEgAEhAKBnNjcmlwdBgCIAEoCUgAEjkKBG1vZGUYAyABKA4yKy5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXF1ZXN0Lk1vZGUSCwoDZW52GAQgAygJEhIKCnNlc3Npb25faWQYBSABKAkSOgoQc2Vzc2lvbl9zdHJhdGVneRgGIAEoDjIgLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uU3RyYXRlZ3kSLgoHcHJvamVjdBgHIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5Qcm9qZWN0SAGIAQESEwoLbGFuZ3VhZ2VfaWQYCCABKAkSQwoJcmV0ZW50aW9uGAkgASgOMjAucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdC5SZXRlbnRpb24iRAoETW9kZRIUChBNT0RFX1VOU1BFQ0lGSUVEEAASEwoPTU9ERV9QUk9NUFRfQUxMEAESEQoNTU9ERV9TS0lQX0FMTBACIlcKCVJldGVudGlvbhIZChVSRVRFTlRJT05fVU5TUEVDSUZJRUQQABIXChNSRVRFTlRJT05fRklSU1RfUlVOEAESFgoSUkVURU5USU9OX0xBU1RfUlVOEAJCCAoGc291cmNlQgoKCF9wcm9qZWN0ItoDChZSZXNvbHZlUHJvZ3JhbVJlc3BvbnNlEg4KBnNjcmlwdBgBIAEoCRI8Cghjb21tYW5kcxgCIAEoCzIqLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbUNvbW1hbmRMaXN0Ej8KBHZhcnMYAyADKAsyMS5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5WYXJSZXN1bHQaiQEKCVZhclJlc3VsdBI+CgZzdGF0dXMYASABKA4yLi5ydW5tZS5ydW5uZXIudjIuUmVzb2x2ZVByb2dyYW1SZXNwb25zZS5TdGF0dXMSDAoEbmFtZRgCIAEoCRIWCg5vcmlnaW5hbF92YWx1ZRgDIAEoCRIWCg5yZXNvbHZlZF92YWx1ZRgEIAEoCSKkAQoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEhMKD1NUQVRVU19SRVNPTFZFRBABEiIKHlNUQVRVU19VTlJFU09MVkVEX1dJVEhfTUVTU0FHRRACEiYKIlNUQVRVU19VTlJFU09MVkVEX1dJVEhfUExBQ0VIT0xERVIQAxIhCh1TVEFUVVNfVU5SRVNPTFZFRF9XSVRIX1NFQ1JFVBAEIkMKFk1vbml0b3JFbnZTdG9yZVJlcXVlc3QSKQoHc2Vzc2lvbhgBIAEoCzIYLnJ1bm1lLnJ1bm5lci52Mi5TZXNzaW9uIsIECh9Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90EkoKBGVudnMYASADKAsyPC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2VTbmFwc2hvdC5TbmFwc2hvdEVudhrOAgoLU25hcHNob3RFbnYSRwoGc3RhdHVzGAEgASgOMjcucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuU3RhdHVzEgwKBG5hbWUYAiABKAkSEwoLZGVzY3JpcHRpb24YAyABKAkSDAoEc3BlYxgEIAEoCRITCgtpc19yZXF1aXJlZBgFIAEoCBIOCgZvcmlnaW4YBiABKAkSFgoOb3JpZ2luYWxfdmFsdWUYByABKAkSFgoOcmVzb2x2ZWRfdmFsdWUYCCABKAkSEwoLY3JlYXRlX3RpbWUYCSABKAkSEwoLdXBkYXRlX3RpbWUYCiABKAkSRgoGZXJyb3JzGAsgAygLMjYucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlc3BvbnNlU25hcHNob3QuRXJyb3IaJgoFRXJyb3ISDAoEY29kZRgBIAEoDRIPCgdtZXNzYWdlGAIgASgJIloKBlN0YXR1cxIWChJTVEFUVVNfVU5TUEVDSUZJRUQQABISCg5TVEFUVVNfTElURVJBTBABEhEKDVNUQVRVU19ISURERU4QAhIRCg1TVEFUVVNfTUFTS0VEEAMimwEKF01vbml0b3JFbnZTdG9yZVJlc3BvbnNlEjIKBHR5cGUYASABKA4yJC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlVHlwZRJECghzbmFwc2hvdBgCIAEoCzIwLnJ1bm1lLnJ1bm5lci52Mi5Nb25pdG9yRW52U3RvcmVSZXNwb25zZVNuYXBzaG90SABCBgoEZGF0YSpdChNTZXNzaW9uRW52U3RvcmVUeXBlEiYKIlNFU1NJT05fRU5WX1NUT1JFX1RZUEVfVU5TUEVDSUZJRUQQABIeChpTRVNTSU9OX0VOVl9TVE9SRV9UWVBFX09XTBABKl4KC0V4ZWN1dGVTdG9wEhwKGEVYRUNVVEVfU1RPUF9VTlNQRUNJRklFRBAAEhoKFkVYRUNVVEVfU1RPUF9JTlRFUlJVUFQQARIVChFFWEVDVVRFX1NUT1BfS0lMTBACKlUKD1Nlc3Npb25TdHJhdGVneRIgChxTRVNTSU9OX1NUUkFURUdZX1VOU1BFQ0lGSUVEEAASIAocU0VTU0lPTl9TVFJBVEVHWV9NT1NUX1JFQ0VOVBABKmIKE01vbml0b3JFbnZTdG9yZVR5cGUSJgoiTU9OSVRPUl9FTlZfU1RPUkVfVFlQRV9VTlNQRUNJRklFRBAAEiMKH01PTklUT1JfRU5WX1NUT1JFX1RZUEVfU05BUFNIT1QQATKQBgoNUnVubmVyU2VydmljZRJgCg1DcmVhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLkNyZWF0ZVNlc3Npb25SZXNwb25zZSIAElcKCkdldFNlc3Npb24SIi5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlcXVlc3QaIy5ydW5tZS5ydW5uZXIudjIuR2V0U2Vzc2lvblJlc3BvbnNlIgASXQoMTGlzdFNlc3Npb25zEiQucnVubWUucnVubmVyLnYyLkxpc3RTZXNzaW9uc1JlcXVlc3QaJS5ydW5tZS5ydW5uZXIudjIuTGlzdFNlc3Npb25zUmVzcG9uc2UiABJgCg1VcGRhdGVTZXNzaW9uEiUucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXF1ZXN0GiYucnVubWUucnVubmVyLnYyLlVwZGF0ZVNlc3Npb25SZXNwb25zZSIAEmAKDURlbGV0ZVNlc3Npb24SJS5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlcXVlc3QaJi5ydW5tZS5ydW5uZXIudjIuRGVsZXRlU2Vzc2lvblJlc3BvbnNlIgASaAoPTW9uaXRvckVudlN0b3JlEicucnVubWUucnVubmVyLnYyLk1vbml0b3JFbnZTdG9yZVJlcXVlc3QaKC5ydW5tZS5ydW5uZXIudjIuTW9uaXRvckVudlN0b3JlUmVzcG9uc2UiADABElIKB0V4ZWN1dGUSHy5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlcXVlc3QaIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlIgAoATABEmMKDlJlc29sdmVQcm9ncmFtEiYucnVubWUucnVubmVyLnYyLlJlc29sdmVQcm9ncmFtUmVxdWVzdBonLnJ1bm1lLnJ1bm5lci52Mi5SZXNvbHZlUHJvZ3JhbVJlc3BvbnNlIgBCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3J1bm5lci92MjtydW5uZXJ2MmIGcHJvdG8z",[Oh,os]),Sa=Ve(or,12),Bi=Ve(or,13),Nh=Fr(or,19,0),$e=Pr(Nh),Mh=Fr(or,2),Fh=Pr(Mh);function Ph(e,t){ya(t,e);const r=Vh(e.$unknown,t),[i,a,m]=Ur(t);for(const v of r)va(i,new Ji(v.data),a,v.wireType,{readUnknownFields:!0});return m()}function Uh(e,t,r){var i;ya(t,e);const a=((i=e.$unknown)!==null&&i!==void 0?i:[]).filter(h=>h.no!==t.number),[m,v]=Ur(t,r),s=new ea;ua(s,{writeUnknownFields:!0},m,v);const c=new Ji(s.finish());for(;c.pos<c.len;){const[h,f]=c.tag(),u=c.skip(f,h);a.push({no:h,wireType:f,data:u})}e.$unknown=a}function Vh(e,t){if(e===void 0)return[];if(t.fieldKind==="enum"||t.fieldKind==="scalar"){for(let r=e.length-1;r>=0;--r)if(e[r].no==t.number)return[e[r]];return[]}return e.filter(r=>r.no===t.number)}function Ur(e,t){const r=e.typeName,i=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:r}),a=Object.assign(Object.assign({},e.extendee),{fields:[i],members:[i],oneofs:[]}),m=ve(a,t!==void 0?{[r]:t}:void 0);return[De(a,m),i,()=>{const v=m[r];if(v===void 0){const s=e.message;return nr(s)?gt(s.fields[0].scalar,s.fields[0].longAsString):ve(s)}return v}]}function ya(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const Hh=3,$h=2,En={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function Wh(e){return e?Object.assign(Object.assign({},En),e):En}function Gh(e,t,r){return ar(De(e,t),Wh(r))}function ar(e,t){var r;const i=Yh(e,t);if(i!==void 0)return i;const a={};for(const m of e.sortedFields){if(!e.isSet(m)){if(m.presence==Hh)throw new Error(`cannot encode ${m} to JSON: required field not set`);if(!t.alwaysEmitImplicit||m.presence!==$h)continue}const v=kn(m,e.get(m),t);v!==void 0&&(a[zh(m,t)]=v)}if(t.registry){const m=new Set;for(const{no:v}of(r=e.getUnknown())!==null&&r!==void 0?r:[])if(!m.has(v)){m.add(v);const s=t.registry.getExtensionFor(e.desc,v);if(!s)continue;const c=Ph(e.message,s),[h,f]=Ur(s,c),u=kn(f,h.get(f),t);u!==void 0&&(a[s.jsonName]=u)}}return a}function kn(e,t,r){switch(e.fieldKind){case"scalar":return Vr(e,t);case"message":return ar(t,r);case"enum":return cs(e.enum,t,r.enumAsInteger);case"list":return Zh(t,r);case"map":return Kh(t,r)}}function Kh(e,t){const r=e.field(),i={};switch(r.mapKind){case"scalar":for(const[a,m]of e)i[a]=Vr(r,m);break;case"message":for(const[a,m]of e)i[a]=ar(m,t);break;case"enum":for(const[a,m]of e)i[a]=cs(r.enum,m,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?i:void 0}function Zh(e,t){const r=e.field(),i=[];switch(r.listKind){case"scalar":for(const a of e)i.push(Vr(r,a));break;case"enum":for(const a of e)i.push(cs(r.enum,a,t.enumAsInteger));break;case"message":for(const a of e)i.push(ar(a,t));break}return t.alwaysEmitImplicit||i.length>0?i:void 0}function cs(e,t,r){var i;if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: expected number, got ${me(t)}`);if(e.typeName=="google.protobuf.NullValue")return null;if(r)return t;const a=e.value[t];return(i=a==null?void 0:a.name)!==null&&i!==void 0?i:t}function Vr(e,t){var r,i,a,m,v,s;switch(e.scalar){case M.INT32:case M.SFIXED32:case M.SINT32:case M.FIXED32:case M.UINT32:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(r=ot(e,t))===null||r===void 0?void 0:r.message}`);return t;case M.FLOAT:case M.DOUBLE:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(i=ot(e,t))===null||i===void 0?void 0:i.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case M.STRING:if(typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(a=ot(e,t))===null||a===void 0?void 0:a.message}`);return t;case M.BOOL:if(typeof t!="boolean")throw new Error(`cannot encode ${e} to JSON: ${(m=ot(e,t))===null||m===void 0?void 0:m.message}`);return t;case M.UINT64:case M.FIXED64:case M.INT64:case M.SFIXED64:case M.SINT64:if(typeof t!="bigint"&&typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(v=ot(e,t))===null||v===void 0?void 0:v.message}`);return t.toString();case M.BYTES:if(t instanceof Uint8Array)return Yd(t);throw new Error(`cannot encode ${e} to JSON: ${(s=ot(e,t))===null||s===void 0?void 0:s.message}`)}}function zh(e,t){return t.useProtoFieldName?e.name:e.jsonName}function Yh(e,t){if(e.desc.typeName.startsWith("google.protobuf."))switch(e.desc.typeName){case"google.protobuf.Any":return jh(e.message,t);case"google.protobuf.Timestamp":return qh(e.message);case"google.protobuf.Duration":return Xh(e.message);case"google.protobuf.FieldMask":return Jh(e.message);case"google.protobuf.Struct":return Ca(e.message);case"google.protobuf.Value":return ls(e.message);case"google.protobuf.ListValue":return wa(e.message);default:if(nr(e.desc)){const r=e.desc.fields[0];return Vr(r,e.get(r))}return}}function jh(e,t){if(e.typeUrl==="")return{};const{registry:r}=t;let i,a;if(r&&(i=xh(e,r),i&&(a=r.getMessage(i.$typeName))),!a||!i)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);let m=ar(De(a,i),t);return(a.typeName.startsWith("google.protobuf.")||m===null||Array.isArray(m)||typeof m!="object")&&(m={value:m}),m["@type"]=e.typeUrl,m}function Xh(e){if(Number(e.seconds)>315576e6||Number(e.seconds)<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);let t=e.seconds.toString();if(e.nanos!==0){let r=Math.abs(e.nanos).toString();r="0".repeat(9-r.length)+r,r.substring(3)==="000000"?r=r.substring(0,3):r.substring(6)==="000"&&(r=r.substring(0,6)),t+="."+r,e.nanos<0&&Number(e.seconds)==0&&(t="-"+t)}return t+"s"}function Jh(e){return e.paths.map(t=>{if(t.match(/_[0-9]?_/g)||t.match(/[A-Z]/g))throw new Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "`+t+'" is irreversible');return Xt(t)}).join(",")}function Ca(e){const t={};for(const[r,i]of Object.entries(e.fields))t[r]=ls(i);return t}function ls(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":return e.kind.value;case"stringValue":return e.kind.value;case"structValue":return Ca(e.kind.value);case"listValue":return wa(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function wa(e){return e.values.map(ls)}function qh(e){const t=Number(e.seconds)*1e3;if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);let r="Z";if(e.nanos>0){const i=(e.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?r="."+i.substring(0,3)+"Z":i.substring(6)==="000"?r="."+i.substring(0,6)+"Z":r="."+i+"Z"}return new Date(t).toISOString().replace(".000Z",r)}const In={ignoreUnknownFields:!1};function Qh(e){return e?Object.assign(Object.assign({},In),e):In}function eu(e,t,r){const i=De(e);try{Bt(i,t,Qh(r))}catch(a){throw Jd(a)?new Error(`cannot decode ${a.field()} from JSON: ${a.message}`,{cause:a}):a}return i.message}function Bt(e,t,r){var i;if(au(e,t,r))return;if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode ${e.desc} from JSON: ${me(t)}`);const a=new Map,m=new Map;for(const v of e.desc.fields)m.set(v.name,v).set(v.jsonName,v);for(const[v,s]of Object.entries(t)){const c=m.get(v);if(c){if(c.oneof){if(s===null&&c.fieldKind=="scalar")continue;const h=a.get(c.oneof);if(h!==void 0)throw new Ie(c.oneof,`oneof set multiple times by ${h.name} and ${c.name}`);a.set(c.oneof,c)}Bn(e,c,s,r)}else{let h;if(v.startsWith("[")&&v.endsWith("]")&&(h=(i=r.registry)===null||i===void 0?void 0:i.getExtension(v.substring(1,v.length-1)))&&h.extendee.typeName===e.desc.typeName){const[f,u,g]=Ur(h);Bn(f,u,s,r),Uh(e.message,h,g())}if(!h&&!r.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${v}" is unknown`)}}}function Bn(e,t,r,i){switch(t.fieldKind){case"scalar":nu(e,t,r);break;case"enum":su(e,t,r,i);break;case"message":iu(e,t,r,i);break;case"list":ru(e.get(t),r,i);break;case"map":tu(e.get(t),r,i);break}}function tu(e,t,r){if(t===null)return;const i=e.field();if(typeof t!="object"||Array.isArray(t))throw new Ie(i,"expected object, got "+me(t));for(const[a,m]of Object.entries(t)){if(m===null)throw new Ie(i,"map value must not be null");let v;switch(i.mapKind){case"message":const c=De(i.message);Bt(c,m,r),v=c;break;case"enum":if(v=ds(i.enum,m,r.ignoreUnknownFields,!0),v===Hr)return;break;case"scalar":v=Wr(i,m,!0);break}const s=ou(i.mapKey,a);e.set(s,v)}}function ru(e,t,r){if(t===null)return;const i=e.field();if(!Array.isArray(t))throw new Ie(i,"expected Array, got "+me(t));for(const a of t){if(a===null)throw new Ie(i,"list item must not be null");switch(i.listKind){case"message":const m=De(i.message);Bt(m,a,r),e.add(m);break;case"enum":const v=ds(i.enum,a,r.ignoreUnknownFields,!0);v!==Hr&&e.add(v);break;case"scalar":e.add(Wr(i,a,!0));break}}}function iu(e,t,r,i){if(r===null&&t.message.typeName!="google.protobuf.Value"){e.clear(t);return}const a=e.isSet(t)?e.get(t):De(t.message);Bt(a,r,i),e.set(t,a)}function su(e,t,r,i){const a=ds(t.enum,r,i.ignoreUnknownFields,!1);a===$r?e.clear(t):a!==Hr&&e.set(t,a)}function nu(e,t,r){const i=Wr(t,r,!1);i===$r?e.clear(t):e.set(t,i)}const Hr=Symbol();function ds(e,t,r,i){if(t===null)return e.typeName=="google.protobuf.NullValue"?0:i?e.values[0].number:$r;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const a=e.values.find(m=>m.name===t);if(a!==void 0)return a.number;if(r)return Hr;break}throw new Error(`cannot decode ${e} from JSON: ${me(t)}`)}const $r=Symbol();function Wr(e,t,r){if(t===null)return r?gt(e.scalar,!1):$r;switch(e.scalar){case M.DOUBLE:case M.FLOAT:if(t==="NaN")return NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof t=="number"){if(Number.isNaN(t))throw new Ie(e,"unexpected NaN number");if(!Number.isFinite(t))throw new Ie(e,"unexpected infinite number");break}if(typeof t=="string"){if(t===""||t.trim().length!==t.length)break;const i=Number(t);if(!Number.isFinite(i))break;return i}break;case M.INT32:case M.FIXED32:case M.SFIXED32:case M.SINT32:case M.UINT32:return Ea(t);case M.BYTES:if(typeof t=="string"){if(t==="")return new Uint8Array(0);try{return zo(t)}catch(i){const a=i instanceof Error?i.message:String(i);throw new Ie(e,a)}}break}return t}function ou(e,t){switch(e){case M.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case M.INT32:case M.FIXED32:case M.UINT32:case M.SFIXED32:case M.SINT32:return Ea(t);default:return t}}function Ea(e){if(typeof e=="string"){if(e===""||e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function au(e,t,r){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return cu(e.message,t,r),!0;case"google.protobuf.Timestamp":return lu(e.message,t),!0;case"google.protobuf.Duration":return du(e.message,t),!0;case"google.protobuf.FieldMask":return hu(e.message,t),!0;case"google.protobuf.Struct":return ka(e.message,t),!0;case"google.protobuf.Value":return hs(e.message,t),!0;case"google.protobuf.ListValue":return Ia(e.message,t),!0;default:if(nr(e.desc)){const i=e.desc.fields[0];return t===null?e.clear(i):e.set(i,Wr(i,t,!0)),!0}return!1}}function cu(e,t,r){var i;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${me(t)}`);if(Object.keys(t).length==0)return;const a=t["@type"];if(typeof a!="string"||a=="")throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const m=a.includes("/")?a.substring(a.lastIndexOf("/")+1):a;if(!m.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const v=(i=r.registry)===null||i===void 0?void 0:i.getMessage(m);if(!v)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${a} is not in the type registry`);const s=De(v);if(m.startsWith("google.protobuf.")&&Object.prototype.hasOwnProperty.call(t,"value")){const c=t.value;Bt(s,c,r)}else{const c=Object.assign({},t);delete c["@type"],Bt(s,c,r)}Ah(s.desc,s.message,e)}function lu(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${me(t)}`);const r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=oe.parse(i/1e3),e.nanos=0,r[7]&&(e.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9)}function du(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${me(t)}`);const r=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(r===null)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${me(t)}`);const i=Number(r[1]);if(i>315576e6||i<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${me(t)}`);if(e.seconds=oe.parse(i),typeof r[2]!="string")return;const a=r[2]+"0".repeat(9-r[2].length);e.nanos=parseInt(a),(i<0||Object.is(i,-0))&&(e.nanos=-e.nanos)}function hu(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${me(t)}`);if(t==="")return;function r(i){if(i.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);const a=i.replace(/[A-Z]/g,m=>"_"+m.toLowerCase());return a[0]==="_"?a.substring(1):a}e.paths=t.split(",").map(r)}function ka(e,t){if(typeof t!="object"||t==null||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${me(t)}`);for(const[r,i]of Object.entries(t)){const a=ve(ba);hs(a,i),e.fields[r]=a}}function hs(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:Ii.NULL_VALUE};else if(Array.isArray(t)){const r=ve(Dh);Ia(r,t),e.kind={case:"listValue",value:r}}else{const r=ve(Th);ka(r,t),e.kind={case:"structValue",value:r}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${me(t)}`)}return e}function Ia(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${me(t)}`);for(const r of t){const i=ve(ba);hs(i,r),e.values.push(i)}}const uu=it("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),fu=Fr(uu,0),gu=Pr(fu),pu=it("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),Ba=it("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[pu,or]),Ai=Ve(Ba,3),_u=Ve(Ba,4),Aa="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Lr=32,vu=16,Ra=10,An=0xffffffffffff;var lt;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(lt||(lt={}));class Ft extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function mu(e){const t=Math.floor(e()*Lr)%Lr;return Aa.charAt(t)}function bu(e){const t=Su(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const i=new Uint8Array(1);return r.getRandomValues(i),i[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new Ft(lt.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Su(){return wu()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function yu(e,t){let r="";for(;e>0;e--)r=mu(t)+r;return r}function Cu(e,t=Ra){if(isNaN(e))throw new Ft(lt.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>An)throw new Ft(lt.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${An}: ${e}`);if(e<0)throw new Ft(lt.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Ft(lt.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,i="";for(let a=t;a>0;a--)r=e%Lr,i=Aa.charAt(r)+i,e=(e-r)/Lr;return i}function wu(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Eu(e,t){const r=bu(),i=Date.now();return Cu(i,Ra)+yu(vu,r)}const Se=[];for(let e=0;e<256;++e)Se.push((e+256).toString(16).slice(1));function ku(e,t=0){return(Se[e[t+0]]+Se[e[t+1]]+Se[e[t+2]]+Se[e[t+3]]+"-"+Se[e[t+4]]+Se[e[t+5]]+"-"+Se[e[t+6]]+Se[e[t+7]]+"-"+Se[e[t+8]]+Se[e[t+9]]+"-"+Se[e[t+10]]+Se[e[t+11]]+Se[e[t+12]]+Se[e[t+13]]+Se[e[t+14]]+Se[e[t+15]]).toLowerCase()}let ui;const Iu=new Uint8Array(16);function Bu(){if(!ui){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ui=crypto.getRandomValues.bind(crypto)}return ui(Iu)}const Au=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Rn={randomUUID:Au};function Ru(e,t,r){var a;if(Rn.randomUUID&&!e)return Rn.randomUUID();e=e||{};const i=e.random??((a=e.rng)==null?void 0:a.call(e))??Bu();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,ku(i)}const xu=5e3,Lu=1e3,gr=4e3,xn=1e3;var xa=(e=>(e.CONTINUOUS="CONTINUOUS",e.INITIAL="INITIAL",e))(xa||{});class La{constructor({knownID:t,runID:r,sequence:i,options:a}){this.queue=new Te,this.subscriptions=[],this.reconnect=new Te,this.client=new pe,this._latencies=new Te,this._latenciesConnectable=nt(this._latencies.asObservable().pipe(Rl((m,v)=>{if(v.latency<0){const s=m.get(v.streamID);s&&m.set(v.streamID,{...s,readyState:v.readyState})}else m.set(v.streamID,v);return m},new Map))),this._errors=new Te,this._errorsConnectable=nt(this._errors.asObservable()),this._stdout=new Te,this._stderr=new Te,this._exitCode=new Te,this._pid=new Te,this._mimeType=new Te,this._stdoutConnectable=nt(this._stdout.asObservable()),this._stderrConnectable=nt(this._stderr.asObservable()),this._exitCodeConnectable=nt(this._exitCode.asObservable()),this._pidConnectable=nt(this._pid.asObservable()),this._mimeTypeConnectable=nt(this._mimeType.asObservable()),this.knownID=t,this.runID=r,this.sequence=i,this.runnerEndpoint=a.runnerEndpoint,this.interceptors=a.interceptors,this.autoReconnect=a.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(Fs(xn,sr,{leading:!0,trailing:!0}),Ms(m=>this.useSocketClient(m.streamID).pipe(Ms(v=>this.useHeartbeat(v,m))))).pipe(fo()),this.subscriptions.push(this.monitor()),this.subscriptions.push(this.process())}get latencies(){return this._latenciesConnectable}get errors(){return this._errorsConnectable}get stdout(){return this._stdoutConnectable}get stderr(){return this._stderrConnectable}get exitCode(){return this._exitCodeConnectable}get pid(){return this._pidConnectable}get mimeType(){return this._mimeTypeConnectable}monitor(){return bl(Lu).pipe(Fe(()=>this.autoReconnect),ii(this.reconnect),Fe(([,r])=>r.heartbeat==="CONTINUOUS"),ii(this.latencies),Ae(([,r])=>Array.from(r.values()).filter(i=>i.readyState===WebSocket.OPEN&&i.latency>=gr)),Fe(r=>r.length>0),Fs(xn)).subscribe({next:r=>{console.log(new Date,"Triggering reconnect",r),this.connect()},complete:()=>{console.log("Monitor complete")},error:r=>{console.error("Error in monitor",r)}})}process(){const t=this.client.pipe(Fe(v=>(v==null?void 0:v.readyState)===WebSocket.OPEN),Ns(1)),r=this.queue.pipe(kl(()=>t),Fe(v=>v.length>0),Ae(v=>v.sort((s,c)=>{const h=f=>{var u;return!!((u=f.payload.value)!=null&&u.config)};return h(c)?1:h(s)?-1:0}))),i=this.queue.pipe(xl(t));return Sl(r.pipe(ct(v=>v)),i).pipe(ii(this.client),hr(([,v])=>v.readyState===WebSocket.OPEN),ct(async([v,s])=>{await Tn({req:v,interceptors:this.interceptors,socket:s,knownID:this.knownID,runID:this.runID})})).subscribe({error:v=>{this._errors.next(v)}})}useSocketClient(t){return new pe(r=>{const i=new URL(this.runnerEndpoint);i.searchParams.set("id",t),i.searchParams.set("runID",this.runID);const a=new WebSocket(i.toString()),m=h=>{if(console.log(new Date,`WebSocket transport ${t} closed`,h),h.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},v=h=>{console.log(new Date,`WebSocket transport ${t} error`,h),this.autoReconnect||r.error(h)},s=h=>{var y,E;if(typeof h.data!="string"){console.warn("Unexpected WebSocket message type:",typeof h.data);return}let f;try{f=Ln(h.data),console.log("Received WebsocketResponse:",f)}catch(p){console.error("Failed to parse WebsocketResponse:",p)}const u=f.status;if(u&&u.code!==gu.OK){r.error(u);return}if(f.pong)return;const g=f.payload.value;if(g.stdoutData&&g.stdoutData.length>0&&((y=this.callback)==null||y.call(this,{type:Q.terminalStdout,output:{"runme.dev/id":this.knownID,data:g.stdoutData}}),this._stdout.next(g.stdoutData)),g.stderrData&&g.stderrData.length>0&&((E=this.callback)==null||E.call(this,{type:Q.terminalStderr,output:{"runme.dev/id":this.knownID,data:g.stderrData}}),this._stderr.next(g.stderrData)),g.exitCode!==void 0&&(this._exitCode.next(g.exitCode),r.complete()),g.pid!==void 0&&this._pid.next(g.pid),g.mimeType){const n=g.mimeType.split(";")[0];this._mimeType.next(n)}},c=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(a)};return a.addEventListener("close",m),a.addEventListener("error",v),a.addEventListener("message",s),a.addEventListener("open",c),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),a.removeEventListener("close",m),a.removeEventListener("error",v),a.removeEventListener("message",s),a.removeEventListener("open",c),a.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(ve(Ai,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:i}){return new pe(a=>{const m=pi(t,"message").pipe(hr(()=>t.readyState===WebSocket.OPEN),Ae(f=>Ln(f.data)),Ae(f=>f.pong),Fe(f=>f!==void 0),Ae(f=>({receivedAt:BigInt(Date.now()),pong:f}))),c=(i==="INITIAL"?Ht(0):Ht(0,xu)).pipe(hr(()=>t.readyState===WebSocket.OPEN),Ae(()=>{const f={timestamp:BigInt(Date.now())};return ve(Ai,{ping:f})}),ct(async f=>(await Tn({req:f,interceptors:this.interceptors,socket:t}),f)),Ae(f=>f.ping)).pipe(Fe(f=>(f==null?void 0:f.timestamp)!==void 0),ct(f=>wl(m.pipe(Fe(u=>u.pong.timestamp===f.timestamp),Ns(1),Ae(u=>{const g=f.timestamp,y=u.receivedAt;return Number(y-g)})),Ht(gr).pipe(Ae(()=>{throw new Error(`Pong not received within ${gr}ms for stream ${r}`)}))).pipe(lo(u=>(this._latencies.next({streamID:r,latency:gr,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",u.message),sl(null))))),Al(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),Ll(f=>{f!==null&&this._latencies.next({streamID:r,latency:f,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),h=[];return h.push(c.subscribe({error:f=>{console.error("Unexpected error sending heartbeat",f)}})),a.next(t),()=>{h.forEach(f=>f.unsubscribe())}})}connect(t="CONTINUOUS"){const r=Tu(),i=this.latencies.pipe(Ae(a=>{const m=a.get(r);return m===void 0?null:m}),hr(a=>(a==null?void 0:a.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),i}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function Ln(e){const t=JSON.parse(e);return eu(_u,t)}async function Tn({req:e,interceptors:t,socket:r,knownID:i,runID:a}){i&&(e.knownId=i),a&&(e.runId=a);const m={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let v=async h=>({stream:!1,message:{},method:{},service:{},header:h.header});for(const h of t.concat().reverse())v=h(v);const c=(await v(m)).header.get("Authorization");c&&e&&(e.authorization=c),r.send(JSON.stringify(Gh(Ai,e)))}function Tu(){return Ru().replace(/-/g,"")}function Ta(){return`run_${Eu()}`}var Du=Object.defineProperty,Ou=Object.getOwnPropertyDescriptor,Da=e=>{throw TypeError(e)},Ze=(e,t,r,i)=>{for(var a=i>1?void 0:i?Ou(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&Du(t,r,a),a},us=(e,t,r)=>t.has(e)||Da("Cannot "+r),ne=(e,t,r)=>(us(e,t,"read from private field"),t.get(e)),pr=(e,t,r)=>t.has(e)?Da("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Tr=(e,t,r,i)=>(us(e,t,"write to private field"),t.set(e,r),r),Re=(e,t,r)=>(us(e,t,"access private method"),r),Ce,Pe,dt,Ee,Oa,fs,Na,Ri,Dr,xi,Ma,Fa;const Nu="runme-console";let Ue=class extends we{constructor(){super(),pr(this,Ee),this.disposables=[],pr(this,Ce),pr(this,Pe,[]),pr(this,dt,{rows:34,cols:100,x:0,y:0}),this.takeFocus=!0,this.view={theme:"dark",fontFamily:"monospace",fontSize:12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,smoothScrollDuration:0,scrollback:4e3},this.commands=[],this.stream={knownID:this.id,runID:Ta(),sequence:0,languageID:"sh",runnerEndpoint:"ws://localhost:8080/ws",reconnect:!0},this.interceptors=[],Re(this,Ee,Fa).call(this)}applyThemeStyles(){this.consoleView&&this.consoleView.applyThemeStyles()}connectedCallback(){if(super.connectedCallback(),!this.id)throw new Error("No id provided to terminal!");Re(this,Ee,Oa).call(this),Re(this,Ee,Ri).call(this),Re(this,Ee,xi).call(this)}disconnectedCallback(){super.disconnectedCallback(),Re(this,Ee,Dr).call(this),this.disposables.forEach(({dispose:e})=>e())}updated(e){super.updated(e),this.consoleView&&Re(this,Ee,fs).call(this),(e.has("id")||e.has("stream")||e.has("commands"))&&(Re(this,Ee,Ri).call(this),Re(this,Ee,xi).call(this))}firstUpdated(e){super.firstUpdated(e)}render(){return Y`<div></div>`}dispose(){Re(this,Ee,Dr).call(this),this.disposables.forEach(({dispose:e})=>e())}};Ce=new WeakMap;Pe=new WeakMap;dt=new WeakMap;Ee=new WeakSet;Oa=function(){this.shadowRoot&&(this.consoleView=document.createElement("console-view"),Re(this,Ee,fs).call(this),this.shadowRoot.appendChild(this.consoleView),Re(this,Ee,Na).call(this))};fs=function(){this.consoleView&&(this.consoleView.setAttribute("id",this.id),this.consoleView.setAttribute("buttons","false"),this.consoleView.setAttribute("takeFocus",this.takeFocus.toString()),this.consoleView.setAttribute("theme",this.view.theme),this.view.fontFamily&&this.consoleView.setAttribute("fontFamily",this.view.fontFamily),this.view.fontSize&&this.consoleView.setAttribute("fontSize",this.view.fontSize.toString()),this.view.cursorStyle&&this.consoleView.setAttribute("cursorStyle",this.view.cursorStyle),this.view.cursorBlink&&this.consoleView.setAttribute("cursorBlink",this.view.cursorBlink.toString()),this.view.cursorWidth&&this.consoleView.setAttribute("cursorWidth",this.view.cursorWidth.toString()),this.view.smoothScrollDuration&&this.consoleView.setAttribute("smoothScrollDuration",this.view.smoothScrollDuration.toString()),this.view.scrollback&&this.consoleView.setAttribute("scrollback",this.view.scrollback.toString()),this.initialContent&&this.consoleView.setAttribute("initialContent",this.initialContent),this.initialRows!==void 0&&this.consoleView.setAttribute("initialRows",this.initialRows.toString()))};Na=function(){if(!this.consoleView)return;const e=t=>r=>{this.dispatchEvent(new CustomEvent(t,{detail:r.detail}))};this.consoleView.addEventListener("stdout",e("stdout")),this.consoleView.addEventListener("stderr",e("stderr")),this.consoleView.addEventListener("exitcode",e("exitcode")),this.consoleView.addEventListener("pid",e("pid")),this.consoleView.addEventListener("mimetype",e("mimetype"))};Ri=function(){if(ne(this,Ce))return;const e=this.stream.knownID??this.id;(!e||!this.stream.runID||!this.stream.runnerEndpoint)&&console.warn("Missing required stream properties"),Tr(this,Ce,new La({knownID:e,runID:this.stream.runID,sequence:this.stream.sequence??0,options:{runnerEndpoint:this.stream.runnerEndpoint,autoReconnect:this.stream.reconnect,interceptors:this.interceptors??[]}}));const t=ne(this,Ce).connect().subscribe();ne(this,Pe).push(()=>t.unsubscribe());const r=ne(this,Ce).stdout.subscribe(s=>{this.dispatchEvent(new CustomEvent("stdout",{detail:s})),this.consoleView&&this.consoleView.terminal&&this.consoleView.terminal.write(s)}),i=ne(this,Ce).stderr.subscribe(s=>{this.dispatchEvent(new CustomEvent("stderr",{detail:s}))}),a=ne(this,Ce).exitCode.subscribe(s=>{this.dispatchEvent(new CustomEvent("exitcode",{detail:s})),Re(this,Ee,Dr).call(this)}),m=ne(this,Ce).pid.subscribe(s=>{this.dispatchEvent(new CustomEvent("pid",{detail:s}))}),v=ne(this,Ce).mimeType.subscribe(s=>{this.dispatchEvent(new CustomEvent("mimetype",{detail:s}))});ne(this,Pe).push(()=>r.unsubscribe()),ne(this,Pe).push(()=>i.unsubscribe()),ne(this,Pe).push(()=>a.unsubscribe()),ne(this,Pe).push(()=>m.unsubscribe()),ne(this,Pe).push(()=>v.unsubscribe())};Dr=function(){var e;ne(this,Pe).forEach(t=>{try{t()}catch{}}),Tr(this,Pe,[]),(e=ne(this,Ce))==null||e.close(),Tr(this,Ce,void 0)};xi=function(){if(!ne(this,Ce)||!this.commands.length||!this.stream.runID)return;const e=Re(this,Ee,Ma).call(this);e&&ne(this,Ce).sendExecuteRequest(e)};Ma=function(){const e=this.stream.languageID||"sh",r=new Set(["sh","shell","bash","zsh","fish","ksh","csh","tcsh","dash","powershell","pwsh","cmd","ash","elvish","xonsh"]).has(e),i=ve(Bi,{sessionStrategy:Fh.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:e,background:!1,fileExtension:"",env:[`RUNME_ID=${this.stream.knownID??this.id}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],interactive:!0,runId:this.stream.runID,knownId:this.stream.knownID??this.id},winsize:ve(Sa,ne(this,dt))});return this.commands.length===0?(i.config.mode=hi.INLINE,i.config.source={case:"commands",value:ve(wn,{items:["zsh -l"]})}):r?(i.config.source={case:"commands",value:ve(wn,{items:this.commands})},i.config.mode=hi.INLINE):(i.config.source={case:"script",value:this.commands.join(`
|
|
1777
|
+
`)},i.config.mode=hi.FILE,i.config.fileExtension=this.stream.languageID||""),i};Fa=function(){const e=new TextEncoder,t={postMessage:r=>{var i,a;if(r.type===Q.terminalOpen||r.type===Q.terminalResize){const m=Number(r.output.terminalDimensions.columns),v=Number(r.output.terminalDimensions.rows);if(Number.isFinite(m)&&Number.isFinite(v)){if(ne(this,dt).cols===m&&ne(this,dt).rows===v)return;Tr(this,dt,ve(Sa,{cols:m,rows:v,x:0,y:0}));const s=ve(Bi,{winsize:ne(this,dt)});(i=ne(this,Ce))==null||i.sendExecuteRequest(s)}}if(r.type===Q.terminalStdin){const m=e.encode(r.output.input),v=ve(Bi,{inputData:m});(a=ne(this,Ce))==null||a.sendExecuteRequest(v)}},onDidReceiveMessage:r=>{var i;(i=ne(this,Ce))==null||i.setCallback(r)}};try{go(t)}catch{console.error("Failed to set context bridge")}};Ze([j({type:String})],Ue.prototype,"id",2);Ze([j({type:Boolean,converter:e=>e!=="false"})],Ue.prototype,"takeFocus",2);Ze([j({type:Object})],Ue.prototype,"view",2);Ze([j({type:Array})],Ue.prototype,"commands",2);Ze([j({type:String})],Ue.prototype,"initialContent",2);Ze([j({type:Number})],Ue.prototype,"initialRows",2);Ze([j({type:Object})],Ue.prototype,"stream",2);Ze([j({attribute:!1})],Ue.prototype,"interceptors",2);Ue=Ze([xe(Nu)],Ue);var Mu=Object.defineProperty,Fu=Object.getOwnPropertyDescriptor,Gr=(e,t,r,i)=>{for(var a=i>1?void 0:i?Fu(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&Mu(t,r,a),a};let At=class extends we{constructor(){super(...arguments),this.columns=[],this.rows=[],this.renderer=(t,r)=>Y`${t[r]}`,this.displayable=()=>!0,this.hasErrors=()=>!1}get heading(){var t,r;return(t=this.columns)!=null&&t.length?Y`
|
|
1778
1778
|
<thead>
|
|
1779
1779
|
<tr>
|
|
1780
|
-
${(r=this.columns)==null?void 0:r.map(
|
|
1780
|
+
${(r=this.columns)==null?void 0:r.map(i=>{if(typeof i=="string")return Y`<th>${i}</th>`;if(typeof i=="object"){const{text:a,colspan:m}=i;return Y`<th colspan="${m||1}">${a}</th>`}})}
|
|
1781
1781
|
</tr>
|
|
1782
1782
|
</thead>
|
|
1783
|
-
`:fe}render(){var t,r,
|
|
1783
|
+
`:fe}render(){var t,r,i;return!((t=this.rows)!=null&&t.length)&&!((r=this.columns)!=null&&r.length)?fe:Y`<table>
|
|
1784
1784
|
${this.heading}
|
|
1785
1785
|
<tbody>
|
|
1786
|
-
${(
|
|
1787
|
-
class="${ue(this.hasErrors&&this.hasErrors(
|
|
1786
|
+
${(i=this.rows)==null?void 0:i.map(a=>Y`<tr
|
|
1787
|
+
class="${ue(this.hasErrors&&this.hasErrors(a),()=>"row-error",()=>"")}"
|
|
1788
1788
|
>
|
|
1789
|
-
${Object.keys(
|
|
1789
|
+
${Object.keys(a).map(m=>{var v;return ue((v=this.displayable)==null?void 0:v.call(this,a,m),()=>{var s;return Y`<td>${((s=this.renderer)==null?void 0:s.call(this,a,m))||a[m]}</td>`},()=>fe)})}
|
|
1790
1790
|
</tr>`)}
|
|
1791
1791
|
</tbody>
|
|
1792
|
-
</table>`}};
|
|
1792
|
+
</table>`}};At.styles=Ne`
|
|
1793
1793
|
:host {
|
|
1794
1794
|
width: 100%;
|
|
1795
1795
|
}
|
|
@@ -1930,7 +1930,7 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
1930
1930
|
.flex-center {
|
|
1931
1931
|
align-items: center;
|
|
1932
1932
|
}
|
|
1933
|
-
`;
|
|
1933
|
+
`;Gr([j({type:Array})],At.prototype,"columns",2);Gr([j({type:Array})],At.prototype,"rows",2);Gr([j({type:Object})],At.prototype,"renderer",2);At=Gr([xe("table-view")],At);const Pu=Y`
|
|
1934
1934
|
<svg
|
|
1935
1935
|
width="16"
|
|
1936
1936
|
height="16"
|
|
@@ -1945,7 +1945,7 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
1945
1945
|
fill="currentColor"
|
|
1946
1946
|
/>
|
|
1947
1947
|
</svg>
|
|
1948
|
-
|
|
1948
|
+
`,Uu=Y`
|
|
1949
1949
|
<svg
|
|
1950
1950
|
width="16"
|
|
1951
1951
|
height="16"
|
|
@@ -1960,14 +1960,14 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
1960
1960
|
fill="currentColor"
|
|
1961
1961
|
/>
|
|
1962
1962
|
</svg>
|
|
1963
|
-
`;var
|
|
1963
|
+
`;var Vu=Object.defineProperty,Hu=Object.getOwnPropertyDescriptor,gs=(e,t,r,i)=>{for(var a=i>1?void 0:i?Hu(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&Vu(t,r,a),a};let er=class extends we{render(){return Y`<div class="tooltip">
|
|
1964
1964
|
<div
|
|
1965
1965
|
.class="${ue(this.classList,()=>this.classList,()=>"")}"
|
|
1966
1966
|
>
|
|
1967
1967
|
${this.value}
|
|
1968
1968
|
</div>
|
|
1969
1969
|
<div class="tooltiptext">${this.tooltipText}</div>
|
|
1970
|
-
</div>`}};
|
|
1970
|
+
</div>`}};er.styles=Ne`
|
|
1971
1971
|
.tooltip .tooltiptext {
|
|
1972
1972
|
background-color: var(--vscode-notifications-background);
|
|
1973
1973
|
box-shadow: 2px 2px 4px -2px var(--vscode-notifications-border);
|
|
@@ -2016,34 +2016,34 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
2016
2016
|
.optional {
|
|
2017
2017
|
font-weight: 400;
|
|
2018
2018
|
}
|
|
2019
|
-
`;
|
|
2019
|
+
`;gs([j({type:String})],er.prototype,"tooltipText",2);gs([j({type:String})],er.prototype,"value",2);er=gs([xe("tooltip-text")],er);var $u=Object.defineProperty,Wu=Object.getOwnPropertyDescriptor,Rt=(e,t,r,i)=>{for(var a=i>1?void 0:i?Wu(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&$u(t,r,a),a};let tt=class extends we{constructor(){super(...arguments),this.disposables=[],this.displaySecret=!1,this._copied=!1}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t),this._copied=!0,setTimeout(()=>this._copied=!1,1e3)}toggleVisibility(){this.displaySecret=!this.displaySecret}dispose(){this.disposables.forEach(e=>e.dispose())}render(){const e=[void 0,$e.MASKED,$e.LITERAL,$e.UNSPECIFIED].includes(this.status);return Y`
|
|
2020
2020
|
<div class="secret-container">
|
|
2021
|
-
${ue(this.displaySecret,()=>
|
|
2021
|
+
${ue(this.displaySecret,()=>Y`<span class="secret-text">${this.value}</span>`,()=>ue(this.maskedValue,()=>Y`<span class="secret-text"
|
|
2022
2022
|
>${this.maskedValue}</span
|
|
2023
2023
|
>`,()=>Array.from({length:20},(t,r)=>r+1).map(()=>"*").join("")))}
|
|
2024
2024
|
<div class="actions">
|
|
2025
|
-
${ue(e,()=>
|
|
2025
|
+
${ue(e,()=>Y``,()=>ue(this.displaySecret,()=>Y` <vscode-button
|
|
2026
2026
|
appearance="icon"
|
|
2027
2027
|
class="cursor-pointer"
|
|
2028
2028
|
@click=${this.toggleVisibility}
|
|
2029
2029
|
>
|
|
2030
|
-
${
|
|
2031
|
-
</vscode-button>`,()=>
|
|
2030
|
+
${Uu}
|
|
2031
|
+
</vscode-button>`,()=>Y` <vscode-button
|
|
2032
2032
|
appearance="icon"
|
|
2033
2033
|
class="cursor-pointer"
|
|
2034
2034
|
@click=${this.toggleVisibility}
|
|
2035
2035
|
>
|
|
2036
|
-
${
|
|
2036
|
+
${vo}
|
|
2037
2037
|
</vscode-button>`))}
|
|
2038
|
-
${ue([
|
|
2038
|
+
${ue([$e.LITERAL,$e.HIDDEN].includes(this.status),()=>Y` <vscode-button
|
|
2039
2039
|
appearance="icon"
|
|
2040
2040
|
class="cursor-pointer"
|
|
2041
2041
|
@click=${this.onCopy}
|
|
2042
|
-
>${ue(this._copied,()=>
|
|
2043
|
-
>`,()=>
|
|
2042
|
+
>${ue(this._copied,()=>Y`${Pu}`,()=>Y`${Vn}`)}</vscode-button
|
|
2043
|
+
>`,()=>Y``)}
|
|
2044
2044
|
</div>
|
|
2045
2045
|
</div>
|
|
2046
|
-
`}};
|
|
2046
|
+
`}};tt.styles=Ne`
|
|
2047
2047
|
vscode-button {
|
|
2048
2048
|
color: var(--vscode-button-foreground);
|
|
2049
2049
|
background-color: var(--vscode-button-background);
|
|
@@ -2075,7 +2075,7 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
2075
2075
|
.cursor-pointer {
|
|
2076
2076
|
cursor: pointer;
|
|
2077
2077
|
}
|
|
2078
|
-
`;
|
|
2078
|
+
`;Rt([j({type:String})],tt.prototype,"value",2);Rt([j({type:Number})],tt.prototype,"status",2);Rt([j({type:Boolean})],tt.prototype,"displaySecret",2);Rt([j({type:String})],tt.prototype,"maskedValue",2);Rt([uc()],tt.prototype,"_copied",2);tt=Rt([xe("env-viewer")],tt);Y`
|
|
2079
2079
|
<svg
|
|
2080
2080
|
width="16"
|
|
2081
2081
|
height="16"
|
|
@@ -2090,7 +2090,7 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
2090
2090
|
fill="#A1260D"
|
|
2091
2091
|
/>
|
|
2092
2092
|
</svg>
|
|
2093
|
-
`;const
|
|
2093
|
+
`;const Gu=(e,t)=>Y`
|
|
2094
2094
|
<svg
|
|
2095
2095
|
width="${t}px"
|
|
2096
2096
|
height="${e}px"
|
|
@@ -2105,32 +2105,32 @@ Open Dashboard to configure it`)};Zn=function(){var r;const e=Ee();if(!e.postMes
|
|
|
2105
2105
|
fill="#A1260D"
|
|
2106
2106
|
/>
|
|
2107
2107
|
</svg>
|
|
2108
|
-
`;var
|
|
2108
|
+
`;var Ku=Object.defineProperty,Zu=Object.getOwnPropertyDescriptor,Pa=e=>{throw TypeError(e)},Ua=(e,t,r,i)=>{for(var a=i>1?void 0:i?Zu(t,r):t,m=e.length-1,v;m>=0;m--)(v=e[m])&&(a=(i?v(t,r,a):v(a))||a);return i&&a&&Ku(t,r,a),a},zu=(e,t,r)=>t.has(e)||Pa("Cannot "+r),Yu=(e,t,r)=>t.has(e)?Pa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),vt=(e,t,r)=>(zu(e,t,"access private method"),r),Xe,Va,Ha,Pt;const ju="__",Xu=[{text:"Name"},{text:"Value"},{text:"Description"},{text:"Spec"},{text:"Source"},{text:"Updated"}],Ju=["resolvedValue","errors","status","specClass"];let Li=class extends we{constructor(){super(...arguments),Yu(this,Xe),this.disposables=[]}dispose(){this.disposables.forEach(({dispose:e})=>e())}render(){var e;return vt(this,Xe,Ha).call(this),Y` <div>
|
|
2109
2109
|
<table-view
|
|
2110
|
-
.columns="${
|
|
2111
|
-
.rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:
|
|
2112
|
-
.displayable="${(t,r)=>!
|
|
2113
|
-
.hasErrors="${t=>{var r;return!(!((r=t.errors)!=null&&r.length)||t.name===
|
|
2114
|
-
.renderer="${(t,r)=>{switch(r){case"originalValue":const
|
|
2115
|
-
.displaySecret="${
|
|
2110
|
+
.columns="${Xu}"
|
|
2111
|
+
.rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:Pl(new Date(t.updateTime)),resolvedValue:t.resolvedValue,errors:t.errors}))}"
|
|
2112
|
+
.displayable="${(t,r)=>!Ju.includes(r)}"
|
|
2113
|
+
.hasErrors="${t=>{var r;return!(!((r=t.errors)!=null&&r.length)||t.name===ju)}}"
|
|
2114
|
+
.renderer="${(t,r)=>{switch(r){case"originalValue":const i=t.status===$e.LITERAL;let a=t.status===$e.MASKED?`${t.resolvedValue} [masked]`:t.resolvedValue;return t.status===$e.UNSPECIFIED?a="[unset]":t.status===$e.HIDDEN&&(a="[hidden]"),a=a.replace(/\n/g," ").replace(/\r/g,""),Y`<env-viewer
|
|
2115
|
+
.displaySecret="${i}"
|
|
2116
2116
|
.value="${t.originalValue}"
|
|
2117
|
-
.maskedValue="${
|
|
2117
|
+
.maskedValue="${vt(this,Xe,Pt).call(this,t,r,()=>a)}"
|
|
2118
2118
|
.status="${t.status}"
|
|
2119
|
-
@onCopy="${async()=>
|
|
2120
|
-
></env-viewer>`;case"updatedAt":return
|
|
2119
|
+
@onCopy="${async()=>vt(this,Xe,Va).call(this,t.originalValue)}"
|
|
2120
|
+
></env-viewer>`;case"updatedAt":return vt(this,Xe,Pt).call(this,t,r,()=>t[r]?Ul(new Date(t[r])):"");case"spec":return vt(this,Xe,Pt).call(this,t,r,()=>Y`<span class="${t.specClass}">${t[r]}</span>`);default:return vt(this,Xe,Pt).call(this,t,r,()=>t[r])}}}"
|
|
2121
2121
|
></table-view>
|
|
2122
|
-
</div>`}};
|
|
2122
|
+
</div>`}};Xe=new WeakSet;Va=function(e){return navigator.clipboard.writeText(e)};Ha=function(){var e;(e=this.variables)==null||e.sort((t,r)=>t.errors.length>0?-1:r.errors.length>0?1:0)};Pt=function(e,t,r){var a;const i=t==="name"?Y`${Gu(10,10)}`:Y``;return(a=e.errors)!=null&&a.length?Y`<div class="flex">
|
|
2123
2123
|
<tooltip-text
|
|
2124
|
-
.tooltipText="${
|
|
2125
|
-
${e.errors.map(
|
|
2124
|
+
.tooltipText="${Y`<div class="flex">
|
|
2125
|
+
${e.errors.map(m=>Y`<span>${i}${m.message}</span>`)}
|
|
2126
2126
|
</div>`}"
|
|
2127
|
-
.value="${
|
|
2127
|
+
.value="${Y`${i} ${r()}`}"
|
|
2128
2128
|
></tooltip-text>
|
|
2129
|
-
</div>`:t==="spec"?
|
|
2129
|
+
</div>`:t==="spec"?Y`<div class="flex">
|
|
2130
2130
|
<tooltip-text
|
|
2131
|
-
.tooltipText="${
|
|
2131
|
+
.tooltipText="${Y`<div class="flex">
|
|
2132
2132
|
Info: Variable is ${e.specClass}
|
|
2133
2133
|
</div>`}"
|
|
2134
2134
|
.value="${r()}"
|
|
2135
2135
|
></tooltip-text>
|
|
2136
|
-
</div>`:
|
|
2136
|
+
</div>`:Y`${r()}`};Ua([j({type:Array})],Li.prototype,"variables",2);Li=Ua([xe("env-store")],Li);exports.ClientMessages=Q;exports.Heartbeat=xa;exports.Streams=La;exports.genRunID=Ta;exports.getContext=Be;exports.setContext=go;
|