@lvce-editor/editor-worker 19.17.4 → 19.18.1
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 +961 -614
- package/package.json +1 -1
- package/dist/editorWorkerMain.min.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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 C=t=>t&&t instanceof MessagePort;const v=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=[C,v,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 _=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 Y=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=Y(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=Y(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=Y(n);const{actualMessage:o,rest:s}=_(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(!C(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 Ct 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 vt=t=>new Ct(t);const bt={__proto__:null,create:St,signal:kt,wrap:vt};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 _t=(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 Yt=t=>t.join(Bt);const Vt=t=>t.split(Bt);const jt=()=>{const t=3;const n=Yt(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=_t(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 Cn=t=>{const n=kn();const{promise:e,resolve:o}=Promise.withResolvers();t[n]=o;return{id:n,promise:e}};const vn=async(t,n,e,o,s)=>{const{id:c,promise:r}=Cn(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 vn(n,t,e,o,false)},invokeAndTransfer(e,...o){return vn(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 _n=t=>{delete zn[t]};const Yn=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]=()=>{_n(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 Ce=59;const ve=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 _e=22;const Ye=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}=Yn(Ze);const lo={__proto__:null,invoke:io,set:ao};const{invoke:uo,set:fo}=Yn(Qe);const ho=(t,n)=>uo("Extensions.getLanguages",t,n);const{invoke:go,set:mo}=Yn(to);const wo=async(t,n)=>go("Open.openUrl",t,n);const{invoke:po,set:yo}=Yn(Ke);const{invoke:Eo,invokeAndTransfer:xo,set:Io}=Yn(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 Co=async t=>Eo("FileSystem.readFile",t);const vo=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:vo,invoke:Eo,invokeAndTransfer:xo,openUri:To,readClipBoardText:Ao,readFile:Co,sendMessagePortToExtensionHostWorker:bo,sendMessagePortToExtensionManagementWorker:Fo,sendMessagePortToOpenerWorker:ko,sendMessagePortToSyntaxHighlightingWorker:Ro,sendMessagePortToTextMeasurementWorker:Po,set:Io,showContextMenu2:So,writeClipBoardText:Mo};const{invoke:Oo,set:Bo}=Yn(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 _o=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 Yo=async()=>{const t="Color Picker Worker";const n="colorPickerWorkerMain.js";return _o(t,n)};const Vo={};const jo=()=>{if(!Vo.workerPromise){Vo.workerPromise=Yo()}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{dispose:Zo,getCommandIds:Qo,registerCommands:Ko,wrapGetter:Jo}=Xo;const ts=t=>Xo.get(t);const ns=()=>{const t=Xo.getKeys();return t.map(String)};const es=(t,n,e)=>{Xo.set(t,n,e)};const os=[];const ss=41;const cs=9;const rs=0;const is=16;const as=51;const ds=11;const ls=38;const us=52;const fs=(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:rs,fontFamily:"",fontSize:0,fontWeight:0,handleOffset:0,handleOffsetX:0,hasListener:false,height:c,highlightedLine:-1,id:t,incrementalEdits:os,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};es(t,a,a)};const hs="compositionUpdate";const gs="contentEditableInput";const ms="delete";const ws="deleteHorizontalRight";const ps="deleteLeft";const ys="editorCut";const Es="editorPasteText";const xs="editorSnippet";const Is="editorType";const Ss="editorTypeWithAutoClosing";const ks="format";const Cs="indentLess";const vs="indentMore";const bs="insertLineBreak";const Ms="lineComment";const As="rename";const Ls="toggleBlockComment";const Ps=Object.create(null);const Fs=(t,n)=>{Ps[t]=n};const Ws=t=>Ps[t];const Ts=t=>Ws(t);const Rs=async(t,n,e)=>{const o=Ts(n.id);if(e.length===1&&e[0].origin===Is&&o.handleEditorType){const n=await o.handleEditorType(t);return{...n}}if(e.length===1&&e[0].origin===ps&&o.handleEditorDeleteLeft){const n=await o.handleEditorDeleteLeft(t);return{...n}}return n};const Ds=async(t,n)=>{const e=t.widgets||[];if(e.length===0){return e}let o=t;for(const s of e){o=await Rs(t,s,n)}return o};const Os=(t,n,e)=>{g(t);g(n);g(e);return Math.min(Math.max(t,n),e)};const Bs="Link";const Ns="Function";const Hs="Parameter";const zs="Type";const $s="VariableName";const Us="Class";const _s=1;const Ys=2816;const Vs=2817;const js=2824;const qs=2825;const Gs=2956;const Xs=2857;const Zs=3072;const Qs=3073;const Ks=3077;const Js=3088;const tc=1792;const nc=1793;const ec=512;const oc=513;const sc=769;const cc=1024;const rc=1536;const ic=1537;const ac=1544;const dc=1545;const lc=2048;const uc=2049;const fc=2056;const hc=2057;const gc=2064;const mc=2080;const wc=2081;const pc=2088;const yc=2089;const Ec=2313;const xc=2560;const Ic=2561;const Sc=2569;const kc=2584;const Cc=256;const vc=257;const bc=272;const Mc=t=>{switch(t){case _s:return Bs;case cc:case rc:case ic:case ac:case dc:case ec:case oc:case sc:return zs;case tc:case nc:return Hs;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:case kc:return $s;case Cc:case vc:case bc:return Us;case Ys:case Vs:case js:case qs:case Gs:case Xs:case Zs:case Qs:case Ks:case Js:return Ns;default:return`Unknown-${t}`}};const Ac=t=>structuredClone(t);const Lc=t=>Ac(t);const Pc={warned:[]};const Fc=t=>{const n=[];for(const e of t){h(e);n.push(e.type,e.length)}return n};const Wc=(t,n)=>{if(Pc.warned.includes(n)){return}Pc.warned.push(n);console.warn(`tokenizers without hasArrayReturn=false are deprecated (language ${t})`)};const Tc=(t,n,e,o,s)=>{try{const c=n(e,o);if(!c?.tokens||!c.state){throw new Error("invalid tokenization result")}if(!s){Wc(t,n);c.tokens=Fc(c.tokens)}return c}catch(t){console.error(t);return{lineState:o,tokens:[0,e.length]}}};const Rc={TopLevelContent:1};const Dc={Text:1};const Oc={[Dc.Text]:"Text"};const Bc={state:Rc.TopLevelContent};const Nc=true;const Hc=(t,n)=>({state:n.state,tokens:[Dc.Text,t.length]});const zc={__proto__:null,State:Rc,TokenMap:Oc,TokenType:Dc,hasArrayReturn:Nc,initialLineState:Bc,tokenizeLine:Hc};const $c={enabled:false};const Uc=t=>{$c.enabled=t};const _c=()=>$c.enabled;const{invoke:Yc,set:Vc}=No;const jc={pending:Object.create(null),tokenizePaths:Object.create(null),tokenizers:Object.create(null)};const qc=t=>Object.hasOwn(jc.tokenizers,t);const Gc=(t,n)=>{jc.tokenizers[t]=n};const Xc=t=>jc.tokenizers[t];const Zc=(t,n)=>{jc.tokenizePaths[t]=n};const Qc=t=>jc.tokenizePaths[t]||"";const Kc=t=>{for(const n of t){if(n&&n.id&&n.tokenize){Zc(n.id,n.tokenize)}}};const Jc=t=>Object.hasOwn(jc.pending,t);const tr=Object.create(null);const nr=(t,n)=>{tr[t]=n};const er=t=>tr[t]||{};const or=async(t,n)=>{if(!n){return}Zc(t,n);if(_c()){const e=await Yc("Tokenizer.load",t,n);nr(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}nr(t,e.TokenMap);Gc(t,e)}catch(t){console.error(t)}};const sr=t=>{if(qc(t)){return Xc(t)}if(Jc(t)){return zc}return zc};const cr=Object.create(null);const rr=(t,n)=>{cr[t]=n};const ir=t=>cr[t]||zc;const ar=(t,n,e,o,s,c,r)=>{const i=sr(e);if(o!==n.length&&i&&i!==zc){const a=o===0&&s===n.length;const d=n.slice(o,s);const l=Tc(t,i.tokenizeLine,d,c[e]||Lc(i.initialLineState),i.hasArrayReturn);c[e]=l;if(l.embeddedLanguage){const n=ar(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 dr=(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(ar(t,a,n,i,e,r,s))}}else{for(const t of Object.keys(r)){r[t]=undefined}}}return{embeddedResults:c,tokenizersToLoad:s}};const lr=(t,n,e)=>t<n?n:e;const ur=(t,n,e)=>{const{invalidStartIndex:o,languageId:s,lineCache:c,lines:r,tokenizerId:i}=t;const a=ir(i);const{hasArrayReturn:d,initialLineState:l,tokenizeLine:u}=a;const f=o;const h=lr(o,e,f);const g=[];const m=[];const w=[];for(let t=f;t<h;t++){const n=t===0?Lc(l):c[t];const e=r[t];const o=Tc(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}=dr(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 fr=Object.create(null);const hr=async(t,n,e,o)=>{if(_c()){if(o){const{id:o,invalidStartIndex:s,languageId:c,lines:r}=t;let i=true;let a=r;if(fr[o]===r){i=false;a=[]}else{fr[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 ur(t,n,e)};const gr=async t=>{for(const n of t){const t=Qc(n);await or(n,t)}};const mr=".";const wr='"';const pr="";const yr="\n";const Er=" ";const xr="\t";const Ir=(t,n,e)=>{if(n){return t.replaceAll(xr,()=>Er.repeat(e))}return t};const Sr=t=>t.includes(xr);const kr=(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 Cr=(t,n,e,o)=>{const s=t.splice(n,e);kr(t,n,o);return s};const vr=t=>t.join("\n");const br=/^\s+/;const Mr=t=>{const n=t.match(br);if(!n){return""}return n[0]};const Ar=(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);Cr(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);Cr(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));Cr(e,n,a.length,[o,...t,s])}t.maxLineY=Math.min(t.numberOfVisibleLines,t.lines.length)}o+=d.length-a.length}return e};const Lr=(t,n)=>t.lines[n];const Pr=t=>vr(t.lines);const Fr=(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 Wr=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 Tr=(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 Rr=(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 Dr=10;const Or=(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 Br=(t,n,e)=>{for(const[o,{end:s}]of t){if(o<e&&s>n){return true}}return false};const Nr=(t,n)=>{for(const[e,o]of t){if(e<=n&&o.end>n){return o}}return undefined};const Hr=(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=Mc(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}=Or(m,l);const I=$r(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=Br(h,E,s);if(i){let t=E;while(t<s){const o=Nr(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=Ir(a,c,r);f.push(l,d);t=i}}else{const t=e.slice(E,s);const o=`Token ${w[n]||"Unknown"}`;const i=Ir(t,c,r);f.push(i,o)}E=s;y=s;if(y>=u){break}}return{difference:I,lineInfo:f}};const zr=()=>({maxOffset:Infinity,minOffset:0});const $r=(t,n,e)=>{const o=t*n;const s=o-e;return s};const Ur=(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=Mc(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}=Or(m,u);const E=$r(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=Br(g,p,c);if(a){let n=p;while(n<c){const o=Nr(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=Ir(d,r,i);h.push(u,l);n=a}}else{const n=t.slice(p,c);const o=`Token ${s[e]||"Unknown"}`;const a=Ir(n,r,i);h.push(a,o)}p=c;w=c;if(w>=f){break}}return{difference:E,lineInfo:h}};const _r=(t,n,e,o,s,c,r,i,a,d,l)=>{const{maxOffset:u,minOffset:f}=zr();if(e.length>0&&n.embeddedResultIndex!==undefined){const s=e[n.embeddedResultIndex];if(s?.isFull){return Hr(e,n,t,o,c,r,i,a,d,l,f,u)}}return Ur(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=er(f);let m=c;const w=2;for(let t=o;t<s;t++){const s=h[t];const c=Sr(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}=_r(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 Vr=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 hr(t,c,a,n);for(let e=0;l.length>0&&e<Dr;e++){await gr(l);const e=await hr(t,c,a,n);({embeddedResults:d,tokenizersToLoad:l,tokens:u}=e)}const f=await Wr(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 jr=(t,n,e,o)=>{const s=t/n*(e-o);if(!Number.isFinite(s)){return 0}return s};const qr=jr;const Gr=(t,n,e)=>{if(t>=n){return 0}return Math.max(Math.round(t**2/n),e)};const Xr=(t,n)=>{if(t>n){return 0}return t**2/n};const Zr=(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 Qr={enabled:false};const Kr=t=>{Qr.enabled=t};const Jr=()=>Qr.enabled;const ti=async(t,n)=>{h(t);g(n);const{deltaY:e,finalDeltaY:o,height:s,itemHeight:c,numberOfVisibleLines:r,scrollBarHeight:i}=t;const a=Os(n,0,o);if(e===a){return t}const d=Math.floor(a/c);const l=d+r;const u=qr(a,o,s,i);const f={...t,deltaY:a,maxLineY:l,minLineY:d,scrollBarY:u};const m=Jr();const{differences:w,textInfos:p}=await Vr(f,m);const y={...f,differences:w,textInfos:p};return y};const ni=async(t,n)=>{if(!n.undoStack){return os}if(t.undoStack===n.undoStack){return os}const e=n.undoStack.at(-1);if(e&&e.length===1){const o=e[0];if(o.origin===Is){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 os};const ei=(t,n)=>t.matchAll(n).toArray();const oi=/(?:https?|ftps?|file):\/\/[^\s"']+|www\.[^\s"']+/g;const si=/^(?:https?|ftp|ftps|file):\/\//;const ci=/^www\./;const ri=".,;:!?";const ii={")":"(","]":"[","}":"{",">":"<"};const ai=(t,n)=>{const e=ii[n];let o=0;for(const s of t){if(s===e){o++}else if(s===n){o--}}return o<0};const di=t=>{let n=t;while(n.length>0){const t=n.at(-1);if(!t){break}if(ri.includes(t)){n=n.slice(0,-1);continue}if(t in ii&&ai(n,t)){n=n.slice(0,-1);continue}break}return n};const li=t=>{const n=ei(t,oi);const e=[];for(const t of n){const n=di(t[0]);if(si.test(n)||ci.test(n)){e.push({length:n.length,start:t.index??0})}}return e};const ui=t=>{const n=[];const{lines:e}=t;let o=0;for(const t of e){const e=li(t);for(const t of e){const e=o+t.start;n.push(e,t.length,_s,0)}o+=t.length+1}return n};const fi=(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===_s&&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 hi=1;const gi=Object.create(null);const mi=(t,n)=>{g(t);g(n);if(!Object.hasOwn(gi,t)){gi[t]=[]}if(!gi[t].includes(n)){gi[t].push(n)}};const wi=(t,n)=>{g(t);g(n);if(Object.hasOwn(gi,t)){const e=gi[t].indexOf(n);if(e!==-1){gi[t].splice(e,1)}}};const pi=t=>{g(t);return gi[t]||[]};const yi=async(t,n,...e)=>{g(t);w(n);const o=pi(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 Ei=(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=Gr(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 xi=t=>{if(!t){return[""]}return t.split("\n")};const{invoke:Ii}=Do;const Si=async t=>{try{await Ii("Main.handleModifiedStatusChange",t,true)}catch{}};const ki=(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 Ci=t=>{let n=0;for(const e of t){if(e===xr){n++}}return n};const vi=/^\p{ASCII}*$/u;const bi=t=>vi.test(t);const Mi=async(t,n)=>t.length*n;const Ai=async(t,n,e,o,s,c,r)=>{const i=await po("TextMeasurement.measureTextWidth",t,n,e,o,s,c,r);return i};const Li=async(t,n,e,o,s,c,r)=>{if(c&&bi(t)){return await Mi(t,r)}return await Ai(t,n,e,o,s,c,r)};const Pi=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=Sr(t);const h=Ir(t,f,i);const m=Ci(t.slice(0,n));const y=h.slice(0,n+m);const E=await Li(y,e,o,s,r,c,l);return E-a+u};const Fi=(t,n,e)=>(t-n)*e;const Wi=t=>`${t}px`;const Ti=(t,n,e,o)=>new Uint32Array([t,n,e,o]);const Ri=t=>new Uint32Array(t);const Di=t=>Ri(t.length);const Oi=(t,n)=>{const e=Di(t);for(let o=0;o<e.length;o+=4){const[s,c,r,i]=ki(t,o);n(e,o,s,c,r,i)}return e};const Bi=(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 Ni=(t,n,e,o)=>{t[n]=t[n+2]=e;t[n+1]=t[n+3]=o};const Hi=(t,n,e,o)=>t===e&&n===o;const zi=(t,n,e,o)=>t===e;const $i=(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 Ui=t=>$i(t,Hi);const _i=t=>$i(t,zi);const Yi=(t,n)=>{const e=Ri(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 Vi=[];const ji=(t,n)=>{if(!n){return Vi}const e=[];for(let n=0;n<t.length;n+=2){const o=t[n];const s=t[n+1];e.push(`${Wi(o)} ${Wi(s)}`)}return e};const qi=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(Wi(o),Wi(s),Wi(c),Wi(r))}return n};const Gi=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]=ki(w,t);if(r<g||o>h){continue}const k=r-g;const C=c[k];const v=f[r];const b=await Pi(v,I,d,a,i,l,u,p,x,y,E,C);const M=Fi(r,g,m);if(Hi(o,s,r,I)&&b>0){n.push(b,M);continue}const A=Fi(o,g,m);const L=o-g;const P=c[L];if(o===r){const t=await Pi(v,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 Pi(t,s,d,a,i,l,u,p,x,y,E,P);const r=await Pi(t,t.length,d,a,i,l,u,p,x,y,E,P);const h=Fi(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=Fi(n,g,m);const s=n-g;const r=c[s];const h=await Pi(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:ji(n,r),selectionInfos:qi(e)}};const Xi=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 Zi=(t,n)=>{h(t);return{...t,selections:n}};const Qi=(t,n)=>{h(t);m(n);const e=Yi(n,Xi);return e};const Ki=(t,n)=>ti(t,n);const Ji=(t,n)=>Ki(t,t.deltaY+n);const ta=t=>t.origin===Ss;const na=(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(ta(s)){o.push(c,r+1,i,a+1)}return o};const ea=(t,n)=>Zi(t,n);const oa=async(t,n,e=undefined)=>{h(t);m(n);if(n.length===0){return t}const o=Ar(t,n);const s={...t,lines:o};const c=e||Qi(s,n);const r=Math.min(t.invalidStartIndex,n[0].start.rowIndex);const i=na(t,n);const a={...s,autoClosingRanges:i,invalidStartIndex:r,lines:o,modified:true,redoStack:[],selections:c,undoStack:[...t.undoStack,n]};const d=ui(a);const l={...a,decorations:d};es(t.uid,t,l);if(!t.modified){await Si(t.uri)}try{await yi(hi,"handleEditorChanged",t.uid,t.uri,n)}catch(t){console.warn("Failed to notify editor change listeners:",t)}const u=await ni(t,l);const f=await Ds(l,n);const g={...l,...f,incrementalEdits:u};if(u!==os){return g}const w=Jr();const{differences:p,textInfos:y}=await Vr(g,w);return{...g,differences:p,textInfos:y}};const sa=async(t,n)=>{h(t);m(n);if(n.length===0){return t}const e=Ar(t,n);const o={...t,lines:e};const s=Qi(o,n);const c=Math.min(t.invalidStartIndex,n[0].start.rowIndex);const r={...o,invalidStartIndex:c,lines:e,selections:s};const i=await ni(t,r);const a={...r,incrementalEdits:i};if(i!==os){return a}const d=Jr();const{differences:l,textInfos:u}=await Vr(a,d);return{...a,differences:l,textInfos:u}};const ca=async(t,n)=>{const e=Ar(t,n);const o=n[0].start.rowIndex;const s={...t,invalidStartIndex:o,lines:e,redoStack:[],undoStack:[...t.undoStack,n]};const c=await ni(t,s);const r={...s,incrementalEdits:c};if(c!==os){return r}const i=Jr();const{differences:a,textInfos:d}=await Vr(r,i);return{...r,differences:a,textInfos:d}};const ra=t=>t.selections&&t.selections.length>0;const ia=(t,n,e,o,s,c)=>Ei(t,{height:s,width:o,x:n,y:e},c);const aa=(t,n)=>{const e=xi(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=Gr(t.height,l,s);return{...t,finalDeltaY:d,finalY:a,lines:e,maxLineY:i,scrollBarHeight:u}};const da={cursorInfos:[],debugEnabled:false,decorations:[],deltaX:0,deltaY:0,diagnostics:[],differences:[],embeds:[],focused:false,hasListener:false,height:0,highlightedLine:-1,incrementalEdits:os,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 la="ExtensionHostHover.execute";const ua="ExtensionHost.executeTabCompletionProvider";const fa="ExtensionHostTextDocument.syncFull";const{invoke:ha,set:ga}=lo;const ma=t=>{w(t);return t.lastIndexOf(mr)};const wa=(t,n)=>t.lastIndexOf(mr,n);const pa=(t,n)=>{for(const e of t){if(e&&e.extensions&&Array.isArray(e.extensions)&&e.extensions.includes(n)){return e.id}}return""};const ya=(t,n)=>{for(const e of t){if(e&&e.fileNames&&Array.isArray(e.fileNames)&&e.fileNames.includes(n)){return e.id}}return""};const Ea=(t,n)=>{w(t);const e=ma(t);const o=t.slice(e);const s=o.toLowerCase();const c=pa(n,s);if(c){return c}const r=t.toLowerCase();const i=wa(t,e-1);const a=t.slice(i);const d=pa(n,a);if(d){return d}const l=ya(n,r);if(l){return l}return"unknown"};const xa=async(t,n)=>{g(t);w(n);const e=await ho(t,n);return e};const Ia=async(t,n,e,o)=>await Li("a",t,n,e,o,false,0);const Sa=async t=>{const n=await Wo(t);return n};const ka="onDiagnostic";const Ca="onHover";const va="onTabCompletion";const ba=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 ha(s,e.uid,...t);return d};const Ma=t=>({documentId:t.id||t.uid,languageId:t.languageId,text:Pr(t),uri:t.uri});const Aa=async t=>{const n=Ma(t);return uo("Extensions.executeDiagnosticProvider",n)};const La=async t=>{const n=await Aa(t);if(n.length>0){return n}const{assetDir:e,platform:o}=t;return ba({args:[],assetDir:e,editor:t,event:ka,method:"ExtensionHost.executeDiagnosticProvider",noProviderFoundMessage:"no diagnostic provider found",platform:o})};const Pa=t=>t.type;const Fa=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 Pi(d[m],n,r,c,s,i,a,f,E,h,o,y);const I=Fi(m,l,u)-u;e.push({height:u,type:Pa(t),width:p,x:x,y:I})}return e};const Wa=(t,n)=>{const e=ui(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 Ta=async t=>{const n=Pr(t);await ha(fa,t.uri,t.id,t.languageId,n);return La(t)};const Ra=async(t,n)=>{const e=await Fa(t,n);const o=e.flatMap(t=>[t.offset,t.length,t.type,t.modifiers||0]);const s=Wa(t,o);return{...t,decorations:s,diagnostics:n,visualDecorations:e}};const Da=(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 Oa=async t=>{try{const n=await Ta(t);if(!ts(t.id)){return t}return Ra(t,n)}catch(n){return Da(n,t)}};const Ba=async t=>{try{const n=await Ta(t);const e=ts(t.id);if(!e){return t}const o=await Ra(e.newState,n);es(t.id,e.oldState,o);await Eo("Editor.rerender",t.id);return o}catch(n){return Da(n,t)}};const Na=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:C,rowHeight:v,savedDeltaY:b,savedSelections:M,tabSize:A,uri:L,useFunctionalRendering:P,width:F,x:W,y:T})=>{g(u);w(o);const R=await Ia(i,r,c,x);const D=await xa(C,t);const O=Ea(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:rs,fontFamily:c,fontSize:r,fontWeight:i,handleOffset:0,handleOffsetX:0,hasListener:false,height:d,id:u,incrementalEdits:os,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:C,primarySelectionIndex:0,redoStack:[],rowHeight:v,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=ia(B,W,T,F,d,9);const H=aa(N,o);let z;if(S&&n){const t=S*v;z=await ti(H,t)}else{z=await ti(H,0)}const $=ui(z);const U={...z,decorations:$};const _=Jr();const{differences:Y,textInfos:V}=await Vr(U,_);const j={...U,differences:Y,focus:ro,focused:true,textInfos:V};es(u,da,j);await ha(fa,L,u,E,o);const q=s?await Ba(j):j;const G=await Sa("editor.completionsOnType");const X=Boolean(G);es(u,da,{...q,completionsOnType:X})};const Ha=(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 za=(t,n)=>{if(!n.focused){return true}if(!t.isSelecting&&n.isSelecting){return false}return t.focused===n.focused&&t.focus===n.focus};const $a=(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 Ua=6;const _a=7;const Ya=11;const Va=12;const ja=13;const qa=(t,n)=>t.widgets===n.widgets;const Ga=[$a,za,za,Ha,qa];const Xa=[Va,Ua,_a,Ya,ja];const Za=(t,n)=>{const e=[];for(let o=0;o<Ga.length;o++){const s=Ga[o];if(!s(t,n)){e.push(Xa[o])}}return e};const Qa=t=>{const{newState:n,oldState:e}=ts(t);const o=Za(e,n);return o};const Ka=t=>{const n=Ws(t.id);if(!n){throw new Error("unsupported widget")}return n.add(t)};const Ja=t=>{const n=Ws(t.id);if(!n){throw new Error("unsupported widget")}return n.render(t)};const td=t=>{const n=Ws(t.id);if(!n){throw new Error("unsupported widget")}return n.remove(t)};const nd=(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=Ka(t);if(n.length>0){d.push(...n)}}const l=[];for(const t of o){const n=Ja(t);if(n.length>0){l.push(...n)}}const u=[];for(const t of s){const n=td(t);if(n.length>0){u.push(...n)}}const f=[...d,...l,...u];return f.filter(t=>t[0]!=="Viewlet.setFocusContext")};const ed=async t=>{const n=ts(t)?.newState;if(!n){return[]}for(const t of n.widgets){if(t.id===We){await qo("ColorPicker.dispose",t.newState.uid)}}const e=nd(n,{widgets:[]});Zo(t);return e};const od=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 sd=t=>{const{selections:n}=t;const e=od(n);return{...t,selections:e}};const cd=(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 rd=t=>{const{lines:n,selections:e}=t;const o=cd(e,n.length);return{...t,selections:o}};const id=(t,n)=>{const e=[];for(const o of n){const n=Rr(t,o.startOffset);const s=Rr(t,o.endOffset);const c=Fr(t,{end:s,start:n});const r={deleted:c,end:s,inserted:xi(o.inserted),origin:ks,start:n};if(r.inserted.length===0){r.inserted=[""]}e.push(r)}return e};const ad=(...t)=>{console.warn(...t)};const dd=(...t)=>{console.error(...t)};const ld=(t,n)=>{if(!Array.isArray(n)){ad("something is wrong with format on save",n);return t}if(n.length===0){return t}const e=id(t,n);return oa(t,e)};const ud=async(t,n)=>{h(t);m(n);return oa(t,n)};const fd=(t,n)=>{const e=[];for(const o of n){if(o.uri===t.uri){for(const n of o.edits){const o=Rr(t,n.offset);const s=Rr(t,n.offset+n.deleted);const c=Fr(t,{end:s,start:o});const r={deleted:c,end:s,inserted:[n.inserted],origin:As,start:o};e.push(r)}}}return e};const hd=async(t,n)=>{h(t);m(n);const e=fd(t,n);if(e.length===0){return t}return oa(t,e)};const gd=t=>{if(!t.focused){return t}const n={...t,focused:false};return n};const md=(t,n,e,o)=>{const s=[];const c=n.length;for(let r=0;r<c;r+=4){const[c,i,a,d]=ki(n,r);const l={columnIndex:i,rowIndex:c};const u={columnIndex:d,rowIndex:a};const f={end:u,start:l};s.push({deleted:Fr(t,f),end:u,inserted:e,origin:o,start:l})}return s};const wd=(t,n,e)=>{const{selections:o}=t;return md(t,o,n,e)};const pd=()=>Math.random();const yd=9;const Ed=async(t,n,e,o,s,c,r,i,a,d)=>{for(let l=n;l<t.length;l++){const n=await Li(t.slice(0,l),s,c,r,i,a,d);if(o-n<e/2){return l}}return t.length};const xd=()=>"Segmenter"in Intl;const Id=()=>{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 Sd=async(t,n,e,o,s,c,r,i)=>{const a=Id();const d=a.getSegments(t);const l=false;const u=0;for(const n of d){const a=await Li(t.slice(0,n.index),s,c,r,i,l,u);if(o-a<e){return n.index}}return t.length};const kd=(t,n)=>{const e=Math.round(t/n);return e};const Cd=(t,n,e)=>{let o=n;for(let s=0;s<n;s++){if(t[s]===xr){o-=e-1}}return o};const vd=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=kd(a,r);const l=Sr(t);const u=Cd(t,d,i);const f=t.slice(0,u);const h=Ir(f,l,i);const m=await Li(h,n,e,o,s,c,r);const y=bi(t);if(y){if(Math.abs(a-m)<r/2){return u}return await Ed(t,u,r,a,n,e,o,s,c,r)}return await Sd(t,u,r,a,n,e,o,s)};const bd=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=Os(y,0,u.length-1);const I=u[x];const S=await vd(I,a,i,r,l,d,o,m,E);return{columnIndex:S,rowIndex:x}};const Md=(t,n,e)=>{const{columnWidth:o,x:s}=t;const c=e*o+s;return c};const Ad=(t,n)=>{const{rowHeight:e,y:o}=t;const s=(n+1)*e+o;return s};const Ld=(t,n,e,o,s)=>{h(t);g(n);g(e);w(o);const c=Md(t,n,e);const r=Ad(t,n);const i=t.widgets.find(t=>t.id===yd);const a=i?.newState.uid??pd();const d={message:o,uid:a,x:c,y:r};const l={id:yd,newState:d};return{...t,widgets:[...t.widgets.filter(t=>t.id!==yd),l]}};const Pd=(t,n,e,o)=>Ld(t,n,e,o);const Fd=String;const Wd=t=>{switch(t){case"(":return")";case"[":return"]";case"{":return"}";default:return"???"}};const Td=async(t,n)=>{try{const e=Rd(t);const o=await Eo("ExtensionHostBraceCompletion.executeBraceCompletionProvider",t,e,n);if(o){const e=Wd(n);const o=n+e;const s=wd(t,[o],Is);return oa(t,s)}const s=wd(t,[n],Is);return oa(t,s)}catch(n){console.error(n);const e=Array.isArray(t.cursor)?t.cursor[0]:t.cursor;return Pd(t,e,Fd(n))}};const Rd=t=>Tr(t,t.selections[0],t.selections[1]);const Dd=t=>{const{selections:n}=t;if(n.length===4&&n[0]===n[2]&&n[1]===n[3]){return t}const e=Ri(4);Ni(e,0,n[0],n[1]);return ea(t,e)};const Od=(t,n)=>{for(const[e,o]of t.entries()){if(o.id===n){return e}}return-1};const Bd=(t,n)=>{const e=Od(t,n);const o=[...t.slice(0,e),...t.slice(e+1)];return o};const Nd=t=>t.id===Fe;const Hd=t=>{const{widgets:n}=t;const e=n.findIndex(Nd);if(e===-1){return t}const o=Bd(n,Fe);return{...t,focused:true,widgets:o}};const zd=t=>t.id===De;const $d=t=>{const{widgets:n}=t;const e=n.findIndex(zd);if(e===-1){return t}const o=Bd(n,De);return{...t,focused:true,widgets:o}};const Ud=async()=>{const t="Rename Worker";const n="renameWorkerMain.js";const e=await _o(t,n);await e.invoke("Rename.initialize");return e};const _d={};const Yd=()=>{if(!_d.workerPromise){_d.workerPromise=Ud()}return _d.workerPromise};const Vd=async(t,...n)=>{const e=await Yd();return await e.invoke(t,...n)};const jd=t=>t.id===Be;const qd=async t=>{const{uid:n,widgets:e}=t;const o=e.findIndex(jd);if(o===-1){return t}const s=e[o];await Vd("Rename.close",s.newState.uid);const c=ts(n);const{newState:r}=c;return r};const Gd=t=>t.id===Ne;const Xd=t=>{const{widgets:n}=t;const e=n.findIndex(Gd);if(e===-1){return t}const o=Bd(n,Ne);return{...t,widgets:o}};const Zd=(t,n)=>{for(const e of t){if(e.id===n){return true}}return false};const Qd=async(t,n,e,o,s,c)=>{const{widgets:r}=e;if(Zd(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 Kd=()=>{const t=pd();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 Jd=(t,n)=>Go(t,n);const tl=async t=>Qd(We,ss,t,Kd,Jd);const nl={compositionText:"",isComposing:false};const el=(t,n)=>{nl.isComposing=true;return t};const ol=(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-nl.compositionText.length;e.push({deleted:[nl.compositionText],end:{columnIndex:i,rowIndex:r},inserted:[n],origin:hs,start:{columnIndex:a,rowIndex:s}})}return e};const sl=(t,n)=>{const{selections:e}=t;const o=ol(e,n);nl.compositionText=n;return oa(t,o)};const cl=(t,n)=>{const{selections:e}=t;const o=ol(e,n);nl.isComposing=false;nl.compositionText="";return oa(t,o)};const rl=async t=>{try{w(t);await Mo(t)}catch(t){throw new k(t,"Failed to write text to clipboard")}};const il=(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 al=(t,n,e,o)=>t===e&&n===o;const dl=async t=>{if(!ra(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=al(o,s,c,r);const a=il(n,i,o,s,c,r);const d=Fr(t,a);const l=vr(d);const u=i?"\n"+l:l;await rl(u);return t};const ll=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:[Lr(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 oa(t,s,c)};const ul=t=>{const{selections:n}=t;const e=n[0];const o={columnIndex:0,rowIndex:e};const s=[{deleted:[""],end:o,inserted:[Lr(t,e),""],start:o}];return oa(t,s)};const fl=(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 hl=(t,n,e,o)=>{t[n]=e;t[n+1]=o};const gl=(t,n,e,o)=>{t[n]=t[n+2]=e;t[n+1]=t[n+3]=o};const ml=(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 wl=(t,n,e)=>{const o=new Uint32Array(t.length);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=ki(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{ml(o,s,c,r,n,e);ml(o,s+2,c,r,n,e)}}else{gl(o,s,t[s],t[s+1])}}return o};const pl=(t,n)=>{const{lines:e,selections:o}=t;const s=wl(o,e,n);return ea(t,s)};const yl=(t,n)=>{if(!xd()){return 1}if(n>t.length){return 1}const e=Id();const o=e.at(t,n-1);if(!o){return 1}return n-o.index};const El=()=>2;const xl=(t,n)=>{if(!xd()){return 1}const e=Id();const o=e.at(t,n);return o.segment.length};const Il=t=>t===Er||t===xr;const Sl=(t,n)=>{if(t.length===0){return 0}for(let e=0;e<n;e++){if(!Il(t[e])){return n-e}}return n};const kl=(t,n)=>t.length-n;const Cl=(t,n)=>{for(const e of n){const n=t.match(e);if(n){return n[0].length}}return 1};const vl=/(?<![A-Z])[A-Z]+\s*$/;const bl=/[\u{C0}-\u{17F}\w\-]+>?\s*$/u;const Ml=/[a-zA-Z]+[^a-zA-Z\d]+\s*$/;const Al=/\s+$/;const Ll=/[^a-zA-Z\d]+\s*$/;const Pl=[vl,bl,Ml,Al,Ll];const Fl=(t,n)=>{const e=t.slice(0,n);return Cl(e,Pl)};const Wl=/^\s*[\u{C0}-\u{17F}\w]+/iu;const Tl=/^[^a-zA-Z\d]+\w*/;const Rl=[Wl,Tl];const Dl=(t,n)=>{const e=t.slice(n);return Cl(e,Rl)};const Ol=/(?<![A-Z])[A-Z]{2}[a-z]+$/;const Bl=/(?=[A-Z]+)[A-Z][a-z]+$/;const Nl=/[A-Z]+[a-z]+\d?\s*$/;const Hl=/[A-Z]+\d*\s*$/;const zl=/[a-z]+\d*\s*$/;const $l=/[A-Z]*[a-z]+_+\s*$/;const Ul=/(?<![A-Z])[A-Z]_+\s*$/;const _l=/[a-z]+\s*$/;const Yl=/[^a-zA-Z\d\s]+\s*$/;const Vl=[Ol,Bl,Nl,Hl,zl,$l,Ul,_l,Yl];const jl=(t,n)=>{const e=t.slice(0,n);return Cl(e,Vl)};const ql=/^\s*[a-z]+\d?/;const Gl=/^\s*[A-Z]{2}[a-z\d]+/;const Xl=/^\s*[A-Z]+(?=[A-Z][a-z]+)/;const Zl=/^\s*[A-Z]+[a-z]*\d*/;const Ql=/^\s*_+[a-z]*\d?/;const Kl=/^\s*[^\da-zA-Z\s]+/;const Jl=[ql,Xl,Zl,Ql,Kl];const tu=[ql,Gl,Xl,Zl,Ql,Kl];const nu=/[A-Z]/;const eu=(t,n)=>{const e=t.slice(n);if(nu.test(t[n-1])){return Cl(e,Jl)}return Cl(e,tu)};const ou=t=>pl(t,yl);const su=(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 cu=(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 ru=(t,n,e)=>{const o=new Uint32Array(t.length);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=ki(t,s);if(c===i&&r===a){cu(o,s,c,r,n,e)}else{o[s]=o[s+2]=i;o[s+1]=o[s+3]=a}}return o};const iu=(t,n)=>{const{lines:e,selections:o}=t;const s=ru(o,e,n);return ea(t,s)};const au=t=>iu(t,xl);const du=(t,n,e,o,s,c)=>{Ni(t,n,s+1,c)};const lu=t=>Oi(t,du);const uu=t=>{const{selections:n}=t;const e=lu(n);return ea(t,e)};const fu=t=>iu(t,kl);const hu=t=>pl(t,Sl);const gu=(t,n,e)=>{h(t);g(n);g(e);const o=Ti(n,e,n,e);return ea(t,o)};const mu=(t,n,e,o,s,c)=>{if(e===0){Ni(t,n,0,0)}else{Ni(t,n,e-1,o)}};const wu=t=>Oi(t,mu);const pu=(t,n,e,o)=>{const{selections:s}=t;const c=wu(s);return ea(t,c)};const yu=t=>pu(t);const Eu=t=>pl(t,Fl);const xu=t=>pl(t,jl);const Iu=t=>iu(t,eu);const Su=t=>iu(t,Dl);const ku=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]=ki(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=md(t,c,[""],ys);await rl(vr(i));return oa(t,a,r)};const Cu=async t=>{const n=wd(t,[""],ys);const e=n.map(t=>vr(t.deleted)).filter(t=>t.length>0);const o=vr(e);await rl(o);return oa(t,n)};const vu=async t=>{const{selections:n}=t;if(Ui(n)){return ku(t)}return Cu(t)};const bu=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:Fr(t,{end:c,start:s}),end:c,inserted:[""],origin:ms,start:s}];return oa(t,r)};const Mu=(t,n,e)=>{const o=[];const s=(n,s,c,r)=>{const i=fl(n,s,t,e);const a={columnIndex:r,rowIndex:c};o.push({deleted:Fr({lines:t},{end:a,start:i}),end:a,inserted:[""],origin:ps,start:i})};Bi(n,s);return o};const Au=(t,n,e,o,s)=>{if(!Hi(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 Lu=(t,n)=>{for(let e=0;e<n.length;e+=4){const[o,s,c,r]=ki(n,e);if(!Au(t,o,s,c,r)){return false}}return true};const Pu=t=>{const{lines:n,selections:e}=t;for(let t=0;t<e.length;t+=4){e[t+1]++;e[t+3]++}const o=Mu(n,e,El);return oa(t,o)};const Fu=(t,n)=>{const{autoClosingRanges:e=[],lines:o,selections:s}=t;if(Lu(e,s)){return Pu(t)}if(Ui(s)){const e=Mu(o,s,n);return oa(t,e)}const c=wd(t,[""],ps);return oa(t,c)};const Wu=t=>Fu(t,Sl);const Tu=(t,n)=>{const{selections:e}=t;if(Ui(e)){const o=[];const{lines:s}=t;for(let c=0;c<e.length;c+=4){const[r,i]=ki(e,c);const a={columnIndex:i,rowIndex:r};const d=su(a,s,n);o.push({deleted:Fr(t,{end:d,start:a}),end:d,inserted:[""],origin:ws,start:a})}return o}const o=wd(t,[""],ws);return o};const Ru=(t,n)=>{const e=Tu(t,n);return oa(t,e)};const Du=t=>Ru(t,kl);const Ou=t=>{const n=Fu(t,yl);return n};const Bu=t=>Ru(t,xl);const Nu=t=>{const n=Fu(t,Fl);return n};const Hu=t=>{const n=Fu(t,jl);return n};const zu=t=>Ru(t,eu);const $u=t=>Ru(t,Dl);const Uu=async t=>{await Eo("SideBar.show","References",true);return t};const _u=async t=>{const n={documentId:t.id||t.uid,languageId:t.languageId,text:Pr(t),uri:t.uri};return uo("Extensions.executeFormattingProvider",n)};const Yu="Failed to execute formatting provider: FormattingError:";const Vu=t=>t&&t instanceof Error&&t.message.startsWith(Yu);const ju="Failed to execute formatting provider: FormattingError:";const qu=async t=>{try{const n=await _u(t);return ld(t,n)}catch(n){if(Vu(n)){console.error("Formatting Error:",n.message.slice(ju.length));return t}console.error(n);const e=String(n);await Ld(t,0,0,e);return t}};const Gu=/^[\w\-]+/;const Xu=/[\w\-]+$/;const Zu=(t,n)=>{const e=t.slice(0,n);const o=e.match(Xu);const s=t.slice(n);const c=s.match(Gu);let r=pr;if(o){r+=o[0]}if(c){r+=c[0]}return{word:r}};const Qu=(t,n)=>{const e=t.slice(0,n);const o=e.match(Xu);if(o){return o[0]}return pr};const Ku=(t,n,e)=>{const{lines:o}=t;const s=o[n];return Zu(s,e)};const Ju=(t,n,e)=>{const{lines:o}=t;const s=o[n];return Qu(s,e)};const tf=async(t,n)=>{const e=await Eo("ExtensionHostDefinition.executeDefinitionProvider",t,n);return e};const nf={};const ef=/\{(PH\d+)\}/g;const of=(t,n=nf)=>{if(n===nf){return t}const e=(t,e)=>n[e];return t.replaceAll(ef,e)};const sf="Copy";const cf="Cut";const rf="Editor: Close Color Picker";const af="Editor: Copy Line Down";const df="Editor: Copy Line Up";const lf="Editor: Format Document (forced)";const uf="Editor: Go To Definition";const ff="Editor: Go To Type Definition";const hf="Editor: Indent";const gf="Editor: Open Color Picker";const mf="Editor: Select All Occurrences";const wf="Editor: Select Down";const pf="Editor: Select Inside String";const yf="Editor: Select Next Occurrence";const Ef="Editor: Select Up";const xf="Show Hover";const If="Editor: Sort Lines Ascending";const Sf="Editor: Toggle Comment";const kf="Editor: Unindent";const Cf="Enter Code";const vf="Escape to close";const bf="Find All Implementations";const Mf="Find All References";const Af="Format Document";const Lf="Go to Definition";const Pf="Go to Type Definition";const Ff="Move Line Down";const Wf="Move Line Up";const Tf="No definition found";const Rf="No definition found for '{PH1}'";const Df="No type definition found";const Of="No type definition found for '{PH1}'";const Bf="Paste";const Nf="Source Action";const Hf="Toggle Block Comment";const zf=()=>of(Lf);const $f=()=>of(Tf);const Uf=t=>of(Rf,{PH1:t});const _f=t=>of(Of,{PH1:t});const Yf=()=>of(Df);const Vf=()=>of(Nf);const jf=()=>of(vf);const qf=()=>of(Cf);const Gf=()=>of(Pf);const Xf=()=>of(Mf);const Zf=()=>of(bf);const Qf=()=>of(cf);const Kf=()=>of(sf);const Jf=()=>of(Bf);const th=()=>of(Hf);const nh=()=>of(Wf);const eh=()=>of(Ff);const oh=()=>of(Af);const sh=()=>of(xf);const ch=()=>of(lf);const rh=()=>of(yf);const ih=()=>of(mf);const ah=()=>of(uf);const dh=()=>of(ff);const lh=()=>of(pf);const uh=()=>of(hf);const fh=()=>of(kf);const hh=()=>of(If);const gh=()=>of(Sf);const mh=()=>of(Ef);const wh=()=>of(wf);const ph=()=>of(gf);const yh=()=>of(rf);const Eh=()=>of(af);const xh=()=>of(df);const Ih=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=Ku(t,r,i);const e=o(n);return Ld(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=Rr(t,n.startOffset);const o=new Uint32Array([e.rowIndex,e.columnIndex,e.rowIndex,e.columnIndex]);return ea(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 Ld(t,r,i,o);return t}const o=n(e);await Ld(t,r,i,o);return t}};const Sh=async(t,n,e)=>{const o=Tr(t,n,e);const s=await tf(t,o);return s};const kh=t=>{if(t.word){return Uf(t.word)}return $f()};const Ch=String;const vh=t=>t?.message?.startsWith("Failed to execute definition provider: No definition provider found");const bh=async t=>Ih({editor:t,getErrorMessage:Ch,getLocation:Sh,getNoLocationFoundMessage:kh,isNoProviderFoundError:vh});const Mh=t=>{if(t.word){return _f(t.word)}return Yf()};const Ah=async(t,n)=>{const e=await Eo("ExtensionHostTypeDefinition.executeTypeDefinitionProvider",t,n);return e};const Lh=async(t,n,e)=>{const o=Tr(t,n,e);const s=await Ah(t,o);return s};const Ph=String;const Fh=t=>t?.message?.startsWith("Failed to execute type definition provider: No type definition provider found");const Wh=async(t,n=true)=>Ih({editor:t,getErrorMessage:Ph,getLocation:Lh,getNoLocationFoundMessage:Mh,isNoProviderFoundError:Fh});const Th=t=>{switch(t){case De:return true;default:return false}};const Rh=t=>{if(t.length===0){return t}return t.filter(Th)};const Dh=async(t,n)=>{await wo(t,n)};const Oh=async(t,n)=>{const{platform:e}=t;const{columnIndex:o,rowIndex:s}=n;const c=Tr(t,s,o);const r=fi(t,c);if(r){await Dh(r,e);return t}const i={...t,selections:new Uint32Array([s,o,s,o])};const a=await bh(i);return a};const Bh=async(t,n)=>{const{selections:e}=t;for(let o=0;o<e.length;o+=4){const[s,c,r,i]=ki(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 ea(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 ea(t,o)};const Nh=1;const Hh=2;const zh=(t,n)=>{const e=Rh(t.widgets);return{...t,focused:true,selectionAnchorPosition:n,selections:new Uint32Array([n.rowIndex,n.columnIndex,n.rowIndex,n.columnIndex]),widgets:e}};const $h=t=>{switch(t){case Hh:return Oh;case Nh:return Bh;default:return zh}};const Uh=async(t,n,e,o)=>{h(t);g(n);g(e);g(o);const s=$h(n);const c=await s(t,{columnIndex:o,rowIndex:e});return c};const _h=3;const Yh=async(t,n,e,o)=>{const{uid:s}=t;await So(s,_h,e,o,{menuId:_h});return t};const Vh=/^[a-zA-Z\u{C0}-\u{17F}\d]+/u;const jh=/[a-zA-Z\u{C0}-\u{17F}\d]+$/u;const qh=(t,n,e)=>{const o=t.slice(0,e);const s=t.slice(e);const c=o.match(jh);const r=s.match(Vh);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 Gh=(t,n,e)=>{const o=Lr(t,n);const s=qh(o,n,e);return ea(t,s)};const Xh=async(t,n,e,o)=>{const s=await bd(t,e,o);return Gh(t,s.rowIndex,s.columnIndex)};const Zh=t=>{if(t.focused&&t.focus===ro){return t}return{...t,additionalFocus:0,focus:ro,focused:true}};const Qh=1;const Kh=2;const Jh=3;const tg=(t,n)=>{if(t){return Hh}if(n){return Nh}return 0};const ng=async(t,n,e,o)=>{h(t);g(n);g(e);g(o);const s=await bd(t,e,o);return Uh(t,n,s.rowIndex,s.columnIndex)};const eg=(t,n)=>new Uint32Array([n,0,n,t.length]);const og=t=>{const{selections:n}=t;const e=n[t.primarySelectionIndex];const o=Lr(t,e);const s=eg(o,e);return ea(t,s)};const sg=(t,n,e,o)=>{h(t);g(e);g(o);return og(t)};const cg=0;const rg=async(t,n,e,o,s,c,r)=>{if(n!==cg){return t}const i=tg(e,o);let a;switch(r){case Kh:a=await Xh(t,i,s,c);break;case Qh:a=await ng(t,i,s,c);break;case Jh:a=sg(t,i,s,c);break;default:return t}return{...a,isSelecting:true}};const ig={editor:undefined,timeout:-1,x:0,y:0};const ag=()=>ig;const dg=(t,n,e,o)=>{ig.editor=t;ig.timeout=n;ig.x=e;ig.y=o};const lg=async(t,n)=>{};const ug=async()=>{const{editor:t,x:n,y:e}=ag();await bd(t,n,e);await lg()};const fg=300;const hg=(t,n,e)=>{if(!t.hoverEnabled){return t}const o=ag();if(o.timeout!==-1){clearTimeout(o.timeout)}const s=setTimeout(ug,fg);dg(t,s,n,e);return t};const gg=(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 mg=async(t,n,e)=>{h(t);g(n);g(e);const o=await bd(t,n,e);const s=Tr(t,o.rowIndex,o.columnIndex);try{const n=await tf(t,s);if(!n){return t}const e=Rr(t,n.startOffset);Rr(t,n.endOffset);const o=t.lineCache[e.rowIndex+1];if(!o){return t}const c=gg(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 wg=(t,n)=>new Uint32Array([n.startRowIndex,n.startColumnIndex,n.endRowIndex,n.endColumnIndex]);const pg=(t,n,e)=>{const o=wg(t,e);const s={end:{columnIndex:o[3],rowIndex:o[2]},start:{columnIndex:o[1],rowIndex:o[0]}};const c=[{deleted:Fr(t,s),end:s.end,inserted:[n],origin:gs,start:s.start}];return c};const yg=(t,n,e)=>{const o=pg(t,n,e);return oa(t,o)};const Eg=(t,n)=>{const e=wg(t,n);return ea(t,e)};const xg=t=>({...t,hasListener:false,isSelecting:false,selectionAutoMovePosition:{columnIndex:0,rowIndex:0}});const Ig=async(t,n,e,o,s,c,r)=>t;const Sg=(t,n)=>t;const kg=async(t,n,e)=>{await bd(t,n,e)};const Cg=t=>{globalThis.requestAnimationFrame(t)};const vg=(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 bg=(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 Mg=async(t,n)=>{let e=n;if(bg(t,n)){const t=Jr();const{differences:o,textInfos:s}=await Vr(n,t);e={...n,differences:o,textInfos:s}}if(!vg(t,n)){return e}const{cursorInfos:o,selectionInfos:s}=await Gi(e);return{...e,cursorInfos:o,selectionInfos:s}};const Ag=-1;const Lg=0;const Pg=1;const Fg=(t,n)=>{if(t.rowIndex>n.rowIndex){return Pg}if(t.rowIndex===n.rowIndex){if(t.columnIndex>n.columnIndex){return Pg}if(t.columnIndex<n.columnIndex){return Ag}return Lg}return Ag};const Wg=(t,n)=>new Uint32Array([t.rowIndex,t.columnIndex,n.rowIndex,n.columnIndex]);const Tg=(t,n)=>new Uint32Array([n.rowIndex,n.columnIndex,n.rowIndex,n.columnIndex]);const Rg=(t,n)=>new Uint32Array([t.rowIndex,t.columnIndex,n.rowIndex,n.columnIndex]);const Dg=(t,n)=>{switch(Fg(n,t)){case Lg:return Tg(t,n);case Pg:return Rg(t,n);case Ag:return Wg(t,n);default:throw new Error("unexpected comparison result")}};const Og=(t,n)=>{const e=t.selectionAnchorPosition;const o=Dg(e,n);return ea(t,o)};const Bg=(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 Ng=async t=>{const n=ts(t);const e=n?.newState;if(!e||!e.hasListener||!e.isSelecting){return}const o=e.selectionAutoMovePosition;if(o.rowIndex===0){return}const s=Bg(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 Mg(e,r);es(e.uid,e,i);Cg(()=>Ng(t))};const Hg=async(t,n,e)=>{h(t);g(n);g(e);const o=await bd(t,n,e);const s=Og(t,o);if(!t.hasListener&&(o.rowIndex<t.minLineY||o.rowIndex>t.maxLineY)){Cg(()=>Ng(t.uid));return{...s,hasListener:true,selectionAutoMovePosition:o}}return s};const zg=async(t,n,e,o)=>{if(!t.isSelecting){return t}if(o){return kg(t,n,e)}return Hg(t,n,e)};const $g=t=>({...t,hasListener:false,isSelecting:false,selectionAutoMovePosition:{columnIndex:0,rowIndex:0}});const Ug=(t,n,e)=>{if(e<=0){return 0}if(e<=t-n/2){return e/(t-n)}return 1};const _g=(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=Os(n,c,c+s);const a=i-c-e;const d=Xr(s,o);const l=o-s+r;const u=Ug(s,d,a);const f=Os(u,0,1);const h=f*l;return{...t,deltaX:h}};const Yg=(t,n)=>{const{deltaX:e,longestLineWidth:o,width:s,x:c}=t;const r=n-c;const i=Xr(s,o);const a=s-i;const d=jr(e,a,s,i);const l=r-d;if(l>=0&&l<i){return{...t,handleOffsetX:l}}const{handleOffset:u,percent:f}=Zr(s,i,r);const h=f*a;return{...t,deltaX:h,handleOffsetX:u}};const Vg=(t,n)=>{const{height:e,scrollBarHeight:o}=t;if(n<=e-o/2){return n/(e-o)}return 1};const jg=async(t,n)=>{const{finalDeltaY:e,handleOffset:o=0,y:s}=t;const c=n-s-o;const r=Vg(t,c);const i=r*e;const a=await Ki(t,i);return a};const qg=jg;const Gg=async(t,n)=>{const{deltaY:e,finalDeltaY:o,height:s,scrollBarHeight:c,y:r}=t;const i=n-r;const a=qr(e,o,s,c);const d=i-a;if(d>=0&&d<c){return{...t,handleOffset:d}}const{handleOffset:l,percent:u}=Zr(s,c,i);const f=u*o;const h=await Ki(t,f);return{...h,handleOffset:l}};const Xg=(t,n)=>{};const Zg={deltaY:0,touchOffsetY:0};const Qg=(t,n)=>{if(n.touches.length===0){return}const e=n.touches[0];Zg.touchOffsetY=e.y;Zg.deltaY=t.deltaY};const Kg=(t,n)=>Ji(t,n);const Jg=(t,n)=>Ki(t,n);const tm=(t,n,e,o)=>{g(n);g(e);g(o);const{deltaX:s}=t;if(e===0){return Kg(t,o)}const c=Os(s+e,0,Infinity);return{...Kg(t,o),deltaX:c}};const nm=(t,n)=>{if(n.touches.length===0){return}const e=n.touches[0];const o=Zg.deltaY+(Zg.touchOffsetY-e.y);Jg(t,o)};const em=(t,n,e,o)=>tm(t,n,e,o);const om=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:Cs,start:{columnIndex:0,rowIndex:t}})}return n};const sm=t=>{const{selections:n}=t;const e=om(n);return oa(t,e)};const cm=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 rm=t=>{const{selections:n}=t;const e=cm(n);return oa(t,e)};const im=async t=>Eo("Languages.getLanguageConfiguration",{languageId:t.languageId,uri:t.uri});const am=t=>{if(t?.indentationRules?.increaseIndentPattern&&typeof t.indentationRules.increaseIndentPattern==="string"){const n=new RegExp(t.indentationRules.increaseIndentPattern);return n}return undefined};const dm=(t,n)=>{if(!n){return false}return n.test(t)};const lm=(t,n,e)=>{const o=[];const s=[];const c=am(e);for(let e=0;e<n.length;e+=4){const[r,i,a,d]=ki(n,e);const l={columnIndex:i,rowIndex:r};const u={columnIndex:d,rowIndex:a};const f={end:u,start:l};if(Hi(r,i,a,d)){const n=t[r];const e=n.slice(0,i);const a=Mr(e);if(dm(e,c)){o.push({deleted:Fr({lines:t},f),end:u,inserted:["",a+" ",a],origin:bs,start:l});s.push(r+1,a.length+2,r+1,a.length+2)}else{o.push({deleted:Fr({lines:t},f),end:u,inserted:["",a],origin:bs,start:l});s.push(r+1,a.length,r+1,a.length)}}else{o.push({deleted:Fr({lines:t},f),end:u,inserted:["",""],origin:bs,start:l});s.push(r+1,0,r+1,0)}}return{changes:o,selectionChanges:new Uint32Array(s)}};const um=async t=>{const{lines:n,selections:e}=t;const o=await im(t);const{changes:s,selectionChanges:c}=lm(n,e,o);return oa(t,s,c)};const fm=2;const hm=0;const gm=()=>{const t=pd();const n={id:Fe,newState:{focused:true,focusSource:fm,height:0,questions:[],uid:t,width:0,x:0,y:0},oldState:{focused:false,focusSource:hm,height:0,questions:[],uid:t,width:0,x:0,y:0}};return n};const mm=async t=>{const n={...t,height:45,width:150,x:100,y:100};return n};const wm=async t=>{const n=true;return Qd(Fe,us,t,gm,mm,n)};const pm=()=>{const t=pd();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:ym,setFactory:Em}=Ho(qe);const xm=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=ts(n);const{languageId:a}=i;await ym("Completions.create",o,c,r,s,e,n,a);await ym("Completions.loadContent",o);const d=await ym("Completions.diff2",o);const l=await ym("Completions.render2",o,d);return{...t,commands:l}};const Im=async t=>{const n=false;return Qd(Te,cs,t,pm,xm,n)};const Sm=()=>{const t=pd();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 km=async()=>{const t="Find Widget Worker";const n="findWidgetWorkerMain.js";return _o(t,n)};const Cm=9002;const vm=async()=>{if(Un(Cm)){return}const t=await km();$n(Cm,t)};const bm=async(t,...n)=>{const e=Un(Cm);return await e.invoke(t,...n)};const Mm=async()=>{const t=Un(Cm);_n(Cm);if(t){await t.dispose()}};const Am=t=>{const n=ts(t);if(!n){throw new Error(`editor ${t} not found`)}const{newState:e}=n;return e};const Lm=async(t,n)=>{const{uid:e}=t;const o=Am(n);const{height:s,width:c,x:r,y:i}=o;await vm();await bm("FindWidget.create",e,r,i,c,s,n);await bm("FindWidget.loadContent",e);const a=await bm("FindWidget.diff2",e);const d=await bm("FindWidget.render2",e,a);return{...t,commands:d}};const Pm=(t,n)=>Lm(t,n);const Fm=async t=>{const n=true;return Qd(De,is,t,Sm,Pm,n)};const Wm=async t=>Fm(t);const Tm=t=>{const{selections:n}=t;const e=n[0];const o=n[1];const s=Md(t,e,o);const c=Ad(t,e);return{columnIndex:o,rowIndex:e,x:s,y:c}};const Rm=()=>{const t=pd();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 Dm=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=ts(n);const{languageId:a}=i;await Vd("Rename.create",o,c,r,s,e,n,a);await Vd("Rename.loadContent",o);const d=await Vd("Rename.diff2",o);const l=await Vd("Rename.render2",o,d);return{...t,commands:l}};const Om=async t=>{const{columnIndex:n,rowIndex:e}=Tm(t);const{word:o}=Ku(t,e,n);if(!o){return t}const s=true;return Qd(Be,ds,t,Rm,Dm,s)};const Bm=async t=>{const n=await ba({args:[],editor:t,event:"onLanguage",method:"ExtensionHostOrganizeImports.execute"});return n};const Nm=async t=>{const n=await Bm(t);return ld(t,n)};const Hm=(t,n)=>{const e=xi(n);const o=wd(t,e,Es);return oa(t,o)};const zm=async t=>{const n=await Ao();w(n);return Hm(t,n)};const $m=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 sa(o,e)};const Um=t=>{if(!t){return`Error: ${t}`}let{message:n}=t;while(t.cause){t=t.cause;n+=`: ${t}`}return n};const _m=t=>{if(!t){return{codeFrame:undefined,message:t,stack:undefined,type:"Error"}}const n=Um(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 Ym=/\((.*):(\d+):(\d+)\)$/;const Vm=/at (.*):(\d+):(\d+)$/;const jm=t=>{for(const n of t){if(Ym.test(n)||Vm.test(n)){return n}}return""};const qm=async t=>{try{const n=xi(t.stack);const e=jm(n);let o=e.match(Ym);if(!o){o=e.match(Vm)}if(!o){return t}const s=vr(n.slice(1));const c=Um(t);return{message:c,stack:s,type:t.constructor.name}}catch(n){console.warn("ErrorHandling Error");console.warn(n);return t}};const Gm=async t=>{if(t&&t.message&&t.codeFrame){return _m(t)}if(t&&t.stack){return qm(t)}return t};const Xm=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 Zm=async t=>{const n=await Gm(t);const e=Xm(n);console.error(e);return n};const Qm=async t=>{try{await Zm(t)}catch(n){console.warn("ErrorHandling error");console.warn(n);console.error(t)}};const Km=async t=>t;const Jm=t=>t.startsWith("untitled:");const tw=async(t,n)=>{await Eo("FileSystem.writeFile",t,n)};const nw=async t=>{const n="Save File";const{canceled:e,filePath:o}=await go("Open.showSaveDialog",n,[],t);if(e){return""}return o};const ew=async(t,n,e)=>{const o=await nw(e);if(!o){return}await Eo("FileSystem.writeFile",o,n);await vo();await Eo("Main.handleUriChange",t,o);return o};const ow=t=>{const n="code"in t?t.code:undefined;return n==="EACCES"||t.message.includes("EACCES:")};const sw=async t=>{if(ow(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 cw=async t=>{try{const{platform:n,uri:e}=t;const o=await Km(t);const s=Pr(o);if(Jm(e)){const t=await ew(e,s,n);if(t){return{...o,modified:false,uri:t}}return o}await tw(e,s);return{...o,modified:false}}catch(n){const e=new k(n,`Failed to save file "${t.uri}"`);await Qm(e);if(t.platform===je){try{await sw(e)}catch(t){await Qm(t)}}return t}};const rw=t=>{const{lines:n}=t;const e=0;const o=0;const s=n.length-1;const c=n.at(-1).length;const r=Ti(e,o,s,c);return ea(t,r)};const iw=(t,n,e)=>{const o=Di(t);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=ki(t,s);ml(o,s+2,c,r,n,e);hl(o,s,i,a)}return o};const aw=(t,n)=>{const{lines:e,selections:o}=t;const s=iw(o,e,n);return ea(t,s)};const dw=t=>{aw(t,Sl)};const lw=/[a-zA-Z\d]/;const uw=t=>lw.test(t);const fw=t=>uw(t)||t==="_";const hw=(t,n)=>{for(let e=n-1;e>=0;e--){if(!fw(t[e])){return e+1}}return 0};const gw=(t,n)=>{for(let e=n;e<t.length;e++){if(!fw(t[e])){return e}}return t.length};const mw=(t,n,e)=>{const o=t[n];const s=hw(o,e);const c=gw(o,e);const r=o.slice(s,c);return{end:c,start:s,word:r}};const ww=(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 pw=(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 yw=(t,n)=>{const e=[];for(let o=0;o<t.length-n.length+1;o){if(ww(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 Ew=(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=mw(t,c,r);if(e.start===e.end){return n}const o=pw(t,e.word);return o}const e=t[o];const i=e.slice(s,r);const a=pw(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=yw(t,i);return a};const xw=t=>{const{lines:n,selections:e}=t;const o=Ew(n,e);return ea(t,o)};const Iw=(t,n,e)=>{const o=new Uint32Array(t.length);for(let s=0;s<t.length;s+=4){const[c,r,i,a]=ki(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 Sw=(t,n)=>{const{lines:e}=t;const{selections:o}=t;const s=Iw(o,e,n);return ea(t,s)};const kw=t=>Sw(t,kl);const Cw=t=>aw(t,yl);const vw=t=>Sw(t,xl);const bw=(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]=ki(n,t);o[t]=s;o[t+1]=c;o[t+2]=Math.min(r+1,e);o[t+3]=i}return o};const Mw=t=>{const{lines:n,selections:e}=t;const o=bw(n,e);return ea(t,o)};const Aw=(t,n)=>{const e=new Uint32Array(n.length);for(let o=0;o<n.length;o+=4){const[s,c,r,i]=ki(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]!==wr){r--}r++;while(a<d.length&&d[a]!==wr){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 Lw=t=>{const{selections:n}=t;const{lines:e}=t;const o=Aw(e,n);return ea(t,o)};const Pw=async(t,n)=>{const e=await Eo("ExtensionHostSelection.executeGrowSelection",t,n);if(e.length===0){return n}return new Uint32Array(e)};const Fw=async t=>{const{selections:n}=t;const e=await Pw(t,n);return ea(t,e)};const Ww=(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 Tw=t=>{const{lines:n}=t;const{selections:e}=t;if(Ui(e)){const t=new Uint32Array(e.length);for(let o=0;o<e.length;o+=4){const[s,c,r,i]=ki(e,o);const a=mw(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(_i(t.selections)){return Ww(t.lines,t.selections)}return undefined};const Rw=(t,n,e,o)=>e>=t&&o<=n;const Dw=t=>{const n=Tw(t);if(!n){return t}const{revealRange:e,selectionEdits:o}=n;const s=o[e];const c=o[e+2];if(Rw(t.minLineY,t.maxLineY,s,c)){return ea(t,o)}return oa(t,[],o)};const Ow=t=>t;const Bw=(t,n)=>{const e=new Uint32Array(n.length);for(let t=0;t<n.length;t+=4){const[o,s,c,r]=ki(n,t);e[t]=Math.max(o-1,0);e[t+1]=s;e[t+2]=c;e[t+3]=r}return e};const Nw=t=>{const{lines:n,selections:e}=t;const o=Bw(n,e);return ea(t,o)};const Hw=t=>aw(t,Fl);const zw=t=>Sw(t,Dl);const $w=(t,n,e)=>{if(t.decorations.length===0&&n.length===0){return t}return{...t,decorations:n,diagnostics:e}};const Uw=async(t,n,e)=>{const{tokenizerId:o}=t;Zc(n,e);await or(n,e);const s=sr(n);const c=o+1;rr(c,s);const r=Am(t.uid);if(!r){return t}const i=Jr();const{differences:a,textInfos:d}=await Vr(t,i);const l=Am(t.uid);if(!l){return t}const u={...l,differences:a,focused:true,textInfos:d};return{...u,invalidStartIndex:0,languageId:n,tokenizerId:c}};const _w=(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 Yw=(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:Fr(t,{end:c,start:s}),end:c,inserted:xi(n),origin:Is,start:s}];return oa(t,r)};const Vw=()=>{const t=pd();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 jw=async()=>{const t="Hover Worker";const n="hoverWorkerMain.js";const e="Hover.initialize";const o=await _o(t,n,e);return o};const qw={};const Gw=()=>{if(!qw.workerPromise){qw.workerPromise=jw()}return qw.workerPromise};const Xw=async(t,...n)=>{const e=await Gw();return await e.invoke(t,...n)};const Zw=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=ts(n);const{languageId:a}=i;await Xw("Hover.create",o,c,r,s,e,n,a);await Xw("Hover.loadContent",o);const d=await Xw("Hover.diff2",o);const l=await Xw("Hover.render2",o,d);return{...t,commands:l}};const Qw=async t=>{const n=false;return Qd(Oe,as,t,Vw,Zw,n)};const Kw="EditorHover";const Jw=async t=>{await Eo("Viewlet.openWidget",Kw);return t};const tp=()=>{const t=pd();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 np=async()=>{const t="Source Action Worker";const n="sourceActionWorkerMain.js";const e="SourceActions.initialize";const o=await _o(t,n,e);return o};const ep={};const op=()=>{if(!ep.workerPromise){ep.workerPromise=np()}return ep.workerPromise};const sp=async(t,...n)=>{const e=await op();return await e.invoke(t,...n)};const cp=async(t,n)=>{const{height:e,uid:o,width:s,x:c,y:r}=t;const{newState:i}=ts(n);const{languageId:a}=i;await sp("SourceActions.create",o,c,r,s,e,n,a);await sp("SourceActions.loadContent",o);const d=await sp("SourceActions.diff2",o);const l=await sp("SourceActions.render2",o,d);return{...t,commands:l}};const rp=async t=>Qd(Ne,ls,t,tp,cp);const ip=(t,n)=>t.localeCompare(n);const ap=t=>{const n=[...t];n.sort(ip);return n};const dp="sort-lines-ascending";const lp=(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=ap(h);s.push({deleted:Fr({lines:t},f),end:u,inserted:g,origin:dp,start:l})}return s};const up=t=>{const{lines:n,selections:e}=t;const o=lp(n,e);return oa(t,o)};const fp=async(t,n)=>ba({args:[n],editor:t,event:va,method:ua,noProviderFoundMessage:"No tab completion provider found",noProviderFoundResult:undefined});const hp=t=>{const{selections:n}=t;const e=n[0];const o=n[1];const s=Tr(t,e,o);return s};const gp=async t=>{const n=hp(t);const e=await fp(t,n);return e};const mp=(t,n,e)=>{const o=xi(e.inserted);const s=[];const c=[];for(let r=0;r<n.length;r+=4){const[i,a,d,l]=ki(n,r);if(o.length>1){const n=Lr({lines:t},i);const r=Mr(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:xs,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:xs,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:xs,start:{columnIndex:a-e.deleted,rowIndex:i}})}}}return{changes:s,selectionChanges:new Uint32Array(c)}};const wp=(t,n)=>{const{lines:e,selections:o}=t;const{changes:s,selectionChanges:c}=mp(e,o,n);return oa(t,s,c)};const pp=String;const yp=async t=>{try{const n=await gp(t);if(!n){return t}return wp(t,n)}catch(n){await Qm(n);const e=t.selections[0];const o=t.selections[1];return Pd(t,e,o,pp(n))}};const Ep=async(t,n)=>{const{assetDir:e,platform:o}=t;try{await zo(`onLanguage:${t.languageId}`,e,o);const s=await ha(`ExtensionHostCommment.execute`,t.uid,n);if(s){return s}}catch{}const s=await im(t);if(!s?.comments?.blockComment){return undefined}return s.comments.blockComment};const xp=/^\s+/;const Ip=/\s+$/;const Sp=(t,n,e)=>({deleted:[e],end:{columnIndex:n+e.length,rowIndex:t},inserted:[],origin:Ls,start:{columnIndex:n,rowIndex:t}});const kp=(t,n,e,o,s,c,r)=>{if(n===o){return[Sp(t,e,c),Sp(t,s-c.length,r)]}return[Sp(n,e,c),Sp(o,s,r)]};const Cp=(t,n)=>{const{selections:e}=t;const[o]=e;const s=Lr(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=Lr(t,r);i=n.indexOf(d);if(i!==-1){break}r++}let l=-1;let u=o;while(u>=0){const n=Lr(t,u);l=n.indexOf(a);if(l!==-1){break}u--}const f=[];if(l!==-1&&i!==-1){f.push(...kp(o,u,l,r,i,a,d))}else{const t=s.match(xp);const n=s.match(Ip);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:Ls,start:{columnIndex:e,rowIndex:o}};const i={deleted:[],end:{columnIndex:c+a.length,rowIndex:o},inserted:[d],origin:Ls,start:{columnIndex:c+a.length,rowIndex:o}};f.push(r,i)}return f};const vp=async t=>{const n=hp(t);const e=await Ep(t,n);if(!e){return t}const o=Cp(t,e);return ca(t,o)};const bp=async t=>{const n=await im(t);if(!n?.comments?.lineComment){return undefined}return n.comments.lineComment};const Mp=/^\s+/;const Ap=(t,n,e)=>{const o=n.match(Mp);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:Ms,start:{columnIndex:s,rowIndex:t}}}return{deleted:[e],end:{columnIndex:s+e.length,rowIndex:t},inserted:[""],origin:Ms,start:{columnIndex:s,rowIndex:t}}}return{deleted:[],end:{columnIndex:s,rowIndex:t},inserted:[`${e} `],origin:Ms,start:{columnIndex:s,rowIndex:t}}};const Lp=async t=>{const n=await bp(t);if(!n){return t}const e=t;const o=t.selections[0];const s=Lr(e,o);const c=[Ap(o,s,n)];return oa(t,c)};const Pp=async t=>{try{const n=await Lp(t);if(t!==n){return n}return vp(t)}catch(n){dd(n);await Ld(t,0,0,String(n));return t}};const Fp=async(t,n)=>{const e=wd(t,[n],Is);const o=await oa(t,e);if(o.completionsOnType){const t=await Im(o);return t}return o};const Wp="/";const Tp="{";const Rp="}";const Dp="(";const Op=")";const Bp="[";const Np="]";const Hp="???";const zp="'";const $p='"';const Up="`";const _p=t=>{switch(t){case Tp:return Rp;case Dp:return Op;case Bp:return Np;default:return Hp}};const Yp=(t,n)=>{const e=_p(n);const o=n+e;const s=wd(t,[o],Ss);const c=new Uint32Array([s[0].start.rowIndex,s[0].start.columnIndex+1,s[0].end.rowIndex,s[0].end.columnIndex+1]);return oa(t,s,c)};const Vp=t=>{const{selections:n}=t;const e=new Uint32Array([n[0],n[1]+1,n[2],n[3]+1]);return ea(t,e)};const jp=(t,n)=>{const{autoClosingRanges:e=[],selections:o}=t;if(Lu(e,o)){return Vp(t)}return Fp(t,n)};const qp=(t,n)=>{const e=n+n;const o=wd(t,[e],Ss);const s=new Uint32Array([o[0].start.rowIndex,o[0].start.columnIndex+1,o[0].end.rowIndex,o[0].end.columnIndex+1]);return oa(t,o,s)};const Gp=async(t,n)=>{const e=Tr(t,t.selections[0],t.selections[1]);const o=await Eo("ExtensionHostClosingTagCompletion.executeClosingTagProvider",t,e,n);if(!o){const e=wd(t,[n],Is);return oa(t,e)}const s=wd(t,[o.inserted],Is);return oa(t,s)};const Xp=async(t,n)=>{const{isAutoClosingBracketsEnabled:e,isAutoClosingQuotesEnabled:o,isAutoClosingTagsEnabled:s}=t;switch(n){case Wp:if(s){return Gp(t,n)}break;case Rp:case Op:case Np:if(e){return jp(t,n)}break;case Tp:case Dp:case Bp:if(e){return Yp(t,n)}break;case Up:case $p:case zp:if(o){return qp(t,n)}break}const c=Fp(t,n);return c};const Zp=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 Qp=t=>{const{undoStack:n}=t;if(n.length===0){return t}const e=n.at(-1);const o=e.map(Zp);const s={...t,redoStack:[...t.redoStack||[],e],undoStack:n.slice(0,-1)};return sa(s,o)};const Kp=t=>t;const Jp=t=>{switch(t){case yd:case We:case Te:case De:case Oe:case Be:case Ne:return true;default:return false}};const ty=(t,n,e)=>{const o=e(t);const{uid:s}=t.newState;const c=[];c.push(["Viewlet.createFunctionalRoot",n,s,Jp(t.id)]);c.push(...o);if(Jp(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 ny=t=>{switch(t){case We:return qo;case Te:return ym;case De:return bm;case Oe:return Xw;case Be:return Vd;case Ne:return sp;default:return undefined}};const ey="Close";const oy=(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 sy=(t,n)=>{for(const e of ns()){const o=ts(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 cy=(t,n)=>{if(t&&t.widgets){return t}const e=ts(t);if(e&&e.newState&&e.newState.widgets){return e.newState}return sy(t,n)};const ry=(t,n,e)=>{const o=t=>t.id===e;const s=n=>t==="close"||t==="handleClickButton"&&n.includes(ey);const c=async(c,...r)=>{const i=cy(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=ny(e);await f(`${n}.${t}`,u,...r);const h=await f(`${n}.diff2`,u);const g=await f(`${n}.render2`,u,h);const m=ts(i.uid).newState;if(s(r)){const t={...m,focused:true,widgets:Bd(m.widgets,e)};es(i.uid,m,t);return t}const w={...l,commands:g};const p=oy(m,e,w);es(i.uid,m,p);return p};return c};const iy=(t,n,e)=>{const o=Object.create(null);for(const s of t){o[s]=ry(s,n,e)}return o};const ay="Viewlet.appendToBody";const dy="focus";const ly="Viewlet.registerEventListeners";const uy="Viewlet.setSelectionByName";const fy="Viewlet.setValueByName";const hy="Viewlet.setFocusContext";const gy="setBounds";const my="Viewlet.setBounds";const wy="Viewlet.setCss";const py="Viewlet.setDom2";const yy="Viewlet.setUid";const Ey=(t,n)=>{const e=[...n.commands];n.commands=[];return e};const xy=[py,wy,ay,my,ly,uy,fy,hy,yy,"Viewlet.focusSelector"];const Iy=t=>{const n=Ey(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(xy.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const Sy=t=>ty(t,"EditorCompletion",Iy);const ky=t=>[["Viewlet.dispose",t.newState.uid]];const{close:Cy,closeDetails:vy,focusFirst:by,focusIndex:My,focusLast:Ay,focusNext:Ly,focusPrevious:Py,handleEditorBlur:Fy,handleEditorClick:Wy,handleEditorDeleteLeft:Ty,handleEditorType:Ry,handlePointerDown:Dy,handleWheel:Oy,openDetails:By,selectCurrent:Ny,selectIndex:Hy,toggleDetails:zy}=iy(["handleEditorType","focusFirst","focusNext","focusPrevious","focusLast","handleEditorDeleteLeft","openDetails","focusIndex","handleEditorBlur","handleEditorClick","openDetails","selectCurrent","selectIndex","toggleDetails","closeDetails","handleWheel","close","handlePointerDown"],"Completions",Te);const $y={__proto__:null,add:Sy,close:Cy,closeDetails:vy,focusFirst:by,focusIndex:My,focusLast:Ay,focusNext:Ly,focusPrevious:Py,handleEditorBlur:Fy,handleEditorClick:Wy,handleEditorDeleteLeft:Ty,handleEditorType:Ry,handlePointerDown:Dy,handleWheel:Oy,openDetails:By,remove:ky,render:Iy,selectCurrent:Ny,selectIndex:Hy,toggleDetails:zy};const Uy=(t,n)=>{const e=[...n.commands];n.commands=[];return e};const _y=[py,wy,ay,my,ly,uy,fy,hy,yy,"Viewlet.focusSelector"];const Yy=t=>{const n=Uy(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(_y.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const Vy=t=>ty(t,"FindWidget",Yy);const jy=t=>[["Viewlet.dispose",t.newState.uid]];const{close:qy,focusCloseButton:Gy,focusFind:Xy,focusNext:Zy,focusNextElement:Qy,focusNextMatchButton:Ky,focusPrevious:Jy,focusPreviousElement:tE,focusPreviousMatchButton:nE,focusReplace:eE,focusReplaceAllButton:oE,focusReplaceButton:sE,focusToggleReplace:cE,handleBlur:rE,handleClickButton:iE,handleFocus:aE,handleInput:dE,handleReplaceFocus:lE,handleReplaceInput:uE,handleToggleReplaceFocus:fE,replace:hE,replaceAll:gE,toggleMatchCase:mE,toggleMatchWholeWord:wE,togglePreserveCase:pE,toggleReplace:yE,toggleUseRegularExpression:EE}=iy(["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 xE={__proto__:null,add:Vy,close:qy,focusCloseButton:Gy,focusFind:Xy,focusNext:Zy,focusNextElement:Qy,focusNextMatchButton:Ky,focusPrevious:Jy,focusPreviousElement:tE,focusPreviousMatchButton:nE,focusReplace:eE,focusReplaceAllButton:oE,focusReplaceButton:sE,focusToggleReplace:cE,handleBlur:rE,handleClickButton:iE,handleFocus:aE,handleInput:dE,handleReplaceFocus:lE,handleReplaceInput:uE,handleToggleReplaceFocus:fE,remove:jy,render:Yy,replace:hE,replaceAll:gE,toggleMatchCase:mE,toggleMatchWholeWord:wE,togglePreserveCase:pE,toggleReplace:yE,toggleUseRegularExpression:EE};const IE=t=>({documentId:t.id||t.uid,languageId:t.languageId,text:Pr(t),uri:t.uri});const SE=async(t,n)=>{const e=IE(t);return uo("Extensions.executeHoverProvider",e,n)};const kE=async(t,n)=>{h(t);g(n);const e=await SE(t,n);if(e){return e}return ba({args:[n],editor:t,event:Ca,method:la,noProviderFoundMessage:"No hover provider found"})};const CE=async(t,n)=>{h(t);g(n);const e=await kE(t,n);return e};const vE=async(t,n,e,o,s)=>100;const bE=(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 ME=(t,n,e)=>{const o=[];const{hasArrayReturn:s,initialLineState:c,tokenizeLine:r,TokenMap:i}=n;let a=Lc(c);for(const n of t){const t=Tc(e,r,n,a,s);const{tokens:c}=t;const d=bE(n,c,i);o.push(d);a=t}console.error({lineInfos:o});return o};const AE=async(t,n,e)=>{await or(n,e);const o=sr(n);const s=xi(t);const c=ME(s,o,n);return c};const LE=(t,n)=>{if(t){return t}const e=n[0];const o=n[1];return{columnIndex:o,rowIndex:e}};const PE=(t,n,e)=>{const o=[];for(const e of t){if(e.rowIndex===n){o.push(e)}}return o};const FE="typescript";const WE=(t,n,e,o)=>{const s=Md(t,n,e);const c=t.height-Ad(t,n)+t.y+40;return{x:s,y:c}};const TE=async(t,n)=>{g(t);const e=ts(t);const o=e.newState;const{selections:s}=o;const{columnIndex:c,rowIndex:r}=LE(n,s);const i=Tr(o,r,c);const a=await CE(o,i);if(!a){return undefined}const{displayString:d,displayStringLanguageId:l,documentation:u}=a;const f="";const h=await AE(d,l||FE,f);const m=Ju(o,r,c);const w=c-m.length;await vE();const{x:p,y:y}=WE(o,r,w);const E=o.diagnostics||[];const x=PE(E,r);return{documentation:u,lineInfos:h,matchingDiagnostics:x,x:p,y:y}};const RE=async(t,n,e)=>{const o=await TE(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 DE=(t,n,e)=>t;const OE=(t,n,e)=>{const{x:o}=t;const s=100;const c=Math.max(n-o,s);return{...t,resizedWidth:c}};const BE=(t,n,e)=>t;const NE="CodeGeneratorInput";const HE="CodeGeneratorMessage";const zE="CodeGeneratorWidget";const $E="DiagnosticError";const UE="DiagnosticWarning";const _E="CompletionDetailCloseButton";const YE="CompletionDetailContent";const VE="Diagnostic";const jE="EditorCursor";const qE="EditorRow";const GE="EditorRowHighlighted";const XE="EditorSelection";const ZE="HoverDisplayString";const QE="HoverDocumentation";const KE="HoverEditorRow";const JE="HoverProblem";const tx="HoverProblemDetail";const nx="HoverProblemMessage";const ex="IconClose";const ox="InputBox";const sx="MaskIcon";const cx="Viewlet";const rx=1;const ix=2;const ax=9;const dx=10;const lx=11;const ux=12;const fx=13;const hx=14;const gx=15;const mx=18;const wx=19;const px=20;const yx=21;const Ex=22;const xx=23;const Ix=26;const Sx=27;const kx=28;const Cx=29;const vx=30;const bx=31;const Mx=32;const Ax=33;const Lx=4;const Px=6;const Fx=8;const Wx=12;const Tx=62;const Rx=t=>({childCount:0,text:t,type:Wx});const Dx=t=>{const n=[{childCount:t.length/2,className:KE,type:Lx}];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:Fx},Rx(o))}return n};const Ox=t=>{const n=t.flatMap(Dx);return n};const Bx={childCount:1,className:nx,type:Fx};const Nx={childCount:1,className:tx,type:Fx};const Hx=(t,n,e)=>{const o=n?1:0;const s=e&&e.length>0?1:0;return t.length+o+s};const zx=(t,n,e)=>{const o=[];o.push({childCount:Hx(t,n,e)+1,className:"Viewlet EditorHover",type:Lx});if(e&&e.length>0){o.push({childCount:e.length*2,className:`${ZE} ${JE}`,type:Lx});for(const t of e){o.push(Bx,Rx(t.message),Nx,Rx(`${t.source} (${t.code})`))}}if(t.length>0){const n=Ox(t);o.push({childCount:t.length,className:ZE,type:Lx},...n)}if(n){o.push({childCount:1,className:QE,type:Lx},Rx(n))}o.push({childCount:0,className:"Sash SashVertical SashResize",onPointerDown:Ix,type:Lx});return o};const $x={apply(t,n){const e=zx(n.lineInfos,n.documentation,n.diagnostics);return[py,e]},isEqual:(t,n)=>t.lineInfos===n.lineInfos&&t.documentation===n.documentation&&t.diagnostics===n.diagnostics};const Ux={apply(t,n){const{height:e,width:o,x:s,y:c}=n;return[gy,s,c,o,e]},isEqual:(t,n)=>t.x===n.x&&t.y===n.y};const _x=[$x,Ux];const Yx=(t,n)=>{const e=[];for(const o of _x){if(!o.isEqual(t,n)){e.push(o.apply(t,n))}}return e};const Vx=[py,wy,ay,my,ly,uy,fy,hy,yy,"Viewlet.focusSelector"];const jx=t=>{const n=Ey(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(Vx.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const qx=t=>ty(t,"EditorRename",jx);const Gx=t=>[["Viewlet.dispose",t.newState.uid]];const{accept:Xx,close:Zx,handleInput:Qx}=iy(["handleInput","close","accept"],"Rename",Be);const Kx={__proto__:null,accept:Xx,add:qx,close:Zx,handleInput:Qx,remove:Gx,render:jx};const Jx=t=>structuredClone(t);const tI=(t,n)=>{const e={...t,focusedIndex:n};return e};const nI=t=>{const n=t.focusedIndex+1;return tI(t,n)};const eI=t=>[["Viewlet.dispose",t.newState.uid]];const oI=[py,wy,ay,my,ly,uy,fy,hy,yy,"Viewlet.focusSelector"];const sI=t=>{const n=Ey(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(oI.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const cI=t=>ty(t,"EditorSourceActions",sI);const rI=eI;const{close:iI,closeDetails:aI,focusFirst:dI,focusIndex:lI,focusLast:uI,focusNext:fI,focusPrevious:hI,handleWheel:gI,selectCurrent:mI,selectIndex:wI,selectItem:pI,toggleDetails:yI}=iy(["focusFirst","focusIndex","focusLast","focusNext","focusPrevious","selectCurrent","selectIndex","selectItem","toggleDetails","closeDetails","handleWheel","close"],"SourceActions",Ne);const EI={__proto__:null,add:cI,close:iI,closeDetails:aI,focusFirst:dI,focusIndex:lI,focusLast:uI,focusNext:fI,focusPrevious:hI,handleWheel:gI,remove:rI,render:sI,selectCurrent:mI,selectIndex:wI,selectItem:pI,toggleDetails:yI};const xI=async(t,n,e,o,s,...c)=>{const r=ny(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=Am(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=oy(u,s,y);return E};const II=async t=>{if(!t){return[]}const{newState:n}=ts(t);return ba({args:[],editor:n,event:"onLanguage",method:"ExtensionHostCodeActions.getSourceActions"})};const SI=/[\w\-]+$/;const kI=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(SI);if(i){return i[0]}return""};const CI=async t=>{await Eo("Focus.setFocus",t)};const vI=async t=>{if(!t){return}await Eo("Focus.removeAdditionalFocus",t)};const bI=12;const MI=9;const AI=11;const LI=12;const PI=16;const FI=38;const WI=43;const TI=46;const RI=47;const DI=48;const OI=49;const BI=50;const NI=52;const HI=t=>{const n=Am(t);return Tm(n)};const zI=t=>{const n=Am(t);return n.uri};const $I=t=>{const n=Am(t);return n.languageId};const UI=t=>{const n=Am(t);return hp(n)};const _I=(t,n,e)=>{const o=Am(t);const{word:s}=Ku(o,n,e);return s};const YI=t=>{const n=Am(t);const e=kI(n);return e};const VI=(t,n,e)=>{const o=Am(t);const s=Ju(o,n,e);return s};const jI=t=>{const n=Am(t);const{lines:e}=n;return e};const qI=t=>{const n=Am(t);const{selections:e}=n;return e};const GI=async(t,n)=>{const e=Am(t);const o={...e,selections:n};const s=await Mg(e,o);es(t,e,s)};const XI=async(t,n,e,o)=>{const s=Am(t);const c=ny(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 Mg(s,d);es(t,s,l);await CI(LI);if(o){await vI(o)}};const ZI=async t=>{await XI(t,De,"FindWidget",0)};const QI=async(t,n)=>{const e=Am(t);const o=await ud(e,n);const s=await Mg(e,o);es(t,e,s)};const KI=async t=>{const n=await II(t);return n};const JI=async t=>{const n=Am(t);const{diagnostics:e}=n;return e};const tS=async(t,n)=>{await po("TextMeasurement.ensureFont",t,n)};const nS=()=>[{command:"Editor.closeSourceAction",key:ee,when:FI},{command:"EditorSourceActions.focusNext",key:de,when:FI},{command:"EditorSourceActions.focusPrevious",key:ie,when:FI},{command:"EditorSourceActions.focusFirst",key:ce,when:FI},{command:"EditorSourceActions.focusLast",key:se,when:FI},{command:"EditorSourceActions.selectCurrent",key:ne,when:FI},{command:"FindWidget.focusNext",key:ne,when:PI},{command:"FindWidget.preventDefaultBrowserFind",key:He|ge,when:PI},{command:"FindWidget.focusPrevious",key:ze|ve,when:PI},{command:"FindWidget.focusNext",key:ve,when:PI},{command:"FindWidget.focusToggleReplace",key:ze|te,when:PI},{command:"FindWidget.focusReplace",key:te,when:PI},{command:"FindWidget.focusPreviousMatchButton",key:te,when:WI},{command:"FindWidget.replaceAll",key:$e|He|ne,when:WI},{command:"FindWidget.focusNextMatchButton",key:te,when:BI},{command:"FindWidget.focusReplace",key:ze|te,when:BI},{command:"FindWidget.focusPreviousMatchButton",key:ze|te,when:OI},{command:"FindWidget.focusCloseButton",key:te,when:OI},{command:"FindWidget.focusNextMatchButton",key:ze|te,when:DI},{command:"FindWidget.focusReplaceButton",key:te,when:DI},{command:"FindWidget.focusFind",key:ze|te,when:WI},{command:"FindWidget.focusReplaceAllButton",key:te,when:TI},{command:"FindWidget.focusCloseButton",key:ze|te,when:TI},{command:"FindWidget.focusReplaceButton",key:ze|te,when:RI},{command:"EditorCompletion.focusNext",key:de,when:MI},{command:"EditorCompletion.focusPrevious",key:ie,when:MI},{command:"EditorCompletion.selectCurrent",key:ne,when:MI},{command:"EditorCompletion.close",key:ee,when:MI},{command:"EditorCompletion.focusLast",key:se,when:MI},{command:"EditorCompletion.focusFirst",key:ce,when:MI},{command:"EditorCompletion.toggleDetails",key:He|oe,when:MI},{command:"Editor.cursorWordRight",key:He|ae,when:LI},{command:"Editor.cursorWordLeft",key:He|re,when:LI},{command:"Editor.deleteWordPartLeft",key:$e|Jn,when:LI},{command:"Editor.deleteWordPartRight",key:$e|le,when:LI},{command:"Editor.deleteWordLeft",key:He|Jn,when:LI},{command:"Editor.deleteWordRight",key:He|le,when:LI},{command:"Editor.selectNextOccurrence",key:He|he,when:LI},{command:"Editor.openColorPicker",key:He|we,when:LI},{command:"Editor.showSourceActions3",key:He|Me,when:LI},{command:"Editor.handleTab",key:te,when:LI},{command:"Editor.unindent",key:ze|te,when:LI},{command:"Editor.indentLess",key:He|Le,when:LI},{command:"Editor.closeFind",key:ee,when:PI},{command:"Editor.openFind2",key:He|ge,when:LI},{command:"Editor.openCodeGenerator",key:He|pe,when:LI},{command:"Editor.closeCodeGenerator",key:ee,when:NI},{command:"EditorCodeGenerator.accept",key:ne,when:NI},{command:"Editor.indentMore",key:He|Pe,when:LI},{command:"Editor.selectCharacterLeft",key:ze|re,when:LI},{command:"Editor.selectWordLeft",key:He|ze|re,when:LI},{command:"Editor.selectCharacterRight",key:ze|ae,when:LI},{command:"Editor.selectWordRight",key:He|ze|ae,when:LI},{command:"Editor.selectLine",key:He|ye,when:LI},{command:"Editor.deleteAllLeft",key:He|ze|Jn,when:LI},{command:"Editor.deleteAllRight",key:He|ze|le,when:LI},{command:"Editor.cancelSelection",key:ee,when:LI},{command:"Editor.undo",key:He|Se,when:LI},{command:"Editor.cursorLeft",key:re,when:LI},{command:"Editor.cursorRight",key:ae,when:LI},{command:"Editor.cursorUp",key:ie,when:LI},{command:"Editor.cursorDown",key:de,when:LI},{command:"Editor.deleteLeft",key:Jn,when:LI},{command:"Editor.deleteRight",key:le,when:LI},{command:"Editor.insertLineBreak",key:ne,when:LI},{command:"Editor.copyLineDown",key:He|ze|he,when:LI},{command:"Editor.moveLineDown",key:He|ze|de,when:LI},{command:"Editor.moveLineUp",key:He|ze|ie,when:LI},{command:"Editor.openCompletion",key:He|oe,when:LI},{command:"Editor.openRename",key:ke,when:LI},{command:"EditorRename.accept",key:ne,when:AI},{command:"Editor.closeRename",key:ee,when:AI},{command:"Editor.cursorHome",key:ce,when:LI},{command:"Editor.cursorEnd",key:se,when:LI},{command:"Editor.toggleComment",key:He|Ae,when:LI},{command:"Editor.copy",key:He|fe,when:LI},{command:"Editor.selectAll",key:He|ue,when:LI},{command:"Editor.showHover2",key:He|me,when:LI},{command:"Editor.cut",key:He|Ie,when:LI},{command:"Editor.paste",key:He|xe,when:LI},{command:"Editor.cursorWordPartLeft",key:$e|re,when:LI},{command:"Editor.cursorWordPartRight",key:$e|ae,when:LI},{command:"Editor.selectAllOccurrences",key:$e|Ce,when:LI},{command:"Editor.addCursorAbove",key:$e|ze|ie,when:LI},{command:"Editor.addCursorBelow",key:$e|ze|de,when:LI},{command:"Editor.findAllReferences",key:$e|ze|be,when:LI},{command:"Editor.organizeImports",key:$e|ze|Ee,when:LI},{command:"Editor.selectionGrow",key:He|ze|oe,when:bI}];const eS=()=>ns();const oS={CommandPalette:"Command Palette"};const sS=()=>of(oS.CommandPalette);const cS={command:"",flags:Ye,id:"separator",label:""};const rS=()=>[{command:"Editor.goToDefinition",flags:Ve,id:"go-to-definition",label:zf()},{command:"Editor.goToTypeDefinition",flags:Ve,id:"go-to-type-definition",label:Gf()},cS,{args:["References",true],command:"SideBar.show",flags:Ve,id:"find-all-references",label:Xf()},{args:["Implementations",true],command:"SideBar.show",flags:Ve,id:"find-all-implementations",label:Zf()},cS,{command:"Editor.format",flags:Ve,id:"format",label:oh()},{command:"Editor.showSourceActions2",flags:Ve,id:_e,label:Vf()},cS,{command:"Editor.cut",flags:Ve,id:"cut",label:Qf()},{command:"Editor.copy",flags:Ve,id:"copy",label:Kf()},{command:"Editor.paste",flags:Ve,id:"paste",label:Jf()},cS,{command:"QuickPick.showEverything",flags:Ve,id:"commandPalette",label:sS()}];const iS=()=>[Ue];const aS=t=>La(t);const dS=async()=>{const t=ns();const n=t.map(t=>{const n=Number(t);const e=ts(n);return e});const e=n.map(t=>t.newState);const o=await Promise.all(e.map(aS));const s=o.flat();return s};const lS=()=>[{id:"Editor.format",label:oh()},{id:"Editor.showHover",label:sh()},{id:"Editor.formatForced",label:ch()},{id:"Editor.selectNextOccurrence",label:rh()},{id:"Editor.selectAllOccurrences",label:ih()},{id:"Editor.goToDefinition",label:ah()},{id:"Editor.goToTypeDefinition",label:dh()},{id:"Editor.selectInsideString",label:lh()},{aliases:["Indent More","DeIndent"],id:"Editor.indent",label:uh()},{aliases:["Indent Less","DeIndent"],id:"Editor.unindent",label:fh()},{id:"Editor.sortLinesAscending",label:hh()},{id:"Editor.toggleComment",label:gh()},{id:"Editor.selectUp",label:mh()},{id:"Editor.selectDown",label:wh()},{id:"Editor.toggleBlockComment",label:th()},{id:"Editor.openColorPicker",label:ph()},{id:"Editor.closeColorPicker",label:yh()},{id:"Editor.copyLineDown",label:Eh()},{id:"Editor.copyLineUp",label:xh()},{id:"Editor.moveLineDown",label:eh()},{id:"Editor.moveLineUp",label:nh()},{id:"Editor.showSourceActions2",label:Vf()}];const uS=t=>{const n=Am(t);const{selections:e}=n;return e};const fS=t=>{g(t);const n=Am(t);const{lines:e}=n;return e.join(yr)};const hS="insertText";const gS=(t,n,e)=>{switch(n){case hS:return Xp(t,e);default:return t}};const mS=async(t,n)=>{const e=await Bn({commandMap:{},messagePort:t});if(n){$n(n,e)}};const wS=(t,n)=>wp(t,n);const pS=async t=>{const n=await gp(t);if(!n){return t}return wS(t,n)};const yS=async()=>{await Mm();await vm()};const ES=t=>{switch(t){case De:return{invoke:bm,name:"FindWidget"};default:return undefined}};const xS=async(t,n,e,o)=>{if(e?.newState){const s=`${n}:${e.newState.uid}`;const c=ES(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 IS=async(t,n)=>{const e=[];for(const o of t){const t=parseInt(o);const s=ts(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 xS(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 SS=async(t,n,e)=>{if(!e?.newState){return}const o=ES(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 kS=async t=>{const n=Object.create(null);for(const e of t){const t=ts(parseInt(e));if(!t?.newState||!Array.isArray(t.newState.widgets)){continue}const{widgets:o}=t.newState;for(const t of o){await SS(n,e,t)}}return n};const CS={isReloading:false};const vS=async()=>{if(CS.isReloading){return}CS.isReloading=true;try{const t=ns();const n=await kS(t);await yS();const e=await IS(t,n);for(const t of e){es(t.newState.uid,t.oldState,t.newState)}await Eo(`Editor.rerender`)}finally{CS.isReloading=false}};const bS=async t=>{try{await Ro(t)}catch{await xo("SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker",t,"HandleMessagePort.handleMessagePort")}};const MS=async()=>{try{const t=await Rn({commandMap:{},send:bS});return t}catch(t){throw new k(t,`Failed to create syntax highlighting worker rpc`)}};const AS=async(t,n)=>{if(t){Uc(true);const t=await MS();Vc(t)}if(n){Kr(true)}};const LS=async()=>{const t="Completion Worker";const n="completionWorkerMain.js";const e="Completions.initialize";const o=await _o(t,n,e);return o};const PS=async(t,n)=>{Em(LS);await AS(t,n)};const FS="editor.lineHeight";const WS="editor.fontSize";const TS="editor.fontFamily";const RS="editor.letterSpacing";const DS="editor.tabSize";const OS="editor.lineNumbers";const BS="editor.diagnostics";const NS="editor.quickSuggestions";const HS="editor.autoClosingQuotes";const zS="editor.autoclosingBrackets";const $S="editor.fontWeight";const US=async()=>Boolean(await Sa(zS));const _S=async()=>Boolean(await Sa(HS));const YS=async()=>Boolean(await Sa(NS));const VS=async()=>true;const jS=async()=>await Sa(FS)||20;const qS=async()=>await Sa(WS)||15;const GS=async()=>await Sa(TS)||"Fira Code";const XS=async()=>await Sa(RS)??.5;const ZS=async()=>await Sa(DS)||2;const QS=async()=>await Sa(OS)??false;const KS=async()=>[".","/"];const JS=async()=>await Sa(BS)??false;const tk=async()=>await Sa($S)??400;const nk=async()=>{const[t,n,e,o,s,c,r,i,a,d,l,u,f]=await Promise.all([JS(),GS(),qS(),tk(),US(),_S(),VS(),YS(),QS(),jS(),ZS(),XS(),KS()]);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 ek=(t,n)=>{for(const e of t){if(e?.id===n&&e.tokenize){return e.tokenize}}return""};const ok=t=>{if(t instanceof Error){return t.message}return String(t)};const sk=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 nk();const k=await Ia(g,h,f,E);const C=await xa(c,e);Kc(C);const v=Ea(r,C);const b=ek(C,v);await or(v,b);const M=sr(v);const A=t.tokenizerId+1;rr(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:v,letterSpacing:E,lineNumbers:x,loadError:"",rowHeight:I,tabSize:S,tokenizerId:A};let P="";try{P=await Co(r)}catch(t){const n=ia(L,a,d,i,o,9);return{...n,differences:[],focus:ro,focused:true,initial:false,loadError:ok(t),textInfos:[]}}const F=ia(L,a,d,i,o,9);const W=aa(F,P);let T=W;const R=ui(T);const D={...T,decorations:R};const O=Jr();const{differences:B,textInfos:N}=await Vr(D,O);const H={...D,differences:B,focus:ro,focused:true,textInfos:N};await ha(fa,r,s,v,P);const z=u?await Oa(H):H;const $=await Sa("editor.completionsOnType");const U=Boolean($);const _={...z,completionsOnType:U,initial:false};return _};const ck=t=>t;const rk=t=>t;const ik=(t,n)=>{g(t);g(n);mi(t,n)};const ak=(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 dk=(t,n,e)=>{const o=t/n*e;if(!Number.isFinite(o)){return 0}return o};const lk=(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=qr(o,s,c,d);const h=Gr(u,r,i);const g=dk(e,r,u);const m=ak(l,a,d,f,h,g);return[oo,l,m]};const uk=(t,n)=>{const e=".EditorInput textarea";return[eo,n.uid,e]};const fk=(t,n)=>[so,n.uid,ro];const hk=1;const gk=2;const mk=3;const wk=4;const pk=6;const yk=7;const Ek=8;const xk=9;const Ik=10;const Sk=11;const kk=t=>t!=="type"&&t!=="childCount";const Ck=t=>{const n=Object.keys(t).filter(kk);return n};const vk=t=>{const n=[];let e=0;while(e<t.length){const o=t[e];const{children:s,nodesConsumed:c}=bk(t,e+1,o.childCount||0);n.push({node:o,children:s});e+=1+c}return n};const bk=(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}=bk(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 Mk=(t,n)=>{if(t.type!==n.type){return null}const e=[];if(t.type===jn){if(t.uid!==n.uid){e.push({type:Sk,uid:n.uid})}return e}if(t.type===Vn&&n.type===Vn){if(t.text!==n.text){e.push({type:hk,value:n.text})}return e}const o=Ck(t);const s=Ck(n);for(const o of s){if(t[o]!==n[o]){e.push({type:mk,key:o,value:n[o]})}}for(const t of o){if(!Object.hasOwn(n,t)){e.push({type:wk,key:t})}}return e};const Ak=t=>{const n=[t.node];for(const e of t.children){n.push(...Ak(e))}return n};const Lk=(t,n,e)=>{if(n===-1){t.push({type:yk,index:e});return e}if(n!==e){t.push({type:Ik,index:e})}return e};const Pk=(t,n)=>{if(n>=0){t.push({type:Ek})}return-1};const Fk=(t,n)=>{n.push({type:pk,nodes:Ak(t)})};const Wk=(t,n)=>{n.push({type:gk,nodes:Ak(t)})};const Tk=(t,n,e,o,s)=>{const c=Mk(t.node,n.node);if(c===null){const t=Lk(e,o,s);Wk(n,e);return t}const r=t.children.length>0||n.children.length>0;if(c.length===0&&!r){return o}const i=Lk(e,o,s);if(c.length>0){e.push(...c)}if(r){Dk(t.children,n.children,e)}return i};const Rk=(t,n,e)=>{const o=Mk(t.node,n.node);if(o===null){Wk(n,e);return}if(o.length>0){e.push(...o)}if(t.children.length>0||n.children.length>0){Dk(t.children,n.children,e)}};const Dk=(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=Pk(e,s);Fk(i,e);continue}if(!i){c.push(r);continue}s=Tk(o,i,e,s,r)}Pk(e,s);for(let t=c.length-1;t>=0;t--){e.push({type:xk,index:c[t]})}};const Ok=(t,n,e,o)=>{if(o.length===0&&t.length===1&&n.length===1){Rk(t[0],n[0],e);return}Dk(t,n,e)};const Bk=t=>{let n=-1;for(let e=t.length-1;e>=0;e--){const o=t[e];if(o.type!==yk&&o.type!==Ek&&o.type!==Ik){n=e;break}}return n===-1?[]:t.slice(0,n+1)};const Nk=(t,n)=>{const e=vk(t);const o=vk(n);const s=[];Ok(e,o,s,[]);return Bk(s)};const Hk=()=>[{childCount:1,className:"EditorInput",type:Lx},{ariaAutoComplete:"list",ariaMultiLine:"true",ariaRoleDescription:"editor",autocapitalize:"off",autocomplete:"off",autocorrect:"off",childCount:0,name:"editor",onBeforeInput:rx,onBlur:ix,onCompositionEnd:dx,onCompositionStart:lx,onCompositionUpdate:ux,onCut:hx,onFocus:gx,onPaste:px,role:"textbox",spellcheck:false,type:Tx,wrap:"off"}];const zk=t=>{const n=Array.from(t,t=>({childCount:0,className:jE,translate:t,type:Lx}));return n};const $k=t=>{const n=zk([...t]);return[{childCount:t.length,className:"LayerCursor",type:Lx},...n]};const Uk="error";const _k="warning";const Yk=t=>{switch(t){case Uk:return $E;case _k:return UE;default:return $E}};const Vk=(...t)=>t.filter(Boolean).join(" ");const jk=t=>{const{height:n,type:e,width:o,x:s,y:c}=t;const r=Yk(e);return[{childCount:0,className:Vk(VE,r),height:n,left:s,top:c,type:Lx,width:o}]};const qk=t=>{const n=t.flatMap(jk);return n};const Gk=t=>{const n=qk([...t]);return[{childCount:t.length,className:"LayerDiagnostics",type:Lx},...n]};const Xk=(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=qE;if(e===o){i+=" "+GE}s.push({childCount:c.length/2,className:i,translate:Wi(r),type:Lx});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:Fx},Rx(n))}}return s};const Zk=(t,n,e=true,o=-1)=>{const s=Xk(t,n,e,o);return[{childCount:t.length,className:"EditorRows",onMouseDown:mx,onPointerDown:yx,onWheel:Ax,type:Lx},...s]};const Qk=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:XE,height:r,left:o,top:s,type:Lx,width:c})}return n};const Kk=t=>{const n=Qk(t);return[{childCount:t.length/4,className:"Selections",type:Lx},...n]};const Jk=(t,n,e,o=true,s=-1,c=[],r=[])=>[{childCount:4,className:"EditorLayers",type:Lx},...Kk(t),...Zk(n,e,o,s),...$k(c),...Gk(r)];const tC=t=>[{childCount:t.length,className:"EditorScrollBarDiagnostics",type:Lx},...qk([...t])];const nC=()=>[{childCount:1,className:"ScrollBar ScrollBarVertical",onContextMenu:fx,onPointerDown:vx,type:Lx},{childCount:0,className:"ScrollBarThumb ScrollBarThumbVertical",type:Lx},{childCount:1,className:"ScrollBar ScrollBarHorizontal",onPointerDown:Sx,type:Lx},{childCount:0,className:"ScrollBarThumb ScrollBarThumbHorizontal",type:Lx}];const eC=({cursorInfos:t=[],diagnostics:n=[],differences:e,highlightedLine:o=-1,lineNumbers:s=true,scrollBarDiagnostics:c=[],selectionInfos:r=[],textInfos:i})=>[{childCount:5,className:"EditorContent",onMouseMove:wx,type:Lx},...Hk(),...Jk(r,i,e,s,o,t,n),...tC(c),...nC()];const oC=t=>[{childCount:1,className:"LineNumber",type:Fx},Rx(t)];const sC=t=>{const n=t.flatMap(oC);return n};const cC=t=>{const n=sC([...t]);return[{childCount:t.length,className:"Gutter",type:Lx},...n]};const rC=({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:Lx},{childCount:0,className:"EditorTextIcon EditorTextIconError MaskIcon MaskIconError",type:Lx},{childCount:1,className:"TextEditorErrorMessage",type:Lx},Rx(r)]}const u=c?cC(o):[];return[{childCount:c?2:1,className:"Viewlet Editor","data-uid":l,onContextMenu:fx,role:"code",type:Lx},...u,...eC({cursorInfos:t,diagnostics:n,differences:e,highlightedLine:s,lineNumbers:c,scrollBarDiagnostics:i,selectionInfos:a,textInfos:d})]};const iC=new Map;const aC=t=>iC.get(t);const dC=(t,n)=>{iC.set(t,n)};const lC=t=>{const{initial:n,textInfos:e}=t;if(n&&e.length===0){return[]}return rC(t)};const uC=(t,n)=>{const e=t.initial?lC(t):aC(n.uid)||lC(t);const o=lC(n);const s=Nk(e,o);if(s.length===0){return[]}dC(n.uid,o);return[co,n.uid,s]};const fC=t=>{switch(t){case Ya:return lk;case Ua:return uk;case _a:return fk;case Va:return uC;case ja:return nd;default:throw new Error("unknown renderer")}};const hC=(t,n,e)=>{const o=[];for(const s of e){const e=fC(s);const c=e(t,n);if(c.length>0){if(s===ja){o.push(...c)}else{o.push(c)}}}return o};const gC=(t,n)=>{const{newState:e,oldState:o}=ts(t);es(t,e,e);const s=hC(o,e,n);return s};const mC={apply(t,n){const{incrementalEdits:e}=n;if(e!==os){return["setIncrementalEdits",e]}const{differences:o,textInfos:s}=n;n.differences=o;const{highlightedLine:c,minLineY:r}=n;const i=c-r;const a=Xk(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 wC={apply:(t,n)=>{const{cursorInfos:e=[],selectionInfos:o=[]}=n;const s=zk(e);const c=Qk(o);return["setSelections",s,c]},isEqual:(t,n)=>t.cursorInfos===n.cursorInfos&&t.selectionInfos===n.selectionInfos};const pC={apply:lk,isEqual:Ha};const yC={apply:(t,n)=>["setFocused",n.focused],isEqual:(t,n)=>t.focused===n.focused};const EC={apply:(t,n)=>[so,n.uid,n.focus,0,n.uid,"Editor"],isEqual:(t,n)=>t.focus===n.focus};const xC={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 IC={apply(t,n){const e=qk(n.visualDecorations||[]);return["setDecorationsDom",e]},isEqual:(t,n)=>t.visualDecorations===n.visualDecorations};const SC={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=sC(c);return["renderGutter",r]},isEqual:(t,n)=>t.lineNumbers===n.lineNumbers&&t.minLineY===n.minLineY&&t.maxLineY===n.maxLineY};const kC={apply:nd,isEqual:(t,n)=>t.widgets===n.widgets,multiple:true};const CC=[mC,wC,pC,yC,IC,SC,kC,EC,xC];const vC=async t=>{const n=ts(t);if(!n){return[]}const{newState:e,oldState:o}=n;const s=[];es(t,e,e);for(const t of CC){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 bC=()=>[{name:gx,params:["handleFocus"]},{name:wx,params:["handleMouseMove",Xn,Zn,qn]},{name:ix,params:["handleBlur"]},{name:rx,params:["handleBeforeInput","event.inputType","event.data"],preventDefault:true},{name:lx,params:["compositionStart","event.data"]},{name:ux,params:["compositionUpdate","event.data"]},{name:dx,params:["compositionEnd","event.data"]},{name:hx,params:["cut"],preventDefault:true},{name:px,params:["paste",'event.clipboardData ? event.clipboardData.getData("text/plain") : ""'],preventDefault:true},{name:mx,params:["handleMouseDown","event.button","event.altKey","event.ctrlKey",Xn,Zn,"event.detail"]},{name:yx,params:["handlePointerDown","event.button","event.altKey","event.ctrlKey",Xn,Zn,"event.detail"],trackPointerEvents:[Ex,xx]},{name:Ex,params:["handlePointerMove",Xn,Zn,qn]},{name:xx,params:["handlePointerUp"]},{name:Ax,params:["handleWheel",Qn,"event.deltaX",Kn],passive:true},{name:fx,params:["handleContextMenu",Gn,Xn,Zn],preventDefault:true},{name:vx,params:["handleScrollBarVerticalPointerDown",Zn],preventDefault:true,trackPointerEvents:[bx,Mx]},{name:bx,params:["handleScrollBarVerticalPointerMove",Zn]},{name:Mx,params:["handlePointerUp"]},{name:Sx,params:["handleScrollBarHorizontalPointerDown",Xn],trackPointerEvents:[kx,Cx]},{name:kx,params:["handleScrollBarHorizontalMove",Xn]},{name:Cx,params:["handlePointerUp"]}];const MC=(t,n)=>{const{lines:e}=t;return{lines:e}};const AC=async(t,n,e)=>{await bo(t,e)};const LC=async(t,n)=>{await Fo(t,n)};const PC=(t,n)=>t;const FC=(t,n)=>{g(t);g(n);wi(t,n)};const WC=async(t,...n)=>{const e=Un(Ge);return e.invoke(t,...n)};const TC=async t=>{const n=await WC("RunAndDebug.getHighlight",t);return n};const RC=()=>{const t=ns();return parseInt(t[0])};const DC=async t=>{const n=await TC(t);const e=RC();const o=ts(e);if(!o){return}const{newState:s,oldState:c}=o;const r={...s,highlightedLine:n.rowIndex};es(e,c,r);await Eo("Editor.rerender",e)};const OC=t=>async(n,...e)=>{const o=ts(n);const s=o.newState;const c=await t(s,...e);if(s===c){return c}const r=await Mg(s,c);es(n,s,r);return r};const BC={"ActivateByEvent.activateByEvent":zo,"CodeGenerator.accept":$o,"ColorPicker.loadContent":Go,"Editor.addCursorAbove":OC(sd),"Editor.addCursorBelow":OC(rd),"Editor.applyDocumentEdits":OC(ld),"Editor.applyEdit":OC(ud),"Editor.applyEdit2":QI,"Editor.applyWorkspaceEdit":OC(hd),"Editor.braceCompletion":OC(Td),"Editor.cancelSelection":OC(Dd),"Editor.closeCodeGenerator":OC(Hd),"Editor.closeFind":OC($d),"Editor.closeFind2":ZI,"Editor.closeRename":OC(qd),"Editor.closeSourceAction":OC(Xd),"Editor.closeWidget2":XI,"Editor.compositionEnd":OC(cl),"Editor.compositionStart":OC(el),"Editor.compositionUpdate":OC(sl),"Editor.contextMenu":OC(Yh),"Editor.copy":OC(dl),"Editor.copyLineDown":OC(ll),"Editor.copyLineUp":OC(ul),"Editor.create":Na,"Editor.create2":fs,"Editor.cursorCharacterLeft":OC(ou),"Editor.cursorCharacterRight":OC(au),"Editor.cursorDown":OC(uu),"Editor.cursorEnd":OC(fu),"Editor.cursorHome":OC(hu),"Editor.cursorLeft":OC(ou),"Editor.cursorRight":OC(au),"Editor.cursorSet":OC(gu),"Editor.cursorUp":OC(yu),"Editor.cursorWordLeft":OC(Eu),"Editor.cursorWordPartLeft":OC(xu),"Editor.cursorWordPartRight":OC(Iu),"Editor.cursorWordRight":OC(Su),"Editor.cut":OC(vu),"Editor.deleteAll":OC(bu),"Editor.deleteAllLeft":OC(Wu),"Editor.deleteAllRight":OC(Du),"Editor.deleteCharacterLeft":OC(Ou),"Editor.deleteCharacterRight":OC(Bu),"Editor.deleteHorizontalRight":OC(Ru),"Editor.deleteLeft":OC(Ou),"Editor.deleteRight":OC(Bu),"Editor.deleteWordLeft":OC(Nu),"Editor.deleteWordPartLeft":OC(Hu),"Editor.deleteWordPartRight":OC(zu),"Editor.deleteWordRight":OC($u),"Editor.diff2":Qa,"Editor.dispose":ed,"Editor.executeWidgetCommand":OC(xI),"Editor.findAllReferences":OC(Uu),"Editor.format":OC(qu),"Editor.getCommandIds":Qo,"Editor.getDiagnostics":JI,"Editor.getKeyBindings":nS,"Editor.getKeys":eS,"Editor.getLanguageId":$I,"Editor.getLines2":jI,"Editor.getMenuEntries":rS,"Editor.getMenuEntries2":rS,"Editor.getMenuIds":iS,"Editor.getOffsetAtCursor":UI,"Editor.getPositionAtCursor":HI,"Editor.getProblems":dS,"Editor.getQuickPickMenuEntries":lS,"Editor.getSelections":uS,"Editor.getSelections2":qI,"Editor.getSourceActions":KI,"Editor.getText":fS,"Editor.getUri":zI,"Editor.getWordAt":Ku,"Editor.getWordAt2":_I,"Editor.getWordAtOffset2":YI,"Editor.getWordBefore":Ju,"Editor.getWordBefore2":VI,"Editor.goToDefinition":OC(bh),"Editor.goToTypeDefinition":OC(Wh),"Editor.handleBeforeInput":OC(gS),"Editor.handleBeforeInputFromContentEditable":OC(yg),"Editor.handleBlur":OC(gd),"Editor.handleClickAtPosition":OC(Uh),"Editor.handleContextMenu":OC(Yh),"Editor.handleDoubleClick":OC(Xh),"Editor.handleFocus":OC(Zh),"Editor.handleMouseDown":OC(rg),"Editor.handleMouseMove":OC(hg),"Editor.handleMouseMoveWithAltKey":OC(mg),"Editor.handleNativeSelectionChange":Eg,"Editor.handlePointerCaptureLost":OC(xg),"Editor.handlePointerDown":OC(Ig),"Editor.handlePointerMove":OC(zg),"Editor.handlePointerUp":OC($g),"Editor.handleScrollBarClick":Gg,"Editor.handleScrollBarHorizontalMove":OC(_g),"Editor.handleScrollBarHorizontalPointerDown":OC(Yg),"Editor.handleScrollBarMove":OC(jg),"Editor.handleScrollBarPointerDown":OC(Gg),"Editor.handleScrollBarVerticalMove":OC(qg),"Editor.handleScrollBarVerticalPointerDown":OC(Gg),"Editor.handleScrollBarVerticalPointerMove":OC(qg),"Editor.handleSingleClick":OC(ng),"Editor.handleTab":OC(pS),"Editor.handleTouchEnd":OC(Xg),"Editor.handleTouchMove":OC(nm),"Editor.handleTouchStart":OC(Qg),"Editor.handleTripleClick":OC(sg),"Editor.handleWheel":OC(em),"Editor.hotReload":vS,"Editor.indendLess":OC(sm),"Editor.indentMore":OC(rm),"Editor.insertLineBreak":OC(um),"Editor.loadContent":OC(sk),"Editor.moveLineDown":OC(ck),"Editor.moveLineUp":OC(rk),"Editor.moveRectangleSelection":OC(Sg),"Editor.moveRectangleSelectionPx":OC(kg),"Editor.moveSelection":OC(Og),"Editor.moveSelectionPx":OC(Hg),"Editor.offsetAt":Tr,"Editor.openCodeGenerator":OC(wm),"Editor.openColorPicker":OC(tl),"Editor.openCompletion":OC(Im),"Editor.openFind":OC(Wm),"Editor.openFind2":OC(Fm),"Editor.openRename":OC(Om),"Editor.organizeImports":OC(Nm),"Editor.paste":OC(zm),"Editor.pasteText":OC(Hm),"Editor.redo":OC($m),"Editor.render":vC,"Editor.render2":gC,"Editor.renderEventListeners":bC,"Editor.replaceRange":OC(md),"Editor.rerender":OC(Jx),"Editor.resize":OC(Ei),"Editor.save":OC(cw),"Editor.saveState":Jo(MC),"Editor.selectAll":OC(rw),"Editor.selectAllLeft":OC(dw),"Editor.selectAllOccurrences":OC(xw),"Editor.selectAllRight":OC(kw),"Editor.selectCharacterLeft":OC(Cw),"Editor.selectCharacterRight":OC(vw),"Editor.selectDown":OC(Mw),"Editor.selectInsideString":OC(Lw),"Editor.selectionGrow":OC(Fw),"Editor.selectLine":OC(og),"Editor.selectNextOccurrence":OC(Dw),"Editor.selectPreviousOccurrence":OC(Ow),"Editor.selectUp":OC(Nw),"Editor.selectWord":OC(Gh),"Editor.selectWordLeft":OC(Hw),"Editor.selectWordRight":OC(zw),"Editor.setDebugEnabled":OC(PC),"Editor.setDecorations":OC($w),"Editor.setDelta":OC(tm),"Editor.setDeltaY":OC(Kg),"Editor.setLanguageId":OC(Uw),"Editor.setSelections":OC(_w),"Editor.setSelections2":GI,"Editor.setText":OC(Yw),"Editor.showHover":Jw,"Editor.showHover2":Qw,"Editor.showSourceActions":OC(rp),"Editor.showSourceActions2":OC(rp),"Editor.showSourceActions3":OC(rp),"Editor.sortLinesAscending":OC(up),"Editor.tabCompletion":OC(yp),"Editor.terminate":e,"Editor.toggleBlockComment":OC(vp),"Editor.toggleComment":OC(Pp),"Editor.toggleLineComment":OC(Lp),"Editor.type":OC(Fp),"Editor.typeWithAutoClosing":OC(Xp),"Editor.undo":OC(Qp),"Editor.unIndent":OC(Kp),"Editor.updateDebugInfo":DC,"Editor.updateDiagnostics":OC(Ba),"EditorCompletion.close":Cy,"EditorCompletion.closeDetails":vy,"EditorCompletion.focusFirst":by,"EditorCompletion.focusIndex":My,"EditorCompletion.focusNext":Ly,"EditorCompletion.focusPrevious":Py,"EditorCompletion.handleEditorBlur":Fy,"EditorCompletion.handleEditorClick":Wy,"EditorCompletion.handleEditorDeleteLeft":Ty,"EditorCompletion.handleEditorType":Ry,"EditorCompletion.handlePointerDown":Dy,"EditorCompletion.handleWheel":Oy,"EditorCompletion.openDetails":By,"EditorCompletion.selectCurrent":Ny,"EditorCompletion.selectIndex":Hy,"EditorCompletion.toggleDetails":zy,"EditorRename.accept":Xx,"EditorRename.close":Zx,"EditorRename.handleInput":Qx,"EditorSourceAction.close":iI,"EditorSourceAction.closeDetails":aI,"EditorSourceAction.focusFirst":dI,"EditorSourceAction.focusIndex":lI,"EditorSourceAction.focusNext":fI,"EditorSourceAction.focusPrevious":hI,"EditorSourceAction.handleWheel":gI,"EditorSourceAction.selectCurrent":mI,"EditorSourceAction.selectIndex":wI,"EditorSourceAction.selectItem":pI,"EditorSourceAction.toggleDetails":yI,"EditorSourceActions.focusNext":nI,"ExtensionHostManagement.activateByEvent":zo,"FindWidget.close":qy,"FindWidget.focusCloseButton":Gy,"FindWidget.focusFind":Xy,"FindWidget.focusNext":Zy,"FindWidget.focusNextElement":Qy,"FindWidget.focusNextMatchButton":Ky,"FindWidget.focusPrevious":Jy,"FindWidget.focusPreviousElement":tE,"FindWidget.focusPreviousMatchButton":nE,"FindWidget.focusReplace":eE,"FindWidget.focusReplaceAllButton":oE,"FindWidget.focusReplaceButton":sE,"FindWidget.focusToggleReplace":cE,"FindWidget.handleBlur":rE,"FindWidget.handleClickButton":iE,"FindWidget.handleFocus":aE,"FindWidget.handleInput":dE,"FindWidget.handleReplaceFocus":lE,"FindWidget.handleReplaceInput":uE,"FindWidget.handleToggleReplaceFocus":fE,"FindWidget.loadContent":Lm,"FindWidget.replace":hE,"FindWidget.replaceAll":gE,"FindWidget.toggleMatchCase":mE,"FindWidget.toggleMatchWholeWord":wE,"FindWidget.togglePreserveCase":pE,"FindWidget.toggleReplace":yE,"FindWidget.toggleUseRegularExpression":EE,"Font.ensure":tS,"HandleMessagePort.handleMessagePort":mS,"Hover.getHoverInfo":TE,"Hover.handleSashPointerDown":DE,"Hover.handleSashPointerMove":OE,"Hover.handleSashPointerUp":BE,"Hover.loadContent":RE,"Hover.render":Yx,"Initialize.initialize":PS,"Listener.register":ik,"Listener.registerListener":mi,"Listener.unregister":FC,"SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker":AC,"SendMessagePortToExtensionManagementWorker.sendMessagePortToExtensionManagementWorker":LC};for(const[t,n]of Object.entries(BC)){if(t.startsWith("Editor.")){BC["EditorText"+t.slice("Editor".length)]=n}}const NC=async()=>{const t="HandleMessagePort.handleMessagePort2";const n=await On({commandMap:{},async send(n){await AC(n,t,Xe)}});return n};const HC=async()=>{const t=await NC();ga(t)};const zC=async()=>{const t=await On({commandMap:{},async send(t){await Fo(t,Xe)}});return t};const $C=async()=>{try{const t=await zC();fo(t)}catch{}};const UC=t=>ko(t);const _C=async()=>{const t=await On({commandMap:{},send:UC});mo(t)};const YC=async()=>{const t=await Nn({commandMap:BC});Io(t)};const VC=t=>Po(t);const jC=async()=>{const t=await On({commandMap:{},send:VC});yo(t)};const qC=async()=>{Ko(BC);await Promise.all([YC(),HC(),$C(),jC(),_C()])};const GC="CodeGeneratorInput";const XC=t=>{const n=jf();const e=qf();return[{childCount:2,className:Vk(cx,zE),type:Lx},{childCount:0,className:Vk(NE,ox),name:GC,placeholder:e,type:Px},{childCount:1,className:HE,type:Lx},Rx(n)]};const ZC={apply(t,n){const e=XC();return[py,n.uid,e]},isEqual:(t,n)=>t.questions===n.questions};const QC={apply(t,n){const{height:e,width:o,x:s,y:c}=n;return[gy,s,c,o,e]},isEqual:(t,n)=>t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height};const KC={apply:(t,n)=>[dy,".CodeGeneratorInput",n.focusSource],isEqual:(t,n)=>t.focused===n.focused&&t.focusSource===n.focusSource};const JC=[ZC,QC,KC];const tv=(t,n)=>{const e=[];for(const o of JC){if(!o.isEqual(t,n)){e.push(o.apply(t,n))}}return e};const nv=t=>{const n=tv(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(t[0]===py){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const ev=t=>ty(t,"EditorCodeGenerator",nv);const ov=eI;const sv={__proto__:null,add:ev,remove:ov,render:nv};const cv=(t,n)=>{const e=[...n.commands];n.commands=[];return e};const rv=[py,wy,ay,my,ly,yy];const iv=t=>{const n=cv(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(rv.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const av=t=>ty(t,"ColorPicker",iv);const dv=eI;const lv={};const uv={__proto__:null,Commands:lv,add:av,remove:dv,render:iv};const fv=t=>{const n=[{childCount:2,className:"Viewlet EditorCompletionDetails",type:Lx},{childCount:1,className:YE,type:Lx},Rx(t),{childCount:1,className:_E,onClick:ax,type:Lx},{childCount:0,className:`${sx} ${ex}`,type:Lx}];return n};const hv=(t,n,e)=>{const o=[];for(const s of t){if(!s.isEqual(n,e)){o.push(s.apply(n,e))}}return o};const gv={apply(t,n){const e=fv(n.content);return[py,n.uid,e]},isEqual:(t,n)=>t.content===n.content};const mv={apply(t,n){const{height:e,width:o,x:s,y:c}=n;return[gy,s,c,o,e]},isEqual:(t,n)=>t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height};const wv=[gv,mv];const pv=(t,n)=>hv(wv,t,n);const yv=(t,n)=>{const{widgets:e}=t;for(const t of e){if(t.id===n){return t.newState}}return undefined};const Ev=t=>yv(t,Te);const xv=t=>{const n=pv(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(t[0]===py){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const Iv=t=>ty(t,"EditorCompletionDetails",xv);const Sv=eI;const kv=(t,n)=>{const e=Ev(t);if(!e){return t}const{x:o}=Tm(t);const s=o+e.width-n.borderSize;return{...n,x:s}};const Cv=(t,n)=>kv(t,n);const vv=(t,n)=>kv(t,n);const bv={__proto__:null,add:Iv,handleEditorDeleteLeft:vv,handleEditorType:Cv,remove:Sv,render:xv};const Mv=[py,wy,ay,my,ly,uy,fy,hy,yy,"Viewlet.focusSelector"];const Av=t=>{const n=Ey(t.oldState,t.newState);const e=[];const{uid:o}=t.newState;for(const t of n){if(Mv.includes(t[0])){e.push(t)}else{e.push(["Viewlet.send",o,...t])}}return e};const Lv=t=>ty(t,"EditorCompletion",Av);const Pv=t=>[["Viewlet.dispose",t.newState.uid]];const{close:Fv}=iy(["close"],"",Oe);const Wv={__proto__:null,add:Lv,close:Fv,remove:Pv,render:Av};const Tv=t=>{const{message:n,uid:e,x:o,y:s}=t.newState;const c=[{childCount:1,className:"Viewlet EditorMessage EditorMessageText EditorOverlayMessage",style:`left:${o}px;top:${s}px;`,type:Lx},Rx(n)];return[[py,e,c]]};const Rv=t=>ty(t,"EditorMessage",Tv);const Dv={__proto__:null,add:Rv,remove:Pv,render:Tv};const Ov=()=>{Fs(We,uv);Fs(Te,$y);Fs(Re,bv);Fs(De,xE);Fs(Oe,Wv);Fs(yd,Dv);Fs(Be,Kx);Fs(Ne,EI);Fs(Fe,sv)};const Bv=t=>{t.preventDefault();console.error(`[editor-worker] Unhandled Rejection: ${t.reason}`)};const Nv=(t,n,e,o,s)=>{console.error(`[editor-worker] Unhandled Error: ${s}`);return true};const Hv=t=>{t.addEventListener("error",Nv);t.addEventListener("unhandledrejection",Bv)};const zv=async()=>{Hv(globalThis);await qC();Ov()};zv();
|