@lvce-editor/editor-worker 19.17.1 → 19.17.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/editorWorkerMain.js +11 -17
- package/dist/editorWorkerMain.min.js +1 -1
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -10102,11 +10102,6 @@ const executeWidgetCommand = async (editor, name, method, _uid, widgetId, ...par
|
|
|
10102
10102
|
return newEditor;
|
|
10103
10103
|
};
|
|
10104
10104
|
|
|
10105
|
-
const filterActions = (sourceActions, languageId) => {
|
|
10106
|
-
return sourceActions.filter(action => action.languageId === languageId);
|
|
10107
|
-
};
|
|
10108
|
-
|
|
10109
|
-
// TODO ask extension host worker instead
|
|
10110
10105
|
const getEditorSourceActions = async editorId => {
|
|
10111
10106
|
if (!editorId) {
|
|
10112
10107
|
return [];
|
|
@@ -10114,13 +10109,12 @@ const getEditorSourceActions = async editorId => {
|
|
|
10114
10109
|
const {
|
|
10115
10110
|
newState
|
|
10116
10111
|
} = get$7(editorId);
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
return filtered;
|
|
10112
|
+
return execute({
|
|
10113
|
+
args: [],
|
|
10114
|
+
editor: newState,
|
|
10115
|
+
event: 'onLanguage',
|
|
10116
|
+
method: 'ExtensionHostCodeActions.getSourceActions'
|
|
10117
|
+
});
|
|
10124
10118
|
};
|
|
10125
10119
|
|
|
10126
10120
|
/* eslint-disable sonarjs/super-linear-regex */
|
|
@@ -11116,8 +11110,8 @@ const getEditorPreferences = async () => {
|
|
|
11116
11110
|
|
|
11117
11111
|
const getTokenizePath = (languages, languageId) => {
|
|
11118
11112
|
for (const language of languages) {
|
|
11119
|
-
if (language?.id === languageId) {
|
|
11120
|
-
return language.tokenize
|
|
11113
|
+
if (language?.id === languageId && language.tokenize) {
|
|
11114
|
+
return language.tokenize;
|
|
11121
11115
|
}
|
|
11122
11116
|
}
|
|
11123
11117
|
return '';
|
|
@@ -12513,9 +12507,9 @@ const commandMap = {
|
|
|
12513
12507
|
'Editor.setText': wrapCommand(setText),
|
|
12514
12508
|
'Editor.showHover': showHover,
|
|
12515
12509
|
'Editor.showHover2': showHover3,
|
|
12516
|
-
'Editor.showSourceActions': showSourceActions,
|
|
12517
|
-
'Editor.showSourceActions2': showSourceActions,
|
|
12518
|
-
'Editor.showSourceActions3': showSourceActions,
|
|
12510
|
+
'Editor.showSourceActions': wrapCommand(showSourceActions),
|
|
12511
|
+
'Editor.showSourceActions2': wrapCommand(showSourceActions),
|
|
12512
|
+
'Editor.showSourceActions3': wrapCommand(showSourceActions),
|
|
12519
12513
|
'Editor.sortLinesAscending': wrapCommand(sortLinesAscending),
|
|
12520
12514
|
'Editor.tabCompletion': wrapCommand(tabCompletion),
|
|
12521
12515
|
'Editor.terminate': terminate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=t=>{const n=t.indexOf(".");return t.slice(n+1)};const n=()=>{const n=Object.create(null);const e={};return{clear(){for(const t of Object.keys(n)){delete n[t]}},diff(t,e,o){const{oldState:s,scheduledState:c}=n[t];const r=[];for(let t=0;t<e.length;t++){const n=e[t];if(!n(s,c)){r.push(o[t])}}return r},dispose(t){delete n[t]},get(t){return n[t]},getCommandIds(){const n=Object.keys(e);const o=n.map(t);return o},getKeys(){return Object.keys(n).map(Number)},registerCommands(t){Object.assign(e,t)},set(t,e,o,s){n[t]={newState:o,oldState:e,scheduledState:s??o}},wrapCommand(t){const e=async(e,...o)=>{const{newState:s,oldState:c}=n[e];const r=await t(s,...o);if(c===r||s===r){return}const i=n[e];const a={...i.newState,...r};n[e]={newState:a,oldState:i.oldState,scheduledState:a}};return e},wrapGetter(t){const e=(e,...o)=>{const{newState:s}=n[e];return t(s,...o)};return e},wrapLoadContent(t){const e=async(e,...o)=>{const{newState:s,oldState:c}=n[e];const r=await t(s,...o);const{error:i,state:a}=r;if(c===a||s===a){return{error:i}}const d=n[e];const l={...d.newState,...a};n[e]={newState:l,oldState:d.oldState,scheduledState:l};return{error:i}};return e}}};const e=()=>{globalThis.close()};class o extends Error{constructor(t){super(t);this.name="AssertionError"}}const s=1;const c=2;const r=3;const i=4;const a=5;const d=6;const l=7;const u=8;const f=t=>{switch(typeof t){case"number":return c;case"function":return d;case"string":return i;case"object":if(t===null){return l}if(Array.isArray(t)){return r}return s;case"boolean":return a;default:return u}};const h=t=>{const n=f(t);if(n!==s){throw new o("expected value to be of type object")}};const g=t=>{const n=f(t);if(n!==c){throw new o("expected value to be of type number")}};const m=t=>{const n=f(t);if(n!==r){throw new o("expected value to be of type array")}};const w=t=>{const n=f(t);if(n!==i){throw new o("expected value to be of type string")}};const p=t=>{const n=f(t);if(n!==a){throw new o("expected value to be of type boolean")}};const y=t=>{if(t.startsWith("Error: ")){return t.slice("Error: ".length)}if(t.startsWith("VError: ")){return t.slice("VError: ".length)}return t};const E=(t,n)=>{const e=y(`${t}`);if(n){return`${n}: ${e}`}return e};const x="\n";const I=(t,n=undefined)=>t.indexOf(x,n);const S=(t,n)=>{if(!n){return t}const e=I(t);const o=I(n);if(o===-1){return t}const s=t.slice(0,e);const c=n.slice(o);const r=y(n.slice(0,o));if(s.includes(r)){return s+c}return n};class k extends Error{constructor(t,n){const e=E(t,n);super(e);this.name="VError";if(t instanceof Error){this.stack=S(this.stack,t.stack)}if(t.codeFrame){this.codeFrame=t.codeFrame}if(t.code){this.code=t.code}}}const v=t=>t&&t instanceof MessagePort;const C=t=>t&&t.constructor&&t.constructor.name==="MessagePortMain";const b=t=>typeof OffscreenCanvas!=="undefined"&&t instanceof OffscreenCanvas;const M=(t,n)=>t?.constructor?.name===n;const A=t=>M(t,"Socket");const L=[v,C,b,A];const P=t=>{for(const n of L){if(n(t)){return true}}return false};const F=(t,n,e)=>{if(!t){return}if(e(t)){n.push(t);return}if(Array.isArray(t)){for(const o of t){F(o,n,e)}return}if(typeof t==="object"){for(const o of Object.values(t)){F(o,n,e)}return}};const W=t=>{const n=[];F(t,n,P);return n};const T=t=>{const n=(...n)=>{const e=t.getData(...n);t.dispatchEvent(new MessageEvent("message",{data:e}))};t.onMessage(n);const e=n=>{t.dispatchEvent(new Event("close"))};t.onClose(e)};class R extends EventTarget{constructor(t){super();this._rawIpc=t;T(this)}}const D="E_INCOMPATIBLE_NATIVE_MODULE";const O="E_MODULES_NOT_SUPPORTED_IN_ELECTRON";const B="ERR_MODULE_NOT_FOUND";const N="\n";const H=t=>t.join(N);const z=/^\s+at/;const $=/^\s*at async Promise.all \(index \d+\)$/;const U=t=>z.test(t)&&!$.test(t);const Y=t=>{const n=t.findIndex(U);if(n===-1){return{actualMessage:H(t),rest:[]}}let e=n-1;while(++e<t.length){if(!U(t[e])){break}}return{actualMessage:t[n-1],rest:t.slice(n,e)}};const _=t=>t.split(N);const V=/^Error: The module '.*'$/;const j=/^\s* at/;const q=t=>V.test(t);const G=t=>j.test(t);const X=t=>{const n=_(t);const e=n.findIndex(q);const o=e+n.slice(e).findIndex(G,e);const s=n.slice(e,o);const c=s.join(" ").slice("Error: ".length);return c};const Z=t=>t.includes("[ERR_MODULE_NOT_FOUND]");const Q=t=>{const n=_(t);const e=n.findIndex(Z);const o=n[e];return{code:B,message:o}};const K=t=>{if(!t){return false}return t.includes("ERR_MODULE_NOT_FOUND")};const J=t=>{if(!t){return false}return t.includes("SyntaxError: Cannot use import statement outside a module")};const tt=/^innerError Error: Cannot find module '.*.node'/;const nt=/was compiled against a different Node.js version/;const et=t=>tt.test(t)&&nt.test(t);const ot=t=>{const n=X(t);return{code:D,message:`Incompatible native node module: ${n}`}};const st=()=>({code:O,message:`ES Modules are not supported in electron`});const ct=(t,n)=>{if(et(n)){return ot(n)}if(J(n)){return st()}if(K(n)){return Q(n)}const e=_(n);const{actualMessage:o,rest:s}=Y(e);return{code:"",message:o,stack:s}};class rt extends k{constructor(t,n="",e=""){if(n||e){const{code:o,message:s,stack:c}=ct(n,e);const r=new Error(s);r.code=o;r.stack=c;super(r,t)}else{super(t)}this.name="IpcError";this.stdout=n;this.stderr=e}}const it="ready";const at=t=>t.data;const dt=()=>{if(typeof WorkerGlobalScope==="undefined"){throw new TypeError("module is not in web worker scope")}return globalThis};const lt=t=>{t.postMessage(it)};class ut extends R{getData(t){return at(t)}send(t){this._rawIpc.postMessage(t)}sendAndTransfer(t){const n=W(t);this._rawIpc.postMessage(t,n)}dispose(){}onClose(t){}onMessage(t){this._rawIpc.addEventListener("message",t)}}const ft=t=>new ut(t);const ht=async t=>{const{promise:n,resolve:e}=Promise.withResolvers();t.addEventListener("message",e,{once:true});const o=await n;return o.data};const gt=async()=>{const t=dt();lt(t);const n=ft(t);const e=await ht(n);if(e.method!=="initialize"){throw new rt("unexpected first message")}const o=e.params[0];if(o==="message-port"){n.send({id:e.id,jsonrpc:"2.0",result:null});n.dispose();const t=e.params[1];return t}return globalThis};class mt extends R{getData(t){return at(t)}send(t){this._rawIpc.postMessage(t)}sendAndTransfer(t){const n=W(t);this._rawIpc.postMessage(t,n)}dispose(){if(this._rawIpc.close){this._rawIpc.close()}}onClose(t){}onMessage(t){this._rawIpc.addEventListener("message",t);this._rawIpc.start()}}const wt=t=>new mt(t);const pt={__proto__:null,listen:gt,wrap:wt};const yt=(t,n,e)=>{if("addEventListener"in t){t.addEventListener(n,e)}else{t.on(n,e)}};const Et=(t,n,e)=>{if("removeEventListener"in t){t.removeEventListener(n,e)}else{t.off(n,e)}};const xt=(t,n)=>{const{promise:e,resolve:o}=Promise.withResolvers();const s=Object.create(null);const c=e=>{for(const e of Object.keys(n)){Et(t,e,s[e])}o(e)};for(const[e,o]of Object.entries(n)){const n=t=>{c({event:t,type:o})};yt(t,e,n);s[e]=n}return e};const It=3;const St=async({isMessagePortOpen:t,messagePort:n})=>{if(!v(n)){throw new rt("port must be of type MessagePort")}if(t){return n}const e=xt(n,{message:It});n.start();const{event:o,type:s}=await e;if(s!==It){throw new rt("Failed to wait for ipc message")}if(o.data!==it){throw new rt("unexpected first message")}return n};const kt=t=>{t.start()};class vt extends R{getData=at;send(t){this._rawIpc.postMessage(t)}sendAndTransfer(t){const n=W(t);this._rawIpc.postMessage(t,n)}dispose(){this._rawIpc.close()}onMessage(t){this._rawIpc.addEventListener("message",t)}onClose(t){}}const Ct=t=>new vt(t);const bt={__proto__:null,create:St,signal:kt,wrap:Ct};class Mt extends Error{constructor(t){super(`Command not found ${t}`);this.name="CommandNotFoundError"}}const At=Object.create(null);const Lt=t=>{Object.assign(At,t)};const Pt=t=>At[t];const Ft=(t,...n)=>{const e=Pt(t);if(!e){throw new Mt(t)}return e(...n)};const Wt="2.0";const Tt=Object.create(null);const Rt=t=>Tt[t];const Dt=t=>{delete Tt[t]};class Ot extends Error{constructor(t){super(t);this.name="JsonRpcError"}}const Bt="\n";const Nt="DOMException";const Ht="ReferenceError";const zt="SyntaxError";const $t="TypeError";const Ut=(t,n)=>{if(n){switch(n){case Nt:return DOMException;case Ht:return ReferenceError;case zt:return SyntaxError;case $t:return TypeError;default:return Error}}if(t.startsWith("TypeError: ")){return TypeError}if(t.startsWith("SyntaxError: ")){return SyntaxError}if(t.startsWith("ReferenceError: ")){return ReferenceError}return Error};const Yt=(t,n,e)=>{const o=Ut(t,n);if(o===DOMException&&e){return new o(t,e)}if(o===Error){const n=new Error(t);if(e&&e!=="VError"){n.name=e}return n}return new o(t)};const _t=t=>t.join(Bt);const Vt=t=>t.split(Bt);const jt=()=>{const t=3;const n=_t(Vt((new Error).stack||"").slice(t));return n};const qt=(t,n=undefined)=>t.indexOf(Bt,n);const Gt=t=>{let n=t.stack||t.data||t.message||"";if(n.startsWith(" at")){n=t.message+Bt+n}return n};const Xt=-32601;const Zt=-32001;const Qt=t=>{const n=jt();if(t&&t instanceof Error){if(typeof t.stack==="string"){t.stack=t.stack+Bt+n}return t}if(t&&t.code&&t.code===Xt){const e=new Ot(t.message);const o=Gt(t);e.stack=o+Bt+n;return e}if(t&&t.message){const e=Yt(t.message,t.type,t.name);if(t.data){if(t.data.stack&&t.data.type&&t.message){e.stack=t.data.type+": "+t.message+Bt+t.data.stack+Bt+n}else if(t.data.stack){e.stack=t.data.stack}if(t.data.codeFrame){e.codeFrame=t.data.codeFrame}if(t.data.code){e.code=t.data.code}if(t.data.type){e.name=t.data.type}}else{if(t.stack){const n=e.stack||"";const o=qt(n);const s=Gt(t);e.stack=s+n.slice(o)}if(t.codeFrame){e.codeFrame=t.codeFrame}}return e}if(typeof t==="string"){return new Error(`JsonRpc Error: ${t}`)}return new Error(`JsonRpc Error: ${t}`)};const Kt=t=>{if("error"in t){const n=Qt(t.error);throw n}if("result"in t){return t.result}throw new Ot("unexpected response message")};const Jt=(...t)=>{console.warn(...t)};const tn=(t,n)=>{const e=Rt(t);if(!e){console.log(n);Jt(`callback ${t} may already be disposed`);return}e(n);Dt(t)};const nn="E_COMMAND_NOT_FOUND";const en=t=>{if(t&&t.type){return t.type}if(t&&t.constructor&&t.constructor.name){return t.constructor.name}return undefined};const on=t=>t.trim().startsWith("at ");const sn=t=>{const n=t.stack||"";const e=n.indexOf("\n");if(e!==-1&&!on(n.slice(0,e))){return n.slice(e+1)}return n};const cn=(t,n)=>{if(t&&t.code===nn){return{code:Xt,data:t.stack,message:t.message}}return{code:Zt,data:{code:n.code,codeFrame:n.codeFrame,name:n.name,stack:sn(n),type:en(n)},message:n.message}};const rn=(t,n)=>({error:n,id:t,jsonrpc:Wt});const an=(t,n,e,o)=>{const s=e(n);o(n,s);const c=cn(n,s);return rn(t,c)};const dn=(t,n)=>({id:t.id,jsonrpc:Wt,result:n??null});const ln=(t,n)=>{const e=n??null;return dn(t,e)};const un=(t,n)=>({error:{code:Zt,data:n,message:n.message},id:t,jsonrpc:Wt});const fn=async(t,n,e,o,s,c)=>{try{const o=c(t.method)?await e(t.method,n,...t.params):await e(t.method,...t.params);return ln(t,o)}catch(e){if(n.canUseSimpleErrorResponse){return un(t.id,e)}return an(t.id,e,o,s)}};const hn=t=>t;const gn=()=>{};const mn=()=>false;const wn=tn;const pn=t=>{if(t.length===1){const n=t[0];return{execute:n.execute,ipc:n.ipc,logError:n.logError||gn,message:n.message,preparePrettyError:n.preparePrettyError||hn,requiresSocket:n.requiresSocket||mn,resolve:n.resolve||wn}}return{execute:t[2],ipc:t[0],logError:t[5],message:t[1],preparePrettyError:t[4],requiresSocket:t[6],resolve:t[3]}};const yn=async(...t)=>{const n=pn(t);const{execute:e,ipc:o,logError:s,message:c,preparePrettyError:r,requiresSocket:i,resolve:a}=n;if("id"in c){if("method"in c){const t=await fn(c,o,e,r,s,i);try{o.send(t)}catch(t){const n=an(c.id,t,r,s);o.send(n)}return}a(c.id,c);return}if("method"in c){await fn(c,o,e,r,s,i);return}throw new Ot("unexpected message")};const En="2.0";const xn=(t,n)=>({jsonrpc:En,method:t,params:n});const In=(t,n,e)=>{const o={id:t,jsonrpc:En,method:n,params:e};return o};let Sn=0;const kn=()=>++Sn;const vn=t=>{const n=kn();const{promise:e,resolve:o}=Promise.withResolvers();t[n]=o;return{id:n,promise:e}};const Cn=async(t,n,e,o,s)=>{const{id:c,promise:r}=vn(t);const i=In(c,e,o);if(s&&n.sendAndTransfer){n.sendAndTransfer(i)}else{n.send(i)}const a=await r;return Kt(a)};const bn=t=>{const n=Object.create(null);t._resolve=(t,e)=>{const o=n[t];if(!o){console.warn(`callback ${t} may already be disposed`);return}o(e);delete n[t]};const e={async dispose(){await(t?.dispose())},invoke(e,...o){return Cn(n,t,e,o,false)},invokeAndTransfer(e,...o){return Cn(n,t,e,o,true)},ipc:t,send(n,...e){const o=xn(n,e);t.send(o)}};return e};const Mn=()=>false;const An=t=>t;const Ln=()=>{};const Pn=t=>{const n=t?.target?.requiresSocket||Mn;const e=t?.target?.execute||Ft;return yn(t.target,t.data,e,t.target._resolve,An,Ln,n)};const Fn=t=>{if("addEventListener"in t){t.addEventListener("message",Pn)}else if("on"in t){t.on("message",Pn)}};const Wn=async(t,n)=>{const e=await t.listen(n);if(t.signal){t.signal(e)}const o=t.wrap(e);return o};const Tn=async({commandMap:t,isMessagePortOpen:n=true,messagePort:e})=>{Lt(t);const o=await bt.create({isMessagePortOpen:n,messagePort:e});const s=bt.wrap(o);Fn(s);const c=bn(s);e.start();return c};const Rn=async({commandMap:t,isMessagePortOpen:n,send:e})=>{const{port1:o,port2:s}=new MessageChannel;await e(o);return Tn({commandMap:t,isMessagePortOpen:n,messagePort:s})};const Dn=t=>{let n;const e=()=>{if(!n){n=t()}return n};return{async dispose(){const t=await e();await t.dispose()},async invoke(t,...n){const o=await e();return o.invoke(t,...n)},async invokeAndTransfer(t,...n){const o=await e();return o.invokeAndTransfer(t,...n)},async send(t,...n){const o=await e();o.send(t,...n)}}};const On=async({commandMap:t,isMessagePortOpen:n,send:e})=>Dn(()=>Rn({commandMap:t,isMessagePortOpen:n,send:e}));const Bn=async({commandMap:t,messagePort:n})=>Tn({commandMap:t,messagePort:n});const Nn=async({commandMap:t})=>{Lt(t);const n=await Wn(pt);Fn(n);const e=bn(n);return e};const Hn=({commandMap:t})=>{const n=[];const e=(e,...o)=>{n.push([e,...o]);const s=t[e];if(!s){throw new Error(`command ${e} not found`)}return s(...o)};const o={invocations:n,invoke:e,invokeAndTransfer:e};return o};const zn=Object.create(null);const $n=(t,n)=>{zn[t]=n};const Un=t=>zn[t];const Yn=t=>{delete zn[t]};const _n=t=>({async dispose(){const n=Un(t);await n.dispose()},invoke(n,...e){const o=Un(t);return o.invoke(n,...e)},invokeAndTransfer(n,...e){const o=Un(t);return o.invokeAndTransfer(n,...e)},registerMockRpc(n){const e=Hn({commandMap:n});$n(t,e);e[Symbol.dispose]=()=>{Yn(t)};return e},set(n){$n(t,n)}});const Vn=12;const jn=100;const qn="event.altKey";const Gn="event.button";const Xn="event.clientX";const Zn="event.clientY";const Qn="event.deltaMode";const Kn="event.deltaY";const Jn=1;const te=2;const ne=3;const ee=8;const oe=9;const se=255;const ce=12;const re=13;const ie=14;const ae=15;const de=16;const le=18;const ue=29;const fe=31;const he=32;const ge=34;const me=36;const we=38;const pe=39;const ye=40;const Ee=43;const xe=50;const Ie=52;const Se=54;const ke=58;const ve=59;const Ce=60;const be=68;const Me=87;const Ae=88;const Le=90;const Pe=92;const Fe=1;const We=2;const Te=3;const Re=4;const De=5;const Oe=6;const Be=7;const Ne=8;const He=1<<11>>>0;const ze=1<<10>>>0;const $e=1<<9>>>0;const Ue=3;const Ye=22;const _e=1;const Ve=0;const je=2;const qe=301;const Ge=55;const Xe=99;const Ze=44;const Qe=9006;const Ke=7009;const Je=300;const to=4561;const no=1;const eo="Viewlet.focusSelector";const oo="Viewlet.setCss";const so="Viewlet.setFocusContext";const co="Viewlet.setPatches";const ro=12;const{invoke:io,set:ao}=_n(Ze);const lo={__proto__:null,invoke:io,set:ao};const{invoke:uo,set:fo}=_n(Qe);const ho=(t,n)=>uo("Extensions.getLanguages",t,n);const{invoke:go,set:mo}=_n(to);const wo=async(t,n)=>go("Open.openUrl",t,n);const{invoke:po,set:yo}=_n(Ke);const{invoke:Eo,invokeAndTransfer:xo,set:Io}=_n(no);const So=async(t,n,e,o,s)=>{g(t);g(n);g(e);g(o);await Eo("ContextMenu.show2",t,n,e,o,s)};const ko=async(t,n)=>{const e="HandleMessagePort.handleMessagePort";await xo("SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker",t,e,n)};const vo=async t=>Eo("FileSystem.readFile",t);const Co=async()=>Eo("Layout.handleWorkspaceRefresh");const bo=async(t,n=0)=>{const e="HandleMessagePort.handleMessagePort2";await xo("SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker",t,e,n)};const Mo=async t=>{await Eo("ClipBoard.writeText",t)};const Ao=async()=>Eo("ClipBoard.readText");const Lo=(t,n,e)=>Eo("ExtensionHostManagement.activateByEvent",t,n,e);const Po=async t=>{const n="TextMeasurement.handleMessagePort";await xo("SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker",t,n,0)};const Fo=async(t,n)=>{const e="Extensions.handleMessagePort";await xo("SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker",t,e,n)};const Wo=async t=>await Eo("Preferences.get",t);const To=async(t,n,e)=>{await Eo("Main.openUri",t,n,e)};const Ro=async t=>{await xo("SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker",t,"HandleMessagePort.handleMessagePort2")};const Do={__proto__:null,activateByEvent:Lo,getPreference:Wo,handleWorkspaceRefresh:Co,invoke:Eo,invokeAndTransfer:xo,openUri:To,readClipBoardText:Ao,readFile:vo,sendMessagePortToExtensionHostWorker:bo,sendMessagePortToExtensionManagementWorker:Fo,sendMessagePortToOpenerWorker:ko,sendMessagePortToSyntaxHighlightingWorker:Ro,sendMessagePortToTextMeasurementWorker:Po,set:Io,showContextMenu2:So,writeClipBoardText:Mo};const{invoke:Oo,set:Bo}=_n(Je);const No={__proto__:null,invoke:Oo,set:Bo};const Ho=t=>{let n;let e;const o=async()=>{const n=await e();$n(t,n)};const s=async()=>{if(!n){n=o()}await n};return{async invoke(n,...e){await s();const o=Un(t);return o.invoke(n,...e)},async invokeAndTransfer(n,...e){await s();const o=Un(t);return o.invokeAndTransfer(n,...e)},setFactory(t){e=t}}};const zo=async(t,n,e)=>{w(t);await Lo(t,n,e)};const $o=t=>t;const Uo=6;const Yo=async(t,n,e)=>{const o=await Rn({commandMap:{},isMessagePortOpen:true,async send(e){await xo("IpcParent.create",{method:Uo,name:t,port:e,raw:true,url:n})}});if(e){await o.invoke(e)}return o};const _o=async()=>{const t="Color Picker Worker";const n="colorPickerWorkerMain.js";return Yo(t,n)};const Vo={};const jo=()=>{if(!Vo.workerPromise){Vo.workerPromise=_o()}return Vo.workerPromise};const qo=async(t,...n)=>{const e=await jo();return await e.invoke(t,...n)};const Go=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;await qo("ColorPicker.create",o,c,r,s,e,n);await qo("ColorPicker.loadContent",o);const i=await qo("ColorPicker.diff2",o);const a=await qo("ColorPicker.render2",o,i);return{...t,commands:a}};const Xo=n();const{getCommandIds:Zo,registerCommands:Qo,wrapGetter:Ko}=Xo;const Jo=t=>Xo.get(t);const ts=()=>{const t=Xo.getKeys();return t.map(String)};const ns=(t,n,e)=>{Xo.set(t,n,e)};const es=[];const os=41;const ss=9;const cs=0;const rs=16;const is=51;const as=11;const ds=38;const ls=52;const us=(t,n,e,o,s,c,r,i)=>{g(t);const a={additionalFocus:0,assetDir:i,charWidth:0,columnWidth:0,completionState:"",completionTriggerCharacters:[],completionUid:0,cursorInfos:[],cursorWidth:2,debugEnabled:false,decorations:[],deltaX:0,deltaY:0,diagnostics:[],diagnosticsEnabled:false,differences:[],embeds:[],finalDeltaY:0,finalY:0,focus:0,focused:false,focusKey:cs,fontFamily:"",fontSize:0,fontWeight:0,handleOffset:0,handleOffsetX:0,hasListener:false,height:c,highlightedLine:-1,id:t,incrementalEdits:es,initial:true,invalidStartIndex:0,isAutoClosingBracketsEnabled:false,isAutoClosingQuotesEnabled:false,isAutoClosingTagsEnabled:false,isMonospaceFont:false,isQuickSuggestionsEnabled:false,isSelecting:false,itemHeight:20,languageId:"",letterSpacing:0,lineCache:[],lineNumbers:false,lines:[],longestLineWidth:0,maxLineY:0,minimumSliderSize:20,minLineY:0,modified:false,numberOfLines:0,numberOfVisibleLines:0,platform:r,primarySelectionIndex:0,redoStack:[],rowHeight:0,savedSelections:[],scrollBarHeight:0,scrollBarWidth:0,selectionAnchorPosition:{columnIndex:0,rowIndex:0},selectionAutoMovePosition:{columnIndex:0,rowIndex:0},selectionInfos:[],selections:new Uint32Array,tabSize:0,textInfos:[],tokenizerId:0,uid:t,undoStack:[],uri:n,validLines:[],visualDecorations:[],widgets:[],width:s,x:e,y:o};ns(t,a,a)};const fs="compositionUpdate";const hs="contentEditableInput";const gs="delete";const ms="deleteHorizontalRight";const ws="deleteLeft";const ps="editorCut";const ys="editorPasteText";const Es="editorSnippet";const xs="editorType";const Is="editorTypeWithAutoClosing";const Ss="format";const ks="indentLess";const vs="indentMore";const Cs="insertLineBreak";const bs="lineComment";const Ms="rename";const As="toggleBlockComment";const Ls=Object.create(null);const Ps=(t,n)=>{Ls[t]=n};const Fs=t=>Ls[t];const Ws=t=>Fs(t);const Ts=async(t,n,e)=>{const o=Ws(n.id);if(e.length===1&&e[0].origin===xs&&o.handleEditorType){const n=await o.handleEditorType(t);return{...n}}if(e.length===1&&e[0].origin===ws&&o.handleEditorDeleteLeft){const n=await o.handleEditorDeleteLeft(t);return{...n}}return n};const Rs=async(t,n)=>{const e=t.widgets||[];if(e.length===0){return e}let o=t;for(const s of e){o=await Ts(t,s,n)}return o};const Ds=(t,n,e)=>{g(t);g(n);g(e);return Math.min(Math.max(t,n),e)};const Os="Link";const Bs="Function";const Ns="Parameter";const Hs="Type";const zs="VariableName";const $s="Class";const Us=1;const Ys=2816;const _s=2817;const Vs=2824;const js=2825;const qs=2956;const Gs=2857;const Xs=3072;const Zs=3073;const Qs=3077;const Ks=3088;const Js=1792;const tc=1793;const nc=512;const ec=513;const oc=769;const sc=1024;const cc=1536;const rc=1537;const ic=1544;const ac=1545;const dc=2048;const lc=2049;const uc=2056;const fc=2057;const hc=2064;const gc=2080;const mc=2081;const wc=2088;const pc=2089;const yc=2313;const Ec=2560;const xc=2561;const Ic=2569;const Sc=2584;const kc=256;const vc=257;const Cc=272;const bc=t=>{switch(t){case Us:return Os;case sc:case cc:case rc:case ic:case ac:case nc:case ec:case oc:return Hs;case Js:case tc:return Ns;case dc:case lc:case uc:case fc:case hc:case gc:case mc:case wc:case pc:case yc:case Ec:case xc:case Ic:case Sc:return zs;case kc:case vc:case Cc:return $s;case Ys:case _s:case Vs:case js:case qs:case Gs:case Xs:case Zs:case Qs:case Ks:return Bs;default:return`Unknown-${t}`}};const Mc=t=>structuredClone(t);const Ac=t=>Mc(t);const Lc={warned:[]};const Pc=t=>{const n=[];for(const e of t){h(e);n.push(e.type,e.length)}return n};const Fc=(t,n)=>{if(Lc.warned.includes(n)){return}Lc.warned.push(n);console.warn(`tokenizers without hasArrayReturn=false are deprecated (language ${t})`)};const Wc=(t,n,e,o,s)=>{try{const c=n(e,o);if(!c?.tokens||!c.state){throw new Error("invalid tokenization result")}if(!s){Fc(t,n);c.tokens=Pc(c.tokens)}return c}catch(t){console.error(t);return{lineState:o,tokens:[0,e.length]}}};const Tc={TopLevelContent:1};const Rc={Text:1};const Dc={[Rc.Text]:"Text"};const Oc={state:Tc.TopLevelContent};const Bc=true;const Nc=(t,n)=>({state:n.state,tokens:[Rc.Text,t.length]});const Hc={__proto__:null,State:Tc,TokenMap:Dc,TokenType:Rc,hasArrayReturn:Bc,initialLineState:Oc,tokenizeLine:Nc};const zc={enabled:false};const $c=t=>{zc.enabled=t};const Uc=()=>zc.enabled;const{invoke:Yc,set:_c}=No;const Vc={pending:Object.create(null),tokenizePaths:Object.create(null),tokenizers:Object.create(null)};const jc=t=>Object.hasOwn(Vc.tokenizers,t);const qc=(t,n)=>{Vc.tokenizers[t]=n};const Gc=t=>Vc.tokenizers[t];const Xc=(t,n)=>{Vc.tokenizePaths[t]=n};const Zc=t=>Vc.tokenizePaths[t]||"";const Qc=t=>{for(const n of t){if(n&&n.id&&n.tokenize){Xc(n.id,n.tokenize)}}};const Kc=t=>Object.hasOwn(Vc.pending,t);const Jc=Object.create(null);const tr=(t,n)=>{Jc[t]=n};const nr=t=>Jc[t]||{};const er=async(t,n)=>{if(!n){return}Xc(t,n);if(Uc()){const e=await Yc("Tokenizer.load",t,n);tr(t,e);return}try{const e=await import(n);if(typeof e.tokenizeLine!=="function"){console.warn(`tokenizer.tokenizeLine should be a function in "${n}"`);return}if(!e.TokenMap||typeof e.TokenMap!=="object"||Array.isArray(e.TokenMap)){console.warn(`tokenizer.TokenMap should be an object in "${n}"`);return}tr(t,e.TokenMap);qc(t,e)}catch(t){console.error(t)}};const or=t=>{if(jc(t)){return Gc(t)}if(Kc(t)){return Hc}return Hc};const sr=Object.create(null);const cr=(t,n)=>{sr[t]=n};const rr=t=>sr[t]||Hc;const ir=(t,n,e,o,s,c,r)=>{const i=or(e);if(o!==n.length&&i&&i!==Hc){const a=o===0&&s===n.length;const d=n.slice(o,s);const l=Wc(t,i.tokenizeLine,d,c[e]||Ac(i.initialLineState),i.hasArrayReturn);c[e]=l;if(l.embeddedLanguage){const n=ir(t,d,l.embeddedLanguage,l.embeddedLanguageStart,l.embeddedLanguageEnd,c,r);if(n?.isFull){return n}}return{isFull:a,result:l,TokenMap:i.TokenMap}}r.push(e);c[e]=undefined;return{isFull:false,result:{},TokenMap:[]}};const ar=(t,n,e,o)=>{const s=[];const c=[];const r=Object.create(null);for(const i of o){const o=e[i+1];const a=n[i];if(o.embeddedLanguage){const{embeddedLanguage:n,embeddedLanguageEnd:e,embeddedLanguageStart:i}=o;if(a.length===0){const t={tokens:[]};o.embeddedResultIndex=c.length;c.push({isFull:true,result:t,TokenMap:[]})}else{o.embeddedResultIndex=c.length;c.push(ir(t,a,n,i,e,r,s))}}else{for(const t of Object.keys(r)){r[t]=undefined}}}return{embeddedResults:c,tokenizersToLoad:s}};const dr=(t,n,e)=>t<n?n:e;const lr=(t,n,e)=>{const{invalidStartIndex:o,languageId:s,lineCache:c,lines:r,tokenizerId:i}=t;const a=rr(i);const{hasArrayReturn:d,initialLineState:l,tokenizeLine:u}=a;const f=o;const h=dr(o,e,f);const g=[];const m=[];const w=[];for(let t=f;t<h;t++){const n=t===0?Ac(l):c[t];const e=r[t];const o=Wc(s,u,e,n,d);c[t+1]=o;if(o.embeddedLanguage){o.embeddedResultIndex=w.length;w.push(t)}}const p=c.slice(n+1,e+1);if(w.length>0){const{embeddedResults:n,tokenizersToLoad:e}=ar(s,r,c,w);t.invalidStartIndex=0;return{embeddedResults:n,tokenizersToLoad:e,tokens:p}}t.invalidStartIndex=Math.max(o,h);return{embeddedResults:m,tokenizersToLoad:g,tokens:p}};const ur=Object.create(null);const fr=async(t,n,e,o)=>{if(Uc()){if(o){const{id:o,invalidStartIndex:s,languageId:c,lines:r}=t;let i=true;let a=r;if(ur[o]===r){i=false;a=[]}else{ur[o]=r}const d={invalidStartIndex:s,languageId:c};return Yc("GetTokensViewport.getTokensViewport",d,n,e,i,o,a)}return Yc("GetTokensViewport.getTokensViewport",t,n,e,true,t.id,t.lines)}return lr(t,n,e)};const hr=async t=>{for(const n of t){const t=Zc(n);await er(n,t)}};const gr=".";const mr='"';const wr="";const pr="\n";const yr=" ";const Er="\t";const xr=(t,n,e)=>{if(n){return t.replaceAll(Er,()=>yr.repeat(e))}return t};const Ir=t=>t.includes(Er);const Sr=(t,n,e)=>{const o=t.length;const s=e.length;t.length=o+s;for(let e=o-1;e>=n;e--){t[e+s]=t[e]}for(let o=0;o<s;o++){t[o+n]=e[o]}};const kr=(t,n,e,o)=>{const s=t.splice(n,e);Sr(t,n,o);return s};const vr=t=>t.join("\n");const Cr=/^\s+/;const br=t=>{const n=t.match(Cr);if(!n){return""}return n[0]};const Mr=(t,n)=>{h(t);m(n);const e=[...t.lines];let o=0;for(const s of n){const n=s.start.rowIndex+o;const c=s.end.rowIndex+o;const r=s.start.columnIndex;const i=s.end.columnIndex;const{deleted:a,inserted:d}=s;g(n);g(c);g(r);g(i);m(d);m(a);if(n===c){const o=e[n];if(d.length===0){const t=o.slice(0,r);const s=o.slice(i);e[n]=t+s}else if(d.length===1){let t=o.slice(0,r);if(r>o.length){t+=" ".repeat(r-o.length)}const s=o.slice(i);const c=d[0];e[n]=t+c+s}else{const s=o.slice(0,r)+d[0];const c=d.at(-1)+o.slice(i);kr(e,n,a.length,[s,...d.slice(1,-1),c]);t.maxLineY=Math.min(t.numberOfVisibleLines,e.length)}}else{const o=e[n].slice(0,r)+d[0];if(d.length===1){const t=c>=e.length?"":e[c].slice(i);kr(e,n,a.length,[o+t])}else{const t=d.slice(1,-1);const s=d.at(-1)+(c>=e.length?"":e[c].slice(i));kr(e,n,a.length,[o,...t,s])}t.maxLineY=Math.min(t.numberOfVisibleLines,t.lines.length)}o+=d.length-a.length}return e};const Ar=(t,n)=>t.lines[n];const Lr=t=>vr(t.lines);const Pr=(t,n)=>{h(t);const e=n.start.rowIndex;const o=n.start.columnIndex;const s=Math.min(n.end.rowIndex,t.lines.length-1);const c=n.end.columnIndex;if(e===s){return[t.lines[e].slice(o,c)]}const r=[t.lines[e].slice(o),...t.lines.slice(e+1,s),t.lines[s].slice(0,c)];return r};const Fr=async(t,n,e)=>{h(t);g(n);g(e);let o=0;let s=0;const{lines:c}=t;const r=Math.min(n,t.lines.length);while(s<r){o+=c[s].length+1;s++}o+=e;return o};const Wr=(t,n,e)=>{h(t);g(n);g(e);let o=0;let s=0;const{lines:c}=t;const r=Math.min(n,t.lines.length);while(s<r){o+=c[s].length+1;s++}o+=e;return o};const Tr=(t,n)=>{const{lines:e}=t;let o=0;let s=0;let c=0;while(o<e.length&&c<n){c+=e[o].length+1;o++}if(c>n){o--;c-=e[o].length+1;s=n-c}else{s=c-n}return{columnIndex:s,rowIndex:o}};const Rr=10;const Dr=(t,n)=>{let e=0;let o=0;let s=0;const c=t.length;for(let r=0;r<c;r+=2){const c=t[r+1];o+=c;e=o;if(e>=n){e-=c;o-=c;s=r;break}}return{end:o,start:e,startIndex:s}};const Or=(t,n,e)=>{for(const[o,{end:s}]of t){if(o<e&&s>n){return true}}return false};const Br=(t,n)=>{for(const[e,o]of t){if(e<=n&&o.end>n){return o}}return undefined};const Nr=(t,n,e,o,s,c,r,i,a,d,l,u)=>{const f=[];const h=new Map;for(let t=0;t<o.length;t+=4){const n=o[t];const c=o[t+1];const r=o[t+2];const i=n-s;const a=i+c;if(i<e.length&&a>0){const t=bc(r);if(t){h.set(Math.max(0,i),{className:t,end:Math.min(e.length,a)})}}}const g=t[n.embeddedResultIndex];const m=g.result.tokens;const w=g.TokenMap;const p=m.length;let{end:y,start:E,startIndex:x}=Dr(m,l);const I=zr(E,d,a);for(let t=x;t<p;t+=2){const n=m[t];const o=m[t+1];const s=E+o;const i=Or(h,E,s);if(i){let t=E;while(t<s){const o=Br(h,t);let i;let a;let d;if(o){i=Math.min(s,o.end);a=e.slice(t,i);const c=w[n]||"Unknown";d=`Token ${c} ${o.className}`}else{let o=s;for(const[n]of h){if(n>t&&n<s){o=Math.min(o,n)}}i=o;a=e.slice(t,i);d=`Token ${w[n]||"Unknown"}`}const l=xr(a,c,r);f.push(l,d);t=i}}else{const t=e.slice(E,s);const o=`Token ${w[n]||"Unknown"}`;const i=xr(t,c,r);f.push(i,o)}E=s;y=s;if(y>=u){break}}return{difference:I,lineInfo:f}};const Hr=()=>({maxOffset:Infinity,minOffset:0});const zr=(t,n,e)=>{const o=t*n;const s=o-e;return s};const $r=(t,n,e,o,s,c,r,i,a,d,l,u,f)=>{const h=[];const g=new Map;for(let n=0;n<o.length;n+=4){const e=o[n];const s=o[n+1];const r=o[n+2];const i=e-c;const a=i+s;if(i<t.length&&a>0){const n=bc(r);if(n){g.set(Math.max(0,i),{className:n,end:Math.min(t.length,a)})}}}const{tokens:m}=n;let{end:w,start:p,startIndex:y}=Dr(m,u);const E=zr(p,l,d);const x=m.length;for(let n=y;n<x;n+=2){const e=m[n];const o=m[n+1];const c=p+o;const a=Or(g,p,c);if(a){let n=p;while(n<c){const o=Br(g,n);let a;let d;let l;if(o){a=Math.min(c,o.end);d=t.slice(n,a);const r=s[e]||"Unknown";l=`Token ${r} ${o.className}`}else{let o=c;for(const[t]of g){if(t>n&&t<c){o=Math.min(o,t)}}a=o;d=t.slice(n,a);l=`Token ${s[e]||"Unknown"}`}const u=xr(d,r,i);h.push(u,l);n=a}}else{const n=t.slice(p,c);const o=`Token ${s[e]||"Unknown"}`;const a=xr(n,r,i);h.push(a,o)}p=c;w=c;if(w>=f){break}}return{difference:E,lineInfo:h}};const Ur=(t,n,e,o,s,c,r,i,a,d,l)=>{const{maxOffset:u,minOffset:f}=Hr();if(e.length>0&&n.embeddedResultIndex!==undefined){const s=e[n.embeddedResultIndex];if(s?.isFull){return Nr(e,n,t,o,c,r,i,a,d,l,f,u)}}return $r(t,n,e,o,s,c,r,i,a,d,l,f,u)};const Yr=(t,n,e,o,s,c,r,i,a)=>{const d=[];const l=[];const{decorations:u,languageId:f,lines:h}=t;const g=nr(f);let m=c;const w=2;for(let t=o;t<s;t++){const s=h[t];const c=Ir(s);const f=[];for(let t=0;t<u.length;t+=4){const n=u[t];const e=u[t+1];const o=u[t+2];const c=u[t+3];if(n>=m&&n<m+s.length){f.push(n,e,o,c)}}const{difference:p,lineInfo:y}=Ur(s,n[t-o],e,f,g,m,c,w,r,i,a);d.push(y);l.push(p);m+=s.length+1}return{differences:l,result:d}};const _r=async(t,n)=>{const{charWidth:e,deltaX:o,lines:s,minLineY:c,numberOfVisibleLines:r,width:i}=t;const a=Math.min(c+r,s.length);let{embeddedResults:d,tokenizersToLoad:l,tokens:u}=await fr(t,c,a,n);for(let e=0;l.length>0&&e<Rr;e++){await hr(l);const e=await fr(t,c,a,n);({embeddedResults:d,tokenizersToLoad:l,tokens:u}=e)}const f=await Fr(t,c,0);const h=e;const{differences:g,result:m}=Yr(t,u,d,c,a,f,i,o,h);return{differences:g,textInfos:m}};const Vr=(t,n,e,o)=>{const s=t/n*(e-o);if(!Number.isFinite(s)){return 0}return s};const jr=Vr;const qr=(t,n,e)=>{if(t>=n){return 0}return Math.max(Math.round(t**2/n),e)};const Gr=(t,n)=>{if(t>n){return 0}return t**2/n};const Xr=(t,n,e)=>{const o=n/2;if(e<=o){return{handleOffset:e,percent:0}}if(e<=t-o){return{handleOffset:o,percent:(e-o)/(t-n)}}return{handleOffset:n-t+e,percent:1}};const Zr={enabled:false};const Qr=t=>{Zr.enabled=t};const Kr=()=>Zr.enabled;const Jr=async(t,n)=>{h(t);g(n);const{deltaY:e,finalDeltaY:o,height:s,itemHeight:c,numberOfVisibleLines:r,scrollBarHeight:i}=t;const a=Ds(n,0,o);if(e===a){return t}const d=Math.floor(a/c);const l=d+r;const u=jr(a,o,s,i);const f={...t,deltaY:a,maxLineY:l,minLineY:d,scrollBarY:u};const m=Kr();const{differences:w,textInfos:p}=await _r(f,m);const y={...f,differences:w,textInfos:p};return y};const ti=async(t,n)=>{if(!n.undoStack){return es}if(t.undoStack===n.undoStack){return es}const e=n.undoStack.at(-1);if(e&&e.length===1){const o=e[0];if(o.origin===xs){const{rowIndex:e}=o.start;const{lines:s}=n;const c=t.lines[e];const r=s[e];const i=await Yc("TokenizeIncremental.tokenizeIncremental",n.uid,n.languageId,c,r,e,n.minLineY);if(i&&i.length===1){return i}}}return es};const ni=(t,n)=>t.matchAll(n).toArray();const ei=/(?:https?|ftps?|file):\/\/[^\s"']+|www\.[^\s"']+/g;const oi=/^(?:https?|ftp|ftps|file):\/\//;const si=/^www\./;const ci=".,;:!?";const ri={")":"(","]":"[","}":"{",">":"<"};const ii=(t,n)=>{const e=ri[n];let o=0;for(const s of t){if(s===e){o++}else if(s===n){o--}}return o<0};const ai=t=>{let n=t;while(n.length>0){const t=n.at(-1);if(!t){break}if(ci.includes(t)){n=n.slice(0,-1);continue}if(t in ri&&ii(n,t)){n=n.slice(0,-1);continue}break}return n};const di=t=>{const n=ni(t,ei);const e=[];for(const t of n){const n=ai(t[0]);if(oi.test(n)||si.test(n)){e.push({length:n.length,start:t.index??0})}}return e};const li=t=>{const n=[];const{lines:e}=t;let o=0;for(const t of e){const e=di(t);for(const t of e){const e=o+t.start;n.push(e,t.length,Us,0)}o+=t.length+1}return n};const ui=(t,n)=>{const{decorations:e,lines:o}=t;for(let t=0;t<e.length;t+=4){const s=e[t];const c=e[t+1];const r=e[t+2];if(r===Us&&n>=s&&n<s+c){let t=0;for(const n of o){const e=n.length+1;if(t+e>s){const e=s-t;const o=n.slice(e,e+c);return o}t+=e}}}return undefined};const fi=1;const hi=Object.create(null);const gi=(t,n)=>{g(t);g(n);if(!Object.hasOwn(hi,t)){hi[t]=[]}if(!hi[t].includes(n)){hi[t].push(n)}};const mi=(t,n)=>{g(t);g(n);if(Object.hasOwn(hi,t)){const e=hi[t].indexOf(n);if(e!==-1){hi[t].splice(e,1)}}};const wi=t=>{g(t);return hi[t]||[]};const pi=async(t,n,...e)=>{g(t);w(n);const o=wi(t);const s=o.map(async t=>{try{const o=Un(t);if(o){await o.invoke(n,...e)}}catch(n){console.warn(`Failed to notify listener ${t}:`,n)}});await Promise.all(s)};const yi=(t,n,e=t.columnWidth)=>{const o=n.x??t.x;const s=n.y??t.y;const c=n.width??t.width;const r=n.height??t.height;const i=Math.floor(r/t.itemHeight);const a=t.lines.length;const d=Math.max(a-i,0);const l=d*t.itemHeight;const u=Math.min(t.deltaY,l);const f=Math.floor(u/t.itemHeight);const h=Math.min(f+i,a);const g=a*t.rowHeight;const m=qr(r,g,t.minimumSliderSize);return{...t,columnWidth:e,deltaY:u,finalDeltaY:l,finalY:d,height:r,maxLineY:h,minLineY:f,numberOfVisibleLines:i,scrollBarHeight:m,width:c,x:o,y:s}};const Ei=t=>{if(!t){return[""]}return t.split("\n")};const{invoke:xi}=Do;const Ii=async t=>{try{await xi("Main.handleModifiedStatusChange",t,true)}catch{}};const Si=(t,n)=>{const e=t[n];const o=t[n+1];const s=t[n+2];const c=t[n+3];if(e>s||e===s&&o>=c){return[s,c,e,o,1]}return[e,o,s,c,0]};const ki=t=>{let n=0;for(const e of t){if(e===Er){n++}}return n};const vi=/^\p{ASCII}*$/u;const Ci=t=>vi.test(t);const bi=async(t,n)=>t.length*n;const Mi=async(t,n,e,o,s,c,r)=>{const i=await po("TextMeasurement.measureTextWidth",t,n,e,o,s,c,r);return i};const Ai=async(t,n,e,o,s,c,r)=>{if(c&&Ci(t)){return await bi(t,r)}return await Mi(t,n,e,o,s,c,r)};const Li=async(t,n,e,o,s,c,r,i,a,d,l,u=0)=>{if(!t){return 0}w(t);g(i);g(a);g(d);p(c);g(l);g(u);if(n===0){return 0}if(n*l>d){return d}const f=Ir(t);const h=xr(t,f,i);const m=ki(t.slice(0,n));const y=h.slice(0,n+m);const E=await Ai(y,e,o,s,r,c,l);return E-a+u};const Pi=(t,n,e)=>(t-n)*e;const Fi=t=>`${t}px`;const Wi=(t,n,e,o)=>new Uint32Array([t,n,e,o]);const Ti=t=>new Uint32Array(t);const Ri=t=>Ti(t.length);const Di=(t,n)=>{const e=Ri(t);for(let o=0;o<e.length;o+=4){const[s,c,r,i]=Si(t,o);n(e,o,s,c,r,i)}return e};const Oi=(t,n)=>{for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];n(o,s,c,r)}};const Bi=(t,n,e,o)=>{t[n]=t[n+2]=e;t[n+1]=t[n+3]=o};const Ni=(t,n,e,o)=>t===e&&n===o;const Hi=(t,n,e,o)=>t===e;const zi=(t,n)=>{for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];if(!n(o,s,c,r)){return false}}return true};const $i=t=>zi(t,Ni);const Ui=t=>zi(t,Hi);const Yi=(t,n)=>{const e=Ti(t.length*4);let o=0;for(const s of t){const{end:t,start:c}=n(s);e[o++]=c.rowIndex;e[o++]=c.columnIndex;e[o++]=t.rowIndex;e[o++]=t.columnIndex}return e};const _i=[];const Vi=(t,n)=>{if(!n){return _i}const e=[];for(let n=0;n<t.length;n+=2){const o=t[n];const s=t[n+1];e.push(`${Fi(o)} ${Fi(s)}`)}return e};const ji=t=>{const n=[];for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];n.push(Fi(o),Fi(s),Fi(c),Fi(r))}return n};const qi=async t=>{const n=[];const e=[];const{charWidth:o,cursorWidth:s,differences:c,focused:r,fontFamily:i,fontSize:a,fontWeight:d,isMonospaceFont:l,letterSpacing:u,lines:f,maxLineY:h,minLineY:g,rowHeight:m,selections:w,tabSize:p,width:y}=t;const E=o;const x=s/2;for(let t=0;t<w.length;t+=4){const[o,s,r,I,S]=Si(w,t);if(r<g||o>h){continue}const k=r-g;const v=c[k];const C=f[r];const b=await Li(C,I,d,a,i,l,u,p,x,y,E,v);const M=Pi(r,g,m);if(Ni(o,s,r,I)&&b>0){n.push(b,M);continue}const A=Pi(o,g,m);const L=o-g;const P=c[L];if(o===r){const t=await Li(C,s,d,a,i,l,u,p,x,y,E,P);if(S){n.push(t,M)}else if(b>=0){n.push(b,M)}const o=b-t;e.push(t,A,o,m)}else{if(o>=g){const t=f[o];const c=await Li(t,s,d,a,i,l,u,p,x,y,E,P);const r=await Li(t,t.length,d,a,i,l,u,p,x,y,E,P);const h=Pi(o,g,m);const w=r-c;if(S){n.push(c,h)}e.push(c,h,w,m)}const t=Math.max(o+1,g);const w=Math.min(r,h);for(let n=t;n<w;n++){const t=f[n];const o=Pi(n,g,m);const s=n-g;const r=c[s];const h=await Li(t,t.length,d,a,i,l,u,p,x,y,E,r);e.push(0,o,h,m)}if(r<=h){const t=b;e.push(0,M,t,m);if(!S){n.push(t,M)}}}}return{cursorInfos:Vi(n,r),selectionInfos:ji(e)}};const Gi=t=>{const{inserted:n,start:e}=t;const o=e.rowIndex;const s=e.columnIndex;const c=n.length;if(c===1){const t={columnIndex:n.at(-1).length+s,rowIndex:o+c-1};return{end:t,start:t}}const r={columnIndex:s,rowIndex:o+c-1};return{end:r,start:r}};const Xi=(t,n)=>{h(t);return{...t,selections:n}};const Zi=(t,n)=>{h(t);m(n);const e=Yi(n,Gi);return e};const Qi=(t,n)=>Jr(t,n);const Ki=(t,n)=>Qi(t,t.deltaY+n);const Ji=t=>t.origin===Is;const ta=(t,n)=>{const{autoClosingRanges:e=[]}=t;const o=[];const s=n[0];const c=s.start.rowIndex;const r=s.start.columnIndex;const i=s.end.rowIndex;const a=s.end.columnIndex;for(let t=0;t<e.length;t+=4){const n=e[t];const d=e[t+1];const l=e[t+2];const u=e[t+3];if(i===l&&a===u||c===n&&r>=d&&i===l&&a<=u){const t=s.inserted[0].length-s.deleted[0].length;o.push(n,d,l,u+t)}}if(Ji(s)){o.push(c,r+1,i,a+1)}return o};const na=(t,n)=>Xi(t,n);const ea=async(t,n,e=undefined)=>{h(t);m(n);if(n.length===0){return t}const o=Mr(t,n);const s={...t,lines:o};const c=e||Zi(s,n);const r=Math.min(t.invalidStartIndex,n[0].start.rowIndex);const i=ta(t,n);const a={...s,autoClosingRanges:i,invalidStartIndex:r,lines:o,modified:true,redoStack:[],selections:c,undoStack:[...t.undoStack,n]};const d=li(a);const l={...a,decorations:d};ns(t.uid,t,l);if(!t.modified){await Ii(t.uri)}try{await pi(fi,"handleEditorChanged",t.uid,t.uri,n)}catch(t){console.warn("Failed to notify editor change listeners:",t)}const u=await ti(t,l);const f=await Rs(l,n);const g={...l,...f,incrementalEdits:u};if(u!==es){return g}const w=Kr();const{differences:p,textInfos:y}=await _r(g,w);return{...g,differences:p,textInfos:y}};const oa=async(t,n)=>{h(t);m(n);if(n.length===0){return t}const e=Mr(t,n);const o={...t,lines:e};const s=Zi(o,n);const c=Math.min(t.invalidStartIndex,n[0].start.rowIndex);const r={...o,invalidStartIndex:c,lines:e,selections:s};const i=await ti(t,r);const a={...r,incrementalEdits:i};if(i!==es){return a}const d=Kr();const{differences:l,textInfos:u}=await _r(a,d);return{...a,differences:l,textInfos:u}};const sa=async(t,n)=>{const e=Mr(t,n);const o=n[0].start.rowIndex;const s={...t,invalidStartIndex:o,lines:e,redoStack:[],undoStack:[...t.undoStack,n]};const c=await ti(t,s);const r={...s,incrementalEdits:c};if(c!==es){return r}const i=Kr();const{differences:a,textInfos:d}=await _r(r,i);return{...r,differences:a,textInfos:d}};const ca=t=>t.selections&&t.selections.length>0;const ra=(t,n,e,o,s,c)=>yi(t,{height:s,width:o,x:n,y:e},c);const ia=(t,n)=>{const e=Ei(n);const{itemHeight:o,minimumSliderSize:s,numberOfVisibleLines:c}=t;const r=e.length;const i=Math.min(c,r);const a=Math.max(r-c,0);const d=a*o;const l=e.length*t.rowHeight;const u=qr(t.height,l,s);return{...t,finalDeltaY:d,finalY:a,lines:e,maxLineY:i,scrollBarHeight:u}};const aa={cursorInfos:[],debugEnabled:false,decorations:[],deltaX:0,deltaY:0,diagnostics:[],differences:[],embeds:[],focused:false,hasListener:false,height:0,highlightedLine:-1,incrementalEdits:es,isSelecting:false,languageId:"",lineCache:[],lines:[],longestLineWidth:0,maxLineY:0,minLineY:0,redoStack:[],scrollBarHeight:0,selectionAnchorPosition:{columnIndex:0,rowIndex:0},selectionAutoMovePosition:{columnIndex:0,rowIndex:0},selectionInfos:[],selections:new Uint32Array,textInfos:[],tokenizerId:0,undoStack:[],uri:"",width:0,x:0,y:0};const da="ExtensionHostHover.execute";const la="ExtensionHost.executeTabCompletionProvider";const ua="ExtensionHostTextDocument.syncFull";const{invoke:fa,set:ha}=lo;const ga=t=>{w(t);return t.lastIndexOf(gr)};const ma=(t,n)=>t.lastIndexOf(gr,n);const wa=(t,n)=>{for(const e of t){if(e&&e.extensions&&Array.isArray(e.extensions)&&e.extensions.includes(n)){return e.id}}return""};const pa=(t,n)=>{for(const e of t){if(e&&e.fileNames&&Array.isArray(e.fileNames)&&e.fileNames.includes(n)){return e.id}}return""};const ya=(t,n)=>{w(t);const e=ga(t);const o=t.slice(e);const s=o.toLowerCase();const c=wa(n,s);if(c){return c}const r=t.toLowerCase();const i=ma(t,e-1);const a=t.slice(i);const d=wa(n,a);if(d){return d}const l=pa(n,r);if(l){return l}return"unknown"};const Ea=async(t,n)=>{g(t);w(n);const e=await ho(t,n);return e};const xa=async(t,n,e,o)=>await Ai("a",t,n,e,o,false,0);const Ia=async t=>{const n=await Wo(t);return n};const Sa="onDiagnostic";const ka="onHover";const va="onTabCompletion";const Ca=async({args:t,assetDir:n,editor:e,event:o,method:s,noProviderFoundMessage:c,noProviderFoundResult:r=undefined,platform:i})=>{const a=`${o}:${e.languageId}`;await zo(a,n,i);const d=await fa(s,e.uid,...t);return d};const ba=t=>({documentId:t.id||t.uid,languageId:t.languageId,text:Lr(t),uri:t.uri});const Ma=async t=>{const n=ba(t);return uo("Extensions.executeDiagnosticProvider",n)};const Aa=async t=>{const n=await Ma(t);if(n.length>0){return n}const{assetDir:e,platform:o}=t;return Ca({args:[],assetDir:e,editor:t,event:Sa,method:"ExtensionHost.executeDiagnosticProvider",noProviderFoundMessage:"no diagnostic provider found",platform:o})};const La=t=>t.type;const Pa=async(t,n)=>{const e=[];const{charWidth:o,fontFamily:s,fontSize:c,fontWeight:r,isMonospaceFont:i,letterSpacing:a,lines:d,minLineY:l,rowHeight:u,tabSize:f,width:h}=t;for(const t of n){const{columnIndex:n,endColumnIndex:g,rowIndex:m}=t;const w=g-n;const p=w*o;const y=0;const E=0;const x=await Li(d[m],n,r,c,s,i,a,f,E,h,o,y);const I=Pi(m,l,u)-u;e.push({height:u,type:La(t),width:p,x:x,y:I})}return e};const Fa=(t,n)=>{const e=li(t);const o=[...e,...n];const s=[];for(let t=0;t<o.length;t+=4){s.push({length:o[t+1],modifiers:o[t+3],offset:o[t],type:o[t+2]})}s.sort((t,n)=>t.offset-n.offset);const c=[];for(const t of s){c.push(t.offset,t.length,t.type,t.modifiers)}return c};const Wa=async t=>{const n=Lr(t);await fa(ua,t.uri,t.id,t.languageId,n);return Aa(t)};const Ta=async(t,n)=>{const e=await Pa(t,n);const o=e.flatMap(t=>[t.offset,t.length,t.type,t.modifiers||0]);const s=Fa(t,o);return{...t,decorations:s,diagnostics:n,visualDecorations:e}};const Ra=(t,n)=>{if(t instanceof Error&&t.message.includes("No diagnostic provider found")){return n}console.error(`Failed to update diagnostics: ${t}`);return n};const Da=async t=>{try{const n=await Wa(t);if(!Jo(t.id)){return t}return Ta(t,n)}catch(n){return Ra(n,t)}};const Oa=async t=>{try{const n=await Wa(t);const e=Jo(t.id);if(!e){return t}const o=await Ta(e.newState,n);ns(t.id,e.oldState,o);await Eo("Editor.rerender",t.id);return o}catch(n){return Ra(n,t)}};const Ba=async({assetDir:t,columnToReveal:n,completionTriggerCharacters:e,content:o,diagnosticsEnabled:s,fontFamily:c,fontSize:r,fontWeight:i,formatOnSave:a,height:d,hoverEnabled:l,id:u,isAutoClosingBracketsEnabled:f,isAutoClosingQuotesEnabled:h,isAutoClosingTagsEnabled:m,isMonospaceFont:p,isQuickSuggestionsEnabled:y,languageId:E,letterSpacing:x,lineNumbers:I,lineToReveal:S,links:k,platform:v,rowHeight:C,savedDeltaY:b,savedSelections:M,tabSize:A,uri:L,useFunctionalRendering:P,width:F,x:W,y:T})=>{g(u);w(o);const R=await xa(i,r,c,x);const D=await Ea(v,t);const O=ya(L,D);const B={assetDir:t,charWidth:R,columnWidth:0,completionState:"",completionTriggerCharacters:e,completionUid:0,cursorInfos:[],cursorWidth:2,decorations:[],deltaX:0,deltaY:0,diagnostics:[],diagnosticsEnabled:s,differences:[],finalDeltaY:0,finalY:0,focused:false,focusKey:cs,fontFamily:c,fontSize:r,fontWeight:i,handleOffset:0,handleOffsetX:0,hasListener:false,height:d,id:u,incrementalEdits:es,invalidStartIndex:0,isAutoClosingBracketsEnabled:f,isAutoClosingQuotesEnabled:h,isAutoClosingTagsEnabled:m,isMonospaceFont:p,isQuickSuggestionsEnabled:y,isSelecting:false,itemHeight:20,languageId:O,letterSpacing:x,lineCache:[],lineNumbers:I,lines:[],longestLineWidth:0,maxLineY:0,minimumSliderSize:20,minLineY:0,modified:false,numberOfVisiblelines:0,numberOfVisibleLines:0,platform:v,primarySelectionIndex:0,redoStack:[],rowHeight:C,savedSelections:M,scrollBarHeight:0,scrollBarWidth:0,selectionAnchorPosition:{columnIndex:0,rowIndex:0},selectionAutoMovePosition:{columnIndex:0,rowIndex:0},selectionInfos:[],selections:new Uint32Array,tabSize:A,textInfos:[],tokenizerId:0,uid:u,undoStack:[],uri:L,useFunctionalRendering:P,validLines:[],widgets:[],width:F,x:W,y:T};const N=ra(B,W,T,F,d,9);const H=ia(N,o);let z;if(S&&n){const t=S*C;z=await Jr(H,t)}else{z=await Jr(H,0)}const $=li(z);const U={...z,decorations:$};const Y=Kr();const{differences:_,textInfos:V}=await _r(U,Y);const j={...U,differences:_,focus:ro,focused:true,textInfos:V};ns(u,aa,j);await fa(ua,L,u,E,o);const q=s?await Oa(j):j;const G=await Ia("editor.completionsOnType");const X=Boolean(G);ns(u,aa,{...q,completionsOnType:X})};const Na=(t,n)=>t.rowHeight===n.rowHeight&&t.deltaY===n.deltaY&&t.finalDeltaY===n.finalDeltaY&&t.height===n.height&&t.deltaX===n.deltaX&&t.longestLineWidth===n.longestLineWidth&&t.minimumSliderSize===n.minimumSliderSize&&t.width===n.width&&t.scrollBarHeight===n.scrollBarHeight;const Ha=(t,n)=>{if(!n.focused){return true}if(!t.isSelecting&&n.isSelecting){return false}return t.focused===n.focused&&t.focus===n.focus};const za=(t,n)=>t.cursorInfos===n.cursorInfos&&t.diagnostics===n.diagnostics&&t.highlightedLine===n.highlightedLine&&t.lineNumbers===n.lineNumbers&&t.loadError===n.loadError&&t.textInfos===n.textInfos&&t.differences===n.differences&&t.initial===n.initial&&t.selectionInfos===n.selectionInfos;const $a=6;const Ua=7;const Ya=11;const _a=12;const Va=13;const ja=(t,n)=>t.widgets===n.widgets;const qa=[za,Ha,Ha,Na,ja];const Ga=[_a,$a,Ua,Ya,Va];const Xa=(t,n)=>{const e=[];for(let o=0;o<qa.length;o++){const s=qa[o];if(!s(t,n)){e.push(Ga[o])}}return e};const Za=t=>{const{newState:n,oldState:e}=Jo(t);const o=Xa(e,n);return o};const Qa=t=>{const n=[];for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];if(e===0&&o!==0){n.push(o-1,s,o-1,s)}n.push(o,s,c,r)}return new Uint32Array(n)};const Ka=t=>{const{selections:n}=t;const e=Qa(n);return{...t,selections:e}};const Ja=(t,n)=>{const e=[];for(let o=0;o<t.length;o+=4){const s=t[o];const c=t[o+1];const r=t[o+2];const i=t[o+3];e.push(s,c,r,i);if(o===t.length-4&&r<n){e.push(r+1,i,r+1,i)}}return new Uint32Array(e)};const td=t=>{const{lines:n,selections:e}=t;const o=Ja(e,n.length);return{...t,selections:o}};const nd=(t,n)=>{const e=[];for(const o of n){const n=Tr(t,o.startOffset);const s=Tr(t,o.endOffset);const c=Pr(t,{end:s,start:n});const r={deleted:c,end:s,inserted:Ei(o.inserted),origin:Ss,start:n};if(r.inserted.length===0){r.inserted=[""]}e.push(r)}return e};const ed=(...t)=>{console.warn(...t)};const od=(...t)=>{console.error(...t)};const sd=(t,n)=>{if(!Array.isArray(n)){ed("something is wrong with format on save",n);return t}if(n.length===0){return t}const e=nd(t,n);return ea(t,e)};const cd=async(t,n)=>{h(t);m(n);return ea(t,n)};const rd=(t,n)=>{const e=[];for(const o of n){if(o.uri===t.uri){for(const n of o.edits){const o=Tr(t,n.offset);const s=Tr(t,n.offset+n.deleted);const c=Pr(t,{end:s,start:o});const r={deleted:c,end:s,inserted:[n.inserted],origin:Ms,start:o};e.push(r)}}}return e};const id=async(t,n)=>{h(t);m(n);const e=rd(t,n);if(e.length===0){return t}return ea(t,e)};const ad=t=>{if(!t.focused){return t}const n={...t,focused:false};return n};const dd=(t,n,e,o)=>{const s=[];const c=n.length;for(let r=0;r<c;r+=4){const[c,i,a,d]=Si(n,r);const l={columnIndex:i,rowIndex:c};const u={columnIndex:d,rowIndex:a};const f={end:u,start:l};s.push({deleted:Pr(t,f),end:u,inserted:e,origin:o,start:l})}return s};const ld=(t,n,e)=>{const{selections:o}=t;return dd(t,o,n,e)};const ud=async(t,n,e,o,s,c,r,i,a,d)=>{for(let l=n;l<t.length;l++){const n=await Ai(t.slice(0,l),s,c,r,i,a,d);if(o-n<e/2){return l}}return t.length};const fd=()=>"Segmenter"in Intl;const hd=()=>{const t=new Intl.Segmenter;return{at(n,e){const o=t.segment(n);return o.containing(e)},getSegments:n=>t.segment(n),modelIndex(n,e){const o=t.segment(n);let s=0;for(const t of o){if(s>=e){return t.index}s++}return n.length},visualIndex(n,e){const o=t.segment(n);let s=0;for(const t of o){if(t.index>=e){return s}s++}return s}}};const gd=async(t,n,e,o,s,c,r,i)=>{const a=hd();const d=a.getSegments(t);const l=false;const u=0;for(const n of d){const a=await Ai(t.slice(0,n.index),s,c,r,i,l,u);if(o-a<e){return n.index}}return t.length};const md=(t,n)=>{const e=Math.round(t/n);return e};const wd=(t,n,e)=>{let o=n;for(let s=0;s<n;s++){if(t[s]===Er){o-=e-1}}return o};const pd=async(t,n,e,o,s,c,r,i,a)=>{w(t);g(n);g(e);w(o);g(s);p(c);g(r);g(i);g(a);const d=md(a,r);const l=Ir(t);const u=wd(t,d,i);const f=t.slice(0,u);const h=xr(f,l,i);const m=await Ai(h,n,e,o,s,c,r);const y=Ci(t);if(y){if(Math.abs(a-m)<r/2){return u}return await ud(t,u,r,a,n,e,o,s,c,r)}return await gd(t,u,r,a,n,e,o,s)};const yd=async(t,n,e)=>{h(t);g(n);g(e);const{charWidth:o,deltaX:s,deltaY:c,fontFamily:r,fontSize:i,fontWeight:a,isMonospaceFont:d,letterSpacing:l,lines:u,rowHeight:f,tabSize:m,x:w,y:p}=t;const y=Math.floor((e-p+c)/f);if(y<0){return{columnIndex:0,rowIndex:0}}const E=n-w+s;const x=Ds(y,0,u.length-1);const I=u[x];const S=await pd(I,a,i,r,l,d,o,m,E);return{columnIndex:S,rowIndex:x}};const Ed=(t,n,e)=>{const{columnWidth:o,x:s}=t;const c=e*o+s;return c};const xd=(t,n)=>{const{rowHeight:e,y:o}=t;const s=(n+1)*e+o;return s};const Id={timeout:-1};const Sd=async(t,n,e,o,s)=>{h(t);g(n);g(e);w(o);const c=Ed(t,n,e);const r=xd(t,n);const i=o;await Eo("Editor.showOverlayMessage",t,"Viewlet.send",t.uid,"showOverlayMessage",c,r,i);if(!s){const n=()=>{vd(t)};Id.timeout=setTimeout(n,3e3)}return t};const kd=async(t,n,e,o)=>Sd(t,n,e,o,true);const vd=async t=>{clearTimeout(Id.timeout);Id.timeout=-1;return t};const Cd=String;const bd=t=>{switch(t){case"(":return")";case"[":return"]";case"{":return"}";default:return"???"}};const Md=async(t,n)=>{try{const e=Wr(t,t.cursor);const o=await Eo("ExtensionHostBraceCompletion.executeBraceCompletionProvider",t,e,n);if(o){const e=bd(n);const o=n+e;const s=ld(t,[o],xs);return ea(t,s)}const s=ld(t,[n],xs);return ea(t,s)}catch(n){console.error(n);const e=Array.isArray(t.cursor)?t.cursor[0]:t.cursor;return kd(t,e,Cd(n))}};const Ad=t=>{const{selections:n}=t;if(n.length===4&&n[0]===n[2]&&n[1]===n[3]){return t}const e=Ti(4);Bi(e,0,n[0],n[1]);return na(t,e)};const Ld=(t,n)=>{for(const[e,o]of t.entries()){if(o.id===n){return e}}return-1};const Pd=(t,n)=>{const e=Ld(t,n);const o=[...t.slice(0,e),...t.slice(e+1)];return o};const Fd=t=>t.id===Fe;const Wd=t=>{const{widgets:n}=t;const e=n.findIndex(Fd);if(e===-1){return t}const o=Pd(n,Fe);return{...t,focused:true,widgets:o}};const Td=t=>t.id===De;const Rd=t=>{const{widgets:n}=t;const e=n.findIndex(Td);if(e===-1){return t}const o=Pd(n,De);return{...t,focused:true,widgets:o}};const Dd=async()=>{const t="Rename Worker";const n="renameWorkerMain.js";const e=await Yo(t,n);await e.invoke("Rename.initialize");return e};const Od={};const Bd=()=>{if(!Od.workerPromise){Od.workerPromise=Dd()}return Od.workerPromise};const Nd=async(t,...n)=>{const e=await Bd();return await e.invoke(t,...n)};const Hd=t=>t.id===Be;const zd=async t=>{const{uid:n,widgets:e}=t;const o=e.findIndex(Hd);if(o===-1){return t}const s=e[o];await Nd("Rename.close",s.newState.uid);const c=Jo(n);const{newState:r}=c;return r};const $d=t=>t.id===Ne;const Ud=t=>{const{widgets:n}=t;const e=n.findIndex($d);if(e===-1){return t}const o=Pd(n,Ne);return{...t,widgets:o}};const Yd=(t,n)=>{for(const e of t){if(e.id===n){return true}}return false};const _d=async(t,n,e,o,s,c)=>{const{widgets:r}=e;if(Yd(r,t)){return e}const i=o();i.newState.editorUid=e.uid;const a=await s(i.newState,e.uid);a.editorUid=e.uid;const d={...i,newState:a};const l=[...r,d];const u=!c;const f={...e,additionalFocus:c?0:n,focus:c?n:ro,focused:u,widgets:l};return f};const Vd=()=>Math.random();const jd=()=>{const t=Vd();const n={id:We,newState:{commands:[],height:0,uid:t,width:0,x:0,y:0},oldState:{commands:[],height:0,uid:t,width:0,x:0,y:0}};return n};const qd=(t,n)=>Go(t,n);const Gd=async t=>_d(We,os,t,jd,qd);const Xd={compositionText:"",isComposing:false};const Zd=(t,n)=>{Xd.isComposing=true;return t};const Qd=(t,n)=>{const e=[];for(let o=0;o<t.length;o+=4){const s=t[o];const c=t[o+1];const r=t[o+2];const i=t[o+3];const a=c-Xd.compositionText.length;e.push({deleted:[Xd.compositionText],end:{columnIndex:i,rowIndex:r},inserted:[n],origin:fs,start:{columnIndex:a,rowIndex:s}})}return e};const Kd=(t,n)=>{const{selections:e}=t;const o=Qd(e,n);Xd.compositionText=n;return ea(t,o)};const Jd=(t,n)=>{const{selections:e}=t;const o=Qd(e,n);Xd.isComposing=false;Xd.compositionText="";return ea(t,o)};const tl=async t=>{try{w(t);await Mo(t)}catch(t){throw new k(t,"Failed to write text to clipboard")}};const nl=(t,n,e,o,s,c)=>{if(n){const n=t[s].length;return{end:{columnIndex:n,rowIndex:e},start:{columnIndex:0,rowIndex:e}}}return{end:{columnIndex:c,rowIndex:s},start:{columnIndex:o,rowIndex:e}}};const el=(t,n,e,o)=>t===e&&n===o;const ol=async t=>{if(!ca(t)){return t}const{lines:n,selections:e}=t;const o=e[0];const s=e[1];const c=e[2];const r=e[3];const i=el(o,s,c,r);const a=nl(n,i,o,s,c,r);const d=Pr(t,a);const l=vr(d);const u=i?"\n"+l:l;await tl(u);return t};const sl=t=>{const{selections:n}=t;const e=[];for(let t=0;t<n.length;t+=4){const o=n[t];g(o);e.push(o)}const o=[...new Set(e)].toSorted((t,n)=>t-n);const s=o.map(n=>{const e={columnIndex:0,rowIndex:n};return{deleted:[""],end:e,inserted:[Ar(t,n),""],start:e}});const c=new Uint32Array(o.length*4);for(let t=0;t<o.length;t++){const n=o[t]+t+1;c[t*4]=n;c[t*4+1]=0;c[t*4+2]=n;c[t*4+3]=0}return ea(t,s,c)};const cl=t=>{const{selections:n}=t;const e=n[0];const o={columnIndex:0,rowIndex:e};const s=[{deleted:[""],end:o,inserted:[Ar(t,e),""],start:o}];return ea(t,s)};const rl=(t,n,e,o)=>{if(n===0){if(t===0){return{columnIndex:0,rowIndex:0}}return{columnIndex:e[t-1].length,rowIndex:t-1}}const s=o(e[t],n);return{columnIndex:n-s,rowIndex:t}};const il=(t,n,e,o)=>{t[n]=e;t[n+1]=o};const al=(t,n,e,o)=>{t[n]=t[n+2]=e;t[n+1]=t[n+3]=o};const dl=(t,n,e,o,s,c)=>{if(o===0){if(e===0){t[n]=0;t[n+1]=0}else{t[n]=e-1;t[n+1]=s[e-1].length}}else{const r=c(s[e],o);t[n]=e;t[n+1]=o-r}};const ll=(t,n,e)=>{const o=new Uint32Array(t.length);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=Si(t,s);if(c===i&&r===a){if(c===0&&r===0){o[s]=0;o[s+1]=0;o[s+2]=0;o[s+3]=0}else{dl(o,s,c,r,n,e);dl(o,s+2,c,r,n,e)}}else{al(o,s,t[s],t[s+1])}}return o};const ul=(t,n)=>{const{lines:e,selections:o}=t;const s=ll(o,e,n);return na(t,s)};const fl=(t,n)=>{if(!fd()){return 1}if(n>t.length){return 1}const e=hd();const o=e.at(t,n-1);if(!o){return 1}return n-o.index};const hl=()=>2;const gl=(t,n)=>{if(!fd()){return 1}const e=hd();const o=e.at(t,n);return o.segment.length};const ml=t=>t===yr||t===Er;const wl=(t,n)=>{if(t.length===0){return 0}for(let e=0;e<n;e++){if(!ml(t[e])){return n-e}}return n};const pl=(t,n)=>t.length-n;const yl=(t,n)=>{for(const e of n){const n=t.match(e);if(n){return n[0].length}}return 1};const El=/(?<![A-Z])[A-Z]+\s*$/;const xl=/[\u{C0}-\u{17F}\w\-]+>?\s*$/u;const Il=/[a-zA-Z]+[^a-zA-Z\d]+\s*$/;const Sl=/\s+$/;const kl=/[^a-zA-Z\d]+\s*$/;const vl=[El,xl,Il,Sl,kl];const Cl=(t,n)=>{const e=t.slice(0,n);return yl(e,vl)};const bl=/^\s*[\u{C0}-\u{17F}\w]+/iu;const Ml=/^[^a-zA-Z\d]+\w*/;const Al=[bl,Ml];const Ll=(t,n)=>{const e=t.slice(n);return yl(e,Al)};const Pl=/(?<![A-Z])[A-Z]{2}[a-z]+$/;const Fl=/(?=[A-Z]+)[A-Z][a-z]+$/;const Wl=/[A-Z]+[a-z]+\d?\s*$/;const Tl=/[A-Z]+\d*\s*$/;const Rl=/[a-z]+\d*\s*$/;const Dl=/[A-Z]*[a-z]+_+\s*$/;const Ol=/(?<![A-Z])[A-Z]_+\s*$/;const Bl=/[a-z]+\s*$/;const Nl=/[^a-zA-Z\d\s]+\s*$/;const Hl=[Pl,Fl,Wl,Tl,Rl,Dl,Ol,Bl,Nl];const zl=(t,n)=>{const e=t.slice(0,n);return yl(e,Hl)};const $l=/^\s*[a-z]+\d?/;const Ul=/^\s*[A-Z]{2}[a-z\d]+/;const Yl=/^\s*[A-Z]+(?=[A-Z][a-z]+)/;const _l=/^\s*[A-Z]+[a-z]*\d*/;const Vl=/^\s*_+[a-z]*\d?/;const jl=/^\s*[^\da-zA-Z\s]+/;const ql=[$l,Yl,_l,Vl,jl];const Gl=[$l,Ul,Yl,_l,Vl,jl];const Xl=/[A-Z]/;const Zl=(t,n)=>{const e=t.slice(n);if(Xl.test(t[n-1])){return yl(e,ql)}return yl(e,Gl)};const Ql=t=>ul(t,fl);const Kl=(t,n,e)=>{const{rowIndex:o}=t;const{columnIndex:s}=t;if(s>=n[o].length){if(o>=n.length){return t}return{columnIndex:0,rowIndex:o+1}}const c=e(n[o],s);return{columnIndex:s+c,rowIndex:o}};const Jl=(t,n,e,o,s,c)=>{if(e>=s.length){return}const r=s[e];if(o>=r.length){t[n]=t[n+2]=e+1;t[n+1]=t[n+3]=0}else{const s=c(r,o);t[n]=t[n+2]=e;t[n+1]=t[n+3]=o+s}};const tu=(t,n,e)=>{const o=new Uint32Array(t.length);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=Si(t,s);if(c===i&&r===a){Jl(o,s,c,r,n,e)}else{o[s]=o[s+2]=i;o[s+1]=o[s+3]=a}}return o};const nu=(t,n)=>{const{lines:e,selections:o}=t;const s=tu(o,e,n);return na(t,s)};const eu=t=>nu(t,gl);const ou=(t,n,e,o,s,c)=>{Bi(t,n,s+1,c)};const su=t=>Di(t,ou);const cu=t=>{const{selections:n}=t;const e=su(n);return na(t,e)};const ru=t=>nu(t,pl);const iu=t=>ul(t,wl);const au=(t,n,e)=>{h(t);g(n);g(e);const o=Wi(n,e,n,e);return na(t,o)};const du=(t,n,e,o,s,c)=>{if(e===0){Bi(t,n,0,0)}else{Bi(t,n,e-1,o)}};const lu=t=>Di(t,du);const uu=(t,n,e,o)=>{const{selections:s}=t;const c=lu(s);return na(t,c)};const fu=t=>uu(t);const hu=t=>ul(t,Cl);const gu=t=>ul(t,zl);const mu=t=>nu(t,Zl);const wu=t=>nu(t,Ll);const pu=async t=>{const{lines:n,selections:e}=t;const o=new Set;const s=[];for(let t=0;t<e.length;t+=4){const[n]=Si(e,t);if(!o.has(n)){o.add(n);s.push(n)}}const c=new Uint32Array(s.length*4);const r=new Uint32Array(s.length*4);const i=[];for(let t=0;t<s.length;t++){const e=s[t];const o=n[e];const a=t*4;c[a]=e;c[a+1]=0;c[a+2]=e;c[a+3]=o.length;r[a]=e;r[a+1]=0;r[a+2]=e;r[a+3]=0;i.push(o)}const a=dd(t,c,[""],ps);await tl(vr(i));return ea(t,a,r)};const yu=async t=>{const n=ld(t,[""],ps);const e=n.map(t=>vr(t.deleted)).filter(t=>t.length>0);const o=vr(e);await tl(o);return ea(t,n)};const Eu=async t=>{const{selections:n}=t;if($i(n)){return pu(t)}return yu(t)};const xu=t=>{const{lines:n}=t;const e=n.length-1;const o=n.at(-1).length;const s={columnIndex:0,rowIndex:0};const c={columnIndex:o,rowIndex:e};const r=[{deleted:Pr(t,{end:c,start:s}),end:c,inserted:[""],origin:gs,start:s}];return ea(t,r)};const Iu=(t,n,e)=>{const o=[];const s=(n,s,c,r)=>{const i=rl(n,s,t,e);const a={columnIndex:r,rowIndex:c};o.push({deleted:Pr({lines:t},{end:a,start:i}),end:a,inserted:[""],origin:ws,start:i})};Oi(n,s);return o};const Su=(t,n,e,o,s)=>{if(!Ni(n,e,o,s)){return false}if(e<1){return false}for(let o=0;o<t.length;o+=4){const s=t[o];const c=t[o+1];if(n===s&&e===c){return true}}return false};const ku=(t,n)=>{for(let e=0;e<n.length;e+=4){const[o,s,c,r]=Si(n,e);if(!Su(t,o,s,c,r)){return false}}return true};const vu=t=>{const{lines:n,selections:e}=t;for(let t=0;t<e.length;t+=4){e[t+1]++;e[t+3]++}const o=Iu(n,e,hl);return ea(t,o)};const Cu=(t,n)=>{const{autoClosingRanges:e=[],lines:o,selections:s}=t;if(ku(e,s)){return vu(t)}if($i(s)){const e=Iu(o,s,n);return ea(t,e)}const c=ld(t,[""],ws);return ea(t,c)};const bu=t=>Cu(t,wl);const Mu=(t,n)=>{const{selections:e}=t;if($i(e)){const o=[];const{lines:s}=t;for(let c=0;c<e.length;c+=4){const[r,i]=Si(e,c);const a={columnIndex:i,rowIndex:r};const d=Kl(a,s,n);o.push({deleted:Pr(t,{end:d,start:a}),end:d,inserted:[""],origin:ms,start:a})}return o}const o=ld(t,[""],ms);return o};const Au=(t,n)=>{const e=Mu(t,n);return ea(t,e)};const Lu=t=>Au(t,pl);const Pu=t=>{const n=Cu(t,fl);return n};const Fu=t=>Au(t,gl);const Wu=t=>{const n=Cu(t,Cl);return n};const Tu=t=>{const n=Cu(t,zl);return n};const Ru=t=>Au(t,Zl);const Du=t=>Au(t,Ll);const Ou=async t=>{await Eo("SideBar.show","References",true);return t};const Bu=async t=>{const n={documentId:t.id||t.uid,languageId:t.languageId,text:Lr(t),uri:t.uri};return uo("Extensions.executeFormattingProvider",n)};const Nu="Failed to execute formatting provider: FormattingError:";const Hu=t=>t&&t instanceof Error&&t.message.startsWith(Nu);const zu="Failed to execute formatting provider: FormattingError:";const $u=async t=>{try{const n=await Bu(t);return sd(t,n)}catch(n){if(Hu(n)){console.error("Formatting Error:",n.message.slice(zu.length));return t}console.error(n);const e=String(n);await Sd(t,0,0,e,true);return t}};const Uu=/^[\w\-]+/;const Yu=/[\w\-]+$/;const _u=(t,n)=>{const e=t.slice(0,n);const o=e.match(Yu);const s=t.slice(n);const c=s.match(Uu);let r=wr;if(o){r+=o[0]}if(c){r+=c[0]}return{word:r}};const Vu=(t,n)=>{const e=t.slice(0,n);const o=e.match(Yu);if(o){return o[0]}return wr};const ju=(t,n,e)=>{const{lines:o}=t;const s=o[n];return _u(s,e)};const qu=(t,n,e)=>{const{lines:o}=t;const s=o[n];return Vu(s,e)};const Gu=async(t,n)=>{const e=await Eo("ExtensionHostDefinition.executeDefinitionProvider",t,n);return e};const Xu={};const Zu=/\{(PH\d+)\}/g;const Qu=(t,n=Xu)=>{if(n===Xu){return t}const e=(t,e)=>n[e];return t.replaceAll(Zu,e)};const Ku="Copy";const Ju="Cut";const tf="Editor: Close Color Picker";const nf="Editor: Copy Line Down";const ef="Editor: Copy Line Up";const of="Editor: Format Document (forced)";const sf="Editor: Go To Definition";const cf="Editor: Go To Type Definition";const rf="Editor: Indent";const af="Editor: Open Color Picker";const df="Editor: Select All Occurrences";const lf="Editor: Select Down";const uf="Editor: Select Inside String";const ff="Editor: Select Next Occurrence";const hf="Editor: Select Up";const gf="Show Hover";const mf="Editor: Sort Lines Ascending";const wf="Editor: Toggle Comment";const pf="Editor: Unindent";const yf="Enter Code";const Ef="Escape to close";const xf="Find All Implementations";const If="Find All References";const Sf="Format Document";const kf="Go to Definition";const vf="Go to Type Definition";const Cf="Move Line Down";const bf="Move Line Up";const Mf="No definition found";const Af="No definition found for '{PH1}'";const Lf="No type definition found";const Pf="No type definition found for '{PH1}'";const Ff="Paste";const Wf="Source Action";const Tf="Toggle Block Comment";const Rf=()=>Qu(kf);const Df=()=>Qu(Mf);const Of=t=>Qu(Af,{PH1:t});const Bf=t=>Qu(Pf,{PH1:t});const Nf=()=>Qu(Lf);const Hf=()=>Qu(Wf);const zf=()=>Qu(Ef);const $f=()=>Qu(yf);const Uf=()=>Qu(vf);const Yf=()=>Qu(If);const _f=()=>Qu(xf);const Vf=()=>Qu(Ju);const jf=()=>Qu(Ku);const qf=()=>Qu(Ff);const Gf=()=>Qu(Tf);const Xf=()=>Qu(bf);const Zf=()=>Qu(Cf);const Qf=()=>Qu(Sf);const Kf=()=>Qu(gf);const Jf=()=>Qu(of);const th=()=>Qu(ff);const nh=()=>Qu(df);const eh=()=>Qu(sf);const oh=()=>Qu(cf);const sh=()=>Qu(uf);const ch=()=>Qu(rf);const rh=()=>Qu(pf);const ih=()=>Qu(mf);const ah=()=>Qu(wf);const dh=()=>Qu(hf);const lh=()=>Qu(lf);const uh=()=>Qu(af);const fh=()=>Qu(tf);const hh=()=>Qu(nf);const gh=()=>Qu(ef);const mh=async({editor:t,getErrorMessage:n,getLocation:e,getNoLocationFoundMessage:o,isNoProviderFoundError:s})=>{const{selections:c}=t;const r=c[0];const i=c[1];try{const n=await e(t,r,i);if(!n){const n=ju(t,r,i);const e=o(n);return Sd(t,r,i,e,false)}if(typeof n.uri!=="string"||typeof n.startOffset!=="number"||typeof n.endOffset!=="number"){return t}const{uri:s}=n;if(s===t.uri){const e=Tr(t,n.startOffset);const o=new Uint32Array([e.rowIndex,e.columnIndex,e.rowIndex,e.columnIndex]);return na(t,o)}const c={endColumnIndex:n.endColumnIndex,endRowIndex:n.endRowIndex,startColumnIndex:n.startColumnIndex,startRowIndex:n.startRowIndex};await To(s,true,c);return t}catch(e){if(s(e)){const o=n(e);await Sd(t,r,i,o,false);return t}const o=n(e);await Sd(t,r,i,o,true);return t}};const wh=async(t,n,e)=>{const o=Wr(t,n,e);const s=await Gu(t,o);return s};const ph=t=>{if(t.word){return Of(t.word)}return Df()};const yh=String;const Eh=t=>t?.message?.startsWith("Failed to execute definition provider: No definition provider found");const xh=async t=>mh({editor:t,getErrorMessage:yh,getLocation:wh,getNoLocationFoundMessage:ph,isNoProviderFoundError:Eh});const Ih=t=>{if(t.word){return Bf(t.word)}return Nf()};const Sh=async(t,n)=>{const e=await Eo("ExtensionHostTypeDefinition.executeTypeDefinitionProvider",t,n);return e};const kh=async(t,n,e)=>{const o=Wr(t,n,e);const s=await Sh(t,o);return s};const vh=String;const Ch=t=>t?.message?.startsWith("Failed to execute type definition provider: No type definition provider found");const bh=async(t,n=true)=>mh({editor:t,getErrorMessage:vh,getLocation:kh,getNoLocationFoundMessage:Ih,isNoProviderFoundError:Ch});const Mh=t=>{switch(t){case De:return true;default:return false}};const Ah=t=>{if(t.length===0){return t}return t.filter(Mh)};const Lh=async(t,n)=>{await wo(t,n)};const Ph=async(t,n)=>{const{platform:e}=t;const{columnIndex:o,rowIndex:s}=n;const c=Wr(t,s,o);const r=ui(t,c);if(r){await Lh(r,e);return t}const i={...t,selections:new Uint32Array([s,o,s,o])};const a=await xh(i);return a};const Fh=async(t,n)=>{const{selections:e}=t;for(let o=0;o<e.length;o+=4){const[s,c,r,i]=Si(e,o);if(s===n.rowIndex&&c===n.columnIndex&&r===n.rowIndex&&i===n.columnIndex){const n=new Uint32Array(e.length-4);n.set(e.subarray(0,o),0);n.set(e.subarray(o+4),o);return na(t,n)}}const o=new Uint32Array(e.length+4);o.set(e,0);const s=e.length;o[s]=n.rowIndex;o[s+1]=n.columnIndex;o[s+2]=n.rowIndex;o[s+3]=n.columnIndex;return na(t,o)};const Wh=1;const Th=2;const Rh=(t,n)=>{const e=Ah(t.widgets);return{...t,focused:true,selectionAnchorPosition:n,selections:new Uint32Array([n.rowIndex,n.columnIndex,n.rowIndex,n.columnIndex]),widgets:e}};const Dh=t=>{switch(t){case Th:return Ph;case Wh:return Fh;default:return Rh}};const Oh=async(t,n,e,o)=>{h(t);g(n);g(e);g(o);const s=Dh(n);const c=await s(t,{columnIndex:o,rowIndex:e});return c};const Bh=3;const Nh=async(t,n,e,o)=>{const{uid:s}=t;await So(s,Bh,e,o,{menuId:Bh});return t};const Hh=/^[a-zA-Z\u{C0}-\u{17F}\d]+/u;const zh=/[a-zA-Z\u{C0}-\u{17F}\d]+$/u;const $h=(t,n,e)=>{const o=t.slice(0,e);const s=t.slice(e);const c=o.match(zh);const r=s.match(Hh);const i=e-(c?c[0].length:0);const a=e+(r?r[0].length:0);const d=new Uint32Array([n,i,n,a]);return d};const Uh=(t,n,e)=>{const o=Ar(t,n);const s=$h(o,n,e);return na(t,s)};const Yh=async(t,n,e,o)=>{const s=await yd(t,e,o);return Uh(t,s.rowIndex,s.columnIndex)};const _h=t=>{if(t.focused&&t.focus===ro){return t}return{...t,additionalFocus:0,focus:ro,focused:true}};const Vh=1;const jh=2;const qh=3;const Gh=(t,n)=>{if(t){return Th}if(n){return Wh}return 0};const Xh=async(t,n,e,o)=>{h(t);g(n);g(e);g(o);const s=await yd(t,e,o);return Oh(t,n,s.rowIndex,s.columnIndex)};const Zh=(t,n)=>new Uint32Array([n,0,n,t.length]);const Qh=t=>{const{selections:n}=t;const e=n[t.primarySelectionIndex];const o=Ar(t,e);const s=Zh(o,e);return na(t,s)};const Kh=(t,n,e,o)=>{h(t);g(e);g(o);return Qh(t)};const Jh=0;const tg=async(t,n,e,o,s,c,r)=>{if(n!==Jh){return t}const i=Gh(e,o);let a;switch(r){case jh:a=await Yh(t,i,s,c);break;case Vh:a=await Xh(t,i,s,c);break;case qh:a=Kh(t,i,s,c);break;default:return t}return{...a,isSelecting:true}};const ng={editor:undefined,timeout:-1,x:0,y:0};const eg=()=>ng;const og=(t,n,e,o)=>{ng.editor=t;ng.timeout=n;ng.x=e;ng.y=o};const sg=async(t,n)=>{};const cg=async()=>{const{editor:t,x:n,y:e}=eg();await yd(t,n,e);await sg()};const rg=300;const ig=(t,n,e)=>{if(!t.hoverEnabled){return t}const o=eg();if(o.timeout!==-1){clearTimeout(o.timeout)}const s=setTimeout(cg,rg);og(t,s,n,e);return t};const ag=(t,n)=>{let e=0;for(let o=0;o<t.length;o++){const s=t[o];e+=s.length;if(e>=n){return o}}return-1};const dg=async(t,n,e)=>{h(t);g(n);g(e);const o=await yd(t,n,e);const s=Wr(t,o.rowIndex,o.columnIndex);try{const n=await Gu(t,s);if(!n){return t}const e=Tr(t,n.startOffset);Tr(t,n.endOffset);const o=t.lineCache[e.rowIndex+1];if(!o){return t}const c=ag(o.tokens,e.columnIndex);if(c===-1){return t}return t}catch(n){if(n&&n.message.startsWith("Failed to execute definition provider: No definition provider found")){return t}throw n}};const lg=(t,n)=>new Uint32Array([n.startRowIndex,n.startColumnIndex,n.endRowIndex,n.endColumnIndex]);const ug=(t,n,e)=>{const o=lg(t,e);const s={end:{columnIndex:o[3],rowIndex:o[2]},start:{columnIndex:o[1],rowIndex:o[0]}};const c=[{deleted:Pr(t,s),end:s.end,inserted:[n],origin:hs,start:s.start}];return c};const fg=(t,n,e)=>{const o=ug(t,n,e);return ea(t,o)};const hg=(t,n)=>{const e=lg(t,n);return na(t,e)};const gg=t=>({...t,hasListener:false,isSelecting:false,selectionAutoMovePosition:{columnIndex:0,rowIndex:0}});const mg=async(t,n,e,o,s,c,r)=>t;const wg=(t,n)=>t;const pg=async(t,n,e)=>{await yd(t,n,e)};const yg=t=>{globalThis.requestAnimationFrame(t)};const Eg=(t,n)=>t.selections!==n.selections||t.focused!==n.focused||t.minLineY!==n.minLineY||t.maxLineY!==n.maxLineY||t.differences!==n.differences||t.charWidth!==n.charWidth||t.cursorWidth!==n.cursorWidth||t.fontFamily!==n.fontFamily||t.fontSize!==n.fontSize||t.fontWeight!==n.fontWeight||t.isMonospaceFont!==n.isMonospaceFont||t.letterSpacing!==n.letterSpacing||t.lines!==n.lines||t.rowHeight!==n.rowHeight||t.tabSize!==n.tabSize||t.width!==n.width;const xg=(t,n)=>{if(t.textInfos!==n.textInfos||t.differences!==n.differences){return false}return t.lines!==n.lines||t.tokenizerId!==n.tokenizerId||t.minLineY!==n.minLineY||t.maxLineY!==n.maxLineY||t.decorations!==n.decorations||t.embeds!==n.embeds||t.deltaX!==n.deltaX||t.width!==n.width||t.highlightedLine!==n.highlightedLine||t.debugEnabled!==n.debugEnabled};const Ig=async(t,n)=>{let e=n;if(xg(t,n)){const t=Kr();const{differences:o,textInfos:s}=await _r(n,t);e={...n,differences:o,textInfos:s}}if(!Eg(t,n)){return e}const{cursorInfos:o,selectionInfos:s}=await qi(e);return{...e,cursorInfos:o,selectionInfos:s}};const Sg=-1;const kg=0;const vg=1;const Cg=(t,n)=>{if(t.rowIndex>n.rowIndex){return vg}if(t.rowIndex===n.rowIndex){if(t.columnIndex>n.columnIndex){return vg}if(t.columnIndex<n.columnIndex){return Sg}return kg}return Sg};const bg=(t,n)=>new Uint32Array([t.rowIndex,t.columnIndex,n.rowIndex,n.columnIndex]);const Mg=(t,n)=>new Uint32Array([n.rowIndex,n.columnIndex,n.rowIndex,n.columnIndex]);const Ag=(t,n)=>new Uint32Array([t.rowIndex,t.columnIndex,n.rowIndex,n.columnIndex]);const Lg=(t,n)=>{switch(Cg(n,t)){case kg:return Mg(t,n);case vg:return Ag(t,n);case Sg:return bg(t,n);default:throw new Error("unexpected comparison result")}};const Pg=(t,n)=>{const e=t.selectionAnchorPosition;const o=Lg(e,n);return na(t,o)};const Fg=(t,n)=>{const{maxLineY:e,minLineY:o,rowHeight:s}=t;const c=e-o;if(n.rowIndex<o){const e=n.rowIndex;const o=n.rowIndex+c;const r=n.rowIndex*s;const i=t.selectionAnchorPosition;const a=new Uint32Array([n.rowIndex-1,n.columnIndex,i.rowIndex,i.columnIndex]);return{...t,deltaY:r,maxLineY:o,minLineY:e,selections:a}}if(n.rowIndex>e){const c=e-o;const r=n.rowIndex-c;const i=n.rowIndex;const a=r*s;const d=t.selectionAnchorPosition;const l=new Uint32Array([d.rowIndex,d.columnIndex,n.rowIndex+1,n.columnIndex]);return{...t,deltaY:a,maxLineY:i,minLineY:r,selections:l}}return t};const Wg=async t=>{const n=Jo(t);const e=n?.newState;if(!e||!e.hasListener||!e.isSelecting){return}const o=e.selectionAutoMovePosition;if(o.rowIndex===0){return}const s=Fg(e,o);if(e===s){return}const c=o.rowIndex<e.minLineY?-1:1;const r={...s,selectionAutoMovePosition:{columnIndex:o.columnIndex,rowIndex:o.rowIndex+c}};const i=await Ig(e,r);ns(e.uid,e,i);yg(()=>Wg(t))};const Tg=async(t,n,e)=>{h(t);g(n);g(e);const o=await yd(t,n,e);const s=Pg(t,o);if(!t.hasListener&&(o.rowIndex<t.minLineY||o.rowIndex>t.maxLineY)){yg(()=>Wg(t.uid));return{...s,hasListener:true,selectionAutoMovePosition:o}}return s};const Rg=async(t,n,e,o)=>{if(!t.isSelecting){return t}if(o){return pg(t,n,e)}return Tg(t,n,e)};const Dg=t=>({...t,hasListener:false,isSelecting:false,selectionAutoMovePosition:{columnIndex:0,rowIndex:0}});const Og=(t,n,e)=>{if(e<=0){return 0}if(e<=t-n/2){return e/(t-n)}return 1};const Bg=(t,n)=>{const{handleOffsetX:e,longestLineWidth:o,width:s,x:c}=t;if(s>o){return{...t,deltaX:0,scrollBarWidth:0}}const r=20;const i=Ds(n,c,c+s);const a=i-c-e;const d=Gr(s,o);const l=o-s+r;const u=Og(s,d,a);const f=Ds(u,0,1);const h=f*l;return{...t,deltaX:h}};const Ng=(t,n)=>{const{deltaX:e,longestLineWidth:o,width:s,x:c}=t;const r=n-c;const i=Gr(s,o);const a=s-i;const d=Vr(e,a,s,i);const l=r-d;if(l>=0&&l<i){return{...t,handleOffsetX:l}}const{handleOffset:u,percent:f}=Xr(s,i,r);const h=f*a;return{...t,deltaX:h,handleOffsetX:u}};const Hg=(t,n)=>{const{height:e,scrollBarHeight:o}=t;if(n<=e-o/2){return n/(e-o)}return 1};const zg=async(t,n)=>{const{finalDeltaY:e,handleOffset:o=0,y:s}=t;const c=n-s-o;const r=Hg(t,c);const i=r*e;const a=await Qi(t,i);return a};const $g=zg;const Ug=async(t,n)=>{const{deltaY:e,finalDeltaY:o,height:s,scrollBarHeight:c,y:r}=t;const i=n-r;const a=jr(e,o,s,c);const d=i-a;if(d>=0&&d<c){return{...t,handleOffset:d}}const{handleOffset:l,percent:u}=Xr(s,c,i);const f=u*o;const h=await Qi(t,f);return{...h,handleOffset:l}};const Yg=(t,n)=>{};const _g={deltaY:0,touchOffsetY:0};const Vg=(t,n)=>{if(n.touches.length===0){return}const e=n.touches[0];_g.touchOffsetY=e.y;_g.deltaY=t.deltaY};const jg=(t,n)=>Ki(t,n);const qg=(t,n)=>Qi(t,n);const Gg=(t,n,e,o)=>{g(n);g(e);g(o);const{deltaX:s}=t;if(e===0){return jg(t,o)}const c=Ds(s+e,0,Infinity);return{...jg(t,o),deltaX:c}};const Xg=(t,n)=>{if(n.touches.length===0){return}const e=n.touches[0];const o=_g.deltaY+(_g.touchOffsetY-e.y);qg(t,o)};const Zg=(t,n,e,o)=>Gg(t,n,e,o);const Qg=t=>{const n=[];const e=[];for(let n=0;n<t.length;n+=4){const o=t[n];const s=t[n+2];for(let t=o;t<=s;t++){e.push(t)}}for(const t of e){n.push({deleted:[" "],end:{columnIndex:2,rowIndex:t},inserted:[""],origin:ks,start:{columnIndex:0,rowIndex:t}})}return n};const Kg=t=>{const{selections:n}=t;const e=Qg(n);return ea(t,e)};const Jg=t=>{const n=[];for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+2];for(let t=o;t<=s;t++){n.push(t)}}const e=Array.from(n,t=>({deleted:[""],end:{columnIndex:0,rowIndex:t},inserted:[" "],origin:vs,start:{columnIndex:0,rowIndex:t}}));return e};const tm=t=>{const{selections:n}=t;const e=Jg(n);return ea(t,e)};const nm=async t=>Eo("Languages.getLanguageConfiguration",{languageId:t.languageId,uri:t.uri});const em=t=>{if(t?.indentationRules?.increaseIndentPattern&&typeof t.indentationRules.increaseIndentPattern==="string"){const n=new RegExp(t.indentationRules.increaseIndentPattern);return n}return undefined};const om=(t,n)=>{if(!n){return false}return n.test(t)};const sm=(t,n,e)=>{const o=[];const s=[];const c=em(e);for(let e=0;e<n.length;e+=4){const[r,i,a,d]=Si(n,e);const l={columnIndex:i,rowIndex:r};const u={columnIndex:d,rowIndex:a};const f={end:u,start:l};if(Ni(r,i,a,d)){const n=t[r];const e=n.slice(0,i);const a=br(e);if(om(e,c)){o.push({deleted:Pr({lines:t},f),end:u,inserted:["",a+" ",a],origin:Cs,start:l});s.push(r+1,a.length+2,r+1,a.length+2)}else{o.push({deleted:Pr({lines:t},f),end:u,inserted:["",a],origin:Cs,start:l});s.push(r+1,a.length,r+1,a.length)}}else{o.push({deleted:Pr({lines:t},f),end:u,inserted:["",""],origin:Cs,start:l});s.push(r+1,0,r+1,0)}}return{changes:o,selectionChanges:new Uint32Array(s)}};const cm=async t=>{const{lines:n,selections:e}=t;const o=await nm(t);const{changes:s,selectionChanges:c}=sm(n,e,o);return ea(t,s,c)};const rm=2;const im=0;const am=()=>{const t=Vd();const n={id:Fe,newState:{focused:true,focusSource:rm,height:0,questions:[],uid:t,width:0,x:0,y:0},oldState:{focused:false,focusSource:im,height:0,questions:[],uid:t,width:0,x:0,y:0}};return n};const dm=async t=>{const n={...t,height:45,width:150,x:100,y:100};return n};const lm=async t=>{const n=true;return _d(Fe,ls,t,am,dm,n)};const um=()=>{const t=Vd();const n={id:Te,newState:{commands:[],height:0,uid:t,width:0,x:0,y:0},oldState:{commands:[],height:0,uid:t,width:0,x:0,y:0}};return n};const{invoke:fm,setFactory:hm}=Ho(qe);const gm=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=Jo(n);const{languageId:a}=i;await fm("Completions.create",o,c,r,s,e,n,a);await fm("Completions.loadContent",o);const d=await fm("Completions.diff2",o);const l=await fm("Completions.render2",o,d);return{...t,commands:l}};const mm=async t=>{const n=false;return _d(Te,ss,t,um,gm,n)};const wm=()=>{const t=Vd();const n={id:De,newState:{commands:[],editorUid:0,height:0,uid:t,width:0,x:0,y:0},oldState:{commands:[],editorUid:0,height:0,uid:t,width:0,x:0,y:0}};return n};const pm=async()=>{const t="Find Widget Worker";const n="findWidgetWorkerMain.js";return Yo(t,n)};const ym=9002;const Em=async()=>{if(Un(ym)){return}const t=await pm();$n(ym,t)};const xm=async(t,...n)=>{const e=Un(ym);return await e.invoke(t,...n)};const Im=async()=>{const t=Un(ym);Yn(ym);if(t){await t.dispose()}};const Sm=t=>{const n=Jo(t);if(!n){throw new Error(`editor ${t} not found`)}const{newState:e}=n;return e};const km=async(t,n)=>{const{uid:e}=t;const o=Sm(n);const{height:s,width:c,x:r,y:i}=o;await Em();await xm("FindWidget.create",e,r,i,c,s,n);await xm("FindWidget.loadContent",e);const a=await xm("FindWidget.diff2",e);const d=await xm("FindWidget.render2",e,a);return{...t,commands:d}};const vm=(t,n)=>km(t,n);const Cm=async t=>{const n=true;return _d(De,rs,t,wm,vm,n)};const bm=async t=>Cm(t);const Mm=t=>{const{selections:n}=t;const e=n[0];const o=n[1];const s=Ed(t,e,o);const c=xd(t,e);return{columnIndex:o,rowIndex:e,x:s,y:c}};const Am=()=>{const t=Vd();const n={id:Be,newState:{commands:[],height:0,uid:t,width:0,x:0,y:0},oldState:{commands:[],height:0,uid:t,width:0,x:0,y:0}};return n};const Lm=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=Jo(n);const{languageId:a}=i;await Nd("Rename.create",o,c,r,s,e,n,a);await Nd("Rename.loadContent",o);const d=await Nd("Rename.diff2",o);const l=await Nd("Rename.render2",o,d);return{...t,commands:l}};const Pm=async t=>{const{columnIndex:n,rowIndex:e}=Mm(t);const{word:o}=ju(t,e,n);if(!o){return t}const s=true;return _d(Be,as,t,Am,Lm,s)};const Fm=async t=>{const n=await Ca({args:[],editor:t,event:"onLanguage",method:"ExtensionHostOrganizeImports.execute"});return n};const Wm=async t=>{const n=await Fm(t);return sd(t,n)};const Tm=(t,n)=>{const e=Ei(n);const o=ld(t,e,ys);return ea(t,o)};const Rm=async t=>{const n=await Ao();w(n);return Tm(t,n)};const Dm=t=>{const{redoStack:n=[]}=t;if(n.length===0){return t}const e=n.at(-1);const o={...t,redoStack:n.slice(0,-1),undoStack:[...t.undoStack,e]};return oa(o,e)};const Om=t=>{if(!t){return`Error: ${t}`}let{message:n}=t;while(t.cause){t=t.cause;n+=`: ${t}`}return n};const Bm=t=>{if(!t){return{codeFrame:undefined,message:t,stack:undefined,type:"Error"}}const n=Om(t);if(t.codeFrame){return{codeFrame:t.codeFrame,message:n,stack:t.stack,type:t.constructor.name}}return{category:t.category,codeFrame:t.originalCodeFrame,message:n,stack:t.originalStack,stderr:t.stderr}};const Nm=/\((.*):(\d+):(\d+)\)$/;const Hm=/at (.*):(\d+):(\d+)$/;const zm=t=>{for(const n of t){if(Nm.test(n)||Hm.test(n)){return n}}return""};const $m=async t=>{try{const n=Ei(t.stack);const e=zm(n);let o=e.match(Nm);if(!o){o=e.match(Hm)}if(!o){return t}const s=vr(n.slice(1));const c=Om(t);return{message:c,stack:s,type:t.constructor.name}}catch(n){console.warn("ErrorHandling Error");console.warn(n);return t}};const Um=async t=>{if(t&&t.message&&t.codeFrame){return Bm(t)}if(t&&t.stack){return $m(t)}return t};const Ym=t=>{if(t&&t.type&&t.message&&t.codeFrame){return`${t.type}: ${t.message}\n\n${t.codeFrame}\n\n${t.stack}`}if(t&&t.message&&t.codeFrame){return`${t.message}\n\n${t.codeFrame}\n\n${t.stack}`}if(t&&t.type&&t.message){return`${t.type}: ${t.message}\n${t.stack}`}if(t&&t.stack){return t.stack}if(t===null){return null}return String(t)};const _m=async t=>{const n=await Um(t);const e=Ym(n);console.error(e);return n};const Vm=async t=>{try{await _m(t)}catch(n){console.warn("ErrorHandling error");console.warn(n);console.error(t)}};const jm=async t=>t;const qm=t=>t.startsWith("untitled:");const Gm=async(t,n)=>{await Eo("FileSystem.writeFile",t,n)};const Xm=async t=>{const n="Save File";const{canceled:e,filePath:o}=await go("Open.showSaveDialog",n,[],t);if(e){return""}return o};const Zm=async(t,n,e)=>{const o=await Xm(e);if(!o){return}await Eo("FileSystem.writeFile",o,n);await Co();await Eo("Main.handleUriChange",t,o);return o};const Qm=t=>{const n="code"in t?t.code:undefined;return n==="EACCES"||t.message.includes("EACCES:")};const Km=async t=>{if(Qm(t)){await Eo("ElectronDialog.showMessageBox",{buttons:["OK"],defaultId:0,message:"You don't have permission to save changes to this file.",title:"Unable to Save File",type:"error"});return}await Eo("ElectronDialog.showMessageBox",{buttons:["OK"],defaultId:0,detail:t.message,message:"Saving the file failed.",title:"Failed to Save File",type:"error"})};const Jm=async t=>{try{const{platform:n,uri:e}=t;const o=await jm(t);const s=Lr(o);if(qm(e)){const t=await Zm(e,s,n);if(t){return{...o,modified:false,uri:t}}return o}await Gm(e,s);return{...o,modified:false}}catch(n){const e=new k(n,`Failed to save file "${t.uri}"`);await Vm(e);if(t.platform===je){try{await Km(e)}catch(t){await Vm(t)}}return t}};const tw=t=>{const{lines:n}=t;const e=0;const o=0;const s=n.length-1;const c=n.at(-1).length;const r=Wi(e,o,s,c);return na(t,r)};const nw=(t,n,e)=>{const o=Ri(t);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=Si(t,s);dl(o,s+2,c,r,n,e);il(o,s,i,a)}return o};const ew=(t,n)=>{const{lines:e,selections:o}=t;const s=nw(o,e,n);return na(t,s)};const ow=t=>{ew(t,wl)};const sw=/[a-zA-Z\d]/;const cw=t=>sw.test(t);const rw=t=>cw(t)||t==="_";const iw=(t,n)=>{for(let e=n-1;e>=0;e--){if(!rw(t[e])){return e+1}}return 0};const aw=(t,n)=>{for(let e=n;e<t.length;e++){if(!rw(t[e])){return e}}return t.length};const dw=(t,n,e)=>{const o=t[n];const s=iw(o,e);const c=aw(o,e);const r=o.slice(s,c);return{end:c,start:s,word:r}};const lw=(t,n,e)=>{let o=0;if(!t[n+o].endsWith(e[o])){return false}while(++o<e.length-1){if(t[n+o]!==e[o]){return false}}return t[n+o].startsWith(e[o])};const uw=(t,n)=>{if(n.length===0){throw new Error("word length must be greater than zero")}const e=[];for(let o=0;o<t.length;o++){const s=t[o];let c=-n.length;while((c=s.indexOf(n,c+n.length))!==-1){e.push(o,c,o,c+n.length)}}return new Uint32Array(e)};const fw=(t,n)=>{const e=[];for(let o=0;o<t.length-n.length+1;o){if(lw(t,o,n)){e.push(o,t[o].length-n[0].length,o+n.length-1,n.at(-1).length);o+=n.length-1}else{o++}}return new Uint32Array(e)};const hw=(t,n)=>{if(n.length<4){throw new Error("selections must have at least one entry")}const e=0;const o=n[e];const s=n[e+1];const c=n[e+2];const r=n[e+3];if(o===c){if(s===r){const e=dw(t,c,r);if(e.start===e.end){return n}const o=uw(t,e.word);return o}const e=t[o];const i=e.slice(s,r);const a=uw(t,i);return a}const i=[];i.push(t[o].slice(s));for(let n=o+1;n<c-1;n++){i.push(t[n])}i.push(t[c].slice(0,r));const a=fw(t,i);return a};const gw=t=>{const{lines:n,selections:e}=t;const o=hw(n,e);return na(t,o)};const mw=(t,n,e)=>{const o=new Uint32Array(t.length);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=Si(t,s);const d=n[i];o[s]=c;o[s+1]=r;if(a>=d.length){o[s+2]=i+1;o[s+3]=0}else{const t=e(d,a);o[s+2]=i;o[s+3]=a+t}}return o};const ww=(t,n)=>{const{lines:e}=t;const{selections:o}=t;const s=mw(o,e,n);return na(t,s)};const pw=t=>ww(t,pl);const yw=t=>ew(t,fl);const Ew=t=>ww(t,gl);const xw=(t,n)=>{const e=t.length-1;const o=new Uint32Array(n.length);for(let t=0;t<n.length;t+=4){const[s,c,r,i]=Si(n,t);o[t]=s;o[t+1]=c;o[t+2]=Math.min(r+1,e);o[t+3]=i}return o};const Iw=t=>{const{lines:n,selections:e}=t;const o=xw(n,e);return na(t,o)};const Sw=(t,n)=>{const e=new Uint32Array(n.length);for(let o=0;o<n.length;o+=4){const[s,c,r,i]=Si(n,o);if(s===r&&c===i){const n=s;let r=c;let a=i;const d=t[n];while(r>0&&d[r]!==mr){r--}r++;while(a<d.length&&d[a]!==mr){a++}e[o]=n;e[o+1]=r;e[o+2]=n;e[o+3]=a}else{e[o]=s;e[o+1]=c;e[o+2]=r;e[o+3]=i}}return e};const kw=t=>{const{selections:n}=t;const{lines:e}=t;const o=Sw(e,n);return na(t,o)};const vw=async(t,n)=>{const e=await Eo("ExtensionHostSelection.executeGrowSelection",t,n);if(e.length===0){return n}return new Uint32Array(e)};const Cw=async t=>{const{selections:n}=t;const e=await vw(t,n);return na(t,e)};const bw=(t,n)=>{const e=n.length-4;const o=n[e];const s=n[e+1];const c=n[e+3];const r=t[o];const i=r.slice(s,c);const a=r.indexOf(i,c);if(a!==-1){const t=a+i.length;const e=new Uint32Array(n.length+4);e.set(n,0);const s=n.length;e[s]=o;e[s+1]=a;e[s+2]=o;e[s+3]=t;return{revealRange:e.length-4,selectionEdits:e}}for(let e=o+1;e<t.length;e++){const o=t[e];const s=o.indexOf(i);if(s!==-1){const t=s+i.length;const o=new Uint32Array(n.length+4);o.set(n,0);const c=n.length;o[c]=e;o[c+1]=s;o[c+2]=e;o[c+3]=t;return{revealRange:o.length-4,selectionEdits:o}}}let d=0;for(let e=0;e<=o;e++){const o=t[e];let s=-i.length;while((s=o.indexOf(i,s+i.length))!==-1){let t=n[d];while(t<e&&d<n.length){d+=4;t=n[d]}if(t===e){let t=n[d+3];while(t<s&&d<n.length){d+=4;t=n[t+3]}}t=n[d];const o=n[d+1];const c=n[d+3];const r=t===e&&o<=s&&s<=c;if(!r){if(t>e){d-=4}const o=s+i.length;d+=4;const c=new Uint32Array(n.length+4);c.set(n.subarray(0,d),0);c[d]=e;c[d+1]=s;c[d+2]=e;c[d+3]=o;c.set(n.subarray(d),d+4);return{revealRange:c.length-4,selectionEdits:c}}}}return undefined};const Mw=t=>{const{lines:n}=t;const{selections:e}=t;if($i(e)){const t=new Uint32Array(e.length);for(let o=0;o<e.length;o+=4){const[s,c,r,i]=Si(e,o);const a=dw(n,s,c);t[o]=s;if(a.start===a.end){t[o+1]=c;t[o+2]=r;t[o+3]=i}else{t[o+1]=a.start;t[o+2]=s;t[o+3]=a.end}}return{revealRange:t.length-4,selectionEdits:t}}if(Ui(t.selections)){return bw(t.lines,t.selections)}return undefined};const Aw=(t,n,e,o)=>e>=t&&o<=n;const Lw=t=>{const n=Mw(t);if(!n){return t}const{revealRange:e,selectionEdits:o}=n;const s=o[e];const c=o[e+2];if(Aw(t.minLineY,t.maxLineY,s,c)){return na(t,o)}return ea(t,[],o)};const Pw=t=>t;const Fw=(t,n)=>{const e=new Uint32Array(n.length);for(let t=0;t<n.length;t+=4){const[o,s,c,r]=Si(n,t);e[t]=Math.max(o-1,0);e[t+1]=s;e[t+2]=c;e[t+3]=r}return e};const Ww=t=>{const{lines:n,selections:e}=t;const o=Fw(n,e);return na(t,o)};const Tw=t=>ew(t,Cl);const Rw=t=>ww(t,Ll);const Dw=(t,n,e)=>{if(t.decorations.length===0&&n.length===0){return t}return{...t,decorations:n,diagnostics:e}};const Ow=async(t,n,e)=>{const{tokenizerId:o}=t;Xc(n,e);await er(n,e);const s=or(n);const c=o+1;cr(c,s);const r=Sm(t.uid);if(!r){return t}const i=Kr();const{differences:a,textInfos:d}=await _r(t,i);const l=Sm(t.uid);if(!l){return t}const u={...l,differences:a,focused:true,textInfos:d};return{...u,invalidStartIndex:0,languageId:n,tokenizerId:c}};const Bw=(t,n)=>{const{maxLineY:e,minLineY:o,rowHeight:s}=t;const c=n[0];if(c<o){const e=c*s;return{...t,deltaY:e,maxLineY:c+1,minLineY:c,selections:n}}if(c>e){const e=c*s;return{...t,deltaY:e,maxLineY:c+1,minLineY:c,selections:n}}return{...t,selections:n}};const Nw=(t,n)=>{w(n);const e=t.lines.length-1;const o=t.lines.at(-1).length;const s={columnIndex:0,rowIndex:0};const c={columnIndex:o,rowIndex:e};const r=[{deleted:Pr(t,{end:c,start:s}),end:c,inserted:Ei(n),origin:xs,start:s}];return ea(t,r)};const Hw=()=>{const t=Vd();const n={id:Oe,newState:{commands:[],content:"",diagnostics:[],documentation:"",editorUid:0,height:0,lineInfos:[],uid:t,width:0,x:0,y:0},oldState:{commands:[],content:"",diagnostics:[],documentation:"",editorUid:0,height:0,lineInfos:[],uid:t,width:0,x:0,y:0}};return n};const zw=async()=>{const t="Hover Worker";const n="hoverWorkerMain.js";const e="Hover.initialize";const o=await Yo(t,n,e);return o};const $w={};const Uw=()=>{if(!$w.workerPromise){$w.workerPromise=zw()}return $w.workerPromise};const Yw=async(t,...n)=>{const e=await Uw();return await e.invoke(t,...n)};const _w=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=Jo(n);const{languageId:a}=i;await Yw("Hover.create",o,c,r,s,e,n,a);await Yw("Hover.loadContent",o);const d=await Yw("Hover.diff2",o);const l=await Yw("Hover.render2",o,d);return{...t,commands:l}};const Vw=async t=>{const n=false;return _d(Oe,is,t,Hw,_w,n)};const jw="EditorHover";const qw=async t=>{await Eo("Viewlet.openWidget",jw);return t};const Gw=()=>{const t=Vd();const n={id:Ne,newState:{commands:[],focusedIndex:0,height:0,maxHeight:0,sourceActions:[],uid:t,width:0,x:0,y:0},oldState:{commands:[],focusedIndex:0,height:0,maxHeight:0,sourceActions:[],uid:t,width:0,x:0,y:0}};return n};const Xw=async()=>{const t="Source Action Worker";const n="sourceActionWorkerMain.js";const e="SourceActions.initialize";const o=await Yo(t,n,e);return o};const Zw={};const Qw=()=>{if(!Zw.workerPromise){Zw.workerPromise=Xw()}return Zw.workerPromise};const Kw=async(t,...n)=>{const e=await Qw();return await e.invoke(t,...n)};const Jw=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=Jo(n);const{languageId:a}=i;await Kw("SourceActions.create",o,c,r,s,e,n,a);await Kw("SourceActions.loadContent",o);const d=await Kw("SourceActions.diff2",o);const l=await Kw("SourceActions.render2",o,d);return{...t,commands:l}};const tp=async t=>_d(Ne,ds,t,Gw,Jw);const np=(t,n)=>t.localeCompare(n);const ep=t=>{const n=[...t];n.sort(np);return n};const op="sort-lines-ascending";const sp=(t,n)=>{const e=n[0];const o=n[2];const s=[];for(let c=0;c<n.length;c+=4){const r=n[c];const i=n[c+1];const a=n[c+2];const d=n[c+3];const l={columnIndex:i,rowIndex:r};const u={columnIndex:d,rowIndex:a};const f={end:u,start:l};const h=t.slice(e,o+1);const g=ep(h);s.push({deleted:Pr({lines:t},f),end:u,inserted:g,origin:op,start:l})}return s};const cp=t=>{const{lines:n,selections:e}=t;const o=sp(n,e);return ea(t,o)};const rp=async(t,n)=>Ca({args:[n],editor:t,event:va,method:la,noProviderFoundMessage:"No tab completion provider found",noProviderFoundResult:undefined});const ip=t=>{const{selections:n}=t;const e=n[0];const o=n[1];const s=Wr(t,e,o);return s};const ap=async t=>{const n=ip(t);const e=await rp(t,n);return e};const dp=(t,n,e)=>{const o=Ei(e.inserted);const s=[];const c=[];for(let r=0;r<n.length;r+=4){const[i,a,d,l]=Si(n,r);if(o.length>1){const n=Ar({lines:t},i);const r=br(n);const u=[o[0],...o.slice(1).map(t=>r+t)];const f=[""];s.push({deleted:f,end:{columnIndex:l,rowIndex:d},inserted:u,origin:Es,start:{columnIndex:a-e.deleted,rowIndex:i}});const h=o.at(-1);c.push(d+o.length-f.length,l+h.length,d+o.length-f.length,l+h.length)}else{const t=o[0];const n=t.indexOf("$0");if(n===-1){const t=a-e.deleted;c.push(i,t,i,t);s.push({deleted:[""],end:{columnIndex:l,rowIndex:d},inserted:o,origin:Es,start:{columnIndex:a-e.deleted,rowIndex:i}})}else{const n=t.replace("$0","");const o=l+2;c.push(i,o,i,o);s.push({deleted:[""],end:{columnIndex:l,rowIndex:d},inserted:[n],origin:Es,start:{columnIndex:a-e.deleted,rowIndex:i}})}}}return{changes:s,selectionChanges:new Uint32Array(c)}};const lp=(t,n)=>{const{lines:e,selections:o}=t;const{changes:s,selectionChanges:c}=dp(e,o,n);return ea(t,s,c)};const up=String;const fp=async t=>{try{const n=await ap(t);if(!n){return t}return lp(t,n)}catch(n){await Vm(n);const e=t.selections[0];const o=t.selections[1];return kd(t,e,o,up(n))}};const hp=async(t,n)=>{const{assetDir:e,platform:o}=t;try{await zo(`onLanguage:${t.languageId}`,e,o);const s=await fa(`ExtensionHostCommment.execute`,t.uid,n);if(s){return s}}catch{}const s=await nm(t);if(!s?.comments?.blockComment){return undefined}return s.comments.blockComment};const gp=/^\s+/;const mp=/\s+$/;const wp=(t,n,e)=>({deleted:[e],end:{columnIndex:n+e.length,rowIndex:t},inserted:[],origin:As,start:{columnIndex:n,rowIndex:t}});const pp=(t,n,e,o,s,c,r)=>{if(n===o){return[wp(t,e,c),wp(t,s-c.length,r)]}return[wp(n,e,c),wp(o,s,r)]};const yp=(t,n)=>{const{selections:e}=t;const[o]=e;const s=Ar(t,o);const c=t.lines.length;let r=o;let i=-1;const a=n[0];const d=n[1];while(r<c){const n=Ar(t,r);i=n.indexOf(d);if(i!==-1){break}r++}let l=-1;let u=o;while(u>=0){const n=Ar(t,u);l=n.indexOf(a);if(l!==-1){break}u--}const f=[];if(l!==-1&&i!==-1){f.push(...pp(o,u,l,r,i,a,d))}else{const t=s.match(gp);const n=s.match(mp);let e=0;let c=s.length;if(t){e+=t[0].length}if(n){c-=n[0].length}const r={deleted:[],end:{columnIndex:e,rowIndex:o},inserted:[a],origin:As,start:{columnIndex:e,rowIndex:o}};const i={deleted:[],end:{columnIndex:c+a.length,rowIndex:o},inserted:[d],origin:As,start:{columnIndex:c+a.length,rowIndex:o}};f.push(r,i)}return f};const Ep=async t=>{const n=ip(t);const e=await hp(t,n);if(!e){return t}const o=yp(t,e);return sa(t,o)};const xp=async t=>{const n=await nm(t);if(!n?.comments?.lineComment){return undefined}return n.comments.lineComment};const Ip=/^\s+/;const Sp=(t,n,e)=>{const o=n.match(Ip);const s=o?o[0].length:0;if(n.slice(s).startsWith(e)){if(n[s+e.length]===" "){return{deleted:[e+" "],end:{columnIndex:s+e.length+1,rowIndex:t},inserted:[""],origin:bs,start:{columnIndex:s,rowIndex:t}}}return{deleted:[e],end:{columnIndex:s+e.length,rowIndex:t},inserted:[""],origin:bs,start:{columnIndex:s,rowIndex:t}}}return{deleted:[],end:{columnIndex:s,rowIndex:t},inserted:[`${e} `],origin:bs,start:{columnIndex:s,rowIndex:t}}};const kp=async t=>{const n=await xp(t);if(!n){return t}const e=t;const o=t.selections[0];const s=Ar(e,o);const c=[Sp(o,s,n)];return ea(t,c)};const vp=async t=>{try{const n=await kp(t);if(t!==n){return n}return Ep(t)}catch(n){od(n);await Sd(t,0,0,String(n),true);return t}};const Cp=async(t,n)=>{const e=ld(t,[n],xs);const o=await ea(t,e);if(o.completionsOnType){const t=await mm(o);return t}return o};const bp="/";const Mp="{";const Ap="}";const Lp="(";const Pp=")";const Fp="[";const Wp="]";const Tp="???";const Rp="'";const Dp='"';const Op="`";const Bp=t=>{switch(t){case Mp:return Ap;case Lp:return Pp;case Fp:return Wp;default:return Tp}};const Np=(t,n)=>{const e=Bp(n);const o=n+e;const s=ld(t,[o],Is);const c=new Uint32Array([s[0].start.rowIndex,s[0].start.columnIndex+1,s[0].end.rowIndex,s[0].end.columnIndex+1]);return ea(t,s,c)};const Hp=t=>{const{selections:n}=t;const e=new Uint32Array([n[0],n[1]+1,n[2],n[3]+1]);return na(t,e)};const zp=(t,n)=>{const{autoClosingRanges:e=[],selections:o}=t;if(ku(e,o)){return Hp(t)}return Cp(t,n)};const $p=(t,n)=>{const e=n+n;const o=ld(t,[e],Is);const s=new Uint32Array([o[0].start.rowIndex,o[0].start.columnIndex+1,o[0].end.rowIndex,o[0].end.columnIndex+1]);return ea(t,o,s)};const Up=async(t,n)=>{const e=Wr(t,t.selections[0],t.selections[1]);const o=await Eo("ExtensionHostClosingTagCompletion.executeClosingTagProvider",t,e,n);if(!o){const e=ld(t,[n],xs);return ea(t,e)}const s=ld(t,[o.inserted],xs);return ea(t,s)};const Yp=async(t,n)=>{const{isAutoClosingBracketsEnabled:e,isAutoClosingQuotesEnabled:o,isAutoClosingTagsEnabled:s}=t;switch(n){case bp:if(s){return Up(t,n)}break;case Ap:case Pp:case Wp:if(e){return zp(t,n)}break;case Mp:case Lp:case Fp:if(e){return Np(t,n)}break;case Op:case Dp:case Rp:if(o){return $p(t,n)}break}const c=Cp(t,n);return c};const _p=t=>{const n=t.end.columnIndex-t.deleted[0].length+t.inserted[0].length;return{deleted:t.inserted,end:{columnIndex:n,rowIndex:t.end.rowIndex},inserted:t.deleted,start:t.start}};const Vp=t=>{const{undoStack:n}=t;if(n.length===0){return t}const e=n.at(-1);const o=e.map(_p);const s={...t,redoStack:[...t.redoStack||[],e],undoStack:n.slice(0,-1)};return oa(s,o)};const jp=t=>t;const qp=t=>{switch(t){case We:case Te:case De:case Oe:case Be:case Ne:return true;default:return false}};const Gp=(t,n,e)=>{const o=e(t);const{uid:s}=t.newState;const c=[];c.push(["Viewlet.createFunctionalRoot",n,s,qp(t.id)]);c.push(...o);if(qp(t.id)){c.push(["Viewlet.appendToBody",s])}else{c.push(["Viewlet.send",s,"appendWidget"])}const r=c.findIndex(t=>t[2]==="focus"||t[0]==="Viewlet.focusSelector");if(r!==-1){const t=c[r];c.splice(r,1);c.push(t)}return c};const Xp=t=>{switch(t){case We:return qo;case Te:return fm;case De:return xm;case Oe:return Yw;case Be:return Nd;case Ne:return Kw;default:return undefined}};const Zp="Close";const Qp=(t,n,e)=>{const o=t=>t.id===n;const s=t.widgets.findIndex(o);if(s===-1){return t}const c=t.widgets[s];const r={...c,newState:e,oldState:c.newState};const i=[...t.widgets.slice(0,s),r,...t.widgets.slice(s+1)];return{...t,widgets:i}};const Kp=(t,n)=>{for(const e of ts()){const o=Jo(Number(e)).newState;const s=o.widgets||[];for(const e of s){if(e.id===n&&e.newState.uid===t){return o}}}return undefined};const Jp=(t,n)=>{if(t&&t.widgets){return t}const e=Jo(t);if(e&&e.newState&&e.newState.widgets){return e.newState}return Kp(t,n)};const ty=(t,n,e)=>{const o=t=>t.id===e;const s=n=>t==="close"||t==="handleClickButton"&&n.includes(Zp);const c=async(c,...r)=>{const i=Jp(c,e);if(!i){return c}const a=i.widgets.findIndex(o);if(a===-1){return i}const d=i.widgets[a];const l=d.newState;const{uid:u}=l;const f=Xp(e);await f(`${n}.${t}`,u,...r);const h=await f(`${n}.diff2`,u);const g=await f(`${n}.render2`,u,h);const m=Jo(i.uid).newState;if(s(r)){const t={...m,focused:true,widgets:Pd(m.widgets,e)};ns(i.uid,m,t);return t}const w={...l,commands:g};const p=Qp(m,e,w);ns(i.uid,m,p);return p};return c};const ny=(t,n,e)=>{const o=Object.create(null);for(const s of t){o[s]=ty(s,n,e)}return o};const ey="Viewlet.appendToBody";const oy="focus";const sy="Viewlet.registerEventListeners";const cy="Viewlet.setSelectionByName";const ry="Viewlet.setValueByName";const iy="Viewlet.setFocusContext";const ay="setBounds";const dy="Viewlet.setBounds";const ly="Viewlet.setCss";const uy="Viewlet.setDom2";const fy="Viewlet.setUid";const hy=(t,n)=>{const e=[...n.commands];n.commands=[];return e};const gy=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const my=t=>{const n=hy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(gy.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const wy=t=>Gp(t,"EditorCompletion",my);const py=t=>[["Viewlet.dispose",t.newState.uid]];const{close:yy,closeDetails:Ey,focusFirst:xy,focusIndex:Iy,focusLast:Sy,focusNext:ky,focusPrevious:vy,handleEditorBlur:Cy,handleEditorClick:by,handleEditorDeleteLeft:My,handleEditorType:Ay,handlePointerDown:Ly,handleWheel:Py,openDetails:Fy,selectCurrent:Wy,selectIndex:Ty,toggleDetails:Ry}=ny(["handleEditorType","focusFirst","focusNext","focusPrevious","focusLast","handleEditorDeleteLeft","openDetails","focusIndex","handleEditorBlur","handleEditorClick","openDetails","selectCurrent","selectIndex","toggleDetails","closeDetails","handleWheel","close","handlePointerDown"],"Completions",Te);const Dy={__proto__:null,add:wy,close:yy,closeDetails:Ey,focusFirst:xy,focusIndex:Iy,focusLast:Sy,focusNext:ky,focusPrevious:vy,handleEditorBlur:Cy,handleEditorClick:by,handleEditorDeleteLeft:My,handleEditorType:Ay,handlePointerDown:Ly,handleWheel:Py,openDetails:Fy,remove:py,render:my,selectCurrent:Wy,selectIndex:Ty,toggleDetails:Ry};const Oy=(t,n)=>{const e=[...n.commands];n.commands=[];return e};const By=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const Ny=t=>{const n=Oy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(By.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const Hy=t=>Gp(t,"FindWidget",Ny);const zy=t=>[["Viewlet.dispose",t.newState.uid]];const{close:$y,focusCloseButton:Uy,focusFind:Yy,focusNext:_y,focusNextElement:Vy,focusNextMatchButton:jy,focusPrevious:qy,focusPreviousElement:Gy,focusPreviousMatchButton:Xy,focusReplace:Zy,focusReplaceAllButton:Qy,focusReplaceButton:Ky,focusToggleReplace:Jy,handleBlur:tE,handleClickButton:nE,handleFocus:eE,handleInput:oE,handleReplaceFocus:sE,handleReplaceInput:cE,handleToggleReplaceFocus:rE,replace:iE,replaceAll:aE,toggleMatchCase:dE,toggleMatchWholeWord:lE,togglePreserveCase:uE,toggleReplace:fE,toggleUseRegularExpression:hE}=ny(["close","focusCloseButton","focusFind","focusNext","focusNextMatchButton","focusPrevious","focusPreviousMatchButton","focusReplace","focusReplaceAllButton","focusReplaceButton","focusToggleReplace","handleBlur","handleClickButton","handleFocus","handleInput","handleReplaceFocus","handleReplaceInput","handleToggleReplaceFocus","replace","replaceAll","toggleMatchCase","toggleMatchWholeWord","toggleReplace","toggleUseRegularExpression","focusNextElement","focusPreviousElement","togglePreserveCase"],"FindWidget",De);const gE={__proto__:null,add:Hy,close:$y,focusCloseButton:Uy,focusFind:Yy,focusNext:_y,focusNextElement:Vy,focusNextMatchButton:jy,focusPrevious:qy,focusPreviousElement:Gy,focusPreviousMatchButton:Xy,focusReplace:Zy,focusReplaceAllButton:Qy,focusReplaceButton:Ky,focusToggleReplace:Jy,handleBlur:tE,handleClickButton:nE,handleFocus:eE,handleInput:oE,handleReplaceFocus:sE,handleReplaceInput:cE,handleToggleReplaceFocus:rE,remove:zy,render:Ny,replace:iE,replaceAll:aE,toggleMatchCase:dE,toggleMatchWholeWord:lE,togglePreserveCase:uE,toggleReplace:fE,toggleUseRegularExpression:hE};const mE=t=>({documentId:t.id||t.uid,languageId:t.languageId,text:Lr(t),uri:t.uri});const wE=async(t,n)=>{const e=mE(t);return uo("Extensions.executeHoverProvider",e,n)};const pE=async(t,n)=>{h(t);g(n);const e=await wE(t,n);if(e){return e}return Ca({args:[n],editor:t,event:ka,method:da,noProviderFoundMessage:"No hover provider found"})};const yE=async(t,n)=>{h(t);g(n);const e=await pE(t,n);return e};const EE=async(t,n,e,o,s)=>100;const xE=(t,n,e)=>{const o=n.length;let s=0;let c=0;const r=[];for(let i=0;i<o;i+=2){const o=n[i];const a=n[i+1];s+=a;const d=t.slice(c,s);const l=`Token ${e[o]||"Unknown"}`;const u=d;r.push(u,l);c=s}return r};const IE=(t,n,e)=>{const o=[];const{hasArrayReturn:s,initialLineState:c,tokenizeLine:r,TokenMap:i}=n;let a=Ac(c);for(const n of t){const t=Wc(e,r,n,a,s);const{tokens:c}=t;const d=xE(n,c,i);o.push(d);a=t}console.error({lineInfos:o});return o};const SE=async(t,n,e)=>{await er(n,e);const o=or(n);const s=Ei(t);const c=IE(s,o,n);return c};const kE=(t,n)=>{if(t){return t}const e=n[0];const o=n[1];return{columnIndex:o,rowIndex:e}};const vE=(t,n,e)=>{const o=[];for(const e of t){if(e.rowIndex===n){o.push(e)}}return o};const CE="typescript";const bE=(t,n,e,o)=>{const s=Ed(t,n,e);const c=t.height-xd(t,n)+t.y+40;return{x:s,y:c}};const ME=async(t,n)=>{g(t);const e=Jo(t);const o=e.newState;const{selections:s}=o;const{columnIndex:c,rowIndex:r}=kE(n,s);const i=Wr(o,r,c);const a=await yE(o,i);if(!a){return undefined}const{displayString:d,displayStringLanguageId:l,documentation:u}=a;const f="";const h=await SE(d,l||CE,f);const m=qu(o,r,c);const w=c-m.length;await EE();const{x:p,y:y}=bE(o,r,w);const E=o.diagnostics||[];const x=vE(E,r);return{documentation:u,lineInfos:h,matchingDiagnostics:x,x:p,y:y}};const AE=async(t,n,e)=>{const o=await ME(t,e);if(!o){return n}const{documentation:s,lineInfos:c,matchingDiagnostics:r,x:i,y:a}=o;return{...n,diagnostics:r,documentation:s,lineInfos:c,x:i,y:a}};const LE=(t,n,e)=>t;const PE=(t,n,e)=>{const{x:o}=t;const s=100;const c=Math.max(n-o,s);return{...t,resizedWidth:c}};const FE=(t,n,e)=>t;const WE="CodeGeneratorInput";const TE="CodeGeneratorMessage";const RE="CodeGeneratorWidget";const DE="DiagnosticError";const OE="DiagnosticWarning";const BE="CompletionDetailCloseButton";const NE="CompletionDetailContent";const HE="Diagnostic";const zE="EditorCursor";const $E="EditorRow";const UE="EditorRowHighlighted";const YE="EditorSelection";const _E="HoverDisplayString";const VE="HoverDocumentation";const jE="HoverEditorRow";const qE="HoverProblem";const GE="HoverProblemDetail";const XE="HoverProblemMessage";const ZE="IconClose";const QE="InputBox";const KE="MaskIcon";const JE="Viewlet";const tx=1;const nx=2;const ex=9;const ox=10;const sx=11;const cx=12;const rx=13;const ix=14;const ax=15;const dx=18;const lx=19;const ux=20;const fx=21;const hx=22;const gx=23;const mx=26;const wx=27;const px=28;const yx=29;const Ex=30;const xx=31;const Ix=32;const Sx=33;const kx=4;const vx=6;const Cx=8;const bx=12;const Mx=62;const Ax=t=>({childCount:0,text:t,type:bx});const Lx=t=>{const n=[{childCount:t.length/2,className:jE,type:kx}];for(let e=0;e<t.length;e+=2){const o=t[e];const s=t[e+1];n.push({childCount:1,className:s,type:Cx},Ax(o))}return n};const Px=t=>{const n=t.flatMap(Lx);return n};const Fx={childCount:1,className:XE,type:Cx};const Wx={childCount:1,className:GE,type:Cx};const Tx=(t,n,e)=>{const o=n?1:0;const s=e&&e.length>0?1:0;return t.length+o+s};const Rx=(t,n,e)=>{const o=[];o.push({childCount:Tx(t,n,e)+1,className:"Viewlet EditorHover",type:kx});if(e&&e.length>0){o.push({childCount:e.length*2,className:`${_E} ${qE}`,type:kx});for(const t of e){o.push(Fx,Ax(t.message),Wx,Ax(`${t.source} (${t.code})`))}}if(t.length>0){const n=Px(t);o.push({childCount:t.length,className:_E,type:kx},...n)}if(n){o.push({childCount:1,className:VE,type:kx},Ax(n))}o.push({childCount:0,className:"Sash SashVertical SashResize",onPointerDown:mx,type:kx});return o};const Dx={apply(t,n){const e=Rx(n.lineInfos,n.documentation,n.diagnostics);return[uy,e]},isEqual:(t,n)=>t.lineInfos===n.lineInfos&&t.documentation===n.documentation&&t.diagnostics===n.diagnostics};const Ox={apply(t,n){const{height:e,width:o,x:s,y:c}=n;return[ay,s,c,o,e]},isEqual:(t,n)=>t.x===n.x&&t.y===n.y};const Bx=[Dx,Ox];const Nx=(t,n)=>{const e=[];for(const o of Bx){if(!o.isEqual(t,n)){e.push(o.apply(t,n))}}return e};const Hx=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const zx=t=>{const n=hy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(Hx.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const $x=t=>Gp(t,"EditorRename",zx);const Ux=t=>[["Viewlet.dispose",t.newState.uid]];const{accept:Yx,close:_x,handleInput:Vx}=ny(["handleInput","close","accept"],"Rename",Be);const jx={__proto__:null,accept:Yx,add:$x,close:_x,handleInput:Vx,remove:Ux,render:zx};const qx=t=>structuredClone(t);const Gx=(t,n)=>{const e={...t,focusedIndex:n};return e};const Xx=t=>{const n=t.focusedIndex+1;return Gx(t,n)};const Zx=t=>[["Viewlet.send",t.newState.uid,"dispose"]];const Qx=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const Kx=t=>{const n=hy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(Qx.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const Jx=t=>Gp(t,"EditorSourceActions",Kx);const tI=Zx;const{close:nI,closeDetails:eI,focusFirst:oI,focusIndex:sI,focusLast:cI,focusNext:rI,focusPrevious:iI,handleWheel:aI,selectCurrent:dI,selectIndex:lI,selectItem:uI,toggleDetails:fI}=ny(["focusFirst","focusIndex","focusLast","focusNext","focusPrevious","selectCurrent","selectIndex","selectItem","toggleDetails","closeDetails","handleWheel","close"],"SourceActions",Ne);const hI={__proto__:null,add:Jx,close:nI,closeDetails:eI,focusFirst:oI,focusIndex:sI,focusLast:cI,focusNext:rI,focusPrevious:iI,handleWheel:aI,remove:tI,render:Kx,selectCurrent:dI,selectIndex:lI,selectItem:uI,toggleDetails:fI};const gI=async(t,n,e,o,s,...c)=>{const r=Xp(s);const i=e.slice(n.length+1);const a=t.widgets.find(t=>t.id===s);if(!a){return t}const{uid:d}=a.newState;g(d);await r(`${n}.${i}`,d,...c);const l=t=>t.id===s;const u=Sm(t.uid);const f=u.widgets.findIndex(l);if(f===-1){return u}const h=await r(`${n}.diff2`,d);const m=await r(`${n}.render2`,d,h);const w=t.widgets.findIndex(l);if(w===-1){return u}const p=u.widgets[w];const y={...p.newState,commands:m};const E=Qp(u,s,y);return E};const mI=(t,n)=>t.filter(t=>t.languageId===n);const wI=async t=>{if(!t){return[]}const{newState:n}=Jo(t);const{languageId:e}=n;const o=await Eo("GetEditorSourceActions.getEditorSourceActions");const s=mI(o,e);return s};const pI=/[\w\-]+$/;const yI=t=>{const{lines:n,selections:e}=t;const o=e[0];const s=e[1];const c=n[o];const r=c.slice(0,s);const i=r.match(pI);if(i){return i[0]}return""};const EI=async t=>{await Eo("Focus.setFocus",t)};const xI=async t=>{if(!t){return}await Eo("Focus.removeAdditionalFocus",t)};const II=12;const SI=9;const kI=11;const vI=12;const CI=16;const bI=38;const MI=43;const AI=46;const LI=47;const PI=48;const FI=49;const WI=50;const TI=52;const RI=t=>{const n=Sm(t);return Mm(n)};const DI=t=>{const n=Sm(t);return n.uri};const OI=t=>{const n=Sm(t);return n.languageId};const BI=t=>{const n=Sm(t);return ip(n)};const NI=(t,n,e)=>{const o=Sm(t);const{word:s}=ju(o,n,e);return s};const HI=t=>{const n=Sm(t);const e=yI(n);return e};const zI=(t,n,e)=>{const o=Sm(t);const s=qu(o,n,e);return s};const $I=t=>{const n=Sm(t);const{lines:e}=n;return e};const UI=t=>{const n=Sm(t);const{selections:e}=n;return e};const YI=async(t,n)=>{const e=Sm(t);const o={...e,selections:n};const s=await Ig(e,o);ns(t,e,s)};const _I=async(t,n,e,o)=>{const s=Sm(t);const c=Xp(n);const{widgets:r}=s;const i=r.findIndex(t=>t.id===n);if(i===-1){return}await c(`${e}.dispose`);const a=[...r.slice(0,i),...r.slice(i+1)];const d={...s,focused:true,widgets:a};const l=await Ig(s,d);ns(t,s,l);await EI(vI);if(o){await xI(o)}};const VI=async t=>{await _I(t,De,"FindWidget",0)};const jI=async(t,n)=>{const e=Sm(t);const o=await cd(e,n);const s=await Ig(e,o);ns(t,e,s)};const qI=async t=>{const n=await wI(t);return n};const GI=async t=>{const n=Sm(t);const{diagnostics:e}=n;return e};const XI=async(t,n)=>{await po("TextMeasurement.ensureFont",t,n)};const ZI=()=>[{command:"Editor.closeSourceAction",key:ee,when:bI},{command:"EditorSourceActions.focusNext",key:de,when:bI},{command:"EditorSourceActions.focusPrevious",key:ie,when:bI},{command:"EditorSourceActions.focusFirst",key:ce,when:bI},{command:"EditorSourceActions.focusLast",key:se,when:bI},{command:"EditorSourceActions.selectCurrent",key:ne,when:bI},{command:"FindWidget.focusNext",key:ne,when:CI},{command:"FindWidget.preventDefaultBrowserFind",key:He|ge,when:CI},{command:"FindWidget.focusPrevious",key:ze|Ce,when:CI},{command:"FindWidget.focusNext",key:Ce,when:CI},{command:"FindWidget.focusToggleReplace",key:ze|te,when:CI},{command:"FindWidget.focusReplace",key:te,when:CI},{command:"FindWidget.focusPreviousMatchButton",key:te,when:MI},{command:"FindWidget.replaceAll",key:$e|He|ne,when:MI},{command:"FindWidget.focusNextMatchButton",key:te,when:WI},{command:"FindWidget.focusReplace",key:ze|te,when:WI},{command:"FindWidget.focusPreviousMatchButton",key:ze|te,when:FI},{command:"FindWidget.focusCloseButton",key:te,when:FI},{command:"FindWidget.focusNextMatchButton",key:ze|te,when:PI},{command:"FindWidget.focusReplaceButton",key:te,when:PI},{command:"FindWidget.focusFind",key:ze|te,when:MI},{command:"FindWidget.focusReplaceAllButton",key:te,when:AI},{command:"FindWidget.focusCloseButton",key:ze|te,when:AI},{command:"FindWidget.focusReplaceButton",key:ze|te,when:LI},{command:"EditorCompletion.focusNext",key:de,when:SI},{command:"EditorCompletion.focusPrevious",key:ie,when:SI},{command:"EditorCompletion.selectCurrent",key:ne,when:SI},{command:"EditorCompletion.close",key:ee,when:SI},{command:"EditorCompletion.focusLast",key:se,when:SI},{command:"EditorCompletion.focusFirst",key:ce,when:SI},{command:"EditorCompletion.toggleDetails",key:He|oe,when:SI},{command:"Editor.cursorWordRight",key:He|ae,when:vI},{command:"Editor.cursorWordLeft",key:He|re,when:vI},{command:"Editor.deleteWordPartLeft",key:$e|Jn,when:vI},{command:"Editor.deleteWordPartRight",key:$e|le,when:vI},{command:"Editor.deleteWordLeft",key:He|Jn,when:vI},{command:"Editor.deleteWordRight",key:He|le,when:vI},{command:"Editor.selectNextOccurrence",key:He|he,when:vI},{command:"Editor.openColorPicker",key:He|we,when:vI},{command:"Editor.showSourceActions3",key:He|Me,when:vI},{command:"Editor.handleTab",key:te,when:vI},{command:"Editor.unindent",key:ze|te,when:vI},{command:"Editor.indentLess",key:He|Le,when:vI},{command:"Editor.closeFind",key:ee,when:CI},{command:"Editor.openFind2",key:He|ge,when:vI},{command:"Editor.openCodeGenerator",key:He|pe,when:vI},{command:"Editor.closeCodeGenerator",key:ee,when:TI},{command:"EditorCodeGenerator.accept",key:ne,when:TI},{command:"Editor.indentMore",key:He|Pe,when:vI},{command:"Editor.selectCharacterLeft",key:ze|re,when:vI},{command:"Editor.selectWordLeft",key:He|ze|re,when:vI},{command:"Editor.selectCharacterRight",key:ze|ae,when:vI},{command:"Editor.selectWordRight",key:He|ze|ae,when:vI},{command:"Editor.selectLine",key:He|ye,when:vI},{command:"Editor.deleteAllLeft",key:He|ze|Jn,when:vI},{command:"Editor.deleteAllRight",key:He|ze|le,when:vI},{command:"Editor.cancelSelection",key:ee,when:vI},{command:"Editor.undo",key:He|Se,when:vI},{command:"Editor.cursorLeft",key:re,when:vI},{command:"Editor.cursorRight",key:ae,when:vI},{command:"Editor.cursorUp",key:ie,when:vI},{command:"Editor.cursorDown",key:de,when:vI},{command:"Editor.deleteLeft",key:Jn,when:vI},{command:"Editor.deleteRight",key:le,when:vI},{command:"Editor.insertLineBreak",key:ne,when:vI},{command:"Editor.copyLineDown",key:He|ze|he,when:vI},{command:"Editor.moveLineDown",key:He|ze|de,when:vI},{command:"Editor.moveLineUp",key:He|ze|ie,when:vI},{command:"Editor.openCompletion",key:He|oe,when:vI},{command:"Editor.openRename",key:ke,when:vI},{command:"EditorRename.accept",key:ne,when:kI},{command:"Editor.closeRename",key:ee,when:kI},{command:"Editor.cursorHome",key:ce,when:vI},{command:"Editor.cursorEnd",key:se,when:vI},{command:"Editor.toggleComment",key:He|Ae,when:vI},{command:"Editor.copy",key:He|fe,when:vI},{command:"Editor.selectAll",key:He|ue,when:vI},{command:"Editor.showHover2",key:He|me,when:vI},{command:"Editor.cut",key:He|Ie,when:vI},{command:"Editor.paste",key:He|xe,when:vI},{command:"Editor.cursorWordPartLeft",key:$e|re,when:vI},{command:"Editor.cursorWordPartRight",key:$e|ae,when:vI},{command:"Editor.selectAllOccurrences",key:$e|ve,when:vI},{command:"Editor.addCursorAbove",key:$e|ze|ie,when:vI},{command:"Editor.addCursorBelow",key:$e|ze|de,when:vI},{command:"Editor.findAllReferences",key:$e|ze|be,when:vI},{command:"Editor.organizeImports",key:$e|ze|Ee,when:vI},{command:"Editor.selectionGrow",key:He|ze|oe,when:II}];const QI=()=>ts();const KI={CommandPalette:"Command Palette"};const JI=()=>Qu(KI.CommandPalette);const tS={command:"",flags:_e,id:"separator",label:""};const nS=()=>[{command:"Editor.goToDefinition",flags:Ve,id:"go-to-definition",label:Rf()},{command:"Editor.goToTypeDefinition",flags:Ve,id:"go-to-type-definition",label:Uf()},tS,{args:["References",true],command:"SideBar.show",flags:Ve,id:"find-all-references",label:Yf()},{args:["Implementations",true],command:"SideBar.show",flags:Ve,id:"find-all-implementations",label:_f()},tS,{command:"Editor.format",flags:Ve,id:"format",label:Qf()},{command:"Editor.showSourceActions2",flags:Ve,id:Ye,label:Hf()},tS,{command:"Editor.cut",flags:Ve,id:"cut",label:Vf()},{command:"Editor.copy",flags:Ve,id:"copy",label:jf()},{command:"Editor.paste",flags:Ve,id:"paste",label:qf()},tS,{command:"QuickPick.showEverything",flags:Ve,id:"commandPalette",label:JI()}];const eS=()=>[Ue];const oS=t=>Aa(t);const sS=async()=>{const t=ts();const n=t.map(t=>{const n=Number(t);const e=Jo(n);return e});const e=n.map(t=>t.newState);const o=await Promise.all(e.map(oS));const s=o.flat();return s};const cS=()=>[{id:"Editor.format",label:Qf()},{id:"Editor.showHover",label:Kf()},{id:"Editor.formatForced",label:Jf()},{id:"Editor.selectNextOccurrence",label:th()},{id:"Editor.selectAllOccurrences",label:nh()},{id:"Editor.goToDefinition",label:eh()},{id:"Editor.goToTypeDefinition",label:oh()},{id:"Editor.selectInsideString",label:sh()},{aliases:["Indent More","DeIndent"],id:"Editor.indent",label:ch()},{aliases:["Indent Less","DeIndent"],id:"Editor.unindent",label:rh()},{id:"Editor.sortLinesAscending",label:ih()},{id:"Editor.toggleComment",label:ah()},{id:"Editor.selectUp",label:dh()},{id:"Editor.selectDown",label:lh()},{id:"Editor.toggleBlockComment",label:Gf()},{id:"Editor.openColorPicker",label:uh()},{id:"Editor.closeColorPicker",label:fh()},{id:"Editor.copyLineDown",label:hh()},{id:"Editor.copyLineUp",label:gh()},{id:"Editor.moveLineDown",label:Zf()},{id:"Editor.moveLineUp",label:Xf()},{id:"Editor.showSourceActions2",label:Hf()}];const rS=t=>{const n=Sm(t);const{selections:e}=n;return e};const iS=t=>{g(t);const n=Sm(t);const{lines:e}=n;return e.join(pr)};const aS="insertText";const dS=(t,n,e)=>{switch(n){case aS:return Yp(t,e);default:return t}};const lS=async(t,n)=>{const e=await Bn({commandMap:{},messagePort:t});if(n){$n(n,e)}};const uS=(t,n)=>lp(t,n);const fS=async t=>{const n=await ap(t);if(!n){return t}return uS(t,n)};const hS=async()=>{await Im();await Em()};const gS=t=>{switch(t){case De:return{invoke:xm,name:"FindWidget"};default:return undefined}};const mS=async(t,n,e,o)=>{if(e?.newState){const s=`${n}:${e.newState.uid}`;const c=gS(e.id);if(c&&o&&Object.hasOwn(o,s)){const{invoke:n,name:r}=c;const i=o[s];await n(`${r}.create`,e.newState.uid,e.newState.x,e.newState.y,e.newState.width,e.newState.height,t);await n(`${r}.loadContent`,e.newState.uid,i);const a=await n(`${r}.diff2`,e.newState.uid);const d=await n(`${r}.render2`,e.newState.uid,a);return{restored:true,widget:{...e,newState:{...e.newState,commands:d}}}}}return{restored:false,widget:e}};const wS=async(t,n)=>{const e=[];for(const o of t){const t=parseInt(o);const s=Jo(t);if(!s?.newState||!Array.isArray(s.newState.widgets)){continue}const{widgets:c}=s.newState;const r=[];let i=false;for(const e of c){const s=await mS(t,o,e,n);r.push(s.widget);if(s.restored){i=true}}if(!i){e.push(s);continue}e.push({...s,newState:{...s.newState,widgets:r}})}return e};const pS=async(t,n,e)=>{if(!e?.newState){return}const o=gS(e.id);if(!o){return}const{invoke:s,name:c}=o;const{uid:r}=e.newState;const i=`${n}:${r}`;const a=await s(`${c}.saveState`,r);t[i]=a};const yS=async t=>{const n=Object.create(null);for(const e of t){const t=Jo(parseInt(e));if(!t?.newState||!Array.isArray(t.newState.widgets)){continue}const{widgets:o}=t.newState;for(const t of o){await pS(n,e,t)}}return n};const ES={isReloading:false};const xS=async()=>{if(ES.isReloading){return}ES.isReloading=true;try{const t=ts();const n=await yS(t);await hS();const e=await wS(t,n);for(const t of e){ns(t.newState.uid,t.oldState,t.newState)}await Eo(`Editor.rerender`)}finally{ES.isReloading=false}};const IS=async t=>{try{await Ro(t)}catch{await xo("SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker",t,"HandleMessagePort.handleMessagePort")}};const SS=async()=>{try{const t=await Rn({commandMap:{},send:IS});return t}catch(t){throw new k(t,`Failed to create syntax highlighting worker rpc`)}};const kS=async(t,n)=>{if(t){$c(true);const t=await SS();_c(t)}if(n){Qr(true)}};const vS=async()=>{const t="Completion Worker";const n="completionWorkerMain.js";const e="Completions.initialize";const o=await Yo(t,n,e);return o};const CS=async(t,n)=>{hm(vS);await kS(t,n)};const bS="editor.lineHeight";const MS="editor.fontSize";const AS="editor.fontFamily";const LS="editor.letterSpacing";const PS="editor.tabSize";const FS="editor.lineNumbers";const WS="editor.diagnostics";const TS="editor.quickSuggestions";const RS="editor.autoClosingQuotes";const DS="editor.autoclosingBrackets";const OS="editor.fontWeight";const BS=async()=>Boolean(await Ia(DS));const NS=async()=>Boolean(await Ia(RS));const HS=async()=>Boolean(await Ia(TS));const zS=async()=>true;const $S=async()=>await Ia(bS)||20;const US=async()=>await Ia(MS)||15;const YS=async()=>await Ia(AS)||"Fira Code";const _S=async()=>await Ia(LS)??.5;const VS=async()=>await Ia(PS)||2;const jS=async()=>await Ia(FS)??false;const qS=async()=>[".","/"];const GS=async()=>await Ia(WS)??false;const XS=async()=>await Ia(OS)??400;const ZS=async()=>{const[t,n,e,o,s,c,r,i,a,d,l,u,f]=await Promise.all([GS(),YS(),US(),XS(),BS(),NS(),zS(),HS(),jS(),$S(),VS(),_S(),qS()]);return{completionTriggerCharacters:f,diagnosticsEnabled:t,fontFamily:n,fontSize:e,fontWeight:o,isAutoClosingBracketsEnabled:s,isAutoClosingQuotesEnabled:c,isAutoClosingTagsEnabled:r,isQuickSuggestionsEnabled:i,letterSpacing:u,lineNumbers:a,rowHeight:d,tabSize:l}};const QS=(t,n)=>{for(const e of t){if(e?.id===n){return e.tokenize||""}}return""};const KS=t=>{if(t instanceof Error){return t.message}return String(t)};const JS=async(t,n)=>{const{assetDir:e,height:o,id:s,platform:c,uri:r,width:i,x:a,y:d}=t;const{completionTriggerCharacters:l,diagnosticsEnabled:u,fontFamily:f,fontSize:h,fontWeight:g,isAutoClosingBracketsEnabled:m,isAutoClosingQuotesEnabled:w,isAutoClosingTagsEnabled:p,isQuickSuggestionsEnabled:y,letterSpacing:E,lineNumbers:x,rowHeight:I,tabSize:S}=await ZS();const k=await xa(g,h,f,E);const v=await Ea(c,e);Qc(v);const C=ya(r,v);const b=QS(v,C);await er(C,b);const M=or(C);const A=t.tokenizerId+1;cr(A,M);const L={...t,charWidth:k,completionTriggerCharacters:l,diagnosticsEnabled:u,fontFamily:f,fontSize:h,fontWeight:g,isAutoClosingBracketsEnabled:m,isAutoClosingQuotesEnabled:w,isAutoClosingTagsEnabled:p,isQuickSuggestionsEnabled:y,languageId:C,letterSpacing:E,lineNumbers:x,loadError:"",rowHeight:I,tabSize:S,tokenizerId:A};let P="";try{P=await vo(r)}catch(t){const n=ra(L,a,d,i,o,9);return{...n,differences:[],focus:ro,focused:true,initial:false,loadError:KS(t),textInfos:[]}}const F=ra(L,a,d,i,o,9);const W=ia(F,P);let T=W;const R=li(T);const D={...T,decorations:R};const O=Kr();const{differences:B,textInfos:N}=await _r(D,O);const H={...D,differences:B,focus:ro,focused:true,textInfos:N};await fa(ua,r,s,C,P);const z=u?await Da(H):H;const $=await Ia("editor.completionsOnType");const U=Boolean($);const Y={...z,completionsOnType:U,initial:false};return Y};const tk=t=>t;const nk=t=>t;const ek=(t,n)=>{g(t);g(n);gi(t,n)};const ok=(t,n,e,o,s,c)=>{const r=`.Editor[data-uid="${t}"]`;return`${r} {\n --EditorRowHeight: ${n}px;\n --ScrollBarHeight: ${e}px;\n --ScrollBarTop: ${o}px;\n --ScrollBarWidth: ${s}px;\n --ScrollBarLeft: ${c}px;\n}\n${r} .EditorRow {\n height: var(--EditorRowHeight);\n line-height: var(--EditorRowHeight);\n}\n${r} .ScrollBarThumbVertical {\n height: var(--ScrollBarHeight);\n translate: 0px var(--ScrollBarTop);\n}\n${r} .ScrollBarThumbHorizontal {\n width: var(--ScrollBarWidth);\n translate: var(--ScrollBarLeft) 0px;\n}\n`};const sk=(t,n,e)=>{const o=t/n*e;if(!Number.isFinite(o)){return 0}return o};const ck=(t,n)=>{const{deltaX:e,deltaY:o,finalDeltaY:s,height:c,longestLineWidth:r,minimumSliderSize:i,rowHeight:a,scrollBarHeight:d,uid:l,width:u}=n;const f=jr(o,s,c,d);const h=qr(u,r,i);const g=sk(e,r,u);const m=ok(l,a,d,f,h,g);return[oo,l,m]};const rk=(t,n)=>{const e=".EditorInput textarea";return[eo,n.uid,e]};const ik=(t,n)=>[so,n.uid,ro];const ak=1;const dk=2;const lk=3;const uk=4;const fk=6;const hk=7;const gk=8;const mk=9;const wk=10;const pk=11;const yk=t=>t!=="type"&&t!=="childCount";const Ek=t=>{const n=Object.keys(t).filter(yk);return n};const xk=t=>{const n=[];let e=0;while(e<t.length){const o=t[e];const{children:s,nodesConsumed:c}=Ik(t,e+1,o.childCount||0);n.push({node:o,children:s});e+=1+c}return n};const Ik=(t,n,e)=>{if(e===0){return{children:[],nodesConsumed:0}}const o=[];let s=n;let c=e;let r=0;while(c>0&&s<t.length){const n=t[s];const e=n.childCount||0;const{children:i,nodesConsumed:a}=Ik(t,s+1,e);o.push({node:n,children:i});const d=1+a;s+=d;r+=d;c--}return{children:o,nodesConsumed:r}};const Sk=(t,n)=>{if(t.type!==n.type){return null}const e=[];if(t.type===jn){if(t.uid!==n.uid){e.push({type:pk,uid:n.uid})}return e}if(t.type===Vn&&n.type===Vn){if(t.text!==n.text){e.push({type:ak,value:n.text})}return e}const o=Ek(t);const s=Ek(n);for(const o of s){if(t[o]!==n[o]){e.push({type:lk,key:o,value:n[o]})}}for(const t of o){if(!Object.hasOwn(n,t)){e.push({type:uk,key:t})}}return e};const kk=t=>{const n=[t.node];for(const e of t.children){n.push(...kk(e))}return n};const vk=(t,n,e)=>{if(n===-1){t.push({type:hk,index:e});return e}if(n!==e){t.push({type:wk,index:e})}return e};const Ck=(t,n)=>{if(n>=0){t.push({type:gk})}return-1};const bk=(t,n)=>{n.push({type:fk,nodes:kk(t)})};const Mk=(t,n)=>{n.push({type:dk,nodes:kk(t)})};const Ak=(t,n,e,o,s)=>{const c=Sk(t.node,n.node);if(c===null){const t=vk(e,o,s);Mk(n,e);return t}const r=t.children.length>0||n.children.length>0;if(c.length===0&&!r){return o}const i=vk(e,o,s);if(c.length>0){e.push(...c)}if(r){Pk(t.children,n.children,e)}return i};const Lk=(t,n,e)=>{const o=Sk(t.node,n.node);if(o===null){Mk(n,e);return}if(o.length>0){e.push(...o)}if(t.children.length>0||n.children.length>0){Pk(t.children,n.children,e)}};const Pk=(t,n,e)=>{const o=Math.max(t.length,n.length);let s=-1;const c=[];for(let r=0;r<o;r++){const o=t[r];const i=n[r];if(!o&&!i){continue}if(!o){s=Ck(e,s);bk(i,e);continue}if(!i){c.push(r);continue}s=Ak(o,i,e,s,r)}Ck(e,s);for(let t=c.length-1;t>=0;t--){e.push({type:mk,index:c[t]})}};const Fk=(t,n,e,o)=>{if(o.length===0&&t.length===1&&n.length===1){Lk(t[0],n[0],e);return}Pk(t,n,e)};const Wk=t=>{let n=-1;for(let e=t.length-1;e>=0;e--){const o=t[e];if(o.type!==hk&&o.type!==gk&&o.type!==wk){n=e;break}}return n===-1?[]:t.slice(0,n+1)};const Tk=(t,n)=>{const e=xk(t);const o=xk(n);const s=[];Fk(e,o,s,[]);return Wk(s)};const Rk=()=>[{childCount:1,className:"EditorInput",type:kx},{ariaAutoComplete:"list",ariaMultiLine:"true",ariaRoleDescription:"editor",autocapitalize:"off",autocomplete:"off",autocorrect:"off",childCount:0,name:"editor",onBeforeInput:tx,onBlur:nx,onCompositionEnd:ox,onCompositionStart:sx,onCompositionUpdate:cx,onCut:ix,onFocus:ax,onPaste:ux,role:"textbox",spellcheck:false,type:Mx,wrap:"off"}];const Dk=t=>{const n=Array.from(t,t=>({childCount:0,className:zE,translate:t,type:kx}));return n};const Ok=t=>{const n=Dk([...t]);return[{childCount:t.length,className:"LayerCursor",type:kx},...n]};const Bk="error";const Nk="warning";const Hk=t=>{switch(t){case Bk:return DE;case Nk:return OE;default:return DE}};const zk=(...t)=>t.filter(Boolean).join(" ");const $k=t=>{const{height:n,type:e,width:o,x:s,y:c}=t;const r=Hk(e);return[{childCount:0,className:zk(HE,r),height:n,left:s,top:c,type:kx,width:o}]};const Uk=t=>{const n=t.flatMap($k);return n};const Yk=t=>{const n=Uk([...t]);return[{childCount:t.length,className:"LayerDiagnostics",type:kx},...n]};const _k=(t,n,e=true,o=-1)=>{const s=[];for(let e=0;e<t.length;e++){const c=t[e];const r=n[e];let i=$E;if(e===o){i+=" "+UE}s.push({childCount:c.length/2,className:i,translate:Fi(r),type:kx});for(let t=0;t<c.length;t+=2){const n=c[t];const e=c[t+1];s.push({childCount:1,className:e,type:Cx},Ax(n))}}return s};const Vk=(t,n,e=true,o=-1)=>{const s=_k(t,n,e,o);return[{childCount:t.length,className:"EditorRows",onMouseDown:dx,onPointerDown:fx,onWheel:Sx,type:kx},...s]};const jk=t=>{const n=[];for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];n.push({childCount:0,className:YE,height:r,left:o,top:s,type:kx,width:c})}return n};const qk=t=>{const n=jk(t);return[{childCount:t.length/4,className:"Selections",type:kx},...n]};const Gk=(t,n,e,o=true,s=-1,c=[],r=[])=>[{childCount:4,className:"EditorLayers",type:kx},...qk(t),...Vk(n,e,o,s),...Ok(c),...Yk(r)];const Xk=t=>[{childCount:t.length,className:"EditorScrollBarDiagnostics",type:kx},...Uk([...t])];const Zk=()=>[{childCount:1,className:"ScrollBar ScrollBarVertical",onContextMenu:rx,onPointerDown:Ex,type:kx},{childCount:0,className:"ScrollBarThumb ScrollBarThumbVertical",type:kx},{childCount:1,className:"ScrollBar ScrollBarHorizontal",onPointerDown:wx,type:kx},{childCount:0,className:"ScrollBarThumb ScrollBarThumbHorizontal",type:kx}];const Qk=({cursorInfos:t=[],diagnostics:n=[],differences:e,highlightedLine:o=-1,lineNumbers:s=true,scrollBarDiagnostics:c=[],selectionInfos:r=[],textInfos:i})=>[{childCount:5,className:"EditorContent",onMouseMove:lx,type:kx},...Rk(),...Gk(r,i,e,s,o,t,n),...Xk(c),...Zk()];const Kk=t=>[{childCount:1,className:"LineNumber",type:Cx},Ax(t)];const Jk=t=>{const n=t.flatMap(Kk);return n};const tv=t=>{const n=Jk([...t]);return[{childCount:t.length,className:"Gutter",type:kx},...n]};const nv=({cursorInfos:t=[],diagnostics:n=[],differences:e,gutterInfos:o=[],highlightedLine:s=-1,lineNumbers:c=true,loadError:r="",scrollBarDiagnostics:i=[],selectionInfos:a=[],textInfos:d,uid:l})=>{if(r){return[{childCount:2,className:"Viewlet TextEditorError","data-uid":l,role:"code",type:kx},{childCount:0,className:"EditorTextIcon EditorTextIconError MaskIcon MaskIconError",type:kx},{childCount:1,className:"TextEditorErrorMessage",type:kx},Ax(r)]}const u=c?tv(o):[];return[{childCount:c?2:1,className:"Viewlet Editor","data-uid":l,onContextMenu:rx,role:"code",type:kx},...u,...Qk({cursorInfos:t,diagnostics:n,differences:e,highlightedLine:s,lineNumbers:c,scrollBarDiagnostics:i,selectionInfos:a,textInfos:d})]};const ev=new Map;const ov=t=>ev.get(t);const sv=(t,n)=>{ev.set(t,n)};const cv=t=>{const{initial:n,textInfos:e}=t;if(n&&e.length===0){return[]}return nv(t)};const rv=(t,n)=>{const e=t.initial?cv(t):ov(n.uid)||cv(t);const o=cv(n);const s=Tk(e,o);if(s.length===0){return[]}sv(n.uid,o);return[co,n.uid,s]};const iv=t=>{const n=Fs(t.id);if(!n){throw new Error("unsupported widget")}return n.add(t)};const av=t=>{const n=Fs(t.id);if(!n){throw new Error("unsupported widget")}return n.render(t)};const dv=t=>{const n=Fs(t.id);if(!n){throw new Error("unsupported widget")}return n.remove(t)};const lv=(t,n)=>{const e=[];const o=[];const s=[];const c=t.widgets||[];const r=n.widgets||[];const i=Object.create(null);const a=Object.create(null);for(const t of c){i[t.id]=t}for(const t of r){a[t.id]=t}for(const t of c){if(Object.hasOwn(a,t.id)){o.push(a[t.id])}else{s.push(t)}}for(const t of r){if(Object.hasOwn(i,t.id));else{e.push(t)}}const d=[];for(const t of e){const n=iv(t);if(n.length>0){d.push(...n)}}const l=[];for(const t of o){const n=av(t);if(n.length>0){l.push(...n)}}const u=[];for(const t of s){const n=dv(t);if(n.length>0){u.push(...n)}}const f=[...d,...l,...u];return f.filter(t=>t[0]!=="Viewlet.setFocusContext")};const uv=t=>{switch(t){case Ya:return ck;case $a:return rk;case Ua:return ik;case _a:return rv;case Va:return lv;default:throw new Error("unknown renderer")}};const fv=(t,n,e)=>{const o=[];for(const s of e){const e=uv(s);const c=e(t,n);if(c.length>0){if(s===Va){o.push(...c)}else{o.push(c)}}}return o};const hv=(t,n)=>{const{newState:e,oldState:o}=Jo(t);ns(t,e,e);const s=fv(o,e,n);return s};const gv={apply(t,n){const{incrementalEdits:e}=n;if(e!==es){return["setIncrementalEdits",e]}const{differences:o,textInfos:s}=n;n.differences=o;const{highlightedLine:c,minLineY:r}=n;const i=c-r;const a=_k(s,o,true,i);return["setText",a]},isEqual:(t,n)=>t.lines===n.lines&&t.tokenizerId===n.tokenizerId&&t.minLineY===n.minLineY&&t.decorations===n.decorations&&t.embeds===n.embeds&&t.deltaX===n.deltaX&&t.width===n.width&&t.highlightedLine===n.highlightedLine&&t.debugEnabled===n.debugEnabled};const mv={apply:(t,n)=>{const{cursorInfos:e=[],selectionInfos:o=[]}=n;const s=Dk(e);const c=jk(o);return["setSelections",s,c]},isEqual:(t,n)=>t.cursorInfos===n.cursorInfos&&t.selectionInfos===n.selectionInfos};const wv={apply:ck,isEqual:Na};const pv={apply:(t,n)=>["setFocused",n.focused],isEqual:(t,n)=>t.focused===n.focused};const yv={apply:(t,n)=>[so,n.uid,n.focus,0,n.uid,"Editor"],isEqual:(t,n)=>t.focus===n.focus};const Ev={apply(t,n){if(n.additionalFocus){return["Viewlet.setAdditionalFocus",n.uid,n.additionalFocus]}return["viewlet.unsetAdditionalFocus",n.uid,n.additionalFocus]},isEqual:(t,n)=>t.additionalFocus===n.additionalFocus};const xv={apply(t,n){const e=Uk(n.visualDecorations||[]);return["setDecorationsDom",e]},isEqual:(t,n)=>t.visualDecorations===n.visualDecorations};const Iv={apply(t,n){const{lineNumbers:e,maxLineY:o,minLineY:s}=n;if(!e){return[]}const c=[];for(let t=s;t<o;t++){c.push(t+1)}const r=Jk(c);return["renderGutter",r]},isEqual:(t,n)=>t.lineNumbers===n.lineNumbers&&t.minLineY===n.minLineY&&t.maxLineY===n.maxLineY};const Sv={apply:lv,isEqual:(t,n)=>t.widgets===n.widgets,multiple:true};const kv=[gv,mv,wv,pv,xv,Iv,Sv,yv,Ev];const vv=async t=>{const n=Jo(t);if(!n){return[]}const{newState:e,oldState:o}=n;const s=[];ns(t,e,e);for(const t of kv){if(t.isEqual(o,e)){continue}const n=await t.apply(o,e);if(t.multiple){s.push(...n)}else if(n.length>0){s.push(n)}}return s};const Cv=()=>[{name:ax,params:["handleFocus"]},{name:lx,params:["handleMouseMove",Xn,Zn,qn]},{name:nx,params:["handleBlur"]},{name:tx,params:["handleBeforeInput","event.inputType","event.data"],preventDefault:true},{name:sx,params:["compositionStart","event.data"]},{name:cx,params:["compositionUpdate","event.data"]},{name:ox,params:["compositionEnd","event.data"]},{name:ix,params:["cut"],preventDefault:true},{name:ux,params:["paste",'event.clipboardData ? event.clipboardData.getData("text/plain") : ""'],preventDefault:true},{name:dx,params:["handleMouseDown","event.button","event.altKey","event.ctrlKey",Xn,Zn,"event.detail"]},{name:fx,params:["handlePointerDown","event.button","event.altKey","event.ctrlKey",Xn,Zn,"event.detail"],trackPointerEvents:[hx,gx]},{name:hx,params:["handlePointerMove",Xn,Zn,qn]},{name:gx,params:["handlePointerUp"]},{name:Sx,params:["handleWheel",Qn,"event.deltaX",Kn],passive:true},{name:rx,params:["handleContextMenu",Gn,Xn,Zn],preventDefault:true},{name:Ex,params:["handleScrollBarVerticalPointerDown",Zn],preventDefault:true,trackPointerEvents:[xx,Ix]},{name:xx,params:["handleScrollBarVerticalPointerMove",Zn]},{name:Ix,params:["handlePointerUp"]},{name:wx,params:["handleScrollBarHorizontalPointerDown",Xn],trackPointerEvents:[px,yx]},{name:px,params:["handleScrollBarHorizontalMove",Xn]},{name:yx,params:["handlePointerUp"]}];const bv=(t,n)=>{const{lines:e}=t;return{lines:e}};const Mv=async(t,n,e)=>{await bo(t,e)};const Av=async(t,n)=>{await Fo(t,n)};const Lv=(t,n)=>t;const Pv=(t,n)=>{g(t);g(n);mi(t,n)};const Fv=async(t,...n)=>{const e=Un(Ge);return e.invoke(t,...n)};const Wv=async t=>{const n=await Fv("RunAndDebug.getHighlight",t);return n};const Tv=()=>{const t=ts();return parseInt(t[0])};const Rv=async t=>{const n=await Wv(t);const e=Tv();const o=Jo(e);if(!o){return}const{newState:s,oldState:c}=o;const r={...s,highlightedLine:n.rowIndex};ns(e,c,r);await Eo("Editor.rerender",e)};const Dv=t=>async(n,...e)=>{const o=Jo(n);const s=o.newState;const c=await t(s,...e);if(s===c){return c}const r=await Ig(s,c);ns(n,s,r);return r};const Ov={"ActivateByEvent.activateByEvent":zo,"CodeGenerator.accept":$o,"ColorPicker.loadContent":Go,"Editor.addCursorAbove":Dv(Ka),"Editor.addCursorBelow":Dv(td),"Editor.applyDocumentEdits":Dv(sd),"Editor.applyEdit":Dv(cd),"Editor.applyEdit2":jI,"Editor.applyWorkspaceEdit":Dv(id),"Editor.braceCompletion":Dv(Md),"Editor.cancelSelection":Dv(Ad),"Editor.closeCodeGenerator":Dv(Wd),"Editor.closeFind":Dv(Rd),"Editor.closeFind2":VI,"Editor.closeRename":Dv(zd),"Editor.closeSourceAction":Dv(Ud),"Editor.closeWidget2":_I,"Editor.compositionEnd":Dv(Jd),"Editor.compositionStart":Dv(Zd),"Editor.compositionUpdate":Dv(Kd),"Editor.contextMenu":Dv(Nh),"Editor.copy":Dv(ol),"Editor.copyLineDown":Dv(sl),"Editor.copyLineUp":Dv(cl),"Editor.create":Ba,"Editor.create2":us,"Editor.cursorCharacterLeft":Dv(Ql),"Editor.cursorCharacterRight":Dv(eu),"Editor.cursorDown":Dv(cu),"Editor.cursorEnd":Dv(ru),"Editor.cursorHome":Dv(iu),"Editor.cursorLeft":Dv(Ql),"Editor.cursorRight":Dv(eu),"Editor.cursorSet":Dv(au),"Editor.cursorUp":Dv(fu),"Editor.cursorWordLeft":Dv(hu),"Editor.cursorWordPartLeft":Dv(gu),"Editor.cursorWordPartRight":Dv(mu),"Editor.cursorWordRight":Dv(wu),"Editor.cut":Dv(Eu),"Editor.deleteAll":Dv(xu),"Editor.deleteAllLeft":Dv(bu),"Editor.deleteAllRight":Dv(Lu),"Editor.deleteCharacterLeft":Dv(Pu),"Editor.deleteCharacterRight":Dv(Fu),"Editor.deleteHorizontalRight":Dv(Au),"Editor.deleteLeft":Dv(Pu),"Editor.deleteRight":Dv(Fu),"Editor.deleteWordLeft":Dv(Wu),"Editor.deleteWordPartLeft":Dv(Tu),"Editor.deleteWordPartRight":Dv(Ru),"Editor.deleteWordRight":Dv(Du),"Editor.diff2":Za,"Editor.executeWidgetCommand":Dv(gI),"Editor.findAllReferences":Dv(Ou),"Editor.format":Dv($u),"Editor.getCommandIds":Zo,"Editor.getDiagnostics":GI,"Editor.getKeyBindings":ZI,"Editor.getKeys":QI,"Editor.getLanguageId":OI,"Editor.getLines2":$I,"Editor.getMenuEntries":nS,"Editor.getMenuEntries2":nS,"Editor.getMenuIds":eS,"Editor.getOffsetAtCursor":BI,"Editor.getPositionAtCursor":RI,"Editor.getProblems":sS,"Editor.getQuickPickMenuEntries":cS,"Editor.getSelections":rS,"Editor.getSelections2":UI,"Editor.getSourceActions":qI,"Editor.getText":iS,"Editor.getUri":DI,"Editor.getWordAt":ju,"Editor.getWordAt2":NI,"Editor.getWordAtOffset2":HI,"Editor.getWordBefore":qu,"Editor.getWordBefore2":zI,"Editor.goToDefinition":Dv(xh),"Editor.goToTypeDefinition":Dv(bh),"Editor.handleBeforeInput":Dv(dS),"Editor.handleBeforeInputFromContentEditable":Dv(fg),"Editor.handleBlur":Dv(ad),"Editor.handleClickAtPosition":Dv(Oh),"Editor.handleContextMenu":Dv(Nh),"Editor.handleDoubleClick":Dv(Yh),"Editor.handleFocus":Dv(_h),"Editor.handleMouseDown":Dv(tg),"Editor.handleMouseMove":Dv(ig),"Editor.handleMouseMoveWithAltKey":Dv(dg),"Editor.handleNativeSelectionChange":hg,"Editor.handlePointerCaptureLost":Dv(gg),"Editor.handlePointerDown":Dv(mg),"Editor.handlePointerMove":Dv(Rg),"Editor.handlePointerUp":Dv(Dg),"Editor.handleScrollBarClick":Ug,"Editor.handleScrollBarHorizontalMove":Dv(Bg),"Editor.handleScrollBarHorizontalPointerDown":Dv(Ng),"Editor.handleScrollBarMove":Dv(zg),"Editor.handleScrollBarPointerDown":Dv(Ug),"Editor.handleScrollBarVerticalMove":Dv($g),"Editor.handleScrollBarVerticalPointerDown":Dv(Ug),"Editor.handleScrollBarVerticalPointerMove":Dv($g),"Editor.handleSingleClick":Dv(Xh),"Editor.handleTab":Dv(fS),"Editor.handleTouchEnd":Dv(Yg),"Editor.handleTouchMove":Dv(Xg),"Editor.handleTouchStart":Dv(Vg),"Editor.handleTripleClick":Dv(Kh),"Editor.handleWheel":Dv(Zg),"Editor.hotReload":xS,"Editor.indendLess":Dv(Kg),"Editor.indentMore":Dv(tm),"Editor.insertLineBreak":Dv(cm),"Editor.loadContent":Dv(JS),"Editor.moveLineDown":Dv(tk),"Editor.moveLineUp":Dv(nk),"Editor.moveRectangleSelection":Dv(wg),"Editor.moveRectangleSelectionPx":Dv(pg),"Editor.moveSelection":Dv(Pg),"Editor.moveSelectionPx":Dv(Tg),"Editor.offsetAt":Wr,"Editor.openCodeGenerator":Dv(lm),"Editor.openColorPicker":Dv(Gd),"Editor.openCompletion":Dv(mm),"Editor.openFind":Dv(bm),"Editor.openFind2":Dv(Cm),"Editor.openRename":Dv(Pm),"Editor.organizeImports":Dv(Wm),"Editor.paste":Dv(Rm),"Editor.pasteText":Dv(Tm),"Editor.redo":Dv(Dm),"Editor.render":vv,"Editor.render2":hv,"Editor.renderEventListeners":Cv,"Editor.replaceRange":Dv(dd),"Editor.rerender":Dv(qx),"Editor.resize":Dv(yi),"Editor.save":Dv(Jm),"Editor.saveState":Ko(bv),"Editor.selectAll":Dv(tw),"Editor.selectAllLeft":Dv(ow),"Editor.selectAllOccurrences":Dv(gw),"Editor.selectAllRight":Dv(pw),"Editor.selectCharacterLeft":Dv(yw),"Editor.selectCharacterRight":Dv(Ew),"Editor.selectDown":Dv(Iw),"Editor.selectInsideString":Dv(kw),"Editor.selectionGrow":Dv(Cw),"Editor.selectLine":Dv(Qh),"Editor.selectNextOccurrence":Dv(Lw),"Editor.selectPreviousOccurrence":Dv(Pw),"Editor.selectUp":Dv(Ww),"Editor.selectWord":Dv(Uh),"Editor.selectWordLeft":Dv(Tw),"Editor.selectWordRight":Dv(Rw),"Editor.setDebugEnabled":Dv(Lv),"Editor.setDecorations":Dv(Dw),"Editor.setDelta":Dv(Gg),"Editor.setDeltaY":Dv(jg),"Editor.setLanguageId":Dv(Ow),"Editor.setSelections":Dv(Bw),"Editor.setSelections2":YI,"Editor.setText":Dv(Nw),"Editor.showHover":qw,"Editor.showHover2":Vw,"Editor.showSourceActions":tp,"Editor.showSourceActions2":tp,"Editor.showSourceActions3":tp,"Editor.sortLinesAscending":Dv(cp),"Editor.tabCompletion":Dv(fp),"Editor.terminate":e,"Editor.toggleBlockComment":Dv(Ep),"Editor.toggleComment":Dv(vp),"Editor.toggleLineComment":Dv(kp),"Editor.type":Dv(Cp),"Editor.typeWithAutoClosing":Dv(Yp),"Editor.undo":Dv(Vp),"Editor.unIndent":Dv(jp),"Editor.updateDebugInfo":Rv,"Editor.updateDiagnostics":Dv(Oa),"EditorCompletion.close":yy,"EditorCompletion.closeDetails":Ey,"EditorCompletion.focusFirst":xy,"EditorCompletion.focusIndex":Iy,"EditorCompletion.focusNext":ky,"EditorCompletion.focusPrevious":vy,"EditorCompletion.handleEditorBlur":Cy,"EditorCompletion.handleEditorClick":by,"EditorCompletion.handleEditorDeleteLeft":My,"EditorCompletion.handleEditorType":Ay,"EditorCompletion.handlePointerDown":Ly,"EditorCompletion.handleWheel":Py,"EditorCompletion.openDetails":Fy,"EditorCompletion.selectCurrent":Wy,"EditorCompletion.selectIndex":Ty,"EditorCompletion.toggleDetails":Ry,"EditorRename.accept":Yx,"EditorRename.close":_x,"EditorRename.handleInput":Vx,"EditorSourceAction.close":nI,"EditorSourceAction.closeDetails":eI,"EditorSourceAction.focusFirst":oI,"EditorSourceAction.focusIndex":sI,"EditorSourceAction.focusNext":rI,"EditorSourceAction.focusPrevious":iI,"EditorSourceAction.handleWheel":aI,"EditorSourceAction.selectCurrent":dI,"EditorSourceAction.selectIndex":lI,"EditorSourceAction.selectItem":uI,"EditorSourceAction.toggleDetails":fI,"EditorSourceActions.focusNext":Xx,"ExtensionHostManagement.activateByEvent":zo,"FindWidget.close":$y,"FindWidget.focusCloseButton":Uy,"FindWidget.focusFind":Yy,"FindWidget.focusNext":_y,"FindWidget.focusNextElement":Vy,"FindWidget.focusNextMatchButton":jy,"FindWidget.focusPrevious":qy,"FindWidget.focusPreviousElement":Gy,"FindWidget.focusPreviousMatchButton":Xy,"FindWidget.focusReplace":Zy,"FindWidget.focusReplaceAllButton":Qy,"FindWidget.focusReplaceButton":Ky,"FindWidget.focusToggleReplace":Jy,"FindWidget.handleBlur":tE,"FindWidget.handleClickButton":nE,"FindWidget.handleFocus":eE,"FindWidget.handleInput":oE,"FindWidget.handleReplaceFocus":sE,"FindWidget.handleReplaceInput":cE,"FindWidget.handleToggleReplaceFocus":rE,"FindWidget.loadContent":km,"FindWidget.replace":iE,"FindWidget.replaceAll":aE,"FindWidget.toggleMatchCase":dE,"FindWidget.toggleMatchWholeWord":lE,"FindWidget.togglePreserveCase":uE,"FindWidget.toggleReplace":fE,"FindWidget.toggleUseRegularExpression":hE,"Font.ensure":XI,"HandleMessagePort.handleMessagePort":lS,"Hover.getHoverInfo":ME,"Hover.handleSashPointerDown":LE,"Hover.handleSashPointerMove":PE,"Hover.handleSashPointerUp":FE,"Hover.loadContent":AE,"Hover.render":Nx,"Initialize.initialize":CS,"Listener.register":ek,"Listener.registerListener":gi,"Listener.unregister":Pv,"SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker":Mv,"SendMessagePortToExtensionManagementWorker.sendMessagePortToExtensionManagementWorker":Av};for(const[t,n]of Object.entries(Ov)){if(t.startsWith("Editor.")){Ov["EditorText"+t.slice("Editor".length)]=n}}const Bv=async()=>{const t="HandleMessagePort.handleMessagePort2";const n=await On({commandMap:{},async send(n){await Mv(n,t,Xe)}});return n};const Nv=async()=>{const t=await Bv();ha(t)};const Hv=async()=>{const t=await On({commandMap:{},async send(t){await Fo(t,Xe)}});return t};const zv=async()=>{try{const t=await Hv();fo(t)}catch{}};const $v=t=>ko(t);const Uv=async()=>{const t=await On({commandMap:{},send:$v});mo(t)};const Yv=async()=>{const t=await Nn({commandMap:Ov});Io(t)};const _v=t=>Po(t);const Vv=async()=>{const t=await On({commandMap:{},send:_v});yo(t)};const jv=async()=>{Qo(Ov);await Promise.all([Yv(),Nv(),zv(),Vv(),Uv()])};const qv="CodeGeneratorInput";const Gv=t=>{const n=zf();const e=$f();return[{childCount:2,className:zk(JE,RE),type:kx},{childCount:0,className:zk(WE,QE),name:qv,placeholder:e,type:vx},{childCount:1,className:TE,type:kx},Ax(n)]};const Xv={apply(t,n){const e=Gv();return[uy,n.uid,e]},isEqual:(t,n)=>t.questions===n.questions};const Zv={apply(t,n){const{height:e,width:o,x:s,y:c}=n;return[ay,s,c,o,e]},isEqual:(t,n)=>t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height};const Qv={apply:(t,n)=>[oy,".CodeGeneratorInput",n.focusSource],isEqual:(t,n)=>t.focused===n.focused&&t.focusSource===n.focusSource};const Kv=[Xv,Zv,Qv];const Jv=(t,n)=>{const e=[];for(const o of Kv){if(!o.isEqual(t,n)){e.push(o.apply(t,n))}}return e};const tC=t=>{const n=Jv(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(t[0]===uy){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const nC=t=>Gp(t,"EditorCodeGenerator",tC);const eC=Zx;const oC={__proto__:null,add:nC,remove:eC,render:tC};const sC=(t,n)=>{const e=[...n.commands];n.commands=[];return e};const cC=[uy,ly,ey,dy,sy,fy];const rC=t=>{const n=sC(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(cC.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const iC=t=>Gp(t,"ColorPicker",rC);const aC=Zx;const dC={};const lC={__proto__:null,Commands:dC,add:iC,remove:aC,render:rC};const uC=t=>{const n=[{childCount:2,className:"Viewlet EditorCompletionDetails",type:kx},{childCount:1,className:NE,type:kx},Ax(t),{childCount:1,className:BE,onClick:ex,type:kx},{childCount:0,className:`${KE} ${ZE}`,type:kx}];return n};const fC=(t,n,e)=>{const o=[];for(const s of t){if(!s.isEqual(n,e)){o.push(s.apply(n,e))}}return o};const hC={apply(t,n){const e=uC(n.content);return[uy,n.uid,e]},isEqual:(t,n)=>t.content===n.content};const gC={apply(t,n){const{height:e,width:o,x:s,y:c}=n;return[ay,s,c,o,e]},isEqual:(t,n)=>t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height};const mC=[hC,gC];const wC=(t,n)=>fC(mC,t,n);const pC=(t,n)=>{const{widgets:e}=t;for(const t of e){if(t.id===n){return t.newState}}return undefined};const yC=t=>pC(t,Te);const EC=t=>{const n=wC(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(t[0]===uy){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const xC=t=>Gp(t,"EditorCompletionDetails",EC);const IC=Zx;const SC=(t,n)=>{const e=yC(t);if(!e){return t}const{x:o}=Mm(t);const s=o+e.width-n.borderSize;return{...n,x:s}};const kC=(t,n)=>SC(t,n);const vC=(t,n)=>SC(t,n);const CC={__proto__:null,add:xC,handleEditorDeleteLeft:vC,handleEditorType:kC,remove:IC,render:EC};const bC=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const MC=t=>{const n=hy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(bC.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const AC=t=>Gp(t,"EditorCompletion",MC);const LC=t=>[["Viewlet.dispose",t.newState.uid]];const{close:PC}=ny(["close"],"",Oe);const FC={__proto__:null,add:AC,close:PC,remove:LC,render:MC};const WC=()=>{Ps(We,lC);Ps(Te,Dy);Ps(Re,CC);Ps(De,gE);Ps(Oe,FC);Ps(Be,jx);Ps(Ne,hI);Ps(Fe,oC)};const TC=t=>{t.preventDefault();console.error(`[editor-worker] Unhandled Rejection: ${t.reason}`)};const RC=(t,n,e,o,s)=>{console.error(`[editor-worker] Unhandled Error: ${s}`);return true};const DC=t=>{t.addEventListener("error",RC);t.addEventListener("unhandledrejection",TC)};const OC=async()=>{DC(globalThis);await jv();WC()};OC();
|
|
1
|
+
const t=t=>{const n=t.indexOf(".");return t.slice(n+1)};const n=()=>{const n=Object.create(null);const e={};return{clear(){for(const t of Object.keys(n)){delete n[t]}},diff(t,e,o){const{oldState:s,scheduledState:c}=n[t];const r=[];for(let t=0;t<e.length;t++){const n=e[t];if(!n(s,c)){r.push(o[t])}}return r},dispose(t){delete n[t]},get(t){return n[t]},getCommandIds(){const n=Object.keys(e);const o=n.map(t);return o},getKeys(){return Object.keys(n).map(Number)},registerCommands(t){Object.assign(e,t)},set(t,e,o,s){n[t]={newState:o,oldState:e,scheduledState:s??o}},wrapCommand(t){const e=async(e,...o)=>{const{newState:s,oldState:c}=n[e];const r=await t(s,...o);if(c===r||s===r){return}const i=n[e];const a={...i.newState,...r};n[e]={newState:a,oldState:i.oldState,scheduledState:a}};return e},wrapGetter(t){const e=(e,...o)=>{const{newState:s}=n[e];return t(s,...o)};return e},wrapLoadContent(t){const e=async(e,...o)=>{const{newState:s,oldState:c}=n[e];const r=await t(s,...o);const{error:i,state:a}=r;if(c===a||s===a){return{error:i}}const d=n[e];const l={...d.newState,...a};n[e]={newState:l,oldState:d.oldState,scheduledState:l};return{error:i}};return e}}};const e=()=>{globalThis.close()};class o extends Error{constructor(t){super(t);this.name="AssertionError"}}const s=1;const c=2;const r=3;const i=4;const a=5;const d=6;const l=7;const u=8;const f=t=>{switch(typeof t){case"number":return c;case"function":return d;case"string":return i;case"object":if(t===null){return l}if(Array.isArray(t)){return r}return s;case"boolean":return a;default:return u}};const h=t=>{const n=f(t);if(n!==s){throw new o("expected value to be of type object")}};const g=t=>{const n=f(t);if(n!==c){throw new o("expected value to be of type number")}};const m=t=>{const n=f(t);if(n!==r){throw new o("expected value to be of type array")}};const w=t=>{const n=f(t);if(n!==i){throw new o("expected value to be of type string")}};const p=t=>{const n=f(t);if(n!==a){throw new o("expected value to be of type boolean")}};const y=t=>{if(t.startsWith("Error: ")){return t.slice("Error: ".length)}if(t.startsWith("VError: ")){return t.slice("VError: ".length)}return t};const E=(t,n)=>{const e=y(`${t}`);if(n){return`${n}: ${e}`}return e};const x="\n";const I=(t,n=undefined)=>t.indexOf(x,n);const S=(t,n)=>{if(!n){return t}const e=I(t);const o=I(n);if(o===-1){return t}const s=t.slice(0,e);const c=n.slice(o);const r=y(n.slice(0,o));if(s.includes(r)){return s+c}return n};class k extends Error{constructor(t,n){const e=E(t,n);super(e);this.name="VError";if(t instanceof Error){this.stack=S(this.stack,t.stack)}if(t.codeFrame){this.codeFrame=t.codeFrame}if(t.code){this.code=t.code}}}const v=t=>t&&t instanceof MessagePort;const C=t=>t&&t.constructor&&t.constructor.name==="MessagePortMain";const b=t=>typeof OffscreenCanvas!=="undefined"&&t instanceof OffscreenCanvas;const M=(t,n)=>t?.constructor?.name===n;const A=t=>M(t,"Socket");const L=[v,C,b,A];const P=t=>{for(const n of L){if(n(t)){return true}}return false};const F=(t,n,e)=>{if(!t){return}if(e(t)){n.push(t);return}if(Array.isArray(t)){for(const o of t){F(o,n,e)}return}if(typeof t==="object"){for(const o of Object.values(t)){F(o,n,e)}return}};const W=t=>{const n=[];F(t,n,P);return n};const T=t=>{const n=(...n)=>{const e=t.getData(...n);t.dispatchEvent(new MessageEvent("message",{data:e}))};t.onMessage(n);const e=n=>{t.dispatchEvent(new Event("close"))};t.onClose(e)};class R extends EventTarget{constructor(t){super();this._rawIpc=t;T(this)}}const D="E_INCOMPATIBLE_NATIVE_MODULE";const O="E_MODULES_NOT_SUPPORTED_IN_ELECTRON";const B="ERR_MODULE_NOT_FOUND";const N="\n";const H=t=>t.join(N);const z=/^\s+at/;const $=/^\s*at async Promise.all \(index \d+\)$/;const U=t=>z.test(t)&&!$.test(t);const Y=t=>{const n=t.findIndex(U);if(n===-1){return{actualMessage:H(t),rest:[]}}let e=n-1;while(++e<t.length){if(!U(t[e])){break}}return{actualMessage:t[n-1],rest:t.slice(n,e)}};const _=t=>t.split(N);const V=/^Error: The module '.*'$/;const j=/^\s* at/;const q=t=>V.test(t);const G=t=>j.test(t);const X=t=>{const n=_(t);const e=n.findIndex(q);const o=e+n.slice(e).findIndex(G,e);const s=n.slice(e,o);const c=s.join(" ").slice("Error: ".length);return c};const Z=t=>t.includes("[ERR_MODULE_NOT_FOUND]");const Q=t=>{const n=_(t);const e=n.findIndex(Z);const o=n[e];return{code:B,message:o}};const K=t=>{if(!t){return false}return t.includes("ERR_MODULE_NOT_FOUND")};const J=t=>{if(!t){return false}return t.includes("SyntaxError: Cannot use import statement outside a module")};const tt=/^innerError Error: Cannot find module '.*.node'/;const nt=/was compiled against a different Node.js version/;const et=t=>tt.test(t)&&nt.test(t);const ot=t=>{const n=X(t);return{code:D,message:`Incompatible native node module: ${n}`}};const st=()=>({code:O,message:`ES Modules are not supported in electron`});const ct=(t,n)=>{if(et(n)){return ot(n)}if(J(n)){return st()}if(K(n)){return Q(n)}const e=_(n);const{actualMessage:o,rest:s}=Y(e);return{code:"",message:o,stack:s}};class rt extends k{constructor(t,n="",e=""){if(n||e){const{code:o,message:s,stack:c}=ct(n,e);const r=new Error(s);r.code=o;r.stack=c;super(r,t)}else{super(t)}this.name="IpcError";this.stdout=n;this.stderr=e}}const it="ready";const at=t=>t.data;const dt=()=>{if(typeof WorkerGlobalScope==="undefined"){throw new TypeError("module is not in web worker scope")}return globalThis};const lt=t=>{t.postMessage(it)};class ut extends R{getData(t){return at(t)}send(t){this._rawIpc.postMessage(t)}sendAndTransfer(t){const n=W(t);this._rawIpc.postMessage(t,n)}dispose(){}onClose(t){}onMessage(t){this._rawIpc.addEventListener("message",t)}}const ft=t=>new ut(t);const ht=async t=>{const{promise:n,resolve:e}=Promise.withResolvers();t.addEventListener("message",e,{once:true});const o=await n;return o.data};const gt=async()=>{const t=dt();lt(t);const n=ft(t);const e=await ht(n);if(e.method!=="initialize"){throw new rt("unexpected first message")}const o=e.params[0];if(o==="message-port"){n.send({id:e.id,jsonrpc:"2.0",result:null});n.dispose();const t=e.params[1];return t}return globalThis};class mt extends R{getData(t){return at(t)}send(t){this._rawIpc.postMessage(t)}sendAndTransfer(t){const n=W(t);this._rawIpc.postMessage(t,n)}dispose(){if(this._rawIpc.close){this._rawIpc.close()}}onClose(t){}onMessage(t){this._rawIpc.addEventListener("message",t);this._rawIpc.start()}}const wt=t=>new mt(t);const pt={__proto__:null,listen:gt,wrap:wt};const yt=(t,n,e)=>{if("addEventListener"in t){t.addEventListener(n,e)}else{t.on(n,e)}};const Et=(t,n,e)=>{if("removeEventListener"in t){t.removeEventListener(n,e)}else{t.off(n,e)}};const xt=(t,n)=>{const{promise:e,resolve:o}=Promise.withResolvers();const s=Object.create(null);const c=e=>{for(const e of Object.keys(n)){Et(t,e,s[e])}o(e)};for(const[e,o]of Object.entries(n)){const n=t=>{c({event:t,type:o})};yt(t,e,n);s[e]=n}return e};const It=3;const St=async({isMessagePortOpen:t,messagePort:n})=>{if(!v(n)){throw new rt("port must be of type MessagePort")}if(t){return n}const e=xt(n,{message:It});n.start();const{event:o,type:s}=await e;if(s!==It){throw new rt("Failed to wait for ipc message")}if(o.data!==it){throw new rt("unexpected first message")}return n};const kt=t=>{t.start()};class vt extends R{getData=at;send(t){this._rawIpc.postMessage(t)}sendAndTransfer(t){const n=W(t);this._rawIpc.postMessage(t,n)}dispose(){this._rawIpc.close()}onMessage(t){this._rawIpc.addEventListener("message",t)}onClose(t){}}const Ct=t=>new vt(t);const bt={__proto__:null,create:St,signal:kt,wrap:Ct};class Mt extends Error{constructor(t){super(`Command not found ${t}`);this.name="CommandNotFoundError"}}const At=Object.create(null);const Lt=t=>{Object.assign(At,t)};const Pt=t=>At[t];const Ft=(t,...n)=>{const e=Pt(t);if(!e){throw new Mt(t)}return e(...n)};const Wt="2.0";const Tt=Object.create(null);const Rt=t=>Tt[t];const Dt=t=>{delete Tt[t]};class Ot extends Error{constructor(t){super(t);this.name="JsonRpcError"}}const Bt="\n";const Nt="DOMException";const Ht="ReferenceError";const zt="SyntaxError";const $t="TypeError";const Ut=(t,n)=>{if(n){switch(n){case Nt:return DOMException;case Ht:return ReferenceError;case zt:return SyntaxError;case $t:return TypeError;default:return Error}}if(t.startsWith("TypeError: ")){return TypeError}if(t.startsWith("SyntaxError: ")){return SyntaxError}if(t.startsWith("ReferenceError: ")){return ReferenceError}return Error};const Yt=(t,n,e)=>{const o=Ut(t,n);if(o===DOMException&&e){return new o(t,e)}if(o===Error){const n=new Error(t);if(e&&e!=="VError"){n.name=e}return n}return new o(t)};const _t=t=>t.join(Bt);const Vt=t=>t.split(Bt);const jt=()=>{const t=3;const n=_t(Vt((new Error).stack||"").slice(t));return n};const qt=(t,n=undefined)=>t.indexOf(Bt,n);const Gt=t=>{let n=t.stack||t.data||t.message||"";if(n.startsWith(" at")){n=t.message+Bt+n}return n};const Xt=-32601;const Zt=-32001;const Qt=t=>{const n=jt();if(t&&t instanceof Error){if(typeof t.stack==="string"){t.stack=t.stack+Bt+n}return t}if(t&&t.code&&t.code===Xt){const e=new Ot(t.message);const o=Gt(t);e.stack=o+Bt+n;return e}if(t&&t.message){const e=Yt(t.message,t.type,t.name);if(t.data){if(t.data.stack&&t.data.type&&t.message){e.stack=t.data.type+": "+t.message+Bt+t.data.stack+Bt+n}else if(t.data.stack){e.stack=t.data.stack}if(t.data.codeFrame){e.codeFrame=t.data.codeFrame}if(t.data.code){e.code=t.data.code}if(t.data.type){e.name=t.data.type}}else{if(t.stack){const n=e.stack||"";const o=qt(n);const s=Gt(t);e.stack=s+n.slice(o)}if(t.codeFrame){e.codeFrame=t.codeFrame}}return e}if(typeof t==="string"){return new Error(`JsonRpc Error: ${t}`)}return new Error(`JsonRpc Error: ${t}`)};const Kt=t=>{if("error"in t){const n=Qt(t.error);throw n}if("result"in t){return t.result}throw new Ot("unexpected response message")};const Jt=(...t)=>{console.warn(...t)};const tn=(t,n)=>{const e=Rt(t);if(!e){console.log(n);Jt(`callback ${t} may already be disposed`);return}e(n);Dt(t)};const nn="E_COMMAND_NOT_FOUND";const en=t=>{if(t&&t.type){return t.type}if(t&&t.constructor&&t.constructor.name){return t.constructor.name}return undefined};const on=t=>t.trim().startsWith("at ");const sn=t=>{const n=t.stack||"";const e=n.indexOf("\n");if(e!==-1&&!on(n.slice(0,e))){return n.slice(e+1)}return n};const cn=(t,n)=>{if(t&&t.code===nn){return{code:Xt,data:t.stack,message:t.message}}return{code:Zt,data:{code:n.code,codeFrame:n.codeFrame,name:n.name,stack:sn(n),type:en(n)},message:n.message}};const rn=(t,n)=>({error:n,id:t,jsonrpc:Wt});const an=(t,n,e,o)=>{const s=e(n);o(n,s);const c=cn(n,s);return rn(t,c)};const dn=(t,n)=>({id:t.id,jsonrpc:Wt,result:n??null});const ln=(t,n)=>{const e=n??null;return dn(t,e)};const un=(t,n)=>({error:{code:Zt,data:n,message:n.message},id:t,jsonrpc:Wt});const fn=async(t,n,e,o,s,c)=>{try{const o=c(t.method)?await e(t.method,n,...t.params):await e(t.method,...t.params);return ln(t,o)}catch(e){if(n.canUseSimpleErrorResponse){return un(t.id,e)}return an(t.id,e,o,s)}};const hn=t=>t;const gn=()=>{};const mn=()=>false;const wn=tn;const pn=t=>{if(t.length===1){const n=t[0];return{execute:n.execute,ipc:n.ipc,logError:n.logError||gn,message:n.message,preparePrettyError:n.preparePrettyError||hn,requiresSocket:n.requiresSocket||mn,resolve:n.resolve||wn}}return{execute:t[2],ipc:t[0],logError:t[5],message:t[1],preparePrettyError:t[4],requiresSocket:t[6],resolve:t[3]}};const yn=async(...t)=>{const n=pn(t);const{execute:e,ipc:o,logError:s,message:c,preparePrettyError:r,requiresSocket:i,resolve:a}=n;if("id"in c){if("method"in c){const t=await fn(c,o,e,r,s,i);try{o.send(t)}catch(t){const n=an(c.id,t,r,s);o.send(n)}return}a(c.id,c);return}if("method"in c){await fn(c,o,e,r,s,i);return}throw new Ot("unexpected message")};const En="2.0";const xn=(t,n)=>({jsonrpc:En,method:t,params:n});const In=(t,n,e)=>{const o={id:t,jsonrpc:En,method:n,params:e};return o};let Sn=0;const kn=()=>++Sn;const vn=t=>{const n=kn();const{promise:e,resolve:o}=Promise.withResolvers();t[n]=o;return{id:n,promise:e}};const Cn=async(t,n,e,o,s)=>{const{id:c,promise:r}=vn(t);const i=In(c,e,o);if(s&&n.sendAndTransfer){n.sendAndTransfer(i)}else{n.send(i)}const a=await r;return Kt(a)};const bn=t=>{const n=Object.create(null);t._resolve=(t,e)=>{const o=n[t];if(!o){console.warn(`callback ${t} may already be disposed`);return}o(e);delete n[t]};const e={async dispose(){await(t?.dispose())},invoke(e,...o){return Cn(n,t,e,o,false)},invokeAndTransfer(e,...o){return Cn(n,t,e,o,true)},ipc:t,send(n,...e){const o=xn(n,e);t.send(o)}};return e};const Mn=()=>false;const An=t=>t;const Ln=()=>{};const Pn=t=>{const n=t?.target?.requiresSocket||Mn;const e=t?.target?.execute||Ft;return yn(t.target,t.data,e,t.target._resolve,An,Ln,n)};const Fn=t=>{if("addEventListener"in t){t.addEventListener("message",Pn)}else if("on"in t){t.on("message",Pn)}};const Wn=async(t,n)=>{const e=await t.listen(n);if(t.signal){t.signal(e)}const o=t.wrap(e);return o};const Tn=async({commandMap:t,isMessagePortOpen:n=true,messagePort:e})=>{Lt(t);const o=await bt.create({isMessagePortOpen:n,messagePort:e});const s=bt.wrap(o);Fn(s);const c=bn(s);e.start();return c};const Rn=async({commandMap:t,isMessagePortOpen:n,send:e})=>{const{port1:o,port2:s}=new MessageChannel;await e(o);return Tn({commandMap:t,isMessagePortOpen:n,messagePort:s})};const Dn=t=>{let n;const e=()=>{if(!n){n=t()}return n};return{async dispose(){const t=await e();await t.dispose()},async invoke(t,...n){const o=await e();return o.invoke(t,...n)},async invokeAndTransfer(t,...n){const o=await e();return o.invokeAndTransfer(t,...n)},async send(t,...n){const o=await e();o.send(t,...n)}}};const On=async({commandMap:t,isMessagePortOpen:n,send:e})=>Dn(()=>Rn({commandMap:t,isMessagePortOpen:n,send:e}));const Bn=async({commandMap:t,messagePort:n})=>Tn({commandMap:t,messagePort:n});const Nn=async({commandMap:t})=>{Lt(t);const n=await Wn(pt);Fn(n);const e=bn(n);return e};const Hn=({commandMap:t})=>{const n=[];const e=(e,...o)=>{n.push([e,...o]);const s=t[e];if(!s){throw new Error(`command ${e} not found`)}return s(...o)};const o={invocations:n,invoke:e,invokeAndTransfer:e};return o};const zn=Object.create(null);const $n=(t,n)=>{zn[t]=n};const Un=t=>zn[t];const Yn=t=>{delete zn[t]};const _n=t=>({async dispose(){const n=Un(t);await n.dispose()},invoke(n,...e){const o=Un(t);return o.invoke(n,...e)},invokeAndTransfer(n,...e){const o=Un(t);return o.invokeAndTransfer(n,...e)},registerMockRpc(n){const e=Hn({commandMap:n});$n(t,e);e[Symbol.dispose]=()=>{Yn(t)};return e},set(n){$n(t,n)}});const Vn=12;const jn=100;const qn="event.altKey";const Gn="event.button";const Xn="event.clientX";const Zn="event.clientY";const Qn="event.deltaMode";const Kn="event.deltaY";const Jn=1;const te=2;const ne=3;const ee=8;const oe=9;const se=255;const ce=12;const re=13;const ie=14;const ae=15;const de=16;const le=18;const ue=29;const fe=31;const he=32;const ge=34;const me=36;const we=38;const pe=39;const ye=40;const Ee=43;const xe=50;const Ie=52;const Se=54;const ke=58;const ve=59;const Ce=60;const be=68;const Me=87;const Ae=88;const Le=90;const Pe=92;const Fe=1;const We=2;const Te=3;const Re=4;const De=5;const Oe=6;const Be=7;const Ne=8;const He=1<<11>>>0;const ze=1<<10>>>0;const $e=1<<9>>>0;const Ue=3;const Ye=22;const _e=1;const Ve=0;const je=2;const qe=301;const Ge=55;const Xe=99;const Ze=44;const Qe=9006;const Ke=7009;const Je=300;const to=4561;const no=1;const eo="Viewlet.focusSelector";const oo="Viewlet.setCss";const so="Viewlet.setFocusContext";const co="Viewlet.setPatches";const ro=12;const{invoke:io,set:ao}=_n(Ze);const lo={__proto__:null,invoke:io,set:ao};const{invoke:uo,set:fo}=_n(Qe);const ho=(t,n)=>uo("Extensions.getLanguages",t,n);const{invoke:go,set:mo}=_n(to);const wo=async(t,n)=>go("Open.openUrl",t,n);const{invoke:po,set:yo}=_n(Ke);const{invoke:Eo,invokeAndTransfer:xo,set:Io}=_n(no);const So=async(t,n,e,o,s)=>{g(t);g(n);g(e);g(o);await Eo("ContextMenu.show2",t,n,e,o,s)};const ko=async(t,n)=>{const e="HandleMessagePort.handleMessagePort";await xo("SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker",t,e,n)};const vo=async t=>Eo("FileSystem.readFile",t);const Co=async()=>Eo("Layout.handleWorkspaceRefresh");const bo=async(t,n=0)=>{const e="HandleMessagePort.handleMessagePort2";await xo("SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker",t,e,n)};const Mo=async t=>{await Eo("ClipBoard.writeText",t)};const Ao=async()=>Eo("ClipBoard.readText");const Lo=(t,n,e)=>Eo("ExtensionHostManagement.activateByEvent",t,n,e);const Po=async t=>{const n="TextMeasurement.handleMessagePort";await xo("SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker",t,n,0)};const Fo=async(t,n)=>{const e="Extensions.handleMessagePort";await xo("SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker",t,e,n)};const Wo=async t=>await Eo("Preferences.get",t);const To=async(t,n,e)=>{await Eo("Main.openUri",t,n,e)};const Ro=async t=>{await xo("SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker",t,"HandleMessagePort.handleMessagePort2")};const Do={__proto__:null,activateByEvent:Lo,getPreference:Wo,handleWorkspaceRefresh:Co,invoke:Eo,invokeAndTransfer:xo,openUri:To,readClipBoardText:Ao,readFile:vo,sendMessagePortToExtensionHostWorker:bo,sendMessagePortToExtensionManagementWorker:Fo,sendMessagePortToOpenerWorker:ko,sendMessagePortToSyntaxHighlightingWorker:Ro,sendMessagePortToTextMeasurementWorker:Po,set:Io,showContextMenu2:So,writeClipBoardText:Mo};const{invoke:Oo,set:Bo}=_n(Je);const No={__proto__:null,invoke:Oo,set:Bo};const Ho=t=>{let n;let e;const o=async()=>{const n=await e();$n(t,n)};const s=async()=>{if(!n){n=o()}await n};return{async invoke(n,...e){await s();const o=Un(t);return o.invoke(n,...e)},async invokeAndTransfer(n,...e){await s();const o=Un(t);return o.invokeAndTransfer(n,...e)},setFactory(t){e=t}}};const zo=async(t,n,e)=>{w(t);await Lo(t,n,e)};const $o=t=>t;const Uo=6;const Yo=async(t,n,e)=>{const o=await Rn({commandMap:{},isMessagePortOpen:true,async send(e){await xo("IpcParent.create",{method:Uo,name:t,port:e,raw:true,url:n})}});if(e){await o.invoke(e)}return o};const _o=async()=>{const t="Color Picker Worker";const n="colorPickerWorkerMain.js";return Yo(t,n)};const Vo={};const jo=()=>{if(!Vo.workerPromise){Vo.workerPromise=_o()}return Vo.workerPromise};const qo=async(t,...n)=>{const e=await jo();return await e.invoke(t,...n)};const Go=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;await qo("ColorPicker.create",o,c,r,s,e,n);await qo("ColorPicker.loadContent",o);const i=await qo("ColorPicker.diff2",o);const a=await qo("ColorPicker.render2",o,i);return{...t,commands:a}};const Xo=n();const{getCommandIds:Zo,registerCommands:Qo,wrapGetter:Ko}=Xo;const Jo=t=>Xo.get(t);const ts=()=>{const t=Xo.getKeys();return t.map(String)};const ns=(t,n,e)=>{Xo.set(t,n,e)};const es=[];const os=41;const ss=9;const cs=0;const rs=16;const is=51;const as=11;const ds=38;const ls=52;const us=(t,n,e,o,s,c,r,i)=>{g(t);const a={additionalFocus:0,assetDir:i,charWidth:0,columnWidth:0,completionState:"",completionTriggerCharacters:[],completionUid:0,cursorInfos:[],cursorWidth:2,debugEnabled:false,decorations:[],deltaX:0,deltaY:0,diagnostics:[],diagnosticsEnabled:false,differences:[],embeds:[],finalDeltaY:0,finalY:0,focus:0,focused:false,focusKey:cs,fontFamily:"",fontSize:0,fontWeight:0,handleOffset:0,handleOffsetX:0,hasListener:false,height:c,highlightedLine:-1,id:t,incrementalEdits:es,initial:true,invalidStartIndex:0,isAutoClosingBracketsEnabled:false,isAutoClosingQuotesEnabled:false,isAutoClosingTagsEnabled:false,isMonospaceFont:false,isQuickSuggestionsEnabled:false,isSelecting:false,itemHeight:20,languageId:"",letterSpacing:0,lineCache:[],lineNumbers:false,lines:[],longestLineWidth:0,maxLineY:0,minimumSliderSize:20,minLineY:0,modified:false,numberOfLines:0,numberOfVisibleLines:0,platform:r,primarySelectionIndex:0,redoStack:[],rowHeight:0,savedSelections:[],scrollBarHeight:0,scrollBarWidth:0,selectionAnchorPosition:{columnIndex:0,rowIndex:0},selectionAutoMovePosition:{columnIndex:0,rowIndex:0},selectionInfos:[],selections:new Uint32Array,tabSize:0,textInfos:[],tokenizerId:0,uid:t,undoStack:[],uri:n,validLines:[],visualDecorations:[],widgets:[],width:s,x:e,y:o};ns(t,a,a)};const fs="compositionUpdate";const hs="contentEditableInput";const gs="delete";const ms="deleteHorizontalRight";const ws="deleteLeft";const ps="editorCut";const ys="editorPasteText";const Es="editorSnippet";const xs="editorType";const Is="editorTypeWithAutoClosing";const Ss="format";const ks="indentLess";const vs="indentMore";const Cs="insertLineBreak";const bs="lineComment";const Ms="rename";const As="toggleBlockComment";const Ls=Object.create(null);const Ps=(t,n)=>{Ls[t]=n};const Fs=t=>Ls[t];const Ws=t=>Fs(t);const Ts=async(t,n,e)=>{const o=Ws(n.id);if(e.length===1&&e[0].origin===xs&&o.handleEditorType){const n=await o.handleEditorType(t);return{...n}}if(e.length===1&&e[0].origin===ws&&o.handleEditorDeleteLeft){const n=await o.handleEditorDeleteLeft(t);return{...n}}return n};const Rs=async(t,n)=>{const e=t.widgets||[];if(e.length===0){return e}let o=t;for(const s of e){o=await Ts(t,s,n)}return o};const Ds=(t,n,e)=>{g(t);g(n);g(e);return Math.min(Math.max(t,n),e)};const Os="Link";const Bs="Function";const Ns="Parameter";const Hs="Type";const zs="VariableName";const $s="Class";const Us=1;const Ys=2816;const _s=2817;const Vs=2824;const js=2825;const qs=2956;const Gs=2857;const Xs=3072;const Zs=3073;const Qs=3077;const Ks=3088;const Js=1792;const tc=1793;const nc=512;const ec=513;const oc=769;const sc=1024;const cc=1536;const rc=1537;const ic=1544;const ac=1545;const dc=2048;const lc=2049;const uc=2056;const fc=2057;const hc=2064;const gc=2080;const mc=2081;const wc=2088;const pc=2089;const yc=2313;const Ec=2560;const xc=2561;const Ic=2569;const Sc=2584;const kc=256;const vc=257;const Cc=272;const bc=t=>{switch(t){case Us:return Os;case sc:case cc:case rc:case ic:case ac:case nc:case ec:case oc:return Hs;case Js:case tc:return Ns;case dc:case lc:case uc:case fc:case hc:case gc:case mc:case wc:case pc:case yc:case Ec:case xc:case Ic:case Sc:return zs;case kc:case vc:case Cc:return $s;case Ys:case _s:case Vs:case js:case qs:case Gs:case Xs:case Zs:case Qs:case Ks:return Bs;default:return`Unknown-${t}`}};const Mc=t=>structuredClone(t);const Ac=t=>Mc(t);const Lc={warned:[]};const Pc=t=>{const n=[];for(const e of t){h(e);n.push(e.type,e.length)}return n};const Fc=(t,n)=>{if(Lc.warned.includes(n)){return}Lc.warned.push(n);console.warn(`tokenizers without hasArrayReturn=false are deprecated (language ${t})`)};const Wc=(t,n,e,o,s)=>{try{const c=n(e,o);if(!c?.tokens||!c.state){throw new Error("invalid tokenization result")}if(!s){Fc(t,n);c.tokens=Pc(c.tokens)}return c}catch(t){console.error(t);return{lineState:o,tokens:[0,e.length]}}};const Tc={TopLevelContent:1};const Rc={Text:1};const Dc={[Rc.Text]:"Text"};const Oc={state:Tc.TopLevelContent};const Bc=true;const Nc=(t,n)=>({state:n.state,tokens:[Rc.Text,t.length]});const Hc={__proto__:null,State:Tc,TokenMap:Dc,TokenType:Rc,hasArrayReturn:Bc,initialLineState:Oc,tokenizeLine:Nc};const zc={enabled:false};const $c=t=>{zc.enabled=t};const Uc=()=>zc.enabled;const{invoke:Yc,set:_c}=No;const Vc={pending:Object.create(null),tokenizePaths:Object.create(null),tokenizers:Object.create(null)};const jc=t=>Object.hasOwn(Vc.tokenizers,t);const qc=(t,n)=>{Vc.tokenizers[t]=n};const Gc=t=>Vc.tokenizers[t];const Xc=(t,n)=>{Vc.tokenizePaths[t]=n};const Zc=t=>Vc.tokenizePaths[t]||"";const Qc=t=>{for(const n of t){if(n&&n.id&&n.tokenize){Xc(n.id,n.tokenize)}}};const Kc=t=>Object.hasOwn(Vc.pending,t);const Jc=Object.create(null);const tr=(t,n)=>{Jc[t]=n};const nr=t=>Jc[t]||{};const er=async(t,n)=>{if(!n){return}Xc(t,n);if(Uc()){const e=await Yc("Tokenizer.load",t,n);tr(t,e);return}try{const e=await import(n);if(typeof e.tokenizeLine!=="function"){console.warn(`tokenizer.tokenizeLine should be a function in "${n}"`);return}if(!e.TokenMap||typeof e.TokenMap!=="object"||Array.isArray(e.TokenMap)){console.warn(`tokenizer.TokenMap should be an object in "${n}"`);return}tr(t,e.TokenMap);qc(t,e)}catch(t){console.error(t)}};const or=t=>{if(jc(t)){return Gc(t)}if(Kc(t)){return Hc}return Hc};const sr=Object.create(null);const cr=(t,n)=>{sr[t]=n};const rr=t=>sr[t]||Hc;const ir=(t,n,e,o,s,c,r)=>{const i=or(e);if(o!==n.length&&i&&i!==Hc){const a=o===0&&s===n.length;const d=n.slice(o,s);const l=Wc(t,i.tokenizeLine,d,c[e]||Ac(i.initialLineState),i.hasArrayReturn);c[e]=l;if(l.embeddedLanguage){const n=ir(t,d,l.embeddedLanguage,l.embeddedLanguageStart,l.embeddedLanguageEnd,c,r);if(n?.isFull){return n}}return{isFull:a,result:l,TokenMap:i.TokenMap}}r.push(e);c[e]=undefined;return{isFull:false,result:{},TokenMap:[]}};const ar=(t,n,e,o)=>{const s=[];const c=[];const r=Object.create(null);for(const i of o){const o=e[i+1];const a=n[i];if(o.embeddedLanguage){const{embeddedLanguage:n,embeddedLanguageEnd:e,embeddedLanguageStart:i}=o;if(a.length===0){const t={tokens:[]};o.embeddedResultIndex=c.length;c.push({isFull:true,result:t,TokenMap:[]})}else{o.embeddedResultIndex=c.length;c.push(ir(t,a,n,i,e,r,s))}}else{for(const t of Object.keys(r)){r[t]=undefined}}}return{embeddedResults:c,tokenizersToLoad:s}};const dr=(t,n,e)=>t<n?n:e;const lr=(t,n,e)=>{const{invalidStartIndex:o,languageId:s,lineCache:c,lines:r,tokenizerId:i}=t;const a=rr(i);const{hasArrayReturn:d,initialLineState:l,tokenizeLine:u}=a;const f=o;const h=dr(o,e,f);const g=[];const m=[];const w=[];for(let t=f;t<h;t++){const n=t===0?Ac(l):c[t];const e=r[t];const o=Wc(s,u,e,n,d);c[t+1]=o;if(o.embeddedLanguage){o.embeddedResultIndex=w.length;w.push(t)}}const p=c.slice(n+1,e+1);if(w.length>0){const{embeddedResults:n,tokenizersToLoad:e}=ar(s,r,c,w);t.invalidStartIndex=0;return{embeddedResults:n,tokenizersToLoad:e,tokens:p}}t.invalidStartIndex=Math.max(o,h);return{embeddedResults:m,tokenizersToLoad:g,tokens:p}};const ur=Object.create(null);const fr=async(t,n,e,o)=>{if(Uc()){if(o){const{id:o,invalidStartIndex:s,languageId:c,lines:r}=t;let i=true;let a=r;if(ur[o]===r){i=false;a=[]}else{ur[o]=r}const d={invalidStartIndex:s,languageId:c};return Yc("GetTokensViewport.getTokensViewport",d,n,e,i,o,a)}return Yc("GetTokensViewport.getTokensViewport",t,n,e,true,t.id,t.lines)}return lr(t,n,e)};const hr=async t=>{for(const n of t){const t=Zc(n);await er(n,t)}};const gr=".";const mr='"';const wr="";const pr="\n";const yr=" ";const Er="\t";const xr=(t,n,e)=>{if(n){return t.replaceAll(Er,()=>yr.repeat(e))}return t};const Ir=t=>t.includes(Er);const Sr=(t,n,e)=>{const o=t.length;const s=e.length;t.length=o+s;for(let e=o-1;e>=n;e--){t[e+s]=t[e]}for(let o=0;o<s;o++){t[o+n]=e[o]}};const kr=(t,n,e,o)=>{const s=t.splice(n,e);Sr(t,n,o);return s};const vr=t=>t.join("\n");const Cr=/^\s+/;const br=t=>{const n=t.match(Cr);if(!n){return""}return n[0]};const Mr=(t,n)=>{h(t);m(n);const e=[...t.lines];let o=0;for(const s of n){const n=s.start.rowIndex+o;const c=s.end.rowIndex+o;const r=s.start.columnIndex;const i=s.end.columnIndex;const{deleted:a,inserted:d}=s;g(n);g(c);g(r);g(i);m(d);m(a);if(n===c){const o=e[n];if(d.length===0){const t=o.slice(0,r);const s=o.slice(i);e[n]=t+s}else if(d.length===1){let t=o.slice(0,r);if(r>o.length){t+=" ".repeat(r-o.length)}const s=o.slice(i);const c=d[0];e[n]=t+c+s}else{const s=o.slice(0,r)+d[0];const c=d.at(-1)+o.slice(i);kr(e,n,a.length,[s,...d.slice(1,-1),c]);t.maxLineY=Math.min(t.numberOfVisibleLines,e.length)}}else{const o=e[n].slice(0,r)+d[0];if(d.length===1){const t=c>=e.length?"":e[c].slice(i);kr(e,n,a.length,[o+t])}else{const t=d.slice(1,-1);const s=d.at(-1)+(c>=e.length?"":e[c].slice(i));kr(e,n,a.length,[o,...t,s])}t.maxLineY=Math.min(t.numberOfVisibleLines,t.lines.length)}o+=d.length-a.length}return e};const Ar=(t,n)=>t.lines[n];const Lr=t=>vr(t.lines);const Pr=(t,n)=>{h(t);const e=n.start.rowIndex;const o=n.start.columnIndex;const s=Math.min(n.end.rowIndex,t.lines.length-1);const c=n.end.columnIndex;if(e===s){return[t.lines[e].slice(o,c)]}const r=[t.lines[e].slice(o),...t.lines.slice(e+1,s),t.lines[s].slice(0,c)];return r};const Fr=async(t,n,e)=>{h(t);g(n);g(e);let o=0;let s=0;const{lines:c}=t;const r=Math.min(n,t.lines.length);while(s<r){o+=c[s].length+1;s++}o+=e;return o};const Wr=(t,n,e)=>{h(t);g(n);g(e);let o=0;let s=0;const{lines:c}=t;const r=Math.min(n,t.lines.length);while(s<r){o+=c[s].length+1;s++}o+=e;return o};const Tr=(t,n)=>{const{lines:e}=t;let o=0;let s=0;let c=0;while(o<e.length&&c<n){c+=e[o].length+1;o++}if(c>n){o--;c-=e[o].length+1;s=n-c}else{s=c-n}return{columnIndex:s,rowIndex:o}};const Rr=10;const Dr=(t,n)=>{let e=0;let o=0;let s=0;const c=t.length;for(let r=0;r<c;r+=2){const c=t[r+1];o+=c;e=o;if(e>=n){e-=c;o-=c;s=r;break}}return{end:o,start:e,startIndex:s}};const Or=(t,n,e)=>{for(const[o,{end:s}]of t){if(o<e&&s>n){return true}}return false};const Br=(t,n)=>{for(const[e,o]of t){if(e<=n&&o.end>n){return o}}return undefined};const Nr=(t,n,e,o,s,c,r,i,a,d,l,u)=>{const f=[];const h=new Map;for(let t=0;t<o.length;t+=4){const n=o[t];const c=o[t+1];const r=o[t+2];const i=n-s;const a=i+c;if(i<e.length&&a>0){const t=bc(r);if(t){h.set(Math.max(0,i),{className:t,end:Math.min(e.length,a)})}}}const g=t[n.embeddedResultIndex];const m=g.result.tokens;const w=g.TokenMap;const p=m.length;let{end:y,start:E,startIndex:x}=Dr(m,l);const I=zr(E,d,a);for(let t=x;t<p;t+=2){const n=m[t];const o=m[t+1];const s=E+o;const i=Or(h,E,s);if(i){let t=E;while(t<s){const o=Br(h,t);let i;let a;let d;if(o){i=Math.min(s,o.end);a=e.slice(t,i);const c=w[n]||"Unknown";d=`Token ${c} ${o.className}`}else{let o=s;for(const[n]of h){if(n>t&&n<s){o=Math.min(o,n)}}i=o;a=e.slice(t,i);d=`Token ${w[n]||"Unknown"}`}const l=xr(a,c,r);f.push(l,d);t=i}}else{const t=e.slice(E,s);const o=`Token ${w[n]||"Unknown"}`;const i=xr(t,c,r);f.push(i,o)}E=s;y=s;if(y>=u){break}}return{difference:I,lineInfo:f}};const Hr=()=>({maxOffset:Infinity,minOffset:0});const zr=(t,n,e)=>{const o=t*n;const s=o-e;return s};const $r=(t,n,e,o,s,c,r,i,a,d,l,u,f)=>{const h=[];const g=new Map;for(let n=0;n<o.length;n+=4){const e=o[n];const s=o[n+1];const r=o[n+2];const i=e-c;const a=i+s;if(i<t.length&&a>0){const n=bc(r);if(n){g.set(Math.max(0,i),{className:n,end:Math.min(t.length,a)})}}}const{tokens:m}=n;let{end:w,start:p,startIndex:y}=Dr(m,u);const E=zr(p,l,d);const x=m.length;for(let n=y;n<x;n+=2){const e=m[n];const o=m[n+1];const c=p+o;const a=Or(g,p,c);if(a){let n=p;while(n<c){const o=Br(g,n);let a;let d;let l;if(o){a=Math.min(c,o.end);d=t.slice(n,a);const r=s[e]||"Unknown";l=`Token ${r} ${o.className}`}else{let o=c;for(const[t]of g){if(t>n&&t<c){o=Math.min(o,t)}}a=o;d=t.slice(n,a);l=`Token ${s[e]||"Unknown"}`}const u=xr(d,r,i);h.push(u,l);n=a}}else{const n=t.slice(p,c);const o=`Token ${s[e]||"Unknown"}`;const a=xr(n,r,i);h.push(a,o)}p=c;w=c;if(w>=f){break}}return{difference:E,lineInfo:h}};const Ur=(t,n,e,o,s,c,r,i,a,d,l)=>{const{maxOffset:u,minOffset:f}=Hr();if(e.length>0&&n.embeddedResultIndex!==undefined){const s=e[n.embeddedResultIndex];if(s?.isFull){return Nr(e,n,t,o,c,r,i,a,d,l,f,u)}}return $r(t,n,e,o,s,c,r,i,a,d,l,f,u)};const Yr=(t,n,e,o,s,c,r,i,a)=>{const d=[];const l=[];const{decorations:u,languageId:f,lines:h}=t;const g=nr(f);let m=c;const w=2;for(let t=o;t<s;t++){const s=h[t];const c=Ir(s);const f=[];for(let t=0;t<u.length;t+=4){const n=u[t];const e=u[t+1];const o=u[t+2];const c=u[t+3];if(n>=m&&n<m+s.length){f.push(n,e,o,c)}}const{difference:p,lineInfo:y}=Ur(s,n[t-o],e,f,g,m,c,w,r,i,a);d.push(y);l.push(p);m+=s.length+1}return{differences:l,result:d}};const _r=async(t,n)=>{const{charWidth:e,deltaX:o,lines:s,minLineY:c,numberOfVisibleLines:r,width:i}=t;const a=Math.min(c+r,s.length);let{embeddedResults:d,tokenizersToLoad:l,tokens:u}=await fr(t,c,a,n);for(let e=0;l.length>0&&e<Rr;e++){await hr(l);const e=await fr(t,c,a,n);({embeddedResults:d,tokenizersToLoad:l,tokens:u}=e)}const f=await Fr(t,c,0);const h=e;const{differences:g,result:m}=Yr(t,u,d,c,a,f,i,o,h);return{differences:g,textInfos:m}};const Vr=(t,n,e,o)=>{const s=t/n*(e-o);if(!Number.isFinite(s)){return 0}return s};const jr=Vr;const qr=(t,n,e)=>{if(t>=n){return 0}return Math.max(Math.round(t**2/n),e)};const Gr=(t,n)=>{if(t>n){return 0}return t**2/n};const Xr=(t,n,e)=>{const o=n/2;if(e<=o){return{handleOffset:e,percent:0}}if(e<=t-o){return{handleOffset:o,percent:(e-o)/(t-n)}}return{handleOffset:n-t+e,percent:1}};const Zr={enabled:false};const Qr=t=>{Zr.enabled=t};const Kr=()=>Zr.enabled;const Jr=async(t,n)=>{h(t);g(n);const{deltaY:e,finalDeltaY:o,height:s,itemHeight:c,numberOfVisibleLines:r,scrollBarHeight:i}=t;const a=Ds(n,0,o);if(e===a){return t}const d=Math.floor(a/c);const l=d+r;const u=jr(a,o,s,i);const f={...t,deltaY:a,maxLineY:l,minLineY:d,scrollBarY:u};const m=Kr();const{differences:w,textInfos:p}=await _r(f,m);const y={...f,differences:w,textInfos:p};return y};const ti=async(t,n)=>{if(!n.undoStack){return es}if(t.undoStack===n.undoStack){return es}const e=n.undoStack.at(-1);if(e&&e.length===1){const o=e[0];if(o.origin===xs){const{rowIndex:e}=o.start;const{lines:s}=n;const c=t.lines[e];const r=s[e];const i=await Yc("TokenizeIncremental.tokenizeIncremental",n.uid,n.languageId,c,r,e,n.minLineY);if(i&&i.length===1){return i}}}return es};const ni=(t,n)=>t.matchAll(n).toArray();const ei=/(?:https?|ftps?|file):\/\/[^\s"']+|www\.[^\s"']+/g;const oi=/^(?:https?|ftp|ftps|file):\/\//;const si=/^www\./;const ci=".,;:!?";const ri={")":"(","]":"[","}":"{",">":"<"};const ii=(t,n)=>{const e=ri[n];let o=0;for(const s of t){if(s===e){o++}else if(s===n){o--}}return o<0};const ai=t=>{let n=t;while(n.length>0){const t=n.at(-1);if(!t){break}if(ci.includes(t)){n=n.slice(0,-1);continue}if(t in ri&&ii(n,t)){n=n.slice(0,-1);continue}break}return n};const di=t=>{const n=ni(t,ei);const e=[];for(const t of n){const n=ai(t[0]);if(oi.test(n)||si.test(n)){e.push({length:n.length,start:t.index??0})}}return e};const li=t=>{const n=[];const{lines:e}=t;let o=0;for(const t of e){const e=di(t);for(const t of e){const e=o+t.start;n.push(e,t.length,Us,0)}o+=t.length+1}return n};const ui=(t,n)=>{const{decorations:e,lines:o}=t;for(let t=0;t<e.length;t+=4){const s=e[t];const c=e[t+1];const r=e[t+2];if(r===Us&&n>=s&&n<s+c){let t=0;for(const n of o){const e=n.length+1;if(t+e>s){const e=s-t;const o=n.slice(e,e+c);return o}t+=e}}}return undefined};const fi=1;const hi=Object.create(null);const gi=(t,n)=>{g(t);g(n);if(!Object.hasOwn(hi,t)){hi[t]=[]}if(!hi[t].includes(n)){hi[t].push(n)}};const mi=(t,n)=>{g(t);g(n);if(Object.hasOwn(hi,t)){const e=hi[t].indexOf(n);if(e!==-1){hi[t].splice(e,1)}}};const wi=t=>{g(t);return hi[t]||[]};const pi=async(t,n,...e)=>{g(t);w(n);const o=wi(t);const s=o.map(async t=>{try{const o=Un(t);if(o){await o.invoke(n,...e)}}catch(n){console.warn(`Failed to notify listener ${t}:`,n)}});await Promise.all(s)};const yi=(t,n,e=t.columnWidth)=>{const o=n.x??t.x;const s=n.y??t.y;const c=n.width??t.width;const r=n.height??t.height;const i=Math.floor(r/t.itemHeight);const a=t.lines.length;const d=Math.max(a-i,0);const l=d*t.itemHeight;const u=Math.min(t.deltaY,l);const f=Math.floor(u/t.itemHeight);const h=Math.min(f+i,a);const g=a*t.rowHeight;const m=qr(r,g,t.minimumSliderSize);return{...t,columnWidth:e,deltaY:u,finalDeltaY:l,finalY:d,height:r,maxLineY:h,minLineY:f,numberOfVisibleLines:i,scrollBarHeight:m,width:c,x:o,y:s}};const Ei=t=>{if(!t){return[""]}return t.split("\n")};const{invoke:xi}=Do;const Ii=async t=>{try{await xi("Main.handleModifiedStatusChange",t,true)}catch{}};const Si=(t,n)=>{const e=t[n];const o=t[n+1];const s=t[n+2];const c=t[n+3];if(e>s||e===s&&o>=c){return[s,c,e,o,1]}return[e,o,s,c,0]};const ki=t=>{let n=0;for(const e of t){if(e===Er){n++}}return n};const vi=/^\p{ASCII}*$/u;const Ci=t=>vi.test(t);const bi=async(t,n)=>t.length*n;const Mi=async(t,n,e,o,s,c,r)=>{const i=await po("TextMeasurement.measureTextWidth",t,n,e,o,s,c,r);return i};const Ai=async(t,n,e,o,s,c,r)=>{if(c&&Ci(t)){return await bi(t,r)}return await Mi(t,n,e,o,s,c,r)};const Li=async(t,n,e,o,s,c,r,i,a,d,l,u=0)=>{if(!t){return 0}w(t);g(i);g(a);g(d);p(c);g(l);g(u);if(n===0){return 0}if(n*l>d){return d}const f=Ir(t);const h=xr(t,f,i);const m=ki(t.slice(0,n));const y=h.slice(0,n+m);const E=await Ai(y,e,o,s,r,c,l);return E-a+u};const Pi=(t,n,e)=>(t-n)*e;const Fi=t=>`${t}px`;const Wi=(t,n,e,o)=>new Uint32Array([t,n,e,o]);const Ti=t=>new Uint32Array(t);const Ri=t=>Ti(t.length);const Di=(t,n)=>{const e=Ri(t);for(let o=0;o<e.length;o+=4){const[s,c,r,i]=Si(t,o);n(e,o,s,c,r,i)}return e};const Oi=(t,n)=>{for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];n(o,s,c,r)}};const Bi=(t,n,e,o)=>{t[n]=t[n+2]=e;t[n+1]=t[n+3]=o};const Ni=(t,n,e,o)=>t===e&&n===o;const Hi=(t,n,e,o)=>t===e;const zi=(t,n)=>{for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];if(!n(o,s,c,r)){return false}}return true};const $i=t=>zi(t,Ni);const Ui=t=>zi(t,Hi);const Yi=(t,n)=>{const e=Ti(t.length*4);let o=0;for(const s of t){const{end:t,start:c}=n(s);e[o++]=c.rowIndex;e[o++]=c.columnIndex;e[o++]=t.rowIndex;e[o++]=t.columnIndex}return e};const _i=[];const Vi=(t,n)=>{if(!n){return _i}const e=[];for(let n=0;n<t.length;n+=2){const o=t[n];const s=t[n+1];e.push(`${Fi(o)} ${Fi(s)}`)}return e};const ji=t=>{const n=[];for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];n.push(Fi(o),Fi(s),Fi(c),Fi(r))}return n};const qi=async t=>{const n=[];const e=[];const{charWidth:o,cursorWidth:s,differences:c,focused:r,fontFamily:i,fontSize:a,fontWeight:d,isMonospaceFont:l,letterSpacing:u,lines:f,maxLineY:h,minLineY:g,rowHeight:m,selections:w,tabSize:p,width:y}=t;const E=o;const x=s/2;for(let t=0;t<w.length;t+=4){const[o,s,r,I,S]=Si(w,t);if(r<g||o>h){continue}const k=r-g;const v=c[k];const C=f[r];const b=await Li(C,I,d,a,i,l,u,p,x,y,E,v);const M=Pi(r,g,m);if(Ni(o,s,r,I)&&b>0){n.push(b,M);continue}const A=Pi(o,g,m);const L=o-g;const P=c[L];if(o===r){const t=await Li(C,s,d,a,i,l,u,p,x,y,E,P);if(S){n.push(t,M)}else if(b>=0){n.push(b,M)}const o=b-t;e.push(t,A,o,m)}else{if(o>=g){const t=f[o];const c=await Li(t,s,d,a,i,l,u,p,x,y,E,P);const r=await Li(t,t.length,d,a,i,l,u,p,x,y,E,P);const h=Pi(o,g,m);const w=r-c;if(S){n.push(c,h)}e.push(c,h,w,m)}const t=Math.max(o+1,g);const w=Math.min(r,h);for(let n=t;n<w;n++){const t=f[n];const o=Pi(n,g,m);const s=n-g;const r=c[s];const h=await Li(t,t.length,d,a,i,l,u,p,x,y,E,r);e.push(0,o,h,m)}if(r<=h){const t=b;e.push(0,M,t,m);if(!S){n.push(t,M)}}}}return{cursorInfos:Vi(n,r),selectionInfos:ji(e)}};const Gi=t=>{const{inserted:n,start:e}=t;const o=e.rowIndex;const s=e.columnIndex;const c=n.length;if(c===1){const t={columnIndex:n.at(-1).length+s,rowIndex:o+c-1};return{end:t,start:t}}const r={columnIndex:s,rowIndex:o+c-1};return{end:r,start:r}};const Xi=(t,n)=>{h(t);return{...t,selections:n}};const Zi=(t,n)=>{h(t);m(n);const e=Yi(n,Gi);return e};const Qi=(t,n)=>Jr(t,n);const Ki=(t,n)=>Qi(t,t.deltaY+n);const Ji=t=>t.origin===Is;const ta=(t,n)=>{const{autoClosingRanges:e=[]}=t;const o=[];const s=n[0];const c=s.start.rowIndex;const r=s.start.columnIndex;const i=s.end.rowIndex;const a=s.end.columnIndex;for(let t=0;t<e.length;t+=4){const n=e[t];const d=e[t+1];const l=e[t+2];const u=e[t+3];if(i===l&&a===u||c===n&&r>=d&&i===l&&a<=u){const t=s.inserted[0].length-s.deleted[0].length;o.push(n,d,l,u+t)}}if(Ji(s)){o.push(c,r+1,i,a+1)}return o};const na=(t,n)=>Xi(t,n);const ea=async(t,n,e=undefined)=>{h(t);m(n);if(n.length===0){return t}const o=Mr(t,n);const s={...t,lines:o};const c=e||Zi(s,n);const r=Math.min(t.invalidStartIndex,n[0].start.rowIndex);const i=ta(t,n);const a={...s,autoClosingRanges:i,invalidStartIndex:r,lines:o,modified:true,redoStack:[],selections:c,undoStack:[...t.undoStack,n]};const d=li(a);const l={...a,decorations:d};ns(t.uid,t,l);if(!t.modified){await Ii(t.uri)}try{await pi(fi,"handleEditorChanged",t.uid,t.uri,n)}catch(t){console.warn("Failed to notify editor change listeners:",t)}const u=await ti(t,l);const f=await Rs(l,n);const g={...l,...f,incrementalEdits:u};if(u!==es){return g}const w=Kr();const{differences:p,textInfos:y}=await _r(g,w);return{...g,differences:p,textInfos:y}};const oa=async(t,n)=>{h(t);m(n);if(n.length===0){return t}const e=Mr(t,n);const o={...t,lines:e};const s=Zi(o,n);const c=Math.min(t.invalidStartIndex,n[0].start.rowIndex);const r={...o,invalidStartIndex:c,lines:e,selections:s};const i=await ti(t,r);const a={...r,incrementalEdits:i};if(i!==es){return a}const d=Kr();const{differences:l,textInfos:u}=await _r(a,d);return{...a,differences:l,textInfos:u}};const sa=async(t,n)=>{const e=Mr(t,n);const o=n[0].start.rowIndex;const s={...t,invalidStartIndex:o,lines:e,redoStack:[],undoStack:[...t.undoStack,n]};const c=await ti(t,s);const r={...s,incrementalEdits:c};if(c!==es){return r}const i=Kr();const{differences:a,textInfos:d}=await _r(r,i);return{...r,differences:a,textInfos:d}};const ca=t=>t.selections&&t.selections.length>0;const ra=(t,n,e,o,s,c)=>yi(t,{height:s,width:o,x:n,y:e},c);const ia=(t,n)=>{const e=Ei(n);const{itemHeight:o,minimumSliderSize:s,numberOfVisibleLines:c}=t;const r=e.length;const i=Math.min(c,r);const a=Math.max(r-c,0);const d=a*o;const l=e.length*t.rowHeight;const u=qr(t.height,l,s);return{...t,finalDeltaY:d,finalY:a,lines:e,maxLineY:i,scrollBarHeight:u}};const aa={cursorInfos:[],debugEnabled:false,decorations:[],deltaX:0,deltaY:0,diagnostics:[],differences:[],embeds:[],focused:false,hasListener:false,height:0,highlightedLine:-1,incrementalEdits:es,isSelecting:false,languageId:"",lineCache:[],lines:[],longestLineWidth:0,maxLineY:0,minLineY:0,redoStack:[],scrollBarHeight:0,selectionAnchorPosition:{columnIndex:0,rowIndex:0},selectionAutoMovePosition:{columnIndex:0,rowIndex:0},selectionInfos:[],selections:new Uint32Array,textInfos:[],tokenizerId:0,undoStack:[],uri:"",width:0,x:0,y:0};const da="ExtensionHostHover.execute";const la="ExtensionHost.executeTabCompletionProvider";const ua="ExtensionHostTextDocument.syncFull";const{invoke:fa,set:ha}=lo;const ga=t=>{w(t);return t.lastIndexOf(gr)};const ma=(t,n)=>t.lastIndexOf(gr,n);const wa=(t,n)=>{for(const e of t){if(e&&e.extensions&&Array.isArray(e.extensions)&&e.extensions.includes(n)){return e.id}}return""};const pa=(t,n)=>{for(const e of t){if(e&&e.fileNames&&Array.isArray(e.fileNames)&&e.fileNames.includes(n)){return e.id}}return""};const ya=(t,n)=>{w(t);const e=ga(t);const o=t.slice(e);const s=o.toLowerCase();const c=wa(n,s);if(c){return c}const r=t.toLowerCase();const i=ma(t,e-1);const a=t.slice(i);const d=wa(n,a);if(d){return d}const l=pa(n,r);if(l){return l}return"unknown"};const Ea=async(t,n)=>{g(t);w(n);const e=await ho(t,n);return e};const xa=async(t,n,e,o)=>await Ai("a",t,n,e,o,false,0);const Ia=async t=>{const n=await Wo(t);return n};const Sa="onDiagnostic";const ka="onHover";const va="onTabCompletion";const Ca=async({args:t,assetDir:n,editor:e,event:o,method:s,noProviderFoundMessage:c,noProviderFoundResult:r=undefined,platform:i})=>{const a=`${o}:${e.languageId}`;await zo(a,n,i);const d=await fa(s,e.uid,...t);return d};const ba=t=>({documentId:t.id||t.uid,languageId:t.languageId,text:Lr(t),uri:t.uri});const Ma=async t=>{const n=ba(t);return uo("Extensions.executeDiagnosticProvider",n)};const Aa=async t=>{const n=await Ma(t);if(n.length>0){return n}const{assetDir:e,platform:o}=t;return Ca({args:[],assetDir:e,editor:t,event:Sa,method:"ExtensionHost.executeDiagnosticProvider",noProviderFoundMessage:"no diagnostic provider found",platform:o})};const La=t=>t.type;const Pa=async(t,n)=>{const e=[];const{charWidth:o,fontFamily:s,fontSize:c,fontWeight:r,isMonospaceFont:i,letterSpacing:a,lines:d,minLineY:l,rowHeight:u,tabSize:f,width:h}=t;for(const t of n){const{columnIndex:n,endColumnIndex:g,rowIndex:m}=t;const w=g-n;const p=w*o;const y=0;const E=0;const x=await Li(d[m],n,r,c,s,i,a,f,E,h,o,y);const I=Pi(m,l,u)-u;e.push({height:u,type:La(t),width:p,x:x,y:I})}return e};const Fa=(t,n)=>{const e=li(t);const o=[...e,...n];const s=[];for(let t=0;t<o.length;t+=4){s.push({length:o[t+1],modifiers:o[t+3],offset:o[t],type:o[t+2]})}s.sort((t,n)=>t.offset-n.offset);const c=[];for(const t of s){c.push(t.offset,t.length,t.type,t.modifiers)}return c};const Wa=async t=>{const n=Lr(t);await fa(ua,t.uri,t.id,t.languageId,n);return Aa(t)};const Ta=async(t,n)=>{const e=await Pa(t,n);const o=e.flatMap(t=>[t.offset,t.length,t.type,t.modifiers||0]);const s=Fa(t,o);return{...t,decorations:s,diagnostics:n,visualDecorations:e}};const Ra=(t,n)=>{if(t instanceof Error&&t.message.includes("No diagnostic provider found")){return n}console.error(`Failed to update diagnostics: ${t}`);return n};const Da=async t=>{try{const n=await Wa(t);if(!Jo(t.id)){return t}return Ta(t,n)}catch(n){return Ra(n,t)}};const Oa=async t=>{try{const n=await Wa(t);const e=Jo(t.id);if(!e){return t}const o=await Ta(e.newState,n);ns(t.id,e.oldState,o);await Eo("Editor.rerender",t.id);return o}catch(n){return Ra(n,t)}};const Ba=async({assetDir:t,columnToReveal:n,completionTriggerCharacters:e,content:o,diagnosticsEnabled:s,fontFamily:c,fontSize:r,fontWeight:i,formatOnSave:a,height:d,hoverEnabled:l,id:u,isAutoClosingBracketsEnabled:f,isAutoClosingQuotesEnabled:h,isAutoClosingTagsEnabled:m,isMonospaceFont:p,isQuickSuggestionsEnabled:y,languageId:E,letterSpacing:x,lineNumbers:I,lineToReveal:S,links:k,platform:v,rowHeight:C,savedDeltaY:b,savedSelections:M,tabSize:A,uri:L,useFunctionalRendering:P,width:F,x:W,y:T})=>{g(u);w(o);const R=await xa(i,r,c,x);const D=await Ea(v,t);const O=ya(L,D);const B={assetDir:t,charWidth:R,columnWidth:0,completionState:"",completionTriggerCharacters:e,completionUid:0,cursorInfos:[],cursorWidth:2,decorations:[],deltaX:0,deltaY:0,diagnostics:[],diagnosticsEnabled:s,differences:[],finalDeltaY:0,finalY:0,focused:false,focusKey:cs,fontFamily:c,fontSize:r,fontWeight:i,handleOffset:0,handleOffsetX:0,hasListener:false,height:d,id:u,incrementalEdits:es,invalidStartIndex:0,isAutoClosingBracketsEnabled:f,isAutoClosingQuotesEnabled:h,isAutoClosingTagsEnabled:m,isMonospaceFont:p,isQuickSuggestionsEnabled:y,isSelecting:false,itemHeight:20,languageId:O,letterSpacing:x,lineCache:[],lineNumbers:I,lines:[],longestLineWidth:0,maxLineY:0,minimumSliderSize:20,minLineY:0,modified:false,numberOfVisiblelines:0,numberOfVisibleLines:0,platform:v,primarySelectionIndex:0,redoStack:[],rowHeight:C,savedSelections:M,scrollBarHeight:0,scrollBarWidth:0,selectionAnchorPosition:{columnIndex:0,rowIndex:0},selectionAutoMovePosition:{columnIndex:0,rowIndex:0},selectionInfos:[],selections:new Uint32Array,tabSize:A,textInfos:[],tokenizerId:0,uid:u,undoStack:[],uri:L,useFunctionalRendering:P,validLines:[],widgets:[],width:F,x:W,y:T};const N=ra(B,W,T,F,d,9);const H=ia(N,o);let z;if(S&&n){const t=S*C;z=await Jr(H,t)}else{z=await Jr(H,0)}const $=li(z);const U={...z,decorations:$};const Y=Kr();const{differences:_,textInfos:V}=await _r(U,Y);const j={...U,differences:_,focus:ro,focused:true,textInfos:V};ns(u,aa,j);await fa(ua,L,u,E,o);const q=s?await Oa(j):j;const G=await Ia("editor.completionsOnType");const X=Boolean(G);ns(u,aa,{...q,completionsOnType:X})};const Na=(t,n)=>t.rowHeight===n.rowHeight&&t.deltaY===n.deltaY&&t.finalDeltaY===n.finalDeltaY&&t.height===n.height&&t.deltaX===n.deltaX&&t.longestLineWidth===n.longestLineWidth&&t.minimumSliderSize===n.minimumSliderSize&&t.width===n.width&&t.scrollBarHeight===n.scrollBarHeight;const Ha=(t,n)=>{if(!n.focused){return true}if(!t.isSelecting&&n.isSelecting){return false}return t.focused===n.focused&&t.focus===n.focus};const za=(t,n)=>t.cursorInfos===n.cursorInfos&&t.diagnostics===n.diagnostics&&t.highlightedLine===n.highlightedLine&&t.lineNumbers===n.lineNumbers&&t.loadError===n.loadError&&t.textInfos===n.textInfos&&t.differences===n.differences&&t.initial===n.initial&&t.selectionInfos===n.selectionInfos;const $a=6;const Ua=7;const Ya=11;const _a=12;const Va=13;const ja=(t,n)=>t.widgets===n.widgets;const qa=[za,Ha,Ha,Na,ja];const Ga=[_a,$a,Ua,Ya,Va];const Xa=(t,n)=>{const e=[];for(let o=0;o<qa.length;o++){const s=qa[o];if(!s(t,n)){e.push(Ga[o])}}return e};const Za=t=>{const{newState:n,oldState:e}=Jo(t);const o=Xa(e,n);return o};const Qa=t=>{const n=[];for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];if(e===0&&o!==0){n.push(o-1,s,o-1,s)}n.push(o,s,c,r)}return new Uint32Array(n)};const Ka=t=>{const{selections:n}=t;const e=Qa(n);return{...t,selections:e}};const Ja=(t,n)=>{const e=[];for(let o=0;o<t.length;o+=4){const s=t[o];const c=t[o+1];const r=t[o+2];const i=t[o+3];e.push(s,c,r,i);if(o===t.length-4&&r<n){e.push(r+1,i,r+1,i)}}return new Uint32Array(e)};const td=t=>{const{lines:n,selections:e}=t;const o=Ja(e,n.length);return{...t,selections:o}};const nd=(t,n)=>{const e=[];for(const o of n){const n=Tr(t,o.startOffset);const s=Tr(t,o.endOffset);const c=Pr(t,{end:s,start:n});const r={deleted:c,end:s,inserted:Ei(o.inserted),origin:Ss,start:n};if(r.inserted.length===0){r.inserted=[""]}e.push(r)}return e};const ed=(...t)=>{console.warn(...t)};const od=(...t)=>{console.error(...t)};const sd=(t,n)=>{if(!Array.isArray(n)){ed("something is wrong with format on save",n);return t}if(n.length===0){return t}const e=nd(t,n);return ea(t,e)};const cd=async(t,n)=>{h(t);m(n);return ea(t,n)};const rd=(t,n)=>{const e=[];for(const o of n){if(o.uri===t.uri){for(const n of o.edits){const o=Tr(t,n.offset);const s=Tr(t,n.offset+n.deleted);const c=Pr(t,{end:s,start:o});const r={deleted:c,end:s,inserted:[n.inserted],origin:Ms,start:o};e.push(r)}}}return e};const id=async(t,n)=>{h(t);m(n);const e=rd(t,n);if(e.length===0){return t}return ea(t,e)};const ad=t=>{if(!t.focused){return t}const n={...t,focused:false};return n};const dd=(t,n,e,o)=>{const s=[];const c=n.length;for(let r=0;r<c;r+=4){const[c,i,a,d]=Si(n,r);const l={columnIndex:i,rowIndex:c};const u={columnIndex:d,rowIndex:a};const f={end:u,start:l};s.push({deleted:Pr(t,f),end:u,inserted:e,origin:o,start:l})}return s};const ld=(t,n,e)=>{const{selections:o}=t;return dd(t,o,n,e)};const ud=async(t,n,e,o,s,c,r,i,a,d)=>{for(let l=n;l<t.length;l++){const n=await Ai(t.slice(0,l),s,c,r,i,a,d);if(o-n<e/2){return l}}return t.length};const fd=()=>"Segmenter"in Intl;const hd=()=>{const t=new Intl.Segmenter;return{at(n,e){const o=t.segment(n);return o.containing(e)},getSegments:n=>t.segment(n),modelIndex(n,e){const o=t.segment(n);let s=0;for(const t of o){if(s>=e){return t.index}s++}return n.length},visualIndex(n,e){const o=t.segment(n);let s=0;for(const t of o){if(t.index>=e){return s}s++}return s}}};const gd=async(t,n,e,o,s,c,r,i)=>{const a=hd();const d=a.getSegments(t);const l=false;const u=0;for(const n of d){const a=await Ai(t.slice(0,n.index),s,c,r,i,l,u);if(o-a<e){return n.index}}return t.length};const md=(t,n)=>{const e=Math.round(t/n);return e};const wd=(t,n,e)=>{let o=n;for(let s=0;s<n;s++){if(t[s]===Er){o-=e-1}}return o};const pd=async(t,n,e,o,s,c,r,i,a)=>{w(t);g(n);g(e);w(o);g(s);p(c);g(r);g(i);g(a);const d=md(a,r);const l=Ir(t);const u=wd(t,d,i);const f=t.slice(0,u);const h=xr(f,l,i);const m=await Ai(h,n,e,o,s,c,r);const y=Ci(t);if(y){if(Math.abs(a-m)<r/2){return u}return await ud(t,u,r,a,n,e,o,s,c,r)}return await gd(t,u,r,a,n,e,o,s)};const yd=async(t,n,e)=>{h(t);g(n);g(e);const{charWidth:o,deltaX:s,deltaY:c,fontFamily:r,fontSize:i,fontWeight:a,isMonospaceFont:d,letterSpacing:l,lines:u,rowHeight:f,tabSize:m,x:w,y:p}=t;const y=Math.floor((e-p+c)/f);if(y<0){return{columnIndex:0,rowIndex:0}}const E=n-w+s;const x=Ds(y,0,u.length-1);const I=u[x];const S=await pd(I,a,i,r,l,d,o,m,E);return{columnIndex:S,rowIndex:x}};const Ed=(t,n,e)=>{const{columnWidth:o,x:s}=t;const c=e*o+s;return c};const xd=(t,n)=>{const{rowHeight:e,y:o}=t;const s=(n+1)*e+o;return s};const Id={timeout:-1};const Sd=async(t,n,e,o,s)=>{h(t);g(n);g(e);w(o);const c=Ed(t,n,e);const r=xd(t,n);const i=o;await Eo("Editor.showOverlayMessage",t,"Viewlet.send",t.uid,"showOverlayMessage",c,r,i);if(!s){const n=()=>{vd(t)};Id.timeout=setTimeout(n,3e3)}return t};const kd=async(t,n,e,o)=>Sd(t,n,e,o,true);const vd=async t=>{clearTimeout(Id.timeout);Id.timeout=-1;return t};const Cd=String;const bd=t=>{switch(t){case"(":return")";case"[":return"]";case"{":return"}";default:return"???"}};const Md=async(t,n)=>{try{const e=Wr(t,t.cursor);const o=await Eo("ExtensionHostBraceCompletion.executeBraceCompletionProvider",t,e,n);if(o){const e=bd(n);const o=n+e;const s=ld(t,[o],xs);return ea(t,s)}const s=ld(t,[n],xs);return ea(t,s)}catch(n){console.error(n);const e=Array.isArray(t.cursor)?t.cursor[0]:t.cursor;return kd(t,e,Cd(n))}};const Ad=t=>{const{selections:n}=t;if(n.length===4&&n[0]===n[2]&&n[1]===n[3]){return t}const e=Ti(4);Bi(e,0,n[0],n[1]);return na(t,e)};const Ld=(t,n)=>{for(const[e,o]of t.entries()){if(o.id===n){return e}}return-1};const Pd=(t,n)=>{const e=Ld(t,n);const o=[...t.slice(0,e),...t.slice(e+1)];return o};const Fd=t=>t.id===Fe;const Wd=t=>{const{widgets:n}=t;const e=n.findIndex(Fd);if(e===-1){return t}const o=Pd(n,Fe);return{...t,focused:true,widgets:o}};const Td=t=>t.id===De;const Rd=t=>{const{widgets:n}=t;const e=n.findIndex(Td);if(e===-1){return t}const o=Pd(n,De);return{...t,focused:true,widgets:o}};const Dd=async()=>{const t="Rename Worker";const n="renameWorkerMain.js";const e=await Yo(t,n);await e.invoke("Rename.initialize");return e};const Od={};const Bd=()=>{if(!Od.workerPromise){Od.workerPromise=Dd()}return Od.workerPromise};const Nd=async(t,...n)=>{const e=await Bd();return await e.invoke(t,...n)};const Hd=t=>t.id===Be;const zd=async t=>{const{uid:n,widgets:e}=t;const o=e.findIndex(Hd);if(o===-1){return t}const s=e[o];await Nd("Rename.close",s.newState.uid);const c=Jo(n);const{newState:r}=c;return r};const $d=t=>t.id===Ne;const Ud=t=>{const{widgets:n}=t;const e=n.findIndex($d);if(e===-1){return t}const o=Pd(n,Ne);return{...t,widgets:o}};const Yd=(t,n)=>{for(const e of t){if(e.id===n){return true}}return false};const _d=async(t,n,e,o,s,c)=>{const{widgets:r}=e;if(Yd(r,t)){return e}const i=o();i.newState.editorUid=e.uid;const a=await s(i.newState,e.uid);a.editorUid=e.uid;const d={...i,newState:a};const l=[...r,d];const u=!c;const f={...e,additionalFocus:c?0:n,focus:c?n:ro,focused:u,widgets:l};return f};const Vd=()=>Math.random();const jd=()=>{const t=Vd();const n={id:We,newState:{commands:[],height:0,uid:t,width:0,x:0,y:0},oldState:{commands:[],height:0,uid:t,width:0,x:0,y:0}};return n};const qd=(t,n)=>Go(t,n);const Gd=async t=>_d(We,os,t,jd,qd);const Xd={compositionText:"",isComposing:false};const Zd=(t,n)=>{Xd.isComposing=true;return t};const Qd=(t,n)=>{const e=[];for(let o=0;o<t.length;o+=4){const s=t[o];const c=t[o+1];const r=t[o+2];const i=t[o+3];const a=c-Xd.compositionText.length;e.push({deleted:[Xd.compositionText],end:{columnIndex:i,rowIndex:r},inserted:[n],origin:fs,start:{columnIndex:a,rowIndex:s}})}return e};const Kd=(t,n)=>{const{selections:e}=t;const o=Qd(e,n);Xd.compositionText=n;return ea(t,o)};const Jd=(t,n)=>{const{selections:e}=t;const o=Qd(e,n);Xd.isComposing=false;Xd.compositionText="";return ea(t,o)};const tl=async t=>{try{w(t);await Mo(t)}catch(t){throw new k(t,"Failed to write text to clipboard")}};const nl=(t,n,e,o,s,c)=>{if(n){const n=t[s].length;return{end:{columnIndex:n,rowIndex:e},start:{columnIndex:0,rowIndex:e}}}return{end:{columnIndex:c,rowIndex:s},start:{columnIndex:o,rowIndex:e}}};const el=(t,n,e,o)=>t===e&&n===o;const ol=async t=>{if(!ca(t)){return t}const{lines:n,selections:e}=t;const o=e[0];const s=e[1];const c=e[2];const r=e[3];const i=el(o,s,c,r);const a=nl(n,i,o,s,c,r);const d=Pr(t,a);const l=vr(d);const u=i?"\n"+l:l;await tl(u);return t};const sl=t=>{const{selections:n}=t;const e=[];for(let t=0;t<n.length;t+=4){const o=n[t];g(o);e.push(o)}const o=[...new Set(e)].toSorted((t,n)=>t-n);const s=o.map(n=>{const e={columnIndex:0,rowIndex:n};return{deleted:[""],end:e,inserted:[Ar(t,n),""],start:e}});const c=new Uint32Array(o.length*4);for(let t=0;t<o.length;t++){const n=o[t]+t+1;c[t*4]=n;c[t*4+1]=0;c[t*4+2]=n;c[t*4+3]=0}return ea(t,s,c)};const cl=t=>{const{selections:n}=t;const e=n[0];const o={columnIndex:0,rowIndex:e};const s=[{deleted:[""],end:o,inserted:[Ar(t,e),""],start:o}];return ea(t,s)};const rl=(t,n,e,o)=>{if(n===0){if(t===0){return{columnIndex:0,rowIndex:0}}return{columnIndex:e[t-1].length,rowIndex:t-1}}const s=o(e[t],n);return{columnIndex:n-s,rowIndex:t}};const il=(t,n,e,o)=>{t[n]=e;t[n+1]=o};const al=(t,n,e,o)=>{t[n]=t[n+2]=e;t[n+1]=t[n+3]=o};const dl=(t,n,e,o,s,c)=>{if(o===0){if(e===0){t[n]=0;t[n+1]=0}else{t[n]=e-1;t[n+1]=s[e-1].length}}else{const r=c(s[e],o);t[n]=e;t[n+1]=o-r}};const ll=(t,n,e)=>{const o=new Uint32Array(t.length);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=Si(t,s);if(c===i&&r===a){if(c===0&&r===0){o[s]=0;o[s+1]=0;o[s+2]=0;o[s+3]=0}else{dl(o,s,c,r,n,e);dl(o,s+2,c,r,n,e)}}else{al(o,s,t[s],t[s+1])}}return o};const ul=(t,n)=>{const{lines:e,selections:o}=t;const s=ll(o,e,n);return na(t,s)};const fl=(t,n)=>{if(!fd()){return 1}if(n>t.length){return 1}const e=hd();const o=e.at(t,n-1);if(!o){return 1}return n-o.index};const hl=()=>2;const gl=(t,n)=>{if(!fd()){return 1}const e=hd();const o=e.at(t,n);return o.segment.length};const ml=t=>t===yr||t===Er;const wl=(t,n)=>{if(t.length===0){return 0}for(let e=0;e<n;e++){if(!ml(t[e])){return n-e}}return n};const pl=(t,n)=>t.length-n;const yl=(t,n)=>{for(const e of n){const n=t.match(e);if(n){return n[0].length}}return 1};const El=/(?<![A-Z])[A-Z]+\s*$/;const xl=/[\u{C0}-\u{17F}\w\-]+>?\s*$/u;const Il=/[a-zA-Z]+[^a-zA-Z\d]+\s*$/;const Sl=/\s+$/;const kl=/[^a-zA-Z\d]+\s*$/;const vl=[El,xl,Il,Sl,kl];const Cl=(t,n)=>{const e=t.slice(0,n);return yl(e,vl)};const bl=/^\s*[\u{C0}-\u{17F}\w]+/iu;const Ml=/^[^a-zA-Z\d]+\w*/;const Al=[bl,Ml];const Ll=(t,n)=>{const e=t.slice(n);return yl(e,Al)};const Pl=/(?<![A-Z])[A-Z]{2}[a-z]+$/;const Fl=/(?=[A-Z]+)[A-Z][a-z]+$/;const Wl=/[A-Z]+[a-z]+\d?\s*$/;const Tl=/[A-Z]+\d*\s*$/;const Rl=/[a-z]+\d*\s*$/;const Dl=/[A-Z]*[a-z]+_+\s*$/;const Ol=/(?<![A-Z])[A-Z]_+\s*$/;const Bl=/[a-z]+\s*$/;const Nl=/[^a-zA-Z\d\s]+\s*$/;const Hl=[Pl,Fl,Wl,Tl,Rl,Dl,Ol,Bl,Nl];const zl=(t,n)=>{const e=t.slice(0,n);return yl(e,Hl)};const $l=/^\s*[a-z]+\d?/;const Ul=/^\s*[A-Z]{2}[a-z\d]+/;const Yl=/^\s*[A-Z]+(?=[A-Z][a-z]+)/;const _l=/^\s*[A-Z]+[a-z]*\d*/;const Vl=/^\s*_+[a-z]*\d?/;const jl=/^\s*[^\da-zA-Z\s]+/;const ql=[$l,Yl,_l,Vl,jl];const Gl=[$l,Ul,Yl,_l,Vl,jl];const Xl=/[A-Z]/;const Zl=(t,n)=>{const e=t.slice(n);if(Xl.test(t[n-1])){return yl(e,ql)}return yl(e,Gl)};const Ql=t=>ul(t,fl);const Kl=(t,n,e)=>{const{rowIndex:o}=t;const{columnIndex:s}=t;if(s>=n[o].length){if(o>=n.length){return t}return{columnIndex:0,rowIndex:o+1}}const c=e(n[o],s);return{columnIndex:s+c,rowIndex:o}};const Jl=(t,n,e,o,s,c)=>{if(e>=s.length){return}const r=s[e];if(o>=r.length){t[n]=t[n+2]=e+1;t[n+1]=t[n+3]=0}else{const s=c(r,o);t[n]=t[n+2]=e;t[n+1]=t[n+3]=o+s}};const tu=(t,n,e)=>{const o=new Uint32Array(t.length);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=Si(t,s);if(c===i&&r===a){Jl(o,s,c,r,n,e)}else{o[s]=o[s+2]=i;o[s+1]=o[s+3]=a}}return o};const nu=(t,n)=>{const{lines:e,selections:o}=t;const s=tu(o,e,n);return na(t,s)};const eu=t=>nu(t,gl);const ou=(t,n,e,o,s,c)=>{Bi(t,n,s+1,c)};const su=t=>Di(t,ou);const cu=t=>{const{selections:n}=t;const e=su(n);return na(t,e)};const ru=t=>nu(t,pl);const iu=t=>ul(t,wl);const au=(t,n,e)=>{h(t);g(n);g(e);const o=Wi(n,e,n,e);return na(t,o)};const du=(t,n,e,o,s,c)=>{if(e===0){Bi(t,n,0,0)}else{Bi(t,n,e-1,o)}};const lu=t=>Di(t,du);const uu=(t,n,e,o)=>{const{selections:s}=t;const c=lu(s);return na(t,c)};const fu=t=>uu(t);const hu=t=>ul(t,Cl);const gu=t=>ul(t,zl);const mu=t=>nu(t,Zl);const wu=t=>nu(t,Ll);const pu=async t=>{const{lines:n,selections:e}=t;const o=new Set;const s=[];for(let t=0;t<e.length;t+=4){const[n]=Si(e,t);if(!o.has(n)){o.add(n);s.push(n)}}const c=new Uint32Array(s.length*4);const r=new Uint32Array(s.length*4);const i=[];for(let t=0;t<s.length;t++){const e=s[t];const o=n[e];const a=t*4;c[a]=e;c[a+1]=0;c[a+2]=e;c[a+3]=o.length;r[a]=e;r[a+1]=0;r[a+2]=e;r[a+3]=0;i.push(o)}const a=dd(t,c,[""],ps);await tl(vr(i));return ea(t,a,r)};const yu=async t=>{const n=ld(t,[""],ps);const e=n.map(t=>vr(t.deleted)).filter(t=>t.length>0);const o=vr(e);await tl(o);return ea(t,n)};const Eu=async t=>{const{selections:n}=t;if($i(n)){return pu(t)}return yu(t)};const xu=t=>{const{lines:n}=t;const e=n.length-1;const o=n.at(-1).length;const s={columnIndex:0,rowIndex:0};const c={columnIndex:o,rowIndex:e};const r=[{deleted:Pr(t,{end:c,start:s}),end:c,inserted:[""],origin:gs,start:s}];return ea(t,r)};const Iu=(t,n,e)=>{const o=[];const s=(n,s,c,r)=>{const i=rl(n,s,t,e);const a={columnIndex:r,rowIndex:c};o.push({deleted:Pr({lines:t},{end:a,start:i}),end:a,inserted:[""],origin:ws,start:i})};Oi(n,s);return o};const Su=(t,n,e,o,s)=>{if(!Ni(n,e,o,s)){return false}if(e<1){return false}for(let o=0;o<t.length;o+=4){const s=t[o];const c=t[o+1];if(n===s&&e===c){return true}}return false};const ku=(t,n)=>{for(let e=0;e<n.length;e+=4){const[o,s,c,r]=Si(n,e);if(!Su(t,o,s,c,r)){return false}}return true};const vu=t=>{const{lines:n,selections:e}=t;for(let t=0;t<e.length;t+=4){e[t+1]++;e[t+3]++}const o=Iu(n,e,hl);return ea(t,o)};const Cu=(t,n)=>{const{autoClosingRanges:e=[],lines:o,selections:s}=t;if(ku(e,s)){return vu(t)}if($i(s)){const e=Iu(o,s,n);return ea(t,e)}const c=ld(t,[""],ws);return ea(t,c)};const bu=t=>Cu(t,wl);const Mu=(t,n)=>{const{selections:e}=t;if($i(e)){const o=[];const{lines:s}=t;for(let c=0;c<e.length;c+=4){const[r,i]=Si(e,c);const a={columnIndex:i,rowIndex:r};const d=Kl(a,s,n);o.push({deleted:Pr(t,{end:d,start:a}),end:d,inserted:[""],origin:ms,start:a})}return o}const o=ld(t,[""],ms);return o};const Au=(t,n)=>{const e=Mu(t,n);return ea(t,e)};const Lu=t=>Au(t,pl);const Pu=t=>{const n=Cu(t,fl);return n};const Fu=t=>Au(t,gl);const Wu=t=>{const n=Cu(t,Cl);return n};const Tu=t=>{const n=Cu(t,zl);return n};const Ru=t=>Au(t,Zl);const Du=t=>Au(t,Ll);const Ou=async t=>{await Eo("SideBar.show","References",true);return t};const Bu=async t=>{const n={documentId:t.id||t.uid,languageId:t.languageId,text:Lr(t),uri:t.uri};return uo("Extensions.executeFormattingProvider",n)};const Nu="Failed to execute formatting provider: FormattingError:";const Hu=t=>t&&t instanceof Error&&t.message.startsWith(Nu);const zu="Failed to execute formatting provider: FormattingError:";const $u=async t=>{try{const n=await Bu(t);return sd(t,n)}catch(n){if(Hu(n)){console.error("Formatting Error:",n.message.slice(zu.length));return t}console.error(n);const e=String(n);await Sd(t,0,0,e,true);return t}};const Uu=/^[\w\-]+/;const Yu=/[\w\-]+$/;const _u=(t,n)=>{const e=t.slice(0,n);const o=e.match(Yu);const s=t.slice(n);const c=s.match(Uu);let r=wr;if(o){r+=o[0]}if(c){r+=c[0]}return{word:r}};const Vu=(t,n)=>{const e=t.slice(0,n);const o=e.match(Yu);if(o){return o[0]}return wr};const ju=(t,n,e)=>{const{lines:o}=t;const s=o[n];return _u(s,e)};const qu=(t,n,e)=>{const{lines:o}=t;const s=o[n];return Vu(s,e)};const Gu=async(t,n)=>{const e=await Eo("ExtensionHostDefinition.executeDefinitionProvider",t,n);return e};const Xu={};const Zu=/\{(PH\d+)\}/g;const Qu=(t,n=Xu)=>{if(n===Xu){return t}const e=(t,e)=>n[e];return t.replaceAll(Zu,e)};const Ku="Copy";const Ju="Cut";const tf="Editor: Close Color Picker";const nf="Editor: Copy Line Down";const ef="Editor: Copy Line Up";const of="Editor: Format Document (forced)";const sf="Editor: Go To Definition";const cf="Editor: Go To Type Definition";const rf="Editor: Indent";const af="Editor: Open Color Picker";const df="Editor: Select All Occurrences";const lf="Editor: Select Down";const uf="Editor: Select Inside String";const ff="Editor: Select Next Occurrence";const hf="Editor: Select Up";const gf="Show Hover";const mf="Editor: Sort Lines Ascending";const wf="Editor: Toggle Comment";const pf="Editor: Unindent";const yf="Enter Code";const Ef="Escape to close";const xf="Find All Implementations";const If="Find All References";const Sf="Format Document";const kf="Go to Definition";const vf="Go to Type Definition";const Cf="Move Line Down";const bf="Move Line Up";const Mf="No definition found";const Af="No definition found for '{PH1}'";const Lf="No type definition found";const Pf="No type definition found for '{PH1}'";const Ff="Paste";const Wf="Source Action";const Tf="Toggle Block Comment";const Rf=()=>Qu(kf);const Df=()=>Qu(Mf);const Of=t=>Qu(Af,{PH1:t});const Bf=t=>Qu(Pf,{PH1:t});const Nf=()=>Qu(Lf);const Hf=()=>Qu(Wf);const zf=()=>Qu(Ef);const $f=()=>Qu(yf);const Uf=()=>Qu(vf);const Yf=()=>Qu(If);const _f=()=>Qu(xf);const Vf=()=>Qu(Ju);const jf=()=>Qu(Ku);const qf=()=>Qu(Ff);const Gf=()=>Qu(Tf);const Xf=()=>Qu(bf);const Zf=()=>Qu(Cf);const Qf=()=>Qu(Sf);const Kf=()=>Qu(gf);const Jf=()=>Qu(of);const th=()=>Qu(ff);const nh=()=>Qu(df);const eh=()=>Qu(sf);const oh=()=>Qu(cf);const sh=()=>Qu(uf);const ch=()=>Qu(rf);const rh=()=>Qu(pf);const ih=()=>Qu(mf);const ah=()=>Qu(wf);const dh=()=>Qu(hf);const lh=()=>Qu(lf);const uh=()=>Qu(af);const fh=()=>Qu(tf);const hh=()=>Qu(nf);const gh=()=>Qu(ef);const mh=async({editor:t,getErrorMessage:n,getLocation:e,getNoLocationFoundMessage:o,isNoProviderFoundError:s})=>{const{selections:c}=t;const r=c[0];const i=c[1];try{const n=await e(t,r,i);if(!n){const n=ju(t,r,i);const e=o(n);return Sd(t,r,i,e,false)}if(typeof n.uri!=="string"||typeof n.startOffset!=="number"||typeof n.endOffset!=="number"){return t}const{uri:s}=n;if(s===t.uri){const e=Tr(t,n.startOffset);const o=new Uint32Array([e.rowIndex,e.columnIndex,e.rowIndex,e.columnIndex]);return na(t,o)}const c={endColumnIndex:n.endColumnIndex,endRowIndex:n.endRowIndex,startColumnIndex:n.startColumnIndex,startRowIndex:n.startRowIndex};await To(s,true,c);return t}catch(e){if(s(e)){const o=n(e);await Sd(t,r,i,o,false);return t}const o=n(e);await Sd(t,r,i,o,true);return t}};const wh=async(t,n,e)=>{const o=Wr(t,n,e);const s=await Gu(t,o);return s};const ph=t=>{if(t.word){return Of(t.word)}return Df()};const yh=String;const Eh=t=>t?.message?.startsWith("Failed to execute definition provider: No definition provider found");const xh=async t=>mh({editor:t,getErrorMessage:yh,getLocation:wh,getNoLocationFoundMessage:ph,isNoProviderFoundError:Eh});const Ih=t=>{if(t.word){return Bf(t.word)}return Nf()};const Sh=async(t,n)=>{const e=await Eo("ExtensionHostTypeDefinition.executeTypeDefinitionProvider",t,n);return e};const kh=async(t,n,e)=>{const o=Wr(t,n,e);const s=await Sh(t,o);return s};const vh=String;const Ch=t=>t?.message?.startsWith("Failed to execute type definition provider: No type definition provider found");const bh=async(t,n=true)=>mh({editor:t,getErrorMessage:vh,getLocation:kh,getNoLocationFoundMessage:Ih,isNoProviderFoundError:Ch});const Mh=t=>{switch(t){case De:return true;default:return false}};const Ah=t=>{if(t.length===0){return t}return t.filter(Mh)};const Lh=async(t,n)=>{await wo(t,n)};const Ph=async(t,n)=>{const{platform:e}=t;const{columnIndex:o,rowIndex:s}=n;const c=Wr(t,s,o);const r=ui(t,c);if(r){await Lh(r,e);return t}const i={...t,selections:new Uint32Array([s,o,s,o])};const a=await xh(i);return a};const Fh=async(t,n)=>{const{selections:e}=t;for(let o=0;o<e.length;o+=4){const[s,c,r,i]=Si(e,o);if(s===n.rowIndex&&c===n.columnIndex&&r===n.rowIndex&&i===n.columnIndex){const n=new Uint32Array(e.length-4);n.set(e.subarray(0,o),0);n.set(e.subarray(o+4),o);return na(t,n)}}const o=new Uint32Array(e.length+4);o.set(e,0);const s=e.length;o[s]=n.rowIndex;o[s+1]=n.columnIndex;o[s+2]=n.rowIndex;o[s+3]=n.columnIndex;return na(t,o)};const Wh=1;const Th=2;const Rh=(t,n)=>{const e=Ah(t.widgets);return{...t,focused:true,selectionAnchorPosition:n,selections:new Uint32Array([n.rowIndex,n.columnIndex,n.rowIndex,n.columnIndex]),widgets:e}};const Dh=t=>{switch(t){case Th:return Ph;case Wh:return Fh;default:return Rh}};const Oh=async(t,n,e,o)=>{h(t);g(n);g(e);g(o);const s=Dh(n);const c=await s(t,{columnIndex:o,rowIndex:e});return c};const Bh=3;const Nh=async(t,n,e,o)=>{const{uid:s}=t;await So(s,Bh,e,o,{menuId:Bh});return t};const Hh=/^[a-zA-Z\u{C0}-\u{17F}\d]+/u;const zh=/[a-zA-Z\u{C0}-\u{17F}\d]+$/u;const $h=(t,n,e)=>{const o=t.slice(0,e);const s=t.slice(e);const c=o.match(zh);const r=s.match(Hh);const i=e-(c?c[0].length:0);const a=e+(r?r[0].length:0);const d=new Uint32Array([n,i,n,a]);return d};const Uh=(t,n,e)=>{const o=Ar(t,n);const s=$h(o,n,e);return na(t,s)};const Yh=async(t,n,e,o)=>{const s=await yd(t,e,o);return Uh(t,s.rowIndex,s.columnIndex)};const _h=t=>{if(t.focused&&t.focus===ro){return t}return{...t,additionalFocus:0,focus:ro,focused:true}};const Vh=1;const jh=2;const qh=3;const Gh=(t,n)=>{if(t){return Th}if(n){return Wh}return 0};const Xh=async(t,n,e,o)=>{h(t);g(n);g(e);g(o);const s=await yd(t,e,o);return Oh(t,n,s.rowIndex,s.columnIndex)};const Zh=(t,n)=>new Uint32Array([n,0,n,t.length]);const Qh=t=>{const{selections:n}=t;const e=n[t.primarySelectionIndex];const o=Ar(t,e);const s=Zh(o,e);return na(t,s)};const Kh=(t,n,e,o)=>{h(t);g(e);g(o);return Qh(t)};const Jh=0;const tg=async(t,n,e,o,s,c,r)=>{if(n!==Jh){return t}const i=Gh(e,o);let a;switch(r){case jh:a=await Yh(t,i,s,c);break;case Vh:a=await Xh(t,i,s,c);break;case qh:a=Kh(t,i,s,c);break;default:return t}return{...a,isSelecting:true}};const ng={editor:undefined,timeout:-1,x:0,y:0};const eg=()=>ng;const og=(t,n,e,o)=>{ng.editor=t;ng.timeout=n;ng.x=e;ng.y=o};const sg=async(t,n)=>{};const cg=async()=>{const{editor:t,x:n,y:e}=eg();await yd(t,n,e);await sg()};const rg=300;const ig=(t,n,e)=>{if(!t.hoverEnabled){return t}const o=eg();if(o.timeout!==-1){clearTimeout(o.timeout)}const s=setTimeout(cg,rg);og(t,s,n,e);return t};const ag=(t,n)=>{let e=0;for(let o=0;o<t.length;o++){const s=t[o];e+=s.length;if(e>=n){return o}}return-1};const dg=async(t,n,e)=>{h(t);g(n);g(e);const o=await yd(t,n,e);const s=Wr(t,o.rowIndex,o.columnIndex);try{const n=await Gu(t,s);if(!n){return t}const e=Tr(t,n.startOffset);Tr(t,n.endOffset);const o=t.lineCache[e.rowIndex+1];if(!o){return t}const c=ag(o.tokens,e.columnIndex);if(c===-1){return t}return t}catch(n){if(n&&n.message.startsWith("Failed to execute definition provider: No definition provider found")){return t}throw n}};const lg=(t,n)=>new Uint32Array([n.startRowIndex,n.startColumnIndex,n.endRowIndex,n.endColumnIndex]);const ug=(t,n,e)=>{const o=lg(t,e);const s={end:{columnIndex:o[3],rowIndex:o[2]},start:{columnIndex:o[1],rowIndex:o[0]}};const c=[{deleted:Pr(t,s),end:s.end,inserted:[n],origin:hs,start:s.start}];return c};const fg=(t,n,e)=>{const o=ug(t,n,e);return ea(t,o)};const hg=(t,n)=>{const e=lg(t,n);return na(t,e)};const gg=t=>({...t,hasListener:false,isSelecting:false,selectionAutoMovePosition:{columnIndex:0,rowIndex:0}});const mg=async(t,n,e,o,s,c,r)=>t;const wg=(t,n)=>t;const pg=async(t,n,e)=>{await yd(t,n,e)};const yg=t=>{globalThis.requestAnimationFrame(t)};const Eg=(t,n)=>t.selections!==n.selections||t.focused!==n.focused||t.minLineY!==n.minLineY||t.maxLineY!==n.maxLineY||t.differences!==n.differences||t.charWidth!==n.charWidth||t.cursorWidth!==n.cursorWidth||t.fontFamily!==n.fontFamily||t.fontSize!==n.fontSize||t.fontWeight!==n.fontWeight||t.isMonospaceFont!==n.isMonospaceFont||t.letterSpacing!==n.letterSpacing||t.lines!==n.lines||t.rowHeight!==n.rowHeight||t.tabSize!==n.tabSize||t.width!==n.width;const xg=(t,n)=>{if(t.textInfos!==n.textInfos||t.differences!==n.differences){return false}return t.lines!==n.lines||t.tokenizerId!==n.tokenizerId||t.minLineY!==n.minLineY||t.maxLineY!==n.maxLineY||t.decorations!==n.decorations||t.embeds!==n.embeds||t.deltaX!==n.deltaX||t.width!==n.width||t.highlightedLine!==n.highlightedLine||t.debugEnabled!==n.debugEnabled};const Ig=async(t,n)=>{let e=n;if(xg(t,n)){const t=Kr();const{differences:o,textInfos:s}=await _r(n,t);e={...n,differences:o,textInfos:s}}if(!Eg(t,n)){return e}const{cursorInfos:o,selectionInfos:s}=await qi(e);return{...e,cursorInfos:o,selectionInfos:s}};const Sg=-1;const kg=0;const vg=1;const Cg=(t,n)=>{if(t.rowIndex>n.rowIndex){return vg}if(t.rowIndex===n.rowIndex){if(t.columnIndex>n.columnIndex){return vg}if(t.columnIndex<n.columnIndex){return Sg}return kg}return Sg};const bg=(t,n)=>new Uint32Array([t.rowIndex,t.columnIndex,n.rowIndex,n.columnIndex]);const Mg=(t,n)=>new Uint32Array([n.rowIndex,n.columnIndex,n.rowIndex,n.columnIndex]);const Ag=(t,n)=>new Uint32Array([t.rowIndex,t.columnIndex,n.rowIndex,n.columnIndex]);const Lg=(t,n)=>{switch(Cg(n,t)){case kg:return Mg(t,n);case vg:return Ag(t,n);case Sg:return bg(t,n);default:throw new Error("unexpected comparison result")}};const Pg=(t,n)=>{const e=t.selectionAnchorPosition;const o=Lg(e,n);return na(t,o)};const Fg=(t,n)=>{const{maxLineY:e,minLineY:o,rowHeight:s}=t;const c=e-o;if(n.rowIndex<o){const e=n.rowIndex;const o=n.rowIndex+c;const r=n.rowIndex*s;const i=t.selectionAnchorPosition;const a=new Uint32Array([n.rowIndex-1,n.columnIndex,i.rowIndex,i.columnIndex]);return{...t,deltaY:r,maxLineY:o,minLineY:e,selections:a}}if(n.rowIndex>e){const c=e-o;const r=n.rowIndex-c;const i=n.rowIndex;const a=r*s;const d=t.selectionAnchorPosition;const l=new Uint32Array([d.rowIndex,d.columnIndex,n.rowIndex+1,n.columnIndex]);return{...t,deltaY:a,maxLineY:i,minLineY:r,selections:l}}return t};const Wg=async t=>{const n=Jo(t);const e=n?.newState;if(!e||!e.hasListener||!e.isSelecting){return}const o=e.selectionAutoMovePosition;if(o.rowIndex===0){return}const s=Fg(e,o);if(e===s){return}const c=o.rowIndex<e.minLineY?-1:1;const r={...s,selectionAutoMovePosition:{columnIndex:o.columnIndex,rowIndex:o.rowIndex+c}};const i=await Ig(e,r);ns(e.uid,e,i);yg(()=>Wg(t))};const Tg=async(t,n,e)=>{h(t);g(n);g(e);const o=await yd(t,n,e);const s=Pg(t,o);if(!t.hasListener&&(o.rowIndex<t.minLineY||o.rowIndex>t.maxLineY)){yg(()=>Wg(t.uid));return{...s,hasListener:true,selectionAutoMovePosition:o}}return s};const Rg=async(t,n,e,o)=>{if(!t.isSelecting){return t}if(o){return pg(t,n,e)}return Tg(t,n,e)};const Dg=t=>({...t,hasListener:false,isSelecting:false,selectionAutoMovePosition:{columnIndex:0,rowIndex:0}});const Og=(t,n,e)=>{if(e<=0){return 0}if(e<=t-n/2){return e/(t-n)}return 1};const Bg=(t,n)=>{const{handleOffsetX:e,longestLineWidth:o,width:s,x:c}=t;if(s>o){return{...t,deltaX:0,scrollBarWidth:0}}const r=20;const i=Ds(n,c,c+s);const a=i-c-e;const d=Gr(s,o);const l=o-s+r;const u=Og(s,d,a);const f=Ds(u,0,1);const h=f*l;return{...t,deltaX:h}};const Ng=(t,n)=>{const{deltaX:e,longestLineWidth:o,width:s,x:c}=t;const r=n-c;const i=Gr(s,o);const a=s-i;const d=Vr(e,a,s,i);const l=r-d;if(l>=0&&l<i){return{...t,handleOffsetX:l}}const{handleOffset:u,percent:f}=Xr(s,i,r);const h=f*a;return{...t,deltaX:h,handleOffsetX:u}};const Hg=(t,n)=>{const{height:e,scrollBarHeight:o}=t;if(n<=e-o/2){return n/(e-o)}return 1};const zg=async(t,n)=>{const{finalDeltaY:e,handleOffset:o=0,y:s}=t;const c=n-s-o;const r=Hg(t,c);const i=r*e;const a=await Qi(t,i);return a};const $g=zg;const Ug=async(t,n)=>{const{deltaY:e,finalDeltaY:o,height:s,scrollBarHeight:c,y:r}=t;const i=n-r;const a=jr(e,o,s,c);const d=i-a;if(d>=0&&d<c){return{...t,handleOffset:d}}const{handleOffset:l,percent:u}=Xr(s,c,i);const f=u*o;const h=await Qi(t,f);return{...h,handleOffset:l}};const Yg=(t,n)=>{};const _g={deltaY:0,touchOffsetY:0};const Vg=(t,n)=>{if(n.touches.length===0){return}const e=n.touches[0];_g.touchOffsetY=e.y;_g.deltaY=t.deltaY};const jg=(t,n)=>Ki(t,n);const qg=(t,n)=>Qi(t,n);const Gg=(t,n,e,o)=>{g(n);g(e);g(o);const{deltaX:s}=t;if(e===0){return jg(t,o)}const c=Ds(s+e,0,Infinity);return{...jg(t,o),deltaX:c}};const Xg=(t,n)=>{if(n.touches.length===0){return}const e=n.touches[0];const o=_g.deltaY+(_g.touchOffsetY-e.y);qg(t,o)};const Zg=(t,n,e,o)=>Gg(t,n,e,o);const Qg=t=>{const n=[];const e=[];for(let n=0;n<t.length;n+=4){const o=t[n];const s=t[n+2];for(let t=o;t<=s;t++){e.push(t)}}for(const t of e){n.push({deleted:[" "],end:{columnIndex:2,rowIndex:t},inserted:[""],origin:ks,start:{columnIndex:0,rowIndex:t}})}return n};const Kg=t=>{const{selections:n}=t;const e=Qg(n);return ea(t,e)};const Jg=t=>{const n=[];for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+2];for(let t=o;t<=s;t++){n.push(t)}}const e=Array.from(n,t=>({deleted:[""],end:{columnIndex:0,rowIndex:t},inserted:[" "],origin:vs,start:{columnIndex:0,rowIndex:t}}));return e};const tm=t=>{const{selections:n}=t;const e=Jg(n);return ea(t,e)};const nm=async t=>Eo("Languages.getLanguageConfiguration",{languageId:t.languageId,uri:t.uri});const em=t=>{if(t?.indentationRules?.increaseIndentPattern&&typeof t.indentationRules.increaseIndentPattern==="string"){const n=new RegExp(t.indentationRules.increaseIndentPattern);return n}return undefined};const om=(t,n)=>{if(!n){return false}return n.test(t)};const sm=(t,n,e)=>{const o=[];const s=[];const c=em(e);for(let e=0;e<n.length;e+=4){const[r,i,a,d]=Si(n,e);const l={columnIndex:i,rowIndex:r};const u={columnIndex:d,rowIndex:a};const f={end:u,start:l};if(Ni(r,i,a,d)){const n=t[r];const e=n.slice(0,i);const a=br(e);if(om(e,c)){o.push({deleted:Pr({lines:t},f),end:u,inserted:["",a+" ",a],origin:Cs,start:l});s.push(r+1,a.length+2,r+1,a.length+2)}else{o.push({deleted:Pr({lines:t},f),end:u,inserted:["",a],origin:Cs,start:l});s.push(r+1,a.length,r+1,a.length)}}else{o.push({deleted:Pr({lines:t},f),end:u,inserted:["",""],origin:Cs,start:l});s.push(r+1,0,r+1,0)}}return{changes:o,selectionChanges:new Uint32Array(s)}};const cm=async t=>{const{lines:n,selections:e}=t;const o=await nm(t);const{changes:s,selectionChanges:c}=sm(n,e,o);return ea(t,s,c)};const rm=2;const im=0;const am=()=>{const t=Vd();const n={id:Fe,newState:{focused:true,focusSource:rm,height:0,questions:[],uid:t,width:0,x:0,y:0},oldState:{focused:false,focusSource:im,height:0,questions:[],uid:t,width:0,x:0,y:0}};return n};const dm=async t=>{const n={...t,height:45,width:150,x:100,y:100};return n};const lm=async t=>{const n=true;return _d(Fe,ls,t,am,dm,n)};const um=()=>{const t=Vd();const n={id:Te,newState:{commands:[],height:0,uid:t,width:0,x:0,y:0},oldState:{commands:[],height:0,uid:t,width:0,x:0,y:0}};return n};const{invoke:fm,setFactory:hm}=Ho(qe);const gm=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=Jo(n);const{languageId:a}=i;await fm("Completions.create",o,c,r,s,e,n,a);await fm("Completions.loadContent",o);const d=await fm("Completions.diff2",o);const l=await fm("Completions.render2",o,d);return{...t,commands:l}};const mm=async t=>{const n=false;return _d(Te,ss,t,um,gm,n)};const wm=()=>{const t=Vd();const n={id:De,newState:{commands:[],editorUid:0,height:0,uid:t,width:0,x:0,y:0},oldState:{commands:[],editorUid:0,height:0,uid:t,width:0,x:0,y:0}};return n};const pm=async()=>{const t="Find Widget Worker";const n="findWidgetWorkerMain.js";return Yo(t,n)};const ym=9002;const Em=async()=>{if(Un(ym)){return}const t=await pm();$n(ym,t)};const xm=async(t,...n)=>{const e=Un(ym);return await e.invoke(t,...n)};const Im=async()=>{const t=Un(ym);Yn(ym);if(t){await t.dispose()}};const Sm=t=>{const n=Jo(t);if(!n){throw new Error(`editor ${t} not found`)}const{newState:e}=n;return e};const km=async(t,n)=>{const{uid:e}=t;const o=Sm(n);const{height:s,width:c,x:r,y:i}=o;await Em();await xm("FindWidget.create",e,r,i,c,s,n);await xm("FindWidget.loadContent",e);const a=await xm("FindWidget.diff2",e);const d=await xm("FindWidget.render2",e,a);return{...t,commands:d}};const vm=(t,n)=>km(t,n);const Cm=async t=>{const n=true;return _d(De,rs,t,wm,vm,n)};const bm=async t=>Cm(t);const Mm=t=>{const{selections:n}=t;const e=n[0];const o=n[1];const s=Ed(t,e,o);const c=xd(t,e);return{columnIndex:o,rowIndex:e,x:s,y:c}};const Am=()=>{const t=Vd();const n={id:Be,newState:{commands:[],height:0,uid:t,width:0,x:0,y:0},oldState:{commands:[],height:0,uid:t,width:0,x:0,y:0}};return n};const Lm=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=Jo(n);const{languageId:a}=i;await Nd("Rename.create",o,c,r,s,e,n,a);await Nd("Rename.loadContent",o);const d=await Nd("Rename.diff2",o);const l=await Nd("Rename.render2",o,d);return{...t,commands:l}};const Pm=async t=>{const{columnIndex:n,rowIndex:e}=Mm(t);const{word:o}=ju(t,e,n);if(!o){return t}const s=true;return _d(Be,as,t,Am,Lm,s)};const Fm=async t=>{const n=await Ca({args:[],editor:t,event:"onLanguage",method:"ExtensionHostOrganizeImports.execute"});return n};const Wm=async t=>{const n=await Fm(t);return sd(t,n)};const Tm=(t,n)=>{const e=Ei(n);const o=ld(t,e,ys);return ea(t,o)};const Rm=async t=>{const n=await Ao();w(n);return Tm(t,n)};const Dm=t=>{const{redoStack:n=[]}=t;if(n.length===0){return t}const e=n.at(-1);const o={...t,redoStack:n.slice(0,-1),undoStack:[...t.undoStack,e]};return oa(o,e)};const Om=t=>{if(!t){return`Error: ${t}`}let{message:n}=t;while(t.cause){t=t.cause;n+=`: ${t}`}return n};const Bm=t=>{if(!t){return{codeFrame:undefined,message:t,stack:undefined,type:"Error"}}const n=Om(t);if(t.codeFrame){return{codeFrame:t.codeFrame,message:n,stack:t.stack,type:t.constructor.name}}return{category:t.category,codeFrame:t.originalCodeFrame,message:n,stack:t.originalStack,stderr:t.stderr}};const Nm=/\((.*):(\d+):(\d+)\)$/;const Hm=/at (.*):(\d+):(\d+)$/;const zm=t=>{for(const n of t){if(Nm.test(n)||Hm.test(n)){return n}}return""};const $m=async t=>{try{const n=Ei(t.stack);const e=zm(n);let o=e.match(Nm);if(!o){o=e.match(Hm)}if(!o){return t}const s=vr(n.slice(1));const c=Om(t);return{message:c,stack:s,type:t.constructor.name}}catch(n){console.warn("ErrorHandling Error");console.warn(n);return t}};const Um=async t=>{if(t&&t.message&&t.codeFrame){return Bm(t)}if(t&&t.stack){return $m(t)}return t};const Ym=t=>{if(t&&t.type&&t.message&&t.codeFrame){return`${t.type}: ${t.message}\n\n${t.codeFrame}\n\n${t.stack}`}if(t&&t.message&&t.codeFrame){return`${t.message}\n\n${t.codeFrame}\n\n${t.stack}`}if(t&&t.type&&t.message){return`${t.type}: ${t.message}\n${t.stack}`}if(t&&t.stack){return t.stack}if(t===null){return null}return String(t)};const _m=async t=>{const n=await Um(t);const e=Ym(n);console.error(e);return n};const Vm=async t=>{try{await _m(t)}catch(n){console.warn("ErrorHandling error");console.warn(n);console.error(t)}};const jm=async t=>t;const qm=t=>t.startsWith("untitled:");const Gm=async(t,n)=>{await Eo("FileSystem.writeFile",t,n)};const Xm=async t=>{const n="Save File";const{canceled:e,filePath:o}=await go("Open.showSaveDialog",n,[],t);if(e){return""}return o};const Zm=async(t,n,e)=>{const o=await Xm(e);if(!o){return}await Eo("FileSystem.writeFile",o,n);await Co();await Eo("Main.handleUriChange",t,o);return o};const Qm=t=>{const n="code"in t?t.code:undefined;return n==="EACCES"||t.message.includes("EACCES:")};const Km=async t=>{if(Qm(t)){await Eo("ElectronDialog.showMessageBox",{buttons:["OK"],defaultId:0,message:"You don't have permission to save changes to this file.",title:"Unable to Save File",type:"error"});return}await Eo("ElectronDialog.showMessageBox",{buttons:["OK"],defaultId:0,detail:t.message,message:"Saving the file failed.",title:"Failed to Save File",type:"error"})};const Jm=async t=>{try{const{platform:n,uri:e}=t;const o=await jm(t);const s=Lr(o);if(qm(e)){const t=await Zm(e,s,n);if(t){return{...o,modified:false,uri:t}}return o}await Gm(e,s);return{...o,modified:false}}catch(n){const e=new k(n,`Failed to save file "${t.uri}"`);await Vm(e);if(t.platform===je){try{await Km(e)}catch(t){await Vm(t)}}return t}};const tw=t=>{const{lines:n}=t;const e=0;const o=0;const s=n.length-1;const c=n.at(-1).length;const r=Wi(e,o,s,c);return na(t,r)};const nw=(t,n,e)=>{const o=Ri(t);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=Si(t,s);dl(o,s+2,c,r,n,e);il(o,s,i,a)}return o};const ew=(t,n)=>{const{lines:e,selections:o}=t;const s=nw(o,e,n);return na(t,s)};const ow=t=>{ew(t,wl)};const sw=/[a-zA-Z\d]/;const cw=t=>sw.test(t);const rw=t=>cw(t)||t==="_";const iw=(t,n)=>{for(let e=n-1;e>=0;e--){if(!rw(t[e])){return e+1}}return 0};const aw=(t,n)=>{for(let e=n;e<t.length;e++){if(!rw(t[e])){return e}}return t.length};const dw=(t,n,e)=>{const o=t[n];const s=iw(o,e);const c=aw(o,e);const r=o.slice(s,c);return{end:c,start:s,word:r}};const lw=(t,n,e)=>{let o=0;if(!t[n+o].endsWith(e[o])){return false}while(++o<e.length-1){if(t[n+o]!==e[o]){return false}}return t[n+o].startsWith(e[o])};const uw=(t,n)=>{if(n.length===0){throw new Error("word length must be greater than zero")}const e=[];for(let o=0;o<t.length;o++){const s=t[o];let c=-n.length;while((c=s.indexOf(n,c+n.length))!==-1){e.push(o,c,o,c+n.length)}}return new Uint32Array(e)};const fw=(t,n)=>{const e=[];for(let o=0;o<t.length-n.length+1;o){if(lw(t,o,n)){e.push(o,t[o].length-n[0].length,o+n.length-1,n.at(-1).length);o+=n.length-1}else{o++}}return new Uint32Array(e)};const hw=(t,n)=>{if(n.length<4){throw new Error("selections must have at least one entry")}const e=0;const o=n[e];const s=n[e+1];const c=n[e+2];const r=n[e+3];if(o===c){if(s===r){const e=dw(t,c,r);if(e.start===e.end){return n}const o=uw(t,e.word);return o}const e=t[o];const i=e.slice(s,r);const a=uw(t,i);return a}const i=[];i.push(t[o].slice(s));for(let n=o+1;n<c-1;n++){i.push(t[n])}i.push(t[c].slice(0,r));const a=fw(t,i);return a};const gw=t=>{const{lines:n,selections:e}=t;const o=hw(n,e);return na(t,o)};const mw=(t,n,e)=>{const o=new Uint32Array(t.length);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=Si(t,s);const d=n[i];o[s]=c;o[s+1]=r;if(a>=d.length){o[s+2]=i+1;o[s+3]=0}else{const t=e(d,a);o[s+2]=i;o[s+3]=a+t}}return o};const ww=(t,n)=>{const{lines:e}=t;const{selections:o}=t;const s=mw(o,e,n);return na(t,s)};const pw=t=>ww(t,pl);const yw=t=>ew(t,fl);const Ew=t=>ww(t,gl);const xw=(t,n)=>{const e=t.length-1;const o=new Uint32Array(n.length);for(let t=0;t<n.length;t+=4){const[s,c,r,i]=Si(n,t);o[t]=s;o[t+1]=c;o[t+2]=Math.min(r+1,e);o[t+3]=i}return o};const Iw=t=>{const{lines:n,selections:e}=t;const o=xw(n,e);return na(t,o)};const Sw=(t,n)=>{const e=new Uint32Array(n.length);for(let o=0;o<n.length;o+=4){const[s,c,r,i]=Si(n,o);if(s===r&&c===i){const n=s;let r=c;let a=i;const d=t[n];while(r>0&&d[r]!==mr){r--}r++;while(a<d.length&&d[a]!==mr){a++}e[o]=n;e[o+1]=r;e[o+2]=n;e[o+3]=a}else{e[o]=s;e[o+1]=c;e[o+2]=r;e[o+3]=i}}return e};const kw=t=>{const{selections:n}=t;const{lines:e}=t;const o=Sw(e,n);return na(t,o)};const vw=async(t,n)=>{const e=await Eo("ExtensionHostSelection.executeGrowSelection",t,n);if(e.length===0){return n}return new Uint32Array(e)};const Cw=async t=>{const{selections:n}=t;const e=await vw(t,n);return na(t,e)};const bw=(t,n)=>{const e=n.length-4;const o=n[e];const s=n[e+1];const c=n[e+3];const r=t[o];const i=r.slice(s,c);const a=r.indexOf(i,c);if(a!==-1){const t=a+i.length;const e=new Uint32Array(n.length+4);e.set(n,0);const s=n.length;e[s]=o;e[s+1]=a;e[s+2]=o;e[s+3]=t;return{revealRange:e.length-4,selectionEdits:e}}for(let e=o+1;e<t.length;e++){const o=t[e];const s=o.indexOf(i);if(s!==-1){const t=s+i.length;const o=new Uint32Array(n.length+4);o.set(n,0);const c=n.length;o[c]=e;o[c+1]=s;o[c+2]=e;o[c+3]=t;return{revealRange:o.length-4,selectionEdits:o}}}let d=0;for(let e=0;e<=o;e++){const o=t[e];let s=-i.length;while((s=o.indexOf(i,s+i.length))!==-1){let t=n[d];while(t<e&&d<n.length){d+=4;t=n[d]}if(t===e){let t=n[d+3];while(t<s&&d<n.length){d+=4;t=n[t+3]}}t=n[d];const o=n[d+1];const c=n[d+3];const r=t===e&&o<=s&&s<=c;if(!r){if(t>e){d-=4}const o=s+i.length;d+=4;const c=new Uint32Array(n.length+4);c.set(n.subarray(0,d),0);c[d]=e;c[d+1]=s;c[d+2]=e;c[d+3]=o;c.set(n.subarray(d),d+4);return{revealRange:c.length-4,selectionEdits:c}}}}return undefined};const Mw=t=>{const{lines:n}=t;const{selections:e}=t;if($i(e)){const t=new Uint32Array(e.length);for(let o=0;o<e.length;o+=4){const[s,c,r,i]=Si(e,o);const a=dw(n,s,c);t[o]=s;if(a.start===a.end){t[o+1]=c;t[o+2]=r;t[o+3]=i}else{t[o+1]=a.start;t[o+2]=s;t[o+3]=a.end}}return{revealRange:t.length-4,selectionEdits:t}}if(Ui(t.selections)){return bw(t.lines,t.selections)}return undefined};const Aw=(t,n,e,o)=>e>=t&&o<=n;const Lw=t=>{const n=Mw(t);if(!n){return t}const{revealRange:e,selectionEdits:o}=n;const s=o[e];const c=o[e+2];if(Aw(t.minLineY,t.maxLineY,s,c)){return na(t,o)}return ea(t,[],o)};const Pw=t=>t;const Fw=(t,n)=>{const e=new Uint32Array(n.length);for(let t=0;t<n.length;t+=4){const[o,s,c,r]=Si(n,t);e[t]=Math.max(o-1,0);e[t+1]=s;e[t+2]=c;e[t+3]=r}return e};const Ww=t=>{const{lines:n,selections:e}=t;const o=Fw(n,e);return na(t,o)};const Tw=t=>ew(t,Cl);const Rw=t=>ww(t,Ll);const Dw=(t,n,e)=>{if(t.decorations.length===0&&n.length===0){return t}return{...t,decorations:n,diagnostics:e}};const Ow=async(t,n,e)=>{const{tokenizerId:o}=t;Xc(n,e);await er(n,e);const s=or(n);const c=o+1;cr(c,s);const r=Sm(t.uid);if(!r){return t}const i=Kr();const{differences:a,textInfos:d}=await _r(t,i);const l=Sm(t.uid);if(!l){return t}const u={...l,differences:a,focused:true,textInfos:d};return{...u,invalidStartIndex:0,languageId:n,tokenizerId:c}};const Bw=(t,n)=>{const{maxLineY:e,minLineY:o,rowHeight:s}=t;const c=n[0];if(c<o){const e=c*s;return{...t,deltaY:e,maxLineY:c+1,minLineY:c,selections:n}}if(c>e){const e=c*s;return{...t,deltaY:e,maxLineY:c+1,minLineY:c,selections:n}}return{...t,selections:n}};const Nw=(t,n)=>{w(n);const e=t.lines.length-1;const o=t.lines.at(-1).length;const s={columnIndex:0,rowIndex:0};const c={columnIndex:o,rowIndex:e};const r=[{deleted:Pr(t,{end:c,start:s}),end:c,inserted:Ei(n),origin:xs,start:s}];return ea(t,r)};const Hw=()=>{const t=Vd();const n={id:Oe,newState:{commands:[],content:"",diagnostics:[],documentation:"",editorUid:0,height:0,lineInfos:[],uid:t,width:0,x:0,y:0},oldState:{commands:[],content:"",diagnostics:[],documentation:"",editorUid:0,height:0,lineInfos:[],uid:t,width:0,x:0,y:0}};return n};const zw=async()=>{const t="Hover Worker";const n="hoverWorkerMain.js";const e="Hover.initialize";const o=await Yo(t,n,e);return o};const $w={};const Uw=()=>{if(!$w.workerPromise){$w.workerPromise=zw()}return $w.workerPromise};const Yw=async(t,...n)=>{const e=await Uw();return await e.invoke(t,...n)};const _w=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=Jo(n);const{languageId:a}=i;await Yw("Hover.create",o,c,r,s,e,n,a);await Yw("Hover.loadContent",o);const d=await Yw("Hover.diff2",o);const l=await Yw("Hover.render2",o,d);return{...t,commands:l}};const Vw=async t=>{const n=false;return _d(Oe,is,t,Hw,_w,n)};const jw="EditorHover";const qw=async t=>{await Eo("Viewlet.openWidget",jw);return t};const Gw=()=>{const t=Vd();const n={id:Ne,newState:{commands:[],focusedIndex:0,height:0,maxHeight:0,sourceActions:[],uid:t,width:0,x:0,y:0},oldState:{commands:[],focusedIndex:0,height:0,maxHeight:0,sourceActions:[],uid:t,width:0,x:0,y:0}};return n};const Xw=async()=>{const t="Source Action Worker";const n="sourceActionWorkerMain.js";const e="SourceActions.initialize";const o=await Yo(t,n,e);return o};const Zw={};const Qw=()=>{if(!Zw.workerPromise){Zw.workerPromise=Xw()}return Zw.workerPromise};const Kw=async(t,...n)=>{const e=await Qw();return await e.invoke(t,...n)};const Jw=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=Jo(n);const{languageId:a}=i;await Kw("SourceActions.create",o,c,r,s,e,n,a);await Kw("SourceActions.loadContent",o);const d=await Kw("SourceActions.diff2",o);const l=await Kw("SourceActions.render2",o,d);return{...t,commands:l}};const tp=async t=>_d(Ne,ds,t,Gw,Jw);const np=(t,n)=>t.localeCompare(n);const ep=t=>{const n=[...t];n.sort(np);return n};const op="sort-lines-ascending";const sp=(t,n)=>{const e=n[0];const o=n[2];const s=[];for(let c=0;c<n.length;c+=4){const r=n[c];const i=n[c+1];const a=n[c+2];const d=n[c+3];const l={columnIndex:i,rowIndex:r};const u={columnIndex:d,rowIndex:a};const f={end:u,start:l};const h=t.slice(e,o+1);const g=ep(h);s.push({deleted:Pr({lines:t},f),end:u,inserted:g,origin:op,start:l})}return s};const cp=t=>{const{lines:n,selections:e}=t;const o=sp(n,e);return ea(t,o)};const rp=async(t,n)=>Ca({args:[n],editor:t,event:va,method:la,noProviderFoundMessage:"No tab completion provider found",noProviderFoundResult:undefined});const ip=t=>{const{selections:n}=t;const e=n[0];const o=n[1];const s=Wr(t,e,o);return s};const ap=async t=>{const n=ip(t);const e=await rp(t,n);return e};const dp=(t,n,e)=>{const o=Ei(e.inserted);const s=[];const c=[];for(let r=0;r<n.length;r+=4){const[i,a,d,l]=Si(n,r);if(o.length>1){const n=Ar({lines:t},i);const r=br(n);const u=[o[0],...o.slice(1).map(t=>r+t)];const f=[""];s.push({deleted:f,end:{columnIndex:l,rowIndex:d},inserted:u,origin:Es,start:{columnIndex:a-e.deleted,rowIndex:i}});const h=o.at(-1);c.push(d+o.length-f.length,l+h.length,d+o.length-f.length,l+h.length)}else{const t=o[0];const n=t.indexOf("$0");if(n===-1){const t=a-e.deleted;c.push(i,t,i,t);s.push({deleted:[""],end:{columnIndex:l,rowIndex:d},inserted:o,origin:Es,start:{columnIndex:a-e.deleted,rowIndex:i}})}else{const n=t.replace("$0","");const o=l+2;c.push(i,o,i,o);s.push({deleted:[""],end:{columnIndex:l,rowIndex:d},inserted:[n],origin:Es,start:{columnIndex:a-e.deleted,rowIndex:i}})}}}return{changes:s,selectionChanges:new Uint32Array(c)}};const lp=(t,n)=>{const{lines:e,selections:o}=t;const{changes:s,selectionChanges:c}=dp(e,o,n);return ea(t,s,c)};const up=String;const fp=async t=>{try{const n=await ap(t);if(!n){return t}return lp(t,n)}catch(n){await Vm(n);const e=t.selections[0];const o=t.selections[1];return kd(t,e,o,up(n))}};const hp=async(t,n)=>{const{assetDir:e,platform:o}=t;try{await zo(`onLanguage:${t.languageId}`,e,o);const s=await fa(`ExtensionHostCommment.execute`,t.uid,n);if(s){return s}}catch{}const s=await nm(t);if(!s?.comments?.blockComment){return undefined}return s.comments.blockComment};const gp=/^\s+/;const mp=/\s+$/;const wp=(t,n,e)=>({deleted:[e],end:{columnIndex:n+e.length,rowIndex:t},inserted:[],origin:As,start:{columnIndex:n,rowIndex:t}});const pp=(t,n,e,o,s,c,r)=>{if(n===o){return[wp(t,e,c),wp(t,s-c.length,r)]}return[wp(n,e,c),wp(o,s,r)]};const yp=(t,n)=>{const{selections:e}=t;const[o]=e;const s=Ar(t,o);const c=t.lines.length;let r=o;let i=-1;const a=n[0];const d=n[1];while(r<c){const n=Ar(t,r);i=n.indexOf(d);if(i!==-1){break}r++}let l=-1;let u=o;while(u>=0){const n=Ar(t,u);l=n.indexOf(a);if(l!==-1){break}u--}const f=[];if(l!==-1&&i!==-1){f.push(...pp(o,u,l,r,i,a,d))}else{const t=s.match(gp);const n=s.match(mp);let e=0;let c=s.length;if(t){e+=t[0].length}if(n){c-=n[0].length}const r={deleted:[],end:{columnIndex:e,rowIndex:o},inserted:[a],origin:As,start:{columnIndex:e,rowIndex:o}};const i={deleted:[],end:{columnIndex:c+a.length,rowIndex:o},inserted:[d],origin:As,start:{columnIndex:c+a.length,rowIndex:o}};f.push(r,i)}return f};const Ep=async t=>{const n=ip(t);const e=await hp(t,n);if(!e){return t}const o=yp(t,e);return sa(t,o)};const xp=async t=>{const n=await nm(t);if(!n?.comments?.lineComment){return undefined}return n.comments.lineComment};const Ip=/^\s+/;const Sp=(t,n,e)=>{const o=n.match(Ip);const s=o?o[0].length:0;if(n.slice(s).startsWith(e)){if(n[s+e.length]===" "){return{deleted:[e+" "],end:{columnIndex:s+e.length+1,rowIndex:t},inserted:[""],origin:bs,start:{columnIndex:s,rowIndex:t}}}return{deleted:[e],end:{columnIndex:s+e.length,rowIndex:t},inserted:[""],origin:bs,start:{columnIndex:s,rowIndex:t}}}return{deleted:[],end:{columnIndex:s,rowIndex:t},inserted:[`${e} `],origin:bs,start:{columnIndex:s,rowIndex:t}}};const kp=async t=>{const n=await xp(t);if(!n){return t}const e=t;const o=t.selections[0];const s=Ar(e,o);const c=[Sp(o,s,n)];return ea(t,c)};const vp=async t=>{try{const n=await kp(t);if(t!==n){return n}return Ep(t)}catch(n){od(n);await Sd(t,0,0,String(n),true);return t}};const Cp=async(t,n)=>{const e=ld(t,[n],xs);const o=await ea(t,e);if(o.completionsOnType){const t=await mm(o);return t}return o};const bp="/";const Mp="{";const Ap="}";const Lp="(";const Pp=")";const Fp="[";const Wp="]";const Tp="???";const Rp="'";const Dp='"';const Op="`";const Bp=t=>{switch(t){case Mp:return Ap;case Lp:return Pp;case Fp:return Wp;default:return Tp}};const Np=(t,n)=>{const e=Bp(n);const o=n+e;const s=ld(t,[o],Is);const c=new Uint32Array([s[0].start.rowIndex,s[0].start.columnIndex+1,s[0].end.rowIndex,s[0].end.columnIndex+1]);return ea(t,s,c)};const Hp=t=>{const{selections:n}=t;const e=new Uint32Array([n[0],n[1]+1,n[2],n[3]+1]);return na(t,e)};const zp=(t,n)=>{const{autoClosingRanges:e=[],selections:o}=t;if(ku(e,o)){return Hp(t)}return Cp(t,n)};const $p=(t,n)=>{const e=n+n;const o=ld(t,[e],Is);const s=new Uint32Array([o[0].start.rowIndex,o[0].start.columnIndex+1,o[0].end.rowIndex,o[0].end.columnIndex+1]);return ea(t,o,s)};const Up=async(t,n)=>{const e=Wr(t,t.selections[0],t.selections[1]);const o=await Eo("ExtensionHostClosingTagCompletion.executeClosingTagProvider",t,e,n);if(!o){const e=ld(t,[n],xs);return ea(t,e)}const s=ld(t,[o.inserted],xs);return ea(t,s)};const Yp=async(t,n)=>{const{isAutoClosingBracketsEnabled:e,isAutoClosingQuotesEnabled:o,isAutoClosingTagsEnabled:s}=t;switch(n){case bp:if(s){return Up(t,n)}break;case Ap:case Pp:case Wp:if(e){return zp(t,n)}break;case Mp:case Lp:case Fp:if(e){return Np(t,n)}break;case Op:case Dp:case Rp:if(o){return $p(t,n)}break}const c=Cp(t,n);return c};const _p=t=>{const n=t.end.columnIndex-t.deleted[0].length+t.inserted[0].length;return{deleted:t.inserted,end:{columnIndex:n,rowIndex:t.end.rowIndex},inserted:t.deleted,start:t.start}};const Vp=t=>{const{undoStack:n}=t;if(n.length===0){return t}const e=n.at(-1);const o=e.map(_p);const s={...t,redoStack:[...t.redoStack||[],e],undoStack:n.slice(0,-1)};return oa(s,o)};const jp=t=>t;const qp=t=>{switch(t){case We:case Te:case De:case Oe:case Be:case Ne:return true;default:return false}};const Gp=(t,n,e)=>{const o=e(t);const{uid:s}=t.newState;const c=[];c.push(["Viewlet.createFunctionalRoot",n,s,qp(t.id)]);c.push(...o);if(qp(t.id)){c.push(["Viewlet.appendToBody",s])}else{c.push(["Viewlet.send",s,"appendWidget"])}const r=c.findIndex(t=>t[2]==="focus"||t[0]==="Viewlet.focusSelector");if(r!==-1){const t=c[r];c.splice(r,1);c.push(t)}return c};const Xp=t=>{switch(t){case We:return qo;case Te:return fm;case De:return xm;case Oe:return Yw;case Be:return Nd;case Ne:return Kw;default:return undefined}};const Zp="Close";const Qp=(t,n,e)=>{const o=t=>t.id===n;const s=t.widgets.findIndex(o);if(s===-1){return t}const c=t.widgets[s];const r={...c,newState:e,oldState:c.newState};const i=[...t.widgets.slice(0,s),r,...t.widgets.slice(s+1)];return{...t,widgets:i}};const Kp=(t,n)=>{for(const e of ts()){const o=Jo(Number(e)).newState;const s=o.widgets||[];for(const e of s){if(e.id===n&&e.newState.uid===t){return o}}}return undefined};const Jp=(t,n)=>{if(t&&t.widgets){return t}const e=Jo(t);if(e&&e.newState&&e.newState.widgets){return e.newState}return Kp(t,n)};const ty=(t,n,e)=>{const o=t=>t.id===e;const s=n=>t==="close"||t==="handleClickButton"&&n.includes(Zp);const c=async(c,...r)=>{const i=Jp(c,e);if(!i){return c}const a=i.widgets.findIndex(o);if(a===-1){return i}const d=i.widgets[a];const l=d.newState;const{uid:u}=l;const f=Xp(e);await f(`${n}.${t}`,u,...r);const h=await f(`${n}.diff2`,u);const g=await f(`${n}.render2`,u,h);const m=Jo(i.uid).newState;if(s(r)){const t={...m,focused:true,widgets:Pd(m.widgets,e)};ns(i.uid,m,t);return t}const w={...l,commands:g};const p=Qp(m,e,w);ns(i.uid,m,p);return p};return c};const ny=(t,n,e)=>{const o=Object.create(null);for(const s of t){o[s]=ty(s,n,e)}return o};const ey="Viewlet.appendToBody";const oy="focus";const sy="Viewlet.registerEventListeners";const cy="Viewlet.setSelectionByName";const ry="Viewlet.setValueByName";const iy="Viewlet.setFocusContext";const ay="setBounds";const dy="Viewlet.setBounds";const ly="Viewlet.setCss";const uy="Viewlet.setDom2";const fy="Viewlet.setUid";const hy=(t,n)=>{const e=[...n.commands];n.commands=[];return e};const gy=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const my=t=>{const n=hy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(gy.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const wy=t=>Gp(t,"EditorCompletion",my);const py=t=>[["Viewlet.dispose",t.newState.uid]];const{close:yy,closeDetails:Ey,focusFirst:xy,focusIndex:Iy,focusLast:Sy,focusNext:ky,focusPrevious:vy,handleEditorBlur:Cy,handleEditorClick:by,handleEditorDeleteLeft:My,handleEditorType:Ay,handlePointerDown:Ly,handleWheel:Py,openDetails:Fy,selectCurrent:Wy,selectIndex:Ty,toggleDetails:Ry}=ny(["handleEditorType","focusFirst","focusNext","focusPrevious","focusLast","handleEditorDeleteLeft","openDetails","focusIndex","handleEditorBlur","handleEditorClick","openDetails","selectCurrent","selectIndex","toggleDetails","closeDetails","handleWheel","close","handlePointerDown"],"Completions",Te);const Dy={__proto__:null,add:wy,close:yy,closeDetails:Ey,focusFirst:xy,focusIndex:Iy,focusLast:Sy,focusNext:ky,focusPrevious:vy,handleEditorBlur:Cy,handleEditorClick:by,handleEditorDeleteLeft:My,handleEditorType:Ay,handlePointerDown:Ly,handleWheel:Py,openDetails:Fy,remove:py,render:my,selectCurrent:Wy,selectIndex:Ty,toggleDetails:Ry};const Oy=(t,n)=>{const e=[...n.commands];n.commands=[];return e};const By=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const Ny=t=>{const n=Oy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(By.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const Hy=t=>Gp(t,"FindWidget",Ny);const zy=t=>[["Viewlet.dispose",t.newState.uid]];const{close:$y,focusCloseButton:Uy,focusFind:Yy,focusNext:_y,focusNextElement:Vy,focusNextMatchButton:jy,focusPrevious:qy,focusPreviousElement:Gy,focusPreviousMatchButton:Xy,focusReplace:Zy,focusReplaceAllButton:Qy,focusReplaceButton:Ky,focusToggleReplace:Jy,handleBlur:tE,handleClickButton:nE,handleFocus:eE,handleInput:oE,handleReplaceFocus:sE,handleReplaceInput:cE,handleToggleReplaceFocus:rE,replace:iE,replaceAll:aE,toggleMatchCase:dE,toggleMatchWholeWord:lE,togglePreserveCase:uE,toggleReplace:fE,toggleUseRegularExpression:hE}=ny(["close","focusCloseButton","focusFind","focusNext","focusNextMatchButton","focusPrevious","focusPreviousMatchButton","focusReplace","focusReplaceAllButton","focusReplaceButton","focusToggleReplace","handleBlur","handleClickButton","handleFocus","handleInput","handleReplaceFocus","handleReplaceInput","handleToggleReplaceFocus","replace","replaceAll","toggleMatchCase","toggleMatchWholeWord","toggleReplace","toggleUseRegularExpression","focusNextElement","focusPreviousElement","togglePreserveCase"],"FindWidget",De);const gE={__proto__:null,add:Hy,close:$y,focusCloseButton:Uy,focusFind:Yy,focusNext:_y,focusNextElement:Vy,focusNextMatchButton:jy,focusPrevious:qy,focusPreviousElement:Gy,focusPreviousMatchButton:Xy,focusReplace:Zy,focusReplaceAllButton:Qy,focusReplaceButton:Ky,focusToggleReplace:Jy,handleBlur:tE,handleClickButton:nE,handleFocus:eE,handleInput:oE,handleReplaceFocus:sE,handleReplaceInput:cE,handleToggleReplaceFocus:rE,remove:zy,render:Ny,replace:iE,replaceAll:aE,toggleMatchCase:dE,toggleMatchWholeWord:lE,togglePreserveCase:uE,toggleReplace:fE,toggleUseRegularExpression:hE};const mE=t=>({documentId:t.id||t.uid,languageId:t.languageId,text:Lr(t),uri:t.uri});const wE=async(t,n)=>{const e=mE(t);return uo("Extensions.executeHoverProvider",e,n)};const pE=async(t,n)=>{h(t);g(n);const e=await wE(t,n);if(e){return e}return Ca({args:[n],editor:t,event:ka,method:da,noProviderFoundMessage:"No hover provider found"})};const yE=async(t,n)=>{h(t);g(n);const e=await pE(t,n);return e};const EE=async(t,n,e,o,s)=>100;const xE=(t,n,e)=>{const o=n.length;let s=0;let c=0;const r=[];for(let i=0;i<o;i+=2){const o=n[i];const a=n[i+1];s+=a;const d=t.slice(c,s);const l=`Token ${e[o]||"Unknown"}`;const u=d;r.push(u,l);c=s}return r};const IE=(t,n,e)=>{const o=[];const{hasArrayReturn:s,initialLineState:c,tokenizeLine:r,TokenMap:i}=n;let a=Ac(c);for(const n of t){const t=Wc(e,r,n,a,s);const{tokens:c}=t;const d=xE(n,c,i);o.push(d);a=t}console.error({lineInfos:o});return o};const SE=async(t,n,e)=>{await er(n,e);const o=or(n);const s=Ei(t);const c=IE(s,o,n);return c};const kE=(t,n)=>{if(t){return t}const e=n[0];const o=n[1];return{columnIndex:o,rowIndex:e}};const vE=(t,n,e)=>{const o=[];for(const e of t){if(e.rowIndex===n){o.push(e)}}return o};const CE="typescript";const bE=(t,n,e,o)=>{const s=Ed(t,n,e);const c=t.height-xd(t,n)+t.y+40;return{x:s,y:c}};const ME=async(t,n)=>{g(t);const e=Jo(t);const o=e.newState;const{selections:s}=o;const{columnIndex:c,rowIndex:r}=kE(n,s);const i=Wr(o,r,c);const a=await yE(o,i);if(!a){return undefined}const{displayString:d,displayStringLanguageId:l,documentation:u}=a;const f="";const h=await SE(d,l||CE,f);const m=qu(o,r,c);const w=c-m.length;await EE();const{x:p,y:y}=bE(o,r,w);const E=o.diagnostics||[];const x=vE(E,r);return{documentation:u,lineInfos:h,matchingDiagnostics:x,x:p,y:y}};const AE=async(t,n,e)=>{const o=await ME(t,e);if(!o){return n}const{documentation:s,lineInfos:c,matchingDiagnostics:r,x:i,y:a}=o;return{...n,diagnostics:r,documentation:s,lineInfos:c,x:i,y:a}};const LE=(t,n,e)=>t;const PE=(t,n,e)=>{const{x:o}=t;const s=100;const c=Math.max(n-o,s);return{...t,resizedWidth:c}};const FE=(t,n,e)=>t;const WE="CodeGeneratorInput";const TE="CodeGeneratorMessage";const RE="CodeGeneratorWidget";const DE="DiagnosticError";const OE="DiagnosticWarning";const BE="CompletionDetailCloseButton";const NE="CompletionDetailContent";const HE="Diagnostic";const zE="EditorCursor";const $E="EditorRow";const UE="EditorRowHighlighted";const YE="EditorSelection";const _E="HoverDisplayString";const VE="HoverDocumentation";const jE="HoverEditorRow";const qE="HoverProblem";const GE="HoverProblemDetail";const XE="HoverProblemMessage";const ZE="IconClose";const QE="InputBox";const KE="MaskIcon";const JE="Viewlet";const tx=1;const nx=2;const ex=9;const ox=10;const sx=11;const cx=12;const rx=13;const ix=14;const ax=15;const dx=18;const lx=19;const ux=20;const fx=21;const hx=22;const gx=23;const mx=26;const wx=27;const px=28;const yx=29;const Ex=30;const xx=31;const Ix=32;const Sx=33;const kx=4;const vx=6;const Cx=8;const bx=12;const Mx=62;const Ax=t=>({childCount:0,text:t,type:bx});const Lx=t=>{const n=[{childCount:t.length/2,className:jE,type:kx}];for(let e=0;e<t.length;e+=2){const o=t[e];const s=t[e+1];n.push({childCount:1,className:s,type:Cx},Ax(o))}return n};const Px=t=>{const n=t.flatMap(Lx);return n};const Fx={childCount:1,className:XE,type:Cx};const Wx={childCount:1,className:GE,type:Cx};const Tx=(t,n,e)=>{const o=n?1:0;const s=e&&e.length>0?1:0;return t.length+o+s};const Rx=(t,n,e)=>{const o=[];o.push({childCount:Tx(t,n,e)+1,className:"Viewlet EditorHover",type:kx});if(e&&e.length>0){o.push({childCount:e.length*2,className:`${_E} ${qE}`,type:kx});for(const t of e){o.push(Fx,Ax(t.message),Wx,Ax(`${t.source} (${t.code})`))}}if(t.length>0){const n=Px(t);o.push({childCount:t.length,className:_E,type:kx},...n)}if(n){o.push({childCount:1,className:VE,type:kx},Ax(n))}o.push({childCount:0,className:"Sash SashVertical SashResize",onPointerDown:mx,type:kx});return o};const Dx={apply(t,n){const e=Rx(n.lineInfos,n.documentation,n.diagnostics);return[uy,e]},isEqual:(t,n)=>t.lineInfos===n.lineInfos&&t.documentation===n.documentation&&t.diagnostics===n.diagnostics};const Ox={apply(t,n){const{height:e,width:o,x:s,y:c}=n;return[ay,s,c,o,e]},isEqual:(t,n)=>t.x===n.x&&t.y===n.y};const Bx=[Dx,Ox];const Nx=(t,n)=>{const e=[];for(const o of Bx){if(!o.isEqual(t,n)){e.push(o.apply(t,n))}}return e};const Hx=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const zx=t=>{const n=hy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(Hx.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const $x=t=>Gp(t,"EditorRename",zx);const Ux=t=>[["Viewlet.dispose",t.newState.uid]];const{accept:Yx,close:_x,handleInput:Vx}=ny(["handleInput","close","accept"],"Rename",Be);const jx={__proto__:null,accept:Yx,add:$x,close:_x,handleInput:Vx,remove:Ux,render:zx};const qx=t=>structuredClone(t);const Gx=(t,n)=>{const e={...t,focusedIndex:n};return e};const Xx=t=>{const n=t.focusedIndex+1;return Gx(t,n)};const Zx=t=>[["Viewlet.send",t.newState.uid,"dispose"]];const Qx=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const Kx=t=>{const n=hy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(Qx.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const Jx=t=>Gp(t,"EditorSourceActions",Kx);const tI=Zx;const{close:nI,closeDetails:eI,focusFirst:oI,focusIndex:sI,focusLast:cI,focusNext:rI,focusPrevious:iI,handleWheel:aI,selectCurrent:dI,selectIndex:lI,selectItem:uI,toggleDetails:fI}=ny(["focusFirst","focusIndex","focusLast","focusNext","focusPrevious","selectCurrent","selectIndex","selectItem","toggleDetails","closeDetails","handleWheel","close"],"SourceActions",Ne);const hI={__proto__:null,add:Jx,close:nI,closeDetails:eI,focusFirst:oI,focusIndex:sI,focusLast:cI,focusNext:rI,focusPrevious:iI,handleWheel:aI,remove:tI,render:Kx,selectCurrent:dI,selectIndex:lI,selectItem:uI,toggleDetails:fI};const gI=async(t,n,e,o,s,...c)=>{const r=Xp(s);const i=e.slice(n.length+1);const a=t.widgets.find(t=>t.id===s);if(!a){return t}const{uid:d}=a.newState;g(d);await r(`${n}.${i}`,d,...c);const l=t=>t.id===s;const u=Sm(t.uid);const f=u.widgets.findIndex(l);if(f===-1){return u}const h=await r(`${n}.diff2`,d);const m=await r(`${n}.render2`,d,h);const w=t.widgets.findIndex(l);if(w===-1){return u}const p=u.widgets[w];const y={...p.newState,commands:m};const E=Qp(u,s,y);return E};const mI=async t=>{if(!t){return[]}const{newState:n}=Jo(t);return Ca({args:[],editor:n,event:"onLanguage",method:"ExtensionHostCodeActions.getSourceActions"})};const wI=/[\w\-]+$/;const pI=t=>{const{lines:n,selections:e}=t;const o=e[0];const s=e[1];const c=n[o];const r=c.slice(0,s);const i=r.match(wI);if(i){return i[0]}return""};const yI=async t=>{await Eo("Focus.setFocus",t)};const EI=async t=>{if(!t){return}await Eo("Focus.removeAdditionalFocus",t)};const xI=12;const II=9;const SI=11;const kI=12;const vI=16;const CI=38;const bI=43;const MI=46;const AI=47;const LI=48;const PI=49;const FI=50;const WI=52;const TI=t=>{const n=Sm(t);return Mm(n)};const RI=t=>{const n=Sm(t);return n.uri};const DI=t=>{const n=Sm(t);return n.languageId};const OI=t=>{const n=Sm(t);return ip(n)};const BI=(t,n,e)=>{const o=Sm(t);const{word:s}=ju(o,n,e);return s};const NI=t=>{const n=Sm(t);const e=pI(n);return e};const HI=(t,n,e)=>{const o=Sm(t);const s=qu(o,n,e);return s};const zI=t=>{const n=Sm(t);const{lines:e}=n;return e};const $I=t=>{const n=Sm(t);const{selections:e}=n;return e};const UI=async(t,n)=>{const e=Sm(t);const o={...e,selections:n};const s=await Ig(e,o);ns(t,e,s)};const YI=async(t,n,e,o)=>{const s=Sm(t);const c=Xp(n);const{widgets:r}=s;const i=r.findIndex(t=>t.id===n);if(i===-1){return}await c(`${e}.dispose`);const a=[...r.slice(0,i),...r.slice(i+1)];const d={...s,focused:true,widgets:a};const l=await Ig(s,d);ns(t,s,l);await yI(kI);if(o){await EI(o)}};const _I=async t=>{await YI(t,De,"FindWidget",0)};const VI=async(t,n)=>{const e=Sm(t);const o=await cd(e,n);const s=await Ig(e,o);ns(t,e,s)};const jI=async t=>{const n=await mI(t);return n};const qI=async t=>{const n=Sm(t);const{diagnostics:e}=n;return e};const GI=async(t,n)=>{await po("TextMeasurement.ensureFont",t,n)};const XI=()=>[{command:"Editor.closeSourceAction",key:ee,when:CI},{command:"EditorSourceActions.focusNext",key:de,when:CI},{command:"EditorSourceActions.focusPrevious",key:ie,when:CI},{command:"EditorSourceActions.focusFirst",key:ce,when:CI},{command:"EditorSourceActions.focusLast",key:se,when:CI},{command:"EditorSourceActions.selectCurrent",key:ne,when:CI},{command:"FindWidget.focusNext",key:ne,when:vI},{command:"FindWidget.preventDefaultBrowserFind",key:He|ge,when:vI},{command:"FindWidget.focusPrevious",key:ze|Ce,when:vI},{command:"FindWidget.focusNext",key:Ce,when:vI},{command:"FindWidget.focusToggleReplace",key:ze|te,when:vI},{command:"FindWidget.focusReplace",key:te,when:vI},{command:"FindWidget.focusPreviousMatchButton",key:te,when:bI},{command:"FindWidget.replaceAll",key:$e|He|ne,when:bI},{command:"FindWidget.focusNextMatchButton",key:te,when:FI},{command:"FindWidget.focusReplace",key:ze|te,when:FI},{command:"FindWidget.focusPreviousMatchButton",key:ze|te,when:PI},{command:"FindWidget.focusCloseButton",key:te,when:PI},{command:"FindWidget.focusNextMatchButton",key:ze|te,when:LI},{command:"FindWidget.focusReplaceButton",key:te,when:LI},{command:"FindWidget.focusFind",key:ze|te,when:bI},{command:"FindWidget.focusReplaceAllButton",key:te,when:MI},{command:"FindWidget.focusCloseButton",key:ze|te,when:MI},{command:"FindWidget.focusReplaceButton",key:ze|te,when:AI},{command:"EditorCompletion.focusNext",key:de,when:II},{command:"EditorCompletion.focusPrevious",key:ie,when:II},{command:"EditorCompletion.selectCurrent",key:ne,when:II},{command:"EditorCompletion.close",key:ee,when:II},{command:"EditorCompletion.focusLast",key:se,when:II},{command:"EditorCompletion.focusFirst",key:ce,when:II},{command:"EditorCompletion.toggleDetails",key:He|oe,when:II},{command:"Editor.cursorWordRight",key:He|ae,when:kI},{command:"Editor.cursorWordLeft",key:He|re,when:kI},{command:"Editor.deleteWordPartLeft",key:$e|Jn,when:kI},{command:"Editor.deleteWordPartRight",key:$e|le,when:kI},{command:"Editor.deleteWordLeft",key:He|Jn,when:kI},{command:"Editor.deleteWordRight",key:He|le,when:kI},{command:"Editor.selectNextOccurrence",key:He|he,when:kI},{command:"Editor.openColorPicker",key:He|we,when:kI},{command:"Editor.showSourceActions3",key:He|Me,when:kI},{command:"Editor.handleTab",key:te,when:kI},{command:"Editor.unindent",key:ze|te,when:kI},{command:"Editor.indentLess",key:He|Le,when:kI},{command:"Editor.closeFind",key:ee,when:vI},{command:"Editor.openFind2",key:He|ge,when:kI},{command:"Editor.openCodeGenerator",key:He|pe,when:kI},{command:"Editor.closeCodeGenerator",key:ee,when:WI},{command:"EditorCodeGenerator.accept",key:ne,when:WI},{command:"Editor.indentMore",key:He|Pe,when:kI},{command:"Editor.selectCharacterLeft",key:ze|re,when:kI},{command:"Editor.selectWordLeft",key:He|ze|re,when:kI},{command:"Editor.selectCharacterRight",key:ze|ae,when:kI},{command:"Editor.selectWordRight",key:He|ze|ae,when:kI},{command:"Editor.selectLine",key:He|ye,when:kI},{command:"Editor.deleteAllLeft",key:He|ze|Jn,when:kI},{command:"Editor.deleteAllRight",key:He|ze|le,when:kI},{command:"Editor.cancelSelection",key:ee,when:kI},{command:"Editor.undo",key:He|Se,when:kI},{command:"Editor.cursorLeft",key:re,when:kI},{command:"Editor.cursorRight",key:ae,when:kI},{command:"Editor.cursorUp",key:ie,when:kI},{command:"Editor.cursorDown",key:de,when:kI},{command:"Editor.deleteLeft",key:Jn,when:kI},{command:"Editor.deleteRight",key:le,when:kI},{command:"Editor.insertLineBreak",key:ne,when:kI},{command:"Editor.copyLineDown",key:He|ze|he,when:kI},{command:"Editor.moveLineDown",key:He|ze|de,when:kI},{command:"Editor.moveLineUp",key:He|ze|ie,when:kI},{command:"Editor.openCompletion",key:He|oe,when:kI},{command:"Editor.openRename",key:ke,when:kI},{command:"EditorRename.accept",key:ne,when:SI},{command:"Editor.closeRename",key:ee,when:SI},{command:"Editor.cursorHome",key:ce,when:kI},{command:"Editor.cursorEnd",key:se,when:kI},{command:"Editor.toggleComment",key:He|Ae,when:kI},{command:"Editor.copy",key:He|fe,when:kI},{command:"Editor.selectAll",key:He|ue,when:kI},{command:"Editor.showHover2",key:He|me,when:kI},{command:"Editor.cut",key:He|Ie,when:kI},{command:"Editor.paste",key:He|xe,when:kI},{command:"Editor.cursorWordPartLeft",key:$e|re,when:kI},{command:"Editor.cursorWordPartRight",key:$e|ae,when:kI},{command:"Editor.selectAllOccurrences",key:$e|ve,when:kI},{command:"Editor.addCursorAbove",key:$e|ze|ie,when:kI},{command:"Editor.addCursorBelow",key:$e|ze|de,when:kI},{command:"Editor.findAllReferences",key:$e|ze|be,when:kI},{command:"Editor.organizeImports",key:$e|ze|Ee,when:kI},{command:"Editor.selectionGrow",key:He|ze|oe,when:xI}];const ZI=()=>ts();const QI={CommandPalette:"Command Palette"};const KI=()=>Qu(QI.CommandPalette);const JI={command:"",flags:_e,id:"separator",label:""};const tS=()=>[{command:"Editor.goToDefinition",flags:Ve,id:"go-to-definition",label:Rf()},{command:"Editor.goToTypeDefinition",flags:Ve,id:"go-to-type-definition",label:Uf()},JI,{args:["References",true],command:"SideBar.show",flags:Ve,id:"find-all-references",label:Yf()},{args:["Implementations",true],command:"SideBar.show",flags:Ve,id:"find-all-implementations",label:_f()},JI,{command:"Editor.format",flags:Ve,id:"format",label:Qf()},{command:"Editor.showSourceActions2",flags:Ve,id:Ye,label:Hf()},JI,{command:"Editor.cut",flags:Ve,id:"cut",label:Vf()},{command:"Editor.copy",flags:Ve,id:"copy",label:jf()},{command:"Editor.paste",flags:Ve,id:"paste",label:qf()},JI,{command:"QuickPick.showEverything",flags:Ve,id:"commandPalette",label:KI()}];const nS=()=>[Ue];const eS=t=>Aa(t);const oS=async()=>{const t=ts();const n=t.map(t=>{const n=Number(t);const e=Jo(n);return e});const e=n.map(t=>t.newState);const o=await Promise.all(e.map(eS));const s=o.flat();return s};const sS=()=>[{id:"Editor.format",label:Qf()},{id:"Editor.showHover",label:Kf()},{id:"Editor.formatForced",label:Jf()},{id:"Editor.selectNextOccurrence",label:th()},{id:"Editor.selectAllOccurrences",label:nh()},{id:"Editor.goToDefinition",label:eh()},{id:"Editor.goToTypeDefinition",label:oh()},{id:"Editor.selectInsideString",label:sh()},{aliases:["Indent More","DeIndent"],id:"Editor.indent",label:ch()},{aliases:["Indent Less","DeIndent"],id:"Editor.unindent",label:rh()},{id:"Editor.sortLinesAscending",label:ih()},{id:"Editor.toggleComment",label:ah()},{id:"Editor.selectUp",label:dh()},{id:"Editor.selectDown",label:lh()},{id:"Editor.toggleBlockComment",label:Gf()},{id:"Editor.openColorPicker",label:uh()},{id:"Editor.closeColorPicker",label:fh()},{id:"Editor.copyLineDown",label:hh()},{id:"Editor.copyLineUp",label:gh()},{id:"Editor.moveLineDown",label:Zf()},{id:"Editor.moveLineUp",label:Xf()},{id:"Editor.showSourceActions2",label:Hf()}];const cS=t=>{const n=Sm(t);const{selections:e}=n;return e};const rS=t=>{g(t);const n=Sm(t);const{lines:e}=n;return e.join(pr)};const iS="insertText";const aS=(t,n,e)=>{switch(n){case iS:return Yp(t,e);default:return t}};const dS=async(t,n)=>{const e=await Bn({commandMap:{},messagePort:t});if(n){$n(n,e)}};const lS=(t,n)=>lp(t,n);const uS=async t=>{const n=await ap(t);if(!n){return t}return lS(t,n)};const fS=async()=>{await Im();await Em()};const hS=t=>{switch(t){case De:return{invoke:xm,name:"FindWidget"};default:return undefined}};const gS=async(t,n,e,o)=>{if(e?.newState){const s=`${n}:${e.newState.uid}`;const c=hS(e.id);if(c&&o&&Object.hasOwn(o,s)){const{invoke:n,name:r}=c;const i=o[s];await n(`${r}.create`,e.newState.uid,e.newState.x,e.newState.y,e.newState.width,e.newState.height,t);await n(`${r}.loadContent`,e.newState.uid,i);const a=await n(`${r}.diff2`,e.newState.uid);const d=await n(`${r}.render2`,e.newState.uid,a);return{restored:true,widget:{...e,newState:{...e.newState,commands:d}}}}}return{restored:false,widget:e}};const mS=async(t,n)=>{const e=[];for(const o of t){const t=parseInt(o);const s=Jo(t);if(!s?.newState||!Array.isArray(s.newState.widgets)){continue}const{widgets:c}=s.newState;const r=[];let i=false;for(const e of c){const s=await gS(t,o,e,n);r.push(s.widget);if(s.restored){i=true}}if(!i){e.push(s);continue}e.push({...s,newState:{...s.newState,widgets:r}})}return e};const wS=async(t,n,e)=>{if(!e?.newState){return}const o=hS(e.id);if(!o){return}const{invoke:s,name:c}=o;const{uid:r}=e.newState;const i=`${n}:${r}`;const a=await s(`${c}.saveState`,r);t[i]=a};const pS=async t=>{const n=Object.create(null);for(const e of t){const t=Jo(parseInt(e));if(!t?.newState||!Array.isArray(t.newState.widgets)){continue}const{widgets:o}=t.newState;for(const t of o){await wS(n,e,t)}}return n};const yS={isReloading:false};const ES=async()=>{if(yS.isReloading){return}yS.isReloading=true;try{const t=ts();const n=await pS(t);await fS();const e=await mS(t,n);for(const t of e){ns(t.newState.uid,t.oldState,t.newState)}await Eo(`Editor.rerender`)}finally{yS.isReloading=false}};const xS=async t=>{try{await Ro(t)}catch{await xo("SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker",t,"HandleMessagePort.handleMessagePort")}};const IS=async()=>{try{const t=await Rn({commandMap:{},send:xS});return t}catch(t){throw new k(t,`Failed to create syntax highlighting worker rpc`)}};const SS=async(t,n)=>{if(t){$c(true);const t=await IS();_c(t)}if(n){Qr(true)}};const kS=async()=>{const t="Completion Worker";const n="completionWorkerMain.js";const e="Completions.initialize";const o=await Yo(t,n,e);return o};const vS=async(t,n)=>{hm(kS);await SS(t,n)};const CS="editor.lineHeight";const bS="editor.fontSize";const MS="editor.fontFamily";const AS="editor.letterSpacing";const LS="editor.tabSize";const PS="editor.lineNumbers";const FS="editor.diagnostics";const WS="editor.quickSuggestions";const TS="editor.autoClosingQuotes";const RS="editor.autoclosingBrackets";const DS="editor.fontWeight";const OS=async()=>Boolean(await Ia(RS));const BS=async()=>Boolean(await Ia(TS));const NS=async()=>Boolean(await Ia(WS));const HS=async()=>true;const zS=async()=>await Ia(CS)||20;const $S=async()=>await Ia(bS)||15;const US=async()=>await Ia(MS)||"Fira Code";const YS=async()=>await Ia(AS)??.5;const _S=async()=>await Ia(LS)||2;const VS=async()=>await Ia(PS)??false;const jS=async()=>[".","/"];const qS=async()=>await Ia(FS)??false;const GS=async()=>await Ia(DS)??400;const XS=async()=>{const[t,n,e,o,s,c,r,i,a,d,l,u,f]=await Promise.all([qS(),US(),$S(),GS(),OS(),BS(),HS(),NS(),VS(),zS(),_S(),YS(),jS()]);return{completionTriggerCharacters:f,diagnosticsEnabled:t,fontFamily:n,fontSize:e,fontWeight:o,isAutoClosingBracketsEnabled:s,isAutoClosingQuotesEnabled:c,isAutoClosingTagsEnabled:r,isQuickSuggestionsEnabled:i,letterSpacing:u,lineNumbers:a,rowHeight:d,tabSize:l}};const ZS=(t,n)=>{for(const e of t){if(e?.id===n&&e.tokenize){return e.tokenize}}return""};const QS=t=>{if(t instanceof Error){return t.message}return String(t)};const KS=async(t,n)=>{const{assetDir:e,height:o,id:s,platform:c,uri:r,width:i,x:a,y:d}=t;const{completionTriggerCharacters:l,diagnosticsEnabled:u,fontFamily:f,fontSize:h,fontWeight:g,isAutoClosingBracketsEnabled:m,isAutoClosingQuotesEnabled:w,isAutoClosingTagsEnabled:p,isQuickSuggestionsEnabled:y,letterSpacing:E,lineNumbers:x,rowHeight:I,tabSize:S}=await XS();const k=await xa(g,h,f,E);const v=await Ea(c,e);Qc(v);const C=ya(r,v);const b=ZS(v,C);await er(C,b);const M=or(C);const A=t.tokenizerId+1;cr(A,M);const L={...t,charWidth:k,completionTriggerCharacters:l,diagnosticsEnabled:u,fontFamily:f,fontSize:h,fontWeight:g,isAutoClosingBracketsEnabled:m,isAutoClosingQuotesEnabled:w,isAutoClosingTagsEnabled:p,isQuickSuggestionsEnabled:y,languageId:C,letterSpacing:E,lineNumbers:x,loadError:"",rowHeight:I,tabSize:S,tokenizerId:A};let P="";try{P=await vo(r)}catch(t){const n=ra(L,a,d,i,o,9);return{...n,differences:[],focus:ro,focused:true,initial:false,loadError:QS(t),textInfos:[]}}const F=ra(L,a,d,i,o,9);const W=ia(F,P);let T=W;const R=li(T);const D={...T,decorations:R};const O=Kr();const{differences:B,textInfos:N}=await _r(D,O);const H={...D,differences:B,focus:ro,focused:true,textInfos:N};await fa(ua,r,s,C,P);const z=u?await Da(H):H;const $=await Ia("editor.completionsOnType");const U=Boolean($);const Y={...z,completionsOnType:U,initial:false};return Y};const JS=t=>t;const tk=t=>t;const nk=(t,n)=>{g(t);g(n);gi(t,n)};const ek=(t,n,e,o,s,c)=>{const r=`.Editor[data-uid="${t}"]`;return`${r} {\n --EditorRowHeight: ${n}px;\n --ScrollBarHeight: ${e}px;\n --ScrollBarTop: ${o}px;\n --ScrollBarWidth: ${s}px;\n --ScrollBarLeft: ${c}px;\n}\n${r} .EditorRow {\n height: var(--EditorRowHeight);\n line-height: var(--EditorRowHeight);\n}\n${r} .ScrollBarThumbVertical {\n height: var(--ScrollBarHeight);\n translate: 0px var(--ScrollBarTop);\n}\n${r} .ScrollBarThumbHorizontal {\n width: var(--ScrollBarWidth);\n translate: var(--ScrollBarLeft) 0px;\n}\n`};const ok=(t,n,e)=>{const o=t/n*e;if(!Number.isFinite(o)){return 0}return o};const sk=(t,n)=>{const{deltaX:e,deltaY:o,finalDeltaY:s,height:c,longestLineWidth:r,minimumSliderSize:i,rowHeight:a,scrollBarHeight:d,uid:l,width:u}=n;const f=jr(o,s,c,d);const h=qr(u,r,i);const g=ok(e,r,u);const m=ek(l,a,d,f,h,g);return[oo,l,m]};const ck=(t,n)=>{const e=".EditorInput textarea";return[eo,n.uid,e]};const rk=(t,n)=>[so,n.uid,ro];const ik=1;const ak=2;const dk=3;const lk=4;const uk=6;const fk=7;const hk=8;const gk=9;const mk=10;const wk=11;const pk=t=>t!=="type"&&t!=="childCount";const yk=t=>{const n=Object.keys(t).filter(pk);return n};const Ek=t=>{const n=[];let e=0;while(e<t.length){const o=t[e];const{children:s,nodesConsumed:c}=xk(t,e+1,o.childCount||0);n.push({node:o,children:s});e+=1+c}return n};const xk=(t,n,e)=>{if(e===0){return{children:[],nodesConsumed:0}}const o=[];let s=n;let c=e;let r=0;while(c>0&&s<t.length){const n=t[s];const e=n.childCount||0;const{children:i,nodesConsumed:a}=xk(t,s+1,e);o.push({node:n,children:i});const d=1+a;s+=d;r+=d;c--}return{children:o,nodesConsumed:r}};const Ik=(t,n)=>{if(t.type!==n.type){return null}const e=[];if(t.type===jn){if(t.uid!==n.uid){e.push({type:wk,uid:n.uid})}return e}if(t.type===Vn&&n.type===Vn){if(t.text!==n.text){e.push({type:ik,value:n.text})}return e}const o=yk(t);const s=yk(n);for(const o of s){if(t[o]!==n[o]){e.push({type:dk,key:o,value:n[o]})}}for(const t of o){if(!Object.hasOwn(n,t)){e.push({type:lk,key:t})}}return e};const Sk=t=>{const n=[t.node];for(const e of t.children){n.push(...Sk(e))}return n};const kk=(t,n,e)=>{if(n===-1){t.push({type:fk,index:e});return e}if(n!==e){t.push({type:mk,index:e})}return e};const vk=(t,n)=>{if(n>=0){t.push({type:hk})}return-1};const Ck=(t,n)=>{n.push({type:uk,nodes:Sk(t)})};const bk=(t,n)=>{n.push({type:ak,nodes:Sk(t)})};const Mk=(t,n,e,o,s)=>{const c=Ik(t.node,n.node);if(c===null){const t=kk(e,o,s);bk(n,e);return t}const r=t.children.length>0||n.children.length>0;if(c.length===0&&!r){return o}const i=kk(e,o,s);if(c.length>0){e.push(...c)}if(r){Lk(t.children,n.children,e)}return i};const Ak=(t,n,e)=>{const o=Ik(t.node,n.node);if(o===null){bk(n,e);return}if(o.length>0){e.push(...o)}if(t.children.length>0||n.children.length>0){Lk(t.children,n.children,e)}};const Lk=(t,n,e)=>{const o=Math.max(t.length,n.length);let s=-1;const c=[];for(let r=0;r<o;r++){const o=t[r];const i=n[r];if(!o&&!i){continue}if(!o){s=vk(e,s);Ck(i,e);continue}if(!i){c.push(r);continue}s=Mk(o,i,e,s,r)}vk(e,s);for(let t=c.length-1;t>=0;t--){e.push({type:gk,index:c[t]})}};const Pk=(t,n,e,o)=>{if(o.length===0&&t.length===1&&n.length===1){Ak(t[0],n[0],e);return}Lk(t,n,e)};const Fk=t=>{let n=-1;for(let e=t.length-1;e>=0;e--){const o=t[e];if(o.type!==fk&&o.type!==hk&&o.type!==mk){n=e;break}}return n===-1?[]:t.slice(0,n+1)};const Wk=(t,n)=>{const e=Ek(t);const o=Ek(n);const s=[];Pk(e,o,s,[]);return Fk(s)};const Tk=()=>[{childCount:1,className:"EditorInput",type:kx},{ariaAutoComplete:"list",ariaMultiLine:"true",ariaRoleDescription:"editor",autocapitalize:"off",autocomplete:"off",autocorrect:"off",childCount:0,name:"editor",onBeforeInput:tx,onBlur:nx,onCompositionEnd:ox,onCompositionStart:sx,onCompositionUpdate:cx,onCut:ix,onFocus:ax,onPaste:ux,role:"textbox",spellcheck:false,type:Mx,wrap:"off"}];const Rk=t=>{const n=Array.from(t,t=>({childCount:0,className:zE,translate:t,type:kx}));return n};const Dk=t=>{const n=Rk([...t]);return[{childCount:t.length,className:"LayerCursor",type:kx},...n]};const Ok="error";const Bk="warning";const Nk=t=>{switch(t){case Ok:return DE;case Bk:return OE;default:return DE}};const Hk=(...t)=>t.filter(Boolean).join(" ");const zk=t=>{const{height:n,type:e,width:o,x:s,y:c}=t;const r=Nk(e);return[{childCount:0,className:Hk(HE,r),height:n,left:s,top:c,type:kx,width:o}]};const $k=t=>{const n=t.flatMap(zk);return n};const Uk=t=>{const n=$k([...t]);return[{childCount:t.length,className:"LayerDiagnostics",type:kx},...n]};const Yk=(t,n,e=true,o=-1)=>{const s=[];for(let e=0;e<t.length;e++){const c=t[e];const r=n[e];let i=$E;if(e===o){i+=" "+UE}s.push({childCount:c.length/2,className:i,translate:Fi(r),type:kx});for(let t=0;t<c.length;t+=2){const n=c[t];const e=c[t+1];s.push({childCount:1,className:e,type:Cx},Ax(n))}}return s};const _k=(t,n,e=true,o=-1)=>{const s=Yk(t,n,e,o);return[{childCount:t.length,className:"EditorRows",onMouseDown:dx,onPointerDown:fx,onWheel:Sx,type:kx},...s]};const Vk=t=>{const n=[];for(let e=0;e<t.length;e+=4){const o=t[e];const s=t[e+1];const c=t[e+2];const r=t[e+3];n.push({childCount:0,className:YE,height:r,left:o,top:s,type:kx,width:c})}return n};const jk=t=>{const n=Vk(t);return[{childCount:t.length/4,className:"Selections",type:kx},...n]};const qk=(t,n,e,o=true,s=-1,c=[],r=[])=>[{childCount:4,className:"EditorLayers",type:kx},...jk(t),..._k(n,e,o,s),...Dk(c),...Uk(r)];const Gk=t=>[{childCount:t.length,className:"EditorScrollBarDiagnostics",type:kx},...$k([...t])];const Xk=()=>[{childCount:1,className:"ScrollBar ScrollBarVertical",onContextMenu:rx,onPointerDown:Ex,type:kx},{childCount:0,className:"ScrollBarThumb ScrollBarThumbVertical",type:kx},{childCount:1,className:"ScrollBar ScrollBarHorizontal",onPointerDown:wx,type:kx},{childCount:0,className:"ScrollBarThumb ScrollBarThumbHorizontal",type:kx}];const Zk=({cursorInfos:t=[],diagnostics:n=[],differences:e,highlightedLine:o=-1,lineNumbers:s=true,scrollBarDiagnostics:c=[],selectionInfos:r=[],textInfos:i})=>[{childCount:5,className:"EditorContent",onMouseMove:lx,type:kx},...Tk(),...qk(r,i,e,s,o,t,n),...Gk(c),...Xk()];const Qk=t=>[{childCount:1,className:"LineNumber",type:Cx},Ax(t)];const Kk=t=>{const n=t.flatMap(Qk);return n};const Jk=t=>{const n=Kk([...t]);return[{childCount:t.length,className:"Gutter",type:kx},...n]};const tv=({cursorInfos:t=[],diagnostics:n=[],differences:e,gutterInfos:o=[],highlightedLine:s=-1,lineNumbers:c=true,loadError:r="",scrollBarDiagnostics:i=[],selectionInfos:a=[],textInfos:d,uid:l})=>{if(r){return[{childCount:2,className:"Viewlet TextEditorError","data-uid":l,role:"code",type:kx},{childCount:0,className:"EditorTextIcon EditorTextIconError MaskIcon MaskIconError",type:kx},{childCount:1,className:"TextEditorErrorMessage",type:kx},Ax(r)]}const u=c?Jk(o):[];return[{childCount:c?2:1,className:"Viewlet Editor","data-uid":l,onContextMenu:rx,role:"code",type:kx},...u,...Zk({cursorInfos:t,diagnostics:n,differences:e,highlightedLine:s,lineNumbers:c,scrollBarDiagnostics:i,selectionInfos:a,textInfos:d})]};const nv=new Map;const ev=t=>nv.get(t);const ov=(t,n)=>{nv.set(t,n)};const sv=t=>{const{initial:n,textInfos:e}=t;if(n&&e.length===0){return[]}return tv(t)};const cv=(t,n)=>{const e=t.initial?sv(t):ev(n.uid)||sv(t);const o=sv(n);const s=Wk(e,o);if(s.length===0){return[]}ov(n.uid,o);return[co,n.uid,s]};const rv=t=>{const n=Fs(t.id);if(!n){throw new Error("unsupported widget")}return n.add(t)};const iv=t=>{const n=Fs(t.id);if(!n){throw new Error("unsupported widget")}return n.render(t)};const av=t=>{const n=Fs(t.id);if(!n){throw new Error("unsupported widget")}return n.remove(t)};const dv=(t,n)=>{const e=[];const o=[];const s=[];const c=t.widgets||[];const r=n.widgets||[];const i=Object.create(null);const a=Object.create(null);for(const t of c){i[t.id]=t}for(const t of r){a[t.id]=t}for(const t of c){if(Object.hasOwn(a,t.id)){o.push(a[t.id])}else{s.push(t)}}for(const t of r){if(Object.hasOwn(i,t.id));else{e.push(t)}}const d=[];for(const t of e){const n=rv(t);if(n.length>0){d.push(...n)}}const l=[];for(const t of o){const n=iv(t);if(n.length>0){l.push(...n)}}const u=[];for(const t of s){const n=av(t);if(n.length>0){u.push(...n)}}const f=[...d,...l,...u];return f.filter(t=>t[0]!=="Viewlet.setFocusContext")};const lv=t=>{switch(t){case Ya:return sk;case $a:return ck;case Ua:return rk;case _a:return cv;case Va:return dv;default:throw new Error("unknown renderer")}};const uv=(t,n,e)=>{const o=[];for(const s of e){const e=lv(s);const c=e(t,n);if(c.length>0){if(s===Va){o.push(...c)}else{o.push(c)}}}return o};const fv=(t,n)=>{const{newState:e,oldState:o}=Jo(t);ns(t,e,e);const s=uv(o,e,n);return s};const hv={apply(t,n){const{incrementalEdits:e}=n;if(e!==es){return["setIncrementalEdits",e]}const{differences:o,textInfos:s}=n;n.differences=o;const{highlightedLine:c,minLineY:r}=n;const i=c-r;const a=Yk(s,o,true,i);return["setText",a]},isEqual:(t,n)=>t.lines===n.lines&&t.tokenizerId===n.tokenizerId&&t.minLineY===n.minLineY&&t.decorations===n.decorations&&t.embeds===n.embeds&&t.deltaX===n.deltaX&&t.width===n.width&&t.highlightedLine===n.highlightedLine&&t.debugEnabled===n.debugEnabled};const gv={apply:(t,n)=>{const{cursorInfos:e=[],selectionInfos:o=[]}=n;const s=Rk(e);const c=Vk(o);return["setSelections",s,c]},isEqual:(t,n)=>t.cursorInfos===n.cursorInfos&&t.selectionInfos===n.selectionInfos};const mv={apply:sk,isEqual:Na};const wv={apply:(t,n)=>["setFocused",n.focused],isEqual:(t,n)=>t.focused===n.focused};const pv={apply:(t,n)=>[so,n.uid,n.focus,0,n.uid,"Editor"],isEqual:(t,n)=>t.focus===n.focus};const yv={apply(t,n){if(n.additionalFocus){return["Viewlet.setAdditionalFocus",n.uid,n.additionalFocus]}return["viewlet.unsetAdditionalFocus",n.uid,n.additionalFocus]},isEqual:(t,n)=>t.additionalFocus===n.additionalFocus};const Ev={apply(t,n){const e=$k(n.visualDecorations||[]);return["setDecorationsDom",e]},isEqual:(t,n)=>t.visualDecorations===n.visualDecorations};const xv={apply(t,n){const{lineNumbers:e,maxLineY:o,minLineY:s}=n;if(!e){return[]}const c=[];for(let t=s;t<o;t++){c.push(t+1)}const r=Kk(c);return["renderGutter",r]},isEqual:(t,n)=>t.lineNumbers===n.lineNumbers&&t.minLineY===n.minLineY&&t.maxLineY===n.maxLineY};const Iv={apply:dv,isEqual:(t,n)=>t.widgets===n.widgets,multiple:true};const Sv=[hv,gv,mv,wv,Ev,xv,Iv,pv,yv];const kv=async t=>{const n=Jo(t);if(!n){return[]}const{newState:e,oldState:o}=n;const s=[];ns(t,e,e);for(const t of Sv){if(t.isEqual(o,e)){continue}const n=await t.apply(o,e);if(t.multiple){s.push(...n)}else if(n.length>0){s.push(n)}}return s};const vv=()=>[{name:ax,params:["handleFocus"]},{name:lx,params:["handleMouseMove",Xn,Zn,qn]},{name:nx,params:["handleBlur"]},{name:tx,params:["handleBeforeInput","event.inputType","event.data"],preventDefault:true},{name:sx,params:["compositionStart","event.data"]},{name:cx,params:["compositionUpdate","event.data"]},{name:ox,params:["compositionEnd","event.data"]},{name:ix,params:["cut"],preventDefault:true},{name:ux,params:["paste",'event.clipboardData ? event.clipboardData.getData("text/plain") : ""'],preventDefault:true},{name:dx,params:["handleMouseDown","event.button","event.altKey","event.ctrlKey",Xn,Zn,"event.detail"]},{name:fx,params:["handlePointerDown","event.button","event.altKey","event.ctrlKey",Xn,Zn,"event.detail"],trackPointerEvents:[hx,gx]},{name:hx,params:["handlePointerMove",Xn,Zn,qn]},{name:gx,params:["handlePointerUp"]},{name:Sx,params:["handleWheel",Qn,"event.deltaX",Kn],passive:true},{name:rx,params:["handleContextMenu",Gn,Xn,Zn],preventDefault:true},{name:Ex,params:["handleScrollBarVerticalPointerDown",Zn],preventDefault:true,trackPointerEvents:[xx,Ix]},{name:xx,params:["handleScrollBarVerticalPointerMove",Zn]},{name:Ix,params:["handlePointerUp"]},{name:wx,params:["handleScrollBarHorizontalPointerDown",Xn],trackPointerEvents:[px,yx]},{name:px,params:["handleScrollBarHorizontalMove",Xn]},{name:yx,params:["handlePointerUp"]}];const Cv=(t,n)=>{const{lines:e}=t;return{lines:e}};const bv=async(t,n,e)=>{await bo(t,e)};const Mv=async(t,n)=>{await Fo(t,n)};const Av=(t,n)=>t;const Lv=(t,n)=>{g(t);g(n);mi(t,n)};const Pv=async(t,...n)=>{const e=Un(Ge);return e.invoke(t,...n)};const Fv=async t=>{const n=await Pv("RunAndDebug.getHighlight",t);return n};const Wv=()=>{const t=ts();return parseInt(t[0])};const Tv=async t=>{const n=await Fv(t);const e=Wv();const o=Jo(e);if(!o){return}const{newState:s,oldState:c}=o;const r={...s,highlightedLine:n.rowIndex};ns(e,c,r);await Eo("Editor.rerender",e)};const Rv=t=>async(n,...e)=>{const o=Jo(n);const s=o.newState;const c=await t(s,...e);if(s===c){return c}const r=await Ig(s,c);ns(n,s,r);return r};const Dv={"ActivateByEvent.activateByEvent":zo,"CodeGenerator.accept":$o,"ColorPicker.loadContent":Go,"Editor.addCursorAbove":Rv(Ka),"Editor.addCursorBelow":Rv(td),"Editor.applyDocumentEdits":Rv(sd),"Editor.applyEdit":Rv(cd),"Editor.applyEdit2":VI,"Editor.applyWorkspaceEdit":Rv(id),"Editor.braceCompletion":Rv(Md),"Editor.cancelSelection":Rv(Ad),"Editor.closeCodeGenerator":Rv(Wd),"Editor.closeFind":Rv(Rd),"Editor.closeFind2":_I,"Editor.closeRename":Rv(zd),"Editor.closeSourceAction":Rv(Ud),"Editor.closeWidget2":YI,"Editor.compositionEnd":Rv(Jd),"Editor.compositionStart":Rv(Zd),"Editor.compositionUpdate":Rv(Kd),"Editor.contextMenu":Rv(Nh),"Editor.copy":Rv(ol),"Editor.copyLineDown":Rv(sl),"Editor.copyLineUp":Rv(cl),"Editor.create":Ba,"Editor.create2":us,"Editor.cursorCharacterLeft":Rv(Ql),"Editor.cursorCharacterRight":Rv(eu),"Editor.cursorDown":Rv(cu),"Editor.cursorEnd":Rv(ru),"Editor.cursorHome":Rv(iu),"Editor.cursorLeft":Rv(Ql),"Editor.cursorRight":Rv(eu),"Editor.cursorSet":Rv(au),"Editor.cursorUp":Rv(fu),"Editor.cursorWordLeft":Rv(hu),"Editor.cursorWordPartLeft":Rv(gu),"Editor.cursorWordPartRight":Rv(mu),"Editor.cursorWordRight":Rv(wu),"Editor.cut":Rv(Eu),"Editor.deleteAll":Rv(xu),"Editor.deleteAllLeft":Rv(bu),"Editor.deleteAllRight":Rv(Lu),"Editor.deleteCharacterLeft":Rv(Pu),"Editor.deleteCharacterRight":Rv(Fu),"Editor.deleteHorizontalRight":Rv(Au),"Editor.deleteLeft":Rv(Pu),"Editor.deleteRight":Rv(Fu),"Editor.deleteWordLeft":Rv(Wu),"Editor.deleteWordPartLeft":Rv(Tu),"Editor.deleteWordPartRight":Rv(Ru),"Editor.deleteWordRight":Rv(Du),"Editor.diff2":Za,"Editor.executeWidgetCommand":Rv(gI),"Editor.findAllReferences":Rv(Ou),"Editor.format":Rv($u),"Editor.getCommandIds":Zo,"Editor.getDiagnostics":qI,"Editor.getKeyBindings":XI,"Editor.getKeys":ZI,"Editor.getLanguageId":DI,"Editor.getLines2":zI,"Editor.getMenuEntries":tS,"Editor.getMenuEntries2":tS,"Editor.getMenuIds":nS,"Editor.getOffsetAtCursor":OI,"Editor.getPositionAtCursor":TI,"Editor.getProblems":oS,"Editor.getQuickPickMenuEntries":sS,"Editor.getSelections":cS,"Editor.getSelections2":$I,"Editor.getSourceActions":jI,"Editor.getText":rS,"Editor.getUri":RI,"Editor.getWordAt":ju,"Editor.getWordAt2":BI,"Editor.getWordAtOffset2":NI,"Editor.getWordBefore":qu,"Editor.getWordBefore2":HI,"Editor.goToDefinition":Rv(xh),"Editor.goToTypeDefinition":Rv(bh),"Editor.handleBeforeInput":Rv(aS),"Editor.handleBeforeInputFromContentEditable":Rv(fg),"Editor.handleBlur":Rv(ad),"Editor.handleClickAtPosition":Rv(Oh),"Editor.handleContextMenu":Rv(Nh),"Editor.handleDoubleClick":Rv(Yh),"Editor.handleFocus":Rv(_h),"Editor.handleMouseDown":Rv(tg),"Editor.handleMouseMove":Rv(ig),"Editor.handleMouseMoveWithAltKey":Rv(dg),"Editor.handleNativeSelectionChange":hg,"Editor.handlePointerCaptureLost":Rv(gg),"Editor.handlePointerDown":Rv(mg),"Editor.handlePointerMove":Rv(Rg),"Editor.handlePointerUp":Rv(Dg),"Editor.handleScrollBarClick":Ug,"Editor.handleScrollBarHorizontalMove":Rv(Bg),"Editor.handleScrollBarHorizontalPointerDown":Rv(Ng),"Editor.handleScrollBarMove":Rv(zg),"Editor.handleScrollBarPointerDown":Rv(Ug),"Editor.handleScrollBarVerticalMove":Rv($g),"Editor.handleScrollBarVerticalPointerDown":Rv(Ug),"Editor.handleScrollBarVerticalPointerMove":Rv($g),"Editor.handleSingleClick":Rv(Xh),"Editor.handleTab":Rv(uS),"Editor.handleTouchEnd":Rv(Yg),"Editor.handleTouchMove":Rv(Xg),"Editor.handleTouchStart":Rv(Vg),"Editor.handleTripleClick":Rv(Kh),"Editor.handleWheel":Rv(Zg),"Editor.hotReload":ES,"Editor.indendLess":Rv(Kg),"Editor.indentMore":Rv(tm),"Editor.insertLineBreak":Rv(cm),"Editor.loadContent":Rv(KS),"Editor.moveLineDown":Rv(JS),"Editor.moveLineUp":Rv(tk),"Editor.moveRectangleSelection":Rv(wg),"Editor.moveRectangleSelectionPx":Rv(pg),"Editor.moveSelection":Rv(Pg),"Editor.moveSelectionPx":Rv(Tg),"Editor.offsetAt":Wr,"Editor.openCodeGenerator":Rv(lm),"Editor.openColorPicker":Rv(Gd),"Editor.openCompletion":Rv(mm),"Editor.openFind":Rv(bm),"Editor.openFind2":Rv(Cm),"Editor.openRename":Rv(Pm),"Editor.organizeImports":Rv(Wm),"Editor.paste":Rv(Rm),"Editor.pasteText":Rv(Tm),"Editor.redo":Rv(Dm),"Editor.render":kv,"Editor.render2":fv,"Editor.renderEventListeners":vv,"Editor.replaceRange":Rv(dd),"Editor.rerender":Rv(qx),"Editor.resize":Rv(yi),"Editor.save":Rv(Jm),"Editor.saveState":Ko(Cv),"Editor.selectAll":Rv(tw),"Editor.selectAllLeft":Rv(ow),"Editor.selectAllOccurrences":Rv(gw),"Editor.selectAllRight":Rv(pw),"Editor.selectCharacterLeft":Rv(yw),"Editor.selectCharacterRight":Rv(Ew),"Editor.selectDown":Rv(Iw),"Editor.selectInsideString":Rv(kw),"Editor.selectionGrow":Rv(Cw),"Editor.selectLine":Rv(Qh),"Editor.selectNextOccurrence":Rv(Lw),"Editor.selectPreviousOccurrence":Rv(Pw),"Editor.selectUp":Rv(Ww),"Editor.selectWord":Rv(Uh),"Editor.selectWordLeft":Rv(Tw),"Editor.selectWordRight":Rv(Rw),"Editor.setDebugEnabled":Rv(Av),"Editor.setDecorations":Rv(Dw),"Editor.setDelta":Rv(Gg),"Editor.setDeltaY":Rv(jg),"Editor.setLanguageId":Rv(Ow),"Editor.setSelections":Rv(Bw),"Editor.setSelections2":UI,"Editor.setText":Rv(Nw),"Editor.showHover":qw,"Editor.showHover2":Vw,"Editor.showSourceActions":Rv(tp),"Editor.showSourceActions2":Rv(tp),"Editor.showSourceActions3":Rv(tp),"Editor.sortLinesAscending":Rv(cp),"Editor.tabCompletion":Rv(fp),"Editor.terminate":e,"Editor.toggleBlockComment":Rv(Ep),"Editor.toggleComment":Rv(vp),"Editor.toggleLineComment":Rv(kp),"Editor.type":Rv(Cp),"Editor.typeWithAutoClosing":Rv(Yp),"Editor.undo":Rv(Vp),"Editor.unIndent":Rv(jp),"Editor.updateDebugInfo":Tv,"Editor.updateDiagnostics":Rv(Oa),"EditorCompletion.close":yy,"EditorCompletion.closeDetails":Ey,"EditorCompletion.focusFirst":xy,"EditorCompletion.focusIndex":Iy,"EditorCompletion.focusNext":ky,"EditorCompletion.focusPrevious":vy,"EditorCompletion.handleEditorBlur":Cy,"EditorCompletion.handleEditorClick":by,"EditorCompletion.handleEditorDeleteLeft":My,"EditorCompletion.handleEditorType":Ay,"EditorCompletion.handlePointerDown":Ly,"EditorCompletion.handleWheel":Py,"EditorCompletion.openDetails":Fy,"EditorCompletion.selectCurrent":Wy,"EditorCompletion.selectIndex":Ty,"EditorCompletion.toggleDetails":Ry,"EditorRename.accept":Yx,"EditorRename.close":_x,"EditorRename.handleInput":Vx,"EditorSourceAction.close":nI,"EditorSourceAction.closeDetails":eI,"EditorSourceAction.focusFirst":oI,"EditorSourceAction.focusIndex":sI,"EditorSourceAction.focusNext":rI,"EditorSourceAction.focusPrevious":iI,"EditorSourceAction.handleWheel":aI,"EditorSourceAction.selectCurrent":dI,"EditorSourceAction.selectIndex":lI,"EditorSourceAction.selectItem":uI,"EditorSourceAction.toggleDetails":fI,"EditorSourceActions.focusNext":Xx,"ExtensionHostManagement.activateByEvent":zo,"FindWidget.close":$y,"FindWidget.focusCloseButton":Uy,"FindWidget.focusFind":Yy,"FindWidget.focusNext":_y,"FindWidget.focusNextElement":Vy,"FindWidget.focusNextMatchButton":jy,"FindWidget.focusPrevious":qy,"FindWidget.focusPreviousElement":Gy,"FindWidget.focusPreviousMatchButton":Xy,"FindWidget.focusReplace":Zy,"FindWidget.focusReplaceAllButton":Qy,"FindWidget.focusReplaceButton":Ky,"FindWidget.focusToggleReplace":Jy,"FindWidget.handleBlur":tE,"FindWidget.handleClickButton":nE,"FindWidget.handleFocus":eE,"FindWidget.handleInput":oE,"FindWidget.handleReplaceFocus":sE,"FindWidget.handleReplaceInput":cE,"FindWidget.handleToggleReplaceFocus":rE,"FindWidget.loadContent":km,"FindWidget.replace":iE,"FindWidget.replaceAll":aE,"FindWidget.toggleMatchCase":dE,"FindWidget.toggleMatchWholeWord":lE,"FindWidget.togglePreserveCase":uE,"FindWidget.toggleReplace":fE,"FindWidget.toggleUseRegularExpression":hE,"Font.ensure":GI,"HandleMessagePort.handleMessagePort":dS,"Hover.getHoverInfo":ME,"Hover.handleSashPointerDown":LE,"Hover.handleSashPointerMove":PE,"Hover.handleSashPointerUp":FE,"Hover.loadContent":AE,"Hover.render":Nx,"Initialize.initialize":vS,"Listener.register":nk,"Listener.registerListener":gi,"Listener.unregister":Lv,"SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker":bv,"SendMessagePortToExtensionManagementWorker.sendMessagePortToExtensionManagementWorker":Mv};for(const[t,n]of Object.entries(Dv)){if(t.startsWith("Editor.")){Dv["EditorText"+t.slice("Editor".length)]=n}}const Ov=async()=>{const t="HandleMessagePort.handleMessagePort2";const n=await On({commandMap:{},async send(n){await bv(n,t,Xe)}});return n};const Bv=async()=>{const t=await Ov();ha(t)};const Nv=async()=>{const t=await On({commandMap:{},async send(t){await Fo(t,Xe)}});return t};const Hv=async()=>{try{const t=await Nv();fo(t)}catch{}};const zv=t=>ko(t);const $v=async()=>{const t=await On({commandMap:{},send:zv});mo(t)};const Uv=async()=>{const t=await Nn({commandMap:Dv});Io(t)};const Yv=t=>Po(t);const _v=async()=>{const t=await On({commandMap:{},send:Yv});yo(t)};const Vv=async()=>{Qo(Dv);await Promise.all([Uv(),Bv(),Hv(),_v(),$v()])};const jv="CodeGeneratorInput";const qv=t=>{const n=zf();const e=$f();return[{childCount:2,className:Hk(JE,RE),type:kx},{childCount:0,className:Hk(WE,QE),name:jv,placeholder:e,type:vx},{childCount:1,className:TE,type:kx},Ax(n)]};const Gv={apply(t,n){const e=qv();return[uy,n.uid,e]},isEqual:(t,n)=>t.questions===n.questions};const Xv={apply(t,n){const{height:e,width:o,x:s,y:c}=n;return[ay,s,c,o,e]},isEqual:(t,n)=>t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height};const Zv={apply:(t,n)=>[oy,".CodeGeneratorInput",n.focusSource],isEqual:(t,n)=>t.focused===n.focused&&t.focusSource===n.focusSource};const Qv=[Gv,Xv,Zv];const Kv=(t,n)=>{const e=[];for(const o of Qv){if(!o.isEqual(t,n)){e.push(o.apply(t,n))}}return e};const Jv=t=>{const n=Kv(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(t[0]===uy){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const tC=t=>Gp(t,"EditorCodeGenerator",Jv);const nC=Zx;const eC={__proto__:null,add:tC,remove:nC,render:Jv};const oC=(t,n)=>{const e=[...n.commands];n.commands=[];return e};const sC=[uy,ly,ey,dy,sy,fy];const cC=t=>{const n=oC(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(sC.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const rC=t=>Gp(t,"ColorPicker",cC);const iC=Zx;const aC={};const dC={__proto__:null,Commands:aC,add:rC,remove:iC,render:cC};const lC=t=>{const n=[{childCount:2,className:"Viewlet EditorCompletionDetails",type:kx},{childCount:1,className:NE,type:kx},Ax(t),{childCount:1,className:BE,onClick:ex,type:kx},{childCount:0,className:`${KE} ${ZE}`,type:kx}];return n};const uC=(t,n,e)=>{const o=[];for(const s of t){if(!s.isEqual(n,e)){o.push(s.apply(n,e))}}return o};const fC={apply(t,n){const e=lC(n.content);return[uy,n.uid,e]},isEqual:(t,n)=>t.content===n.content};const hC={apply(t,n){const{height:e,width:o,x:s,y:c}=n;return[ay,s,c,o,e]},isEqual:(t,n)=>t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height};const gC=[fC,hC];const mC=(t,n)=>uC(gC,t,n);const wC=(t,n)=>{const{widgets:e}=t;for(const t of e){if(t.id===n){return t.newState}}return undefined};const pC=t=>wC(t,Te);const yC=t=>{const n=mC(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(t[0]===uy){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const EC=t=>Gp(t,"EditorCompletionDetails",yC);const xC=Zx;const IC=(t,n)=>{const e=pC(t);if(!e){return t}const{x:o}=Mm(t);const s=o+e.width-n.borderSize;return{...n,x:s}};const SC=(t,n)=>IC(t,n);const kC=(t,n)=>IC(t,n);const vC={__proto__:null,add:EC,handleEditorDeleteLeft:kC,handleEditorType:SC,remove:xC,render:yC};const CC=[uy,ly,ey,dy,sy,cy,ry,iy,fy,"Viewlet.focusSelector"];const bC=t=>{const n=hy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(CC.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const MC=t=>Gp(t,"EditorCompletion",bC);const AC=t=>[["Viewlet.dispose",t.newState.uid]];const{close:LC}=ny(["close"],"",Oe);const PC={__proto__:null,add:MC,close:LC,remove:AC,render:bC};const FC=()=>{Ps(We,dC);Ps(Te,Dy);Ps(Re,vC);Ps(De,gE);Ps(Oe,PC);Ps(Be,jx);Ps(Ne,hI);Ps(Fe,eC)};const WC=t=>{t.preventDefault();console.error(`[editor-worker] Unhandled Rejection: ${t.reason}`)};const TC=(t,n,e,o,s)=>{console.error(`[editor-worker] Unhandled Error: ${s}`);return true};const RC=t=>{t.addEventListener("error",TC);t.addEventListener("unhandledrejection",WC)};const DC=async()=>{RC(globalThis);await Vv();FC()};DC();
|