@vizejs/vite-plugin-musea 0.747.0 → 0.748.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gallery/assets/{MonacoEditor-V86q2U80.js → MonacoEditor-TAa2JDXq.js} +2 -2
- package/dist/gallery/assets/{cssMode-DxkX9O1L.js → cssMode-HbYMEqla.js} +1 -1
- package/dist/gallery/assets/{editor.api-CrhsDSjq.js → editor.api-BnAmILmn.js} +1 -1
- package/dist/gallery/assets/{freemarker2-OZidztIq.js → freemarker2-CUxx3K6C.js} +1 -1
- package/dist/gallery/assets/{handlebars-DaNQ0IP2.js → handlebars-D-tFxs03.js} +1 -1
- package/dist/gallery/assets/{html-CI5YEHUc.js → html-BvCZbWop.js} +1 -1
- package/dist/gallery/assets/{htmlMode-CbwZm463.js → htmlMode-CtpLmhU0.js} +1 -1
- package/dist/gallery/assets/{index-DYIB4vld.js → index-9Jbnkznu.js} +3 -3
- package/dist/gallery/assets/{index-_h6pdH6k.css → index-CT4hwaEG.css} +1 -1
- package/dist/gallery/assets/{javascript-BBxPeOYV.js → javascript-5Q8XUioJ.js} +1 -1
- package/dist/gallery/assets/{jsonMode-CpjSEI2_.js → jsonMode-meopLbOo.js} +1 -1
- package/dist/gallery/assets/{liquid-DFRy4c0C.js → liquid-XBHPlM5o.js} +1 -1
- package/dist/gallery/assets/{lspLanguageFeatures-DPx0iaVJ.js → lspLanguageFeatures-uQPmNYRO.js} +1 -1
- package/dist/gallery/assets/{mdx-BubNp8Hb.js → mdx-DPlyNjoV.js} +1 -1
- package/dist/gallery/assets/{python-3nm8uoJJ.js → python-BJGVh1ia.js} +1 -1
- package/dist/gallery/assets/{razor-BFdE7pgh.js → razor-tl_w-IGC.js} +1 -1
- package/dist/gallery/assets/{register-Bt8Klo24.js → register-B1Z_0Wj1.js} +2 -2
- package/dist/gallery/assets/{toggleHighContrast-BssTMkQK.js → toggleHighContrast-CwaJX3-m.js} +1 -1
- package/dist/gallery/assets/{tsMode-gqy4uD4R.js → tsMode-BTkaxugD.js} +1 -1
- package/dist/gallery/assets/{typescript-BRH7D1zI.js → typescript-BfDavZMU.js} +1 -1
- package/dist/gallery/assets/{vs-C0aFv9c3.js → vs-yheCI45x.js} +3 -3
- package/dist/gallery/assets/{workers-VlBSKmrM.js → workers-CxTFpB1G.js} +1 -1
- package/dist/gallery/assets/{xml-Dbgl-mP4.js → xml-BwtrP1DO.js} +1 -1
- package/dist/gallery/assets/{yaml-eu-WhoYK.js → yaml-jwkm0mVv.js} +1 -1
- package/dist/gallery/index.html +2 -2
- package/package.json +4 -4
package/dist/gallery/assets/{toggleHighContrast-BssTMkQK.js → toggleHighContrast-CwaJX3-m.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,$a as t,$c as n,$d as r,$i as i,$l as a,$n as o,$o as s,$r as c,$s as l,$t as u,$u as d,A as f,Aa as p,Ac as m,Ad as h,Ai as g,Al as _,An as v,Ao as y,Ar as b,As as ee,At as te,Au as ne,B as re,Ba as ie,Bc as ae,Bd as oe,Bi as se,Bl as ce,Bn as le,Bo as ue,Br as de,Bs as fe,Bt as pe,Bu as me,C as he,Ca as ge,Cc as _e,Cd as ve,Cf as ye,Ci as be,Cl as xe,Cn as Se,Co as Ce,Cr as we,Cs as Te,Ct as Ee,Cu as De,D as Oe,Da as ke,Dc as Ae,Dd as x,Df as S,Di as je,Dl as Me,Dn as Ne,Do as Pe,Dr as Fe,Ds as Ie,Dt as Le,Du as Re,E as ze,Ea as Be,Ec as C,Ed as Ve,Ef as He,Ei as Ue,El as We,En as Ge,Eo as Ke,Er as qe,Es as Je,Et as Ye,Eu as Xe,F as Ze,Fa as Qe,Fc as w,Fd as T,Fi as $e,Fl as et,Fn as tt,Fo as nt,Fr as rt,Fs as it,Ft as at,Fu as ot,G as st,Ga as ct,Gc as E,Gd as lt,Gi as ut,Gl as dt,Gn as ft,Go as pt,Gr as mt,Gs as ht,Gt as gt,Gu as _t,H as vt,Ha as yt,Hc as bt,Hd as xt,Hi as St,Hl as Ct,Hn as wt,Ho as Tt,Hr as Et,Hs as D,Ht as Dt,Hu as Ot,I as kt,Ia as O,Ic as k,Id as A,Ii as At,Il as jt,In as Mt,Io as Nt,Ir as Pt,Is as Ft,It,Iu as Lt,J as Rt,Jc as zt,Jd as Bt,Ji as Vt,Jl as Ht,Jn as Ut,Jo as Wt,Jr as Gt,Js as j,Jt as Kt,Ju as qt,K as Jt,Ka as Yt,Kc as Xt,Kd as Zt,Ki as Qt,Kl as $t,Kn as en,Ko as tn,Kr as nn,Ks as rn,Kt as an,Ku as on,L as sn,La as cn,Lc as ln,Ld as un,Li as dn,Ll as fn,Ln as pn,Lo as mn,Lr as hn,Ls as gn,Lt as _n,Lu as vn,M as yn,Ma as bn,Mc as M,Md as xn,Mi as Sn,Ml as Cn,Mn as wn,Mo as Tn,Mr as En,Ms as Dn,Mt as On,Mu as kn,N as An,Na as jn,Nc as Mn,Nd as Nn,Ni as Pn,Nl as Fn,Nn as In,No as Ln,Nr as Rn,Ns as zn,Nt as Bn,Nu as Vn,O as Hn,Oa as Un,Oc as Wn,Od as Gn,Of as N,Oi as Kn,Ol as qn,On as Jn,Oo as Yn,Or as Xn,Os as Zn,Ot as Qn,Ou as $n,P as er,Pa as tr,Pc as nr,Pd as rr,Pi as ir,Pl as ar,Pn as or,Po as sr,Pr as cr,Ps as lr,Pt as ur,Pu as dr,Q as fr,Qa as pr,Qc as mr,Qd as hr,Qi as gr,Ql as _r,Qn as vr,Qo as yr,Qr as br,Qs as xr,Qt as Sr,Qu as Cr,R as wr,Ra as Tr,Rc as Er,Rd as Dr,Ri as Or,Rl as kr,Rn as Ar,Ro as jr,Rr as Mr,Rs as Nr,Rt as Pr,Ru as Fr,S as Ir,Sa as Lr,Sc as Rr,Sd as zr,Sf as Br,Si as Vr,Sl as Hr,Sn as Ur,So as Wr,Sr as Gr,Ss as Kr,St as qr,Su as Jr,T as Yr,Ta as Xr,Tc as Zr,Td as Qr,Tf as $r,Ti as ei,Tl as ti,Tn as ni,To as ri,Tr as ii,Ts as ai,Tt as oi,Tu as si,U as ci,Ua as li,Uc as P,Ud as ui,Ui as di,Ul as fi,Un as pi,Uo as mi,Ur as hi,Us as F,Ut as gi,Uu as _i,V as vi,Va as yi,Vc as bi,Vd as xi,Vi as Si,Vl as Ci,Vn as wi,Vo as Ti,Vr as Ei,Vs as I,Vt as Di,Vu as Oi,W as ki,Wa as Ai,Wc as ji,Wd as Mi,Wi as Ni,Wl as Pi,Wn as Fi,Wo as Ii,Wr as Li,Ws as Ri,Wt as zi,Wu as Bi,X as Vi,Xa as Hi,Xc as Ui,Xd as Wi,Xi as Gi,Xl as Ki,Xn as qi,Xo as Ji,Xr as Yi,Xs as L,Xt as Xi,Xu as Zi,Y as Qi,Ya as $i,Yc as R,Yd as ea,Yi as ta,Yl as na,Yn as ra,Yo as ia,Yr as aa,Ys as z,Yt as oa,Yu as sa,Z as ca,Za as la,Zc as ua,Zd as da,Zi as fa,Zl as pa,Zn as ma,Zo as B,Zr as ha,Zs as ga,Zt as _a,Zu as va,_a as ya,_c as ba,_d as xa,_f as Sa,_i as Ca,_l as wa,_n as Ta,_o as Ea,_r as Da,_s as Oa,_t as ka,_u as Aa,aa as ja,ac as Ma,ad as Na,af as Pa,ai as Fa,al as V,an as Ia,ao as La,ar as Ra,as as za,at as Ba,au as Va,b as Ha,ba as Ua,bc as Wa,bd as Ga,bf as Ka,bi as qa,bl as Ja,bn as Ya,bo as Xa,br as Za,bs as Qa,bt as $a,bu as eo,ca as to,cc as no,cd as ro,cf as io,ci as ao,cl as H,cn as oo,co as so,cr as co,cs as lo,ct as uo,cu as fo,da as po,dc as mo,dd as ho,df as go,di as _o,dl as vo,dn as yo,do as bo,dr as xo,ds as So,dt as Co,du as wo,ea as To,ec as Eo,ed as Do,ef as Oo,ei as ko,el as Ao,en as jo,eo as Mo,er as No,es as Po,et as Fo,eu as Io,fa as Lo,fc as Ro,fd as zo,ff as Bo,fi as Vo,fl as Ho,fn as Uo,fo as Wo,fr as Go,fs as Ko,ft as qo,fu as Jo,g as Yo,ga as Xo,gc as Zo,gd as Qo,gf as $o,gi as es,gl as ts,gn as ns,go as rs,gr as is,gs as as,gt as os,gu as ss,h as cs,ha as ls,hc as us,hd as ds,hf as fs,hi as ps,hl as ms,hn as hs,ho as gs,hr as _s,hs as vs,ht as ys,hu as bs,ia as xs,ic as Ss,id as Cs,if as ws,ii as Ts,il as Es,in as Ds,io as U,ir as Os,is as ks,it as As,iu as js,j as Ms,ja as Ns,jc as W,jd as Ps,ji as Fs,jl as Is,jn as Ls,jo as Rs,jr as zs,js as Bs,jt as Vs,ju as Hs,k as Us,ka as Ws,kc as Gs,kd as Ks,ki as qs,kl as Js,kn as Ys,ko as Xs,kr as Zs,ks as Qs,kt as $s,ku as ec,la as tc,lc as nc,ld as rc,lf as ic,li as ac,ll as oc,ln as sc,lo as cc,lr as lc,ls as uc,lt as dc,lu as fc,ma as pc,mc,md as hc,mf as gc,mi as _c,ml as vc,mn as yc,mo as bc,mr as G,ms as xc,mt as Sc,mu as Cc,na as wc,nc as Tc,nd as Ec,nf as Dc,ni as Oc,nl as kc,nn as Ac,no as K,nr as jc,ns as Mc,nt as Nc,nu as Pc,oa as Fc,oc as Ic,od as Lc,of as q,oi as Rc,ol as zc,on as Bc,oo as Vc,or as Hc,os as Uc,ot as Wc,ou as Gc,pa as Kc,pc as qc,pd as Jc,pf as Yc,pi as Xc,pl as Zc,pn as Qc,po as $c,pr as el,ps as tl,pt as nl,pu as rl,q as il,qa as al,qc as ol,qd as sl,qi as cl,ql as ll,qn as ul,qo as dl,qr as fl,qs as pl,qt as ml,qu as hl,ra as gl,rc as _l,rd as vl,rf as yl,ri as bl,rl as xl,rn as Sl,ro as Cl,rr as wl,rs as Tl,rt as El,ru as J,sa as Dl,sc as Ol,sd as kl,sf as Al,si as jl,sl as Ml,sn as Nl,so as Pl,sr as Fl,ss as Il,st as Ll,su as Rl,ta as zl,tc as Bl,td as Vl,tf as Hl,ti as Ul,tl as Wl,tn as Gl,to as Kl,tr as ql,ts as Jl,tt as Yl,tu as Xl,ua as Zl,uc as Ql,ud as $l,uf as eu,ui as tu,ul as nu,un as ru,uo as iu,ur as au,us as ou,ut as su,uu as cu,v as lu,va as uu,vc as du,vd as fu,vf as pu,vi as mu,vl as hu,vn as gu,vo as _u,vr as Y,vs as vu,vt as yu,vu as bu,w as xu,wa as Su,wc as Cu,wd as wu,wf as Tu,wi as Eu,wl as Du,wn as Ou,wo as ku,wr as Au,ws as ju,wt as Mu,wu as Nu,x as Pu,xa as Fu,xc as X,xd as Iu,xf as Lu,xi as Ru,xl as zu,xn as Bu,xo as Vu,xr as Hu,xs as Uu,xt as Wu,xu as Gu,y as Ku,ya as qu,yc as Ju,yd as Yu,yf as Xu,yi as Zu,yl as Qu,yn as $u,yo as ed,yr as td,ys as nd,yt as rd,yu as id,z as ad,za as od,zc as sd,zd as cd,zi as ld,zl as ud,zn as dd,zo as fd,zr as pd,zs as md,zt as hd,zu as gd}from"./editor.api-CrhsDSjq.js";var _d=class extends Ju{constructor(){super({id:`diffEditor.toggleCollapseUnchangedRegions`,title:N(101,`Toggle Collapse Unchanged Regions`),icon:k.map,toggled:m.has(`config.diffEditor.hideUnchangedRegions.enabled`),precondition:m.has(`isInDiffEditor`),menu:{when:m.has(`isInDiffEditor`),id:X.EditorTitle,order:22,group:`navigation`}})}run(e,...t){let n=e.get(Oa),r=!n.getValue(`diffEditor.hideUnchangedRegions.enabled`);n.updateValue(`diffEditor.hideUnchangedRegions.enabled`,r)}},vd=class extends Ju{constructor(){super({id:`diffEditor.toggleShowMovedCodeBlocks`,title:N(102,`Toggle Show Moved Code Blocks`),precondition:m.has(`isInDiffEditor`)})}run(e,...t){let n=e.get(Oa),r=!n.getValue(`diffEditor.experimental.showMoves`);n.updateValue(`diffEditor.experimental.showMoves`,r)}},yd=class extends Ju{constructor(){super({id:`diffEditor.toggleUseInlineViewWhenSpaceIsLimited`,title:N(103,`Toggle Use Inline View When Space Is Limited`),precondition:m.has(`isInDiffEditor`)})}run(e,...t){let n=e.get(Oa),r=!n.getValue(`diffEditor.useInlineViewWhenSpaceIsLimited`);n.updateValue(`diffEditor.useInlineViewWhenSpaceIsLimited`,r)}},bd=N(104,`Diff Editor`),xd=class extends Ri{constructor(){super({id:`diffEditor.switchSide`,title:N(105,`Switch Side`),icon:k.arrowSwap,precondition:m.has(`isInDiffEditor`),f1:!0,category:bd})}runEditorCommand(e,t,n){let r=Ad(e);if(r instanceof Kt){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}},Sd=class extends Ri{constructor(){super({id:`diffEditor.exitCompareMove`,title:N(106,`Exit Compare Move`),icon:k.close,precondition:B.comparingMovedCode,f1:!1,category:bd,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){let r=Ad(e);r instanceof Kt&&r.exitCompareMove()}},Cd=class extends Ri{constructor(){super({id:`diffEditor.collapseAllUnchangedRegions`,title:N(107,`Collapse All Unchanged Regions`),icon:k.fold,precondition:m.has(`isInDiffEditor`),f1:!0,category:bd})}runEditorCommand(e,t,...n){let r=Ad(e);r instanceof Kt&&r.collapseAllUnchangedRegions()}},wd=class extends Ri{constructor(){super({id:`diffEditor.showAllUnchangedRegions`,title:N(108,`Show All Unchanged Regions`),icon:k.unfold,precondition:m.has(`isInDiffEditor`),f1:!0,category:bd})}runEditorCommand(e,t,...n){let r=Ad(e);r instanceof Kt&&r.showAllUnchangedRegions()}},Td=class extends Ju{constructor(){super({id:`diffEditor.revert`,title:N(109,`Revert`),f1:!0,category:bd,precondition:m.has(`isInDiffEditor`)})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){let t=Ad(e);t instanceof Kt&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){let n=kd(e,t.originalUri,t.modifiedUri);n instanceof Kt&&n.revertRangeMappings(t.mapping.innerChanges??[])}},Ed=N(110,`Accessible Diff Viewer`),Dd=class e extends Ju{static{this.id=`editor.action.accessibleDiffViewer.next`}constructor(){super({id:e.id,title:N(111,`Go to Next Difference`),category:Ed,precondition:m.has(`isInDiffEditor`),keybinding:{primary:65,weight:100},f1:!0})}run(e){Ad(e)?.accessibleDiffViewerNext()}},Od=class e extends Ju{static{this.id=`editor.action.accessibleDiffViewer.prev`}constructor(){super({id:e.id,title:N(112,`Go to Previous Difference`),category:Ed,precondition:m.has(`isInDiffEditor`),keybinding:{primary:1089,weight:100},f1:!0})}run(e){Ad(e)?.accessibleDiffViewerPrev()}};function kd(e,t,n){return e.get(ji).listDiffEditors().find(e=>{let r=e.getModifiedEditor(),i=e.getOriginalEditor();return r&&r.getModel()?.uri.toString()===n.toString()&&i&&i.getModel()?.uri.toString()===t.toString()})||null}function Ad(e){let t=e.get(ji).listDiffEditors(),n=vo();if(n){for(let e of t)if(e.getContainerDomNode().contains(n))return e}return null}C(_d),C(vd),C(yd),_e.appendMenuItem(X.EditorTitle,{command:{id:new vd().desc.id,title:S(135,`Show Moved Code Blocks`),icon:k.move,toggled:Gs.create(`config.diffEditor.experimental.showMoves`,!0),precondition:m.has(`isInDiffEditor`)},order:10,group:`1_diff`,when:m.has(`isInDiffEditor`)}),C(Td);for(let e of[{icon:k.arrowRight,key:B.diffEditorInlineMode.toNegated()},{icon:k.discard,key:B.diffEditorInlineMode}])_e.appendMenuItem(X.DiffEditorHunkToolbar,{command:{id:new Td().desc.id,title:S(136,`Revert Block`),icon:e.icon},when:m.and(B.diffEditorModifiedWritable,e.key),order:5,group:`primary`}),_e.appendMenuItem(X.DiffEditorSelectionToolbar,{command:{id:new Td().desc.id,title:S(137,`Revert Selection`),icon:e.icon},when:m.and(B.diffEditorModifiedWritable,e.key),order:5,group:`primary`});C(xd),C(Sd),C(Cd),C(wd),_e.appendMenuItem(X.EditorTitle,{command:{id:Dd.id,title:S(138,`Open Accessible Diff Viewer`),precondition:m.has(`isInDiffEditor`)},order:10,group:`2_diff`,when:m.and(B.accessibleDiffViewerVisible.negate(),m.has(`isInDiffEditor`))}),Mn.registerCommandAlias(`editor.action.diffReview.next`,Dd.id),C(Dd),Mn.registerCommandAlias(`editor.action.diffReview.prev`,Od.id),C(Od);var jd=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Md=function(e,t){return function(n,r){t(n,r,e)}},Nd,Pd=new M(`selectionAnchorSet`,!1),Fd=class{static{Nd=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(Nd.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Pd.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){let e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(I.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new pi().appendText(S(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ol(S(850,`Anchor set at {0}:{1}`,e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){let t=this.editor.getPosition();this.editor.setSelection(I.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){let e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Fd=Nd=jd([Md(1,W)],Fd);var Id=class extends F{constructor(){super({id:`editor.action.setSelectionAnchor`,label:N(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:sl(2089,2080),weight:100}})}async run(e,t){Fd.get(t)?.setSelectionAnchor()}},Ld=class extends F{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:N(852,`Go to Selection Anchor`),precondition:Pd})}async run(e,t){Fd.get(t)?.goToSelectionAnchor()}},Rd=class extends F{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:N(853,`Select from Anchor to Cursor`),precondition:Pd,kbOpts:{kbExpr:B.editorTextFocus,primary:sl(2089,2089),weight:100}})}async run(e,t){Fd.get(t)?.selectFromAnchorToCursor()}},zd=class extends F{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:N(854,`Cancel Selection Anchor`),precondition:Pd,kbOpts:{kbExpr:B.editorTextFocus,primary:9,weight:100}})}async run(e,t){Fd.get(t)?.cancelSelectionAnchor()}};L(Fd.ID,Fd,4),j(Id),j(Ld),j(Rd),j(zd);var Bd=O(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,S(855,`Overview ruler marker color for matching brackets.`)),Vd=class extends F{constructor(){super({id:`editor.action.jumpToBracket`,label:N(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:3165,weight:100}})}run(e,t){Gd.get(t)?.jumpToBracket()}},Hd=class extends F{constructor(){super({id:`editor.action.selectToBracket`,label:N(858,`Select to Bracket`),precondition:void 0,metadata:{description:N(859,`Select the text inside and including the brackets or curly braces`),args:[{name:`args`,schema:{type:`object`,properties:{selectBrackets:{type:`boolean`,default:!0}}}}]}})}run(e,t,n){let r=!0;n&&n.selectBrackets===!1&&(r=!1),Gd.get(t)?.selectToBracket(r)}},Ud=class extends F{constructor(){super({id:`editor.action.removeBrackets`,label:N(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Gd.get(t)?.removeBrackets(this.id)}},Wd=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Gd=class e extends T{static{this.ID=`editor.contrib.bracketMatchingController`}static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new xa(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{this._matchBrackets!==`never`&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;let e=this._editor.getModel(),t=this._editor.getSelections().map(t=>{let n=t.getStartPosition(),r=e.bracketPairs.matchBracket(n),i=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?i=r[1].getStartPosition():r[1].containsPosition(n)&&(i=r[0].getStartPosition());else{let t=e.bracketPairs.findEnclosingBrackets(n);if(t)i=t[1].getStartPosition();else{let t=e.bracketPairs.findNextBracket(n);t&&t.range&&(i=t.range.getStartPosition())}}return i?new I(i.lineNumber,i.column,i.lineNumber,i.column):new I(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{let i=r.getStartPosition(),a=t.bracketPairs.matchBracket(i);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(i),!a)){let e=t.bracketPairs.findNextBracket(i);e&&e.range&&(a=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let o=null,s=null;if(a){a.sort(D.compareRangesUsingStarts);let[t,n]=a;if(o=e?t.getStartPosition():t.getEndPosition(),s=e?n.getEndPosition():n.getStartPosition(),n.containsPosition(i)){let e=o;o=s,s=e}}o&&s&&n.push(new I(o.lineNumber,o.column,s.lineNumber,s.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(n=>{let r=n.getPosition(),i=t.bracketPairs.matchBracket(r);i||=t.bracketPairs.findEnclosingBrackets(r),i&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:i[0],text:``},{range:i[1],text:``}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Y.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:bl(Bd),position:ju.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Y.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`})}_updateBrackets(){if(this._matchBrackets===`never`)return;this._recomputeBrackets();let e=[],t=0;for(let n of this._lastBracketsData){let r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getSelections();if(t.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let n=this._editor.getModel(),r=n.getVersionId(),i=[];this._lastVersionId===r&&(i=this._lastBracketsData);let a=[],o=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];n.isEmpty()&&(a[o++]=n.getStartPosition())}a.length>1&&a.sort(P.compare);let s=[],c=0,l=0,u=i.length;for(let t=0,r=a.length;t<r;t++){let r=a[t];for(;l<u&&i[l].position.isBefore(r);)l++;if(l<u&&i[l].position.equals(r))s[c++]=i[l];else{let t=n.bracketPairs.matchBracket(r,20),i=e._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!t&&this._matchBrackets===`always`&&(t=n.bracketPairs.findEnclosingBrackets(r,20),i=e._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),s[c++]=new Wd(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};L(Gd.ID,Gd,1),j(Hd),j(Vd),j(Ud),_e.appendMenuItem(X.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:S(856,`Go to &&Bracket`)},order:2}),Oc((e,t)=>{let n=e.getColor(br);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)});var Kd=class{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;let n=this._selection.startLineNumber,r=this._selection.startColumn,i=this._selection.endColumn;if(!(this._isMovingLeft&&r===1)&&!(!this._isMovingLeft&&i===e.getLineMaxColumn(n)))if(this._isMovingLeft){let a=new D(n,r-1,n,r),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new D(n,i,n,i),o)}else{let a=new D(n,i,n,i+1),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new D(n,r,n,r),o)}}computeCursorState(e,t){return this._isMovingLeft?new I(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new I(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}},qd=class extends F{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let n=[],r=t.getSelections();for(let e of r)n.push(new Kd(e,this.left));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}},Jd=class extends qd{constructor(){super(!0,{id:`editor.action.moveCarretLeftAction`,label:N(861,`Move Selected Text Left`),precondition:B.writable})}},Yd=class extends qd{constructor(){super(!1,{id:`editor.action.moveCarretRightAction`,label:N(862,`Move Selected Text Right`),precondition:B.writable})}};j(Jd),j(Yd),j(class extends F{constructor(){super({id:`editor.action.transposeLetters`,label:N(863,`Transpose Letters`),precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let n=t.getModel(),r=[],i=t.getSelections();for(let e of i){if(!e.isEmpty())continue;let t=e.startLineNumber,i=e.startColumn,a=n.getLineMaxColumn(t);if(t===1&&(i===1||i===2&&a===2))continue;let o=i===a?e.getPosition():lr.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=lr.leftPosition(n,o),c=lr.leftPosition(n,s),l=n.getValueInRange(D.fromPositions(c,s)),u=n.getValueInRange(D.fromPositions(s,o)),d=D.fromPositions(c,o);r.push(new it(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Xd=class e{static{this.sep=`.`}static{this.None=new e(`@@none@@`)}static{this.Empty=new e(``)}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(t){return this.equals(t)||this.value===``||t.value.startsWith(this.value+e.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}},Zd=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Qd=function(e,t){return function(n,r){t(n,r,e)}},$d=Y.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),ef=class e extends T{static{this.baseId=`editor.widget.inlineProgressWidget`}constructor(e,t,n,r,i){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=R(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=R(`span.icon`);this.domNode.append(t),t.classList.add(...w.asClassNameArray(k.loading),`codicon-modifier-spin`);let r=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};r(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&r()})),this._register(V(this.domNode,n.CLICK,e=>{this.delegate.cancel()}))}getId(){return e.baseId+`.`+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}},tf=class extends T{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new un),this._currentWidget=this._register(new un),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,n,r,i){let a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=Iu(()=>{let n=D.fromPositions(e);this._currentDecorations.set([{range:n,options:$d}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(ef,this.id,this._editor,n,t,r))},i??this._showDelay);try{return await n}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};tf=Zd([Qd(2,E)],tf);var nf=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},rf=function(e,t){return function(n,r){t(n,r,e)}},af,of=class{static{af=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new M(`messageVisible`,!1,S(1353,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(af.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new un,this._messageListeners=new A,this._mouseOverMessage=!1,this._editor=e,this._visible=af.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(ol(en(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),en(e)){let n=this._messageListeners.add(Ar(e,{actionHandler:(e,t)=>{this.closeMessage(),It(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new sf(this._editor,t,n.element)}else this._messageWidget.value=new sf(this._editor,t,e);this._messageListeners.add(Ps.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&ti(vo(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(V(this._messageWidget.value.getDomNode(),n.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(V(this._messageWidget.value.getDomNode(),n.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let r;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(r?r.containsPosition(e.target.position)||this.closeMessage():r=new D(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(sf.fadeOut(this._messageWidget.value))}};of=af=nf([rf(1,W),rf(2,_n)],of),z(new(ht.bindToContribution(of.get))({id:`leaveEditorMessage`,precondition:of.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var sf=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener(`animationend`,t)},n=setTimeout(t,110);return e.getDomNode().addEventListener(`animationend`,t),e.getDomNode().classList.add(`fadeOut`),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement(`div`),this._domNode.classList.add(`monaco-editor-overlaymessage`),this._domNode.style.marginLeft=`-6px`;let i=document.createElement(`div`);i.classList.add(`anchor`,`top`),this._domNode.appendChild(i);let a=document.createElement(`div`);typeof r==`string`?(a.classList.add(`message`),a.textContent=r):(r.classList.add(`message`),a.appendChild(r)),this._domNode.appendChild(a);let o=document.createElement(`div`);o.classList.add(`anchor`,`below`),this._domNode.appendChild(o),this._editor.addContentWidget(this),this._domNode.classList.add(`fadeIn`)}dispose(){this._editor.removeContentWidget(this)}getId(){return`messageoverlay`}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle(`below`,e===2)}};L(of.ID,of,4);var cf=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},lf=function(e,t){return function(n,r){t(n,r,e)}},uf=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,n,r,i){let a=await this.getEdit(n,i);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,n,r){let i=await this.getEdit(n,r);if(i)return{edits:[{insertText:i.insertText,title:i.title,kind:i.kind,handledMimeType:i.handledMimeType,yieldTo:i.yieldTo}],dispose(){}}}},df=class e extends uf{static{this.id=`text`}constructor(){super(Xd.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[xc.text],this.pasteMimeTypes=[xc.text]}async getEdit(e,t){let n=e.get(xc.text);if(!n||e.has(xc.uriList))return;let r=await n.asString();return{handledMimeType:xc.text,title:S(980,`Insert Plain Text`),insertText:r,kind:this.kind}}},ff=class extends uf{constructor(){super(Xd.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[xc.uriList],this.pasteMimeTypes=[xc.uriList]}async getEdit(e,t){let n=await hf(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===gd.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?S(981,`Insert Uris`):S(982,`Insert Uri`):n.length>1?S(983,`Insert Paths`):S(984,`Insert Path`),{handledMimeType:xc.uriList,insertText:i,title:a,kind:this.kind}}},pf=class extends uf{constructor(e){super(Xd.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[xc.uriList],this.pasteMimeTypes=[xc.uriList]}async getEdit(e,t){let n=await hf(e);if(!n.length||t.isCancellationRequested)return;let r=Jr(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?mc(t.uri,e):void 0}));if(r.length)return{handledMimeType:xc.uriList,insertText:r.join(` `),title:n.length>1?S(985,`Insert Relative Paths`):S(986,`Insert Relative Path`),kind:this.kind}}};pf=cf([lf(0,Qn)],pf);var mf=class{constructor(){this.kind=new Xd(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:xc.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==Rs.PasteAs&&!r.only?.contains(this.kind))return;let a=await n.get(`text/html`)?.asString();if(!(!a||i.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:S(987,`Insert HTML`),kind:this.kind}]}}};async function hf(e){let t=e.get(xc.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of tu.parse(n))try{r.push({uri:Ot.parse(e),originalText:e})}catch{}return r}var gf={scheme:`*`,hasAccessToAllModels:!0},_f=class extends T{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(gf,new df)),this._register(e.documentDropEditProvider.register(gf,new ff)),this._register(e.documentDropEditProvider.register(gf,new pf(t)))}};_f=cf([lf(0,K),lf(1,Qn)],_f);var vf=class extends T{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(gf,new df)),this._register(e.documentPasteEditProvider.register(gf,new ff)),this._register(e.documentPasteEditProvider.register(gf,new pf(t))),this._register(e.documentPasteEditProvider.register(gf,new mf))}};vf=cf([lf(0,K),lf(1,Qn)],vf);var yf=class e{constructor(){this.value=``,this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let t=this.pos,n=0,r=this.value.charCodeAt(t),i;if(i=e._table[r],typeof i==`number`)return this.pos+=1,{type:i,pos:t,len:1};if(e.isDigitCharacter(r)){i=8;do n+=1,r=this.value.charCodeAt(t+n);while(e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}if(e.isVariableCharacter(r)){i=9;do r=this.value.charCodeAt(t+ ++n);while(e.isVariableCharacter(r)||e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}i=10;do n+=1,r=this.value.charCodeAt(t+n);while(!isNaN(r)&&e._table[r]===void 0&&!e.isDigitCharacter(r)&&!e.isVariableCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}},bf=class{constructor(){this._children=[]}appendChild(e){return e instanceof xf&&this._children[this._children.length-1]instanceof xf?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:n}=e,r=n.children.indexOf(e),i=n.children.slice(0);i.splice(r,1,...t),n._children=i,(function e(t,n){for(let r of t)r.parent=n,e(r.children,r)})(t,n)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof kf)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},xf=class e extends bf{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},Sf=class extends bf{},Cf=class e extends Sf{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:+(e.index>t.index)}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof wf?this._children[0]:void 0}clone(){let t=new e(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},wf=class e extends bf{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof xf&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let t=new e;return this.options.forEach(t.appendChild,t),t}},Tf=class e extends bf{constructor(){super(...arguments),this.regexp=RegExp(``)}resolve(e){let t=this,n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(e=>e instanceof Ef&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof Ef){let r=e[n.index]||``;r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return``}clone(){let t=new e;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?`i`:``)+(this.regexp.global?`g`:``)),t._children=this.children.map(e=>e.clone()),t}},Ef=class e extends bf{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}resolve(e){return this.shorthandName===`upcase`?e?e.toLocaleUpperCase():``:this.shorthandName===`downcase`?e?e.toLocaleLowerCase():``:this.shorthandName===`capitalize`?e?e[0].toLocaleUpperCase()+e.substr(1):``:this.shorthandName===`pascalcase`?e?this._toPascalCase(e):``:this.shorthandName===`camelcase`?e?this._toCamelCase(e):``:this.shorthandName===`kebabcase`?e?this._toKebabCase(e):``:this.shorthandName===`snakecase`?e?this._toSnakeCase(e):``:e&&typeof this.ifValue==`string`?this.ifValue:!e&&typeof this.elseValue==`string`?this.elseValue:e||``}_toKebabCase(e){if(!e.match(/[\p{L}0-9]+/gu))return e;if(!e.match(/[\p{L}0-9]/u))return e.trim().toLowerCase().replace(/^_+|_+$/g,``).replace(/[\s_]+/g,`-`);let t=e.trim().replace(/^_+|_+$/g,``),n=t.match(/\p{Lu}{2,}(?=\p{Lu}\p{Ll}+[0-9]*|[\s_-]|$)|\p{Lu}?\p{Ll}+[0-9]*|\p{Lu}(?=\p{Lu}\p{Ll})|\p{Lu}(?=[\s_-]|$)|[0-9]+/gu);return n?n.map(e=>e.toLowerCase()).join(`-`):t.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).join(`-`)}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(e=>e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((e,t)=>t===0?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,`$1_$2`).replace(/[\s\-]+/g,`_`).toLowerCase()}clone(){return new e(this.index,this.shorthandName,this.ifValue,this.elseValue)}},Df=class e extends Sf{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||``)),t===void 0?!1:(this._children=[new xf(t)],!0)}clone(){let t=new e(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}};function Of(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var kf=class e extends bf{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof Cf&&(e.push(n),t=!t||t.index<n.index?n:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){let{all:e}=this.placeholderInfo;return e}offset(e){let t=0,n=!1;return this.walk(r=>r===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return Of([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof Cf&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Df&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let t=new e;return t._children=this.children.map(e=>e.clone()),t}walk(e){Of(this.children,e)}},Af=class{constructor(){this._scanner=new yf,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,`\\$&`)}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){let r=new kf;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){let n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let r=new Map,i=[];t.walk(e=>(e instanceof Cf&&(e.isFinalTabstop?r.set(0,void 0):!r.has(e.index)&&e.children.length>0?r.set(e.index,e.children):i.push(e)),!0));let a=(e,n)=>{let i=r.get(e.index);if(!i)return;let o=new Cf(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof Cf&&r.has(t.index)&&!n.has(t.index)&&(n.add(t.index),a(t,n),n.delete(t.index))}t.replace(e,[o])},o=new Set;for(let e of i)a(e,o);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(e=>e.index===0)||e.appendChild(new Cf(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let e=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){let t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){let e=this._scanner.next();if(e.type!==0&&e.type!==4&&e.type!==5)return!1}this._token=this._scanner.next()}let n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,`$1`);return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new xf(t)),!0):!1}_parseTabstopOrVariableName(e){let t,n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Cf(Number(t)):new Df(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);let r=new Cf(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new xf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new wf;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(t),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseChoiceElement(e){let t=this._token,n=[];for(;!(this._token.type===2||this._token.type===7);){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;n.push(e)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new xf(n.join(``))),!0)}_parseComplexVariable(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);let r=new Df(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new xf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseTransform(e){let t=new Tf,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0)){e=this._accept(6,!0)||e,n+=e;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let e;if(e=this._accept(5,!0)){e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new xf(e));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);let r=this._accept(8,!0);if(!r)return this._backTo(t),!1;if(!n||this._accept(4))return e.appendChild(new Ef(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let n=this._accept(9,!0);return!n||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Ef(Number(r),n)),!0)}else if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new Ef(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new Ef(Number(r),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let n=this._until(4);if(n)return e.appendChild(new Ef(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new Ef(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type===14?!1:(e.appendChild(new xf(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function jf(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new gi(e,{range:t,text:typeof n.insertText==`string`?Af.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function Mf(e){function t(e,t){return`mimeType`in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}let n=new Map;for(let r of e)for(let i of r.yieldTo??[])for(let a of e)if(a!==r&&t(i,a)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(a)}if(!n.size)return Array.from(e);let r=new Set,i=[];function a(e){if(!e.length)return[];let t=e[0];if(i.includes(t))return console.warn(`Yield to cycle detected`,t),e;if(r.has(t))return a(e.slice(1));let o=[],s=n.get(t);return s&&(i.push(t),o=a(s),i.pop()),r.add(t),[...o,t,...a(e.slice(1))]}return a(Array.from(e))}function Nf(e,t){return t&&(e.stack||e.stacktrace)?S(33,`{0}: {1}`,Ff(e),Pf(e.stack)||Pf(e.stacktrace)):Ff(e)}function Pf(e){return Array.isArray(e)?e.join(`
|
|
1
|
+
import{$ as e,$a as t,$c as n,$d as r,$i as i,$l as a,$n as o,$o as s,$r as c,$s as l,$t as u,$u as d,A as f,Aa as p,Ac as m,Ad as h,Ai as g,Al as _,An as v,Ao as y,Ar as b,As as ee,At as te,Au as ne,B as re,Ba as ie,Bc as ae,Bd as oe,Bi as se,Bl as ce,Bn as le,Bo as ue,Br as de,Bs as fe,Bt as pe,Bu as me,C as he,Ca as ge,Cc as _e,Cd as ve,Cf as ye,Ci as be,Cl as xe,Cn as Se,Co as Ce,Cr as we,Cs as Te,Ct as Ee,Cu as De,D as Oe,Da as ke,Dc as Ae,Dd as x,Df as S,Di as je,Dl as Me,Dn as Ne,Do as Pe,Dr as Fe,Ds as Ie,Dt as Le,Du as Re,E as ze,Ea as Be,Ec as C,Ed as Ve,Ef as He,Ei as Ue,El as We,En as Ge,Eo as Ke,Er as qe,Es as Je,Et as Ye,Eu as Xe,F as Ze,Fa as Qe,Fc as w,Fd as T,Fi as $e,Fl as et,Fn as tt,Fo as nt,Fr as rt,Fs as it,Ft as at,Fu as ot,G as st,Ga as ct,Gc as E,Gd as lt,Gi as ut,Gl as dt,Gn as ft,Go as pt,Gr as mt,Gs as ht,Gt as gt,Gu as _t,H as vt,Ha as yt,Hc as bt,Hd as xt,Hi as St,Hl as Ct,Hn as wt,Ho as Tt,Hr as Et,Hs as D,Ht as Dt,Hu as Ot,I as kt,Ia as O,Ic as k,Id as A,Ii as At,Il as jt,In as Mt,Io as Nt,Ir as Pt,Is as Ft,It,Iu as Lt,J as Rt,Jc as zt,Jd as Bt,Ji as Vt,Jl as Ht,Jn as Ut,Jo as Wt,Jr as Gt,Js as j,Jt as Kt,Ju as qt,K as Jt,Ka as Yt,Kc as Xt,Kd as Zt,Ki as Qt,Kl as $t,Kn as en,Ko as tn,Kr as nn,Ks as rn,Kt as an,Ku as on,L as sn,La as cn,Lc as ln,Ld as un,Li as dn,Ll as fn,Ln as pn,Lo as mn,Lr as hn,Ls as gn,Lt as _n,Lu as vn,M as yn,Ma as bn,Mc as M,Md as xn,Mi as Sn,Ml as Cn,Mn as wn,Mo as Tn,Mr as En,Ms as Dn,Mt as On,Mu as kn,N as An,Na as jn,Nc as Mn,Nd as Nn,Ni as Pn,Nl as Fn,Nn as In,No as Ln,Nr as Rn,Ns as zn,Nt as Bn,Nu as Vn,O as Hn,Oa as Un,Oc as Wn,Od as Gn,Of as N,Oi as Kn,Ol as qn,On as Jn,Oo as Yn,Or as Xn,Os as Zn,Ot as Qn,Ou as $n,P as er,Pa as tr,Pc as nr,Pd as rr,Pi as ir,Pl as ar,Pn as or,Po as sr,Pr as cr,Ps as lr,Pt as ur,Pu as dr,Q as fr,Qa as pr,Qc as mr,Qd as hr,Qi as gr,Ql as _r,Qn as vr,Qo as yr,Qr as br,Qs as xr,Qt as Sr,Qu as Cr,R as wr,Ra as Tr,Rc as Er,Rd as Dr,Ri as Or,Rl as kr,Rn as Ar,Ro as jr,Rr as Mr,Rs as Nr,Rt as Pr,Ru as Fr,S as Ir,Sa as Lr,Sc as Rr,Sd as zr,Sf as Br,Si as Vr,Sl as Hr,Sn as Ur,So as Wr,Sr as Gr,Ss as Kr,St as qr,Su as Jr,T as Yr,Ta as Xr,Tc as Zr,Td as Qr,Tf as $r,Ti as ei,Tl as ti,Tn as ni,To as ri,Tr as ii,Ts as ai,Tt as oi,Tu as si,U as ci,Ua as li,Uc as P,Ud as ui,Ui as di,Ul as fi,Un as pi,Uo as mi,Ur as hi,Us as F,Ut as gi,Uu as _i,V as vi,Va as yi,Vc as bi,Vd as xi,Vi as Si,Vl as Ci,Vn as wi,Vo as Ti,Vr as Ei,Vs as I,Vt as Di,Vu as Oi,W as ki,Wa as Ai,Wc as ji,Wd as Mi,Wi as Ni,Wl as Pi,Wn as Fi,Wo as Ii,Wr as Li,Ws as Ri,Wt as zi,Wu as Bi,X as Vi,Xa as Hi,Xc as Ui,Xd as Wi,Xi as Gi,Xl as Ki,Xn as qi,Xo as Ji,Xr as Yi,Xs as L,Xt as Xi,Xu as Zi,Y as Qi,Ya as $i,Yc as R,Yd as ea,Yi as ta,Yl as na,Yn as ra,Yo as ia,Yr as aa,Ys as z,Yt as oa,Yu as sa,Z as ca,Za as la,Zc as ua,Zd as da,Zi as fa,Zl as pa,Zn as ma,Zo as B,Zr as ha,Zs as ga,Zt as _a,Zu as va,_a as ya,_c as ba,_d as xa,_f as Sa,_i as Ca,_l as wa,_n as Ta,_o as Ea,_r as Da,_s as Oa,_t as ka,_u as Aa,aa as ja,ac as Ma,ad as Na,af as Pa,ai as Fa,al as V,an as Ia,ao as La,ar as Ra,as as za,at as Ba,au as Va,b as Ha,ba as Ua,bc as Wa,bd as Ga,bf as Ka,bi as qa,bl as Ja,bn as Ya,bo as Xa,br as Za,bs as Qa,bt as $a,bu as eo,ca as to,cc as no,cd as ro,cf as io,ci as ao,cl as H,cn as oo,co as so,cr as co,cs as lo,ct as uo,cu as fo,da as po,dc as mo,dd as ho,df as go,di as _o,dl as vo,dn as yo,do as bo,dr as xo,ds as So,dt as Co,du as wo,ea as To,ec as Eo,ed as Do,ef as Oo,ei as ko,el as Ao,en as jo,eo as Mo,er as No,es as Po,et as Fo,eu as Io,fa as Lo,fc as Ro,fd as zo,ff as Bo,fi as Vo,fl as Ho,fn as Uo,fo as Wo,fr as Go,fs as Ko,ft as qo,fu as Jo,g as Yo,ga as Xo,gc as Zo,gd as Qo,gf as $o,gi as es,gl as ts,gn as ns,go as rs,gr as is,gs as as,gt as os,gu as ss,h as cs,ha as ls,hc as us,hd as ds,hf as fs,hi as ps,hl as ms,hn as hs,ho as gs,hr as _s,hs as vs,ht as ys,hu as bs,ia as xs,ic as Ss,id as Cs,if as ws,ii as Ts,il as Es,in as Ds,io as U,ir as Os,is as ks,it as As,iu as js,j as Ms,ja as Ns,jc as W,jd as Ps,ji as Fs,jl as Is,jn as Ls,jo as Rs,jr as zs,js as Bs,jt as Vs,ju as Hs,k as Us,ka as Ws,kc as Gs,kd as Ks,ki as qs,kl as Js,kn as Ys,ko as Xs,kr as Zs,ks as Qs,kt as $s,ku as ec,la as tc,lc as nc,ld as rc,lf as ic,li as ac,ll as oc,ln as sc,lo as cc,lr as lc,ls as uc,lt as dc,lu as fc,ma as pc,mc,md as hc,mf as gc,mi as _c,ml as vc,mn as yc,mo as bc,mr as G,ms as xc,mt as Sc,mu as Cc,na as wc,nc as Tc,nd as Ec,nf as Dc,ni as Oc,nl as kc,nn as Ac,no as K,nr as jc,ns as Mc,nt as Nc,nu as Pc,oa as Fc,oc as Ic,od as Lc,of as q,oi as Rc,ol as zc,on as Bc,oo as Vc,or as Hc,os as Uc,ot as Wc,ou as Gc,pa as Kc,pc as qc,pd as Jc,pf as Yc,pi as Xc,pl as Zc,pn as Qc,po as $c,pr as el,ps as tl,pt as nl,pu as rl,q as il,qa as al,qc as ol,qd as sl,qi as cl,ql as ll,qn as ul,qo as dl,qr as fl,qs as pl,qt as ml,qu as hl,ra as gl,rc as _l,rd as vl,rf as yl,ri as bl,rl as xl,rn as Sl,ro as Cl,rr as wl,rs as Tl,rt as El,ru as J,sa as Dl,sc as Ol,sd as kl,sf as Al,si as jl,sl as Ml,sn as Nl,so as Pl,sr as Fl,ss as Il,st as Ll,su as Rl,ta as zl,tc as Bl,td as Vl,tf as Hl,ti as Ul,tl as Wl,tn as Gl,to as Kl,tr as ql,ts as Jl,tt as Yl,tu as Xl,ua as Zl,uc as Ql,ud as $l,uf as eu,ui as tu,ul as nu,un as ru,uo as iu,ur as au,us as ou,ut as su,uu as cu,v as lu,va as uu,vc as du,vd as fu,vf as pu,vi as mu,vl as hu,vn as gu,vo as _u,vr as Y,vs as vu,vt as yu,vu as bu,w as xu,wa as Su,wc as Cu,wd as wu,wf as Tu,wi as Eu,wl as Du,wn as Ou,wo as ku,wr as Au,ws as ju,wt as Mu,wu as Nu,x as Pu,xa as Fu,xc as X,xd as Iu,xf as Lu,xi as Ru,xl as zu,xn as Bu,xo as Vu,xr as Hu,xs as Uu,xt as Wu,xu as Gu,y as Ku,ya as qu,yc as Ju,yd as Yu,yf as Xu,yi as Zu,yl as Qu,yn as $u,yo as ed,yr as td,ys as nd,yt as rd,yu as id,z as ad,za as od,zc as sd,zd as cd,zi as ld,zl as ud,zn as dd,zo as fd,zr as pd,zs as md,zt as hd,zu as gd}from"./editor.api-BnAmILmn.js";var _d=class extends Ju{constructor(){super({id:`diffEditor.toggleCollapseUnchangedRegions`,title:N(101,`Toggle Collapse Unchanged Regions`),icon:k.map,toggled:m.has(`config.diffEditor.hideUnchangedRegions.enabled`),precondition:m.has(`isInDiffEditor`),menu:{when:m.has(`isInDiffEditor`),id:X.EditorTitle,order:22,group:`navigation`}})}run(e,...t){let n=e.get(Oa),r=!n.getValue(`diffEditor.hideUnchangedRegions.enabled`);n.updateValue(`diffEditor.hideUnchangedRegions.enabled`,r)}},vd=class extends Ju{constructor(){super({id:`diffEditor.toggleShowMovedCodeBlocks`,title:N(102,`Toggle Show Moved Code Blocks`),precondition:m.has(`isInDiffEditor`)})}run(e,...t){let n=e.get(Oa),r=!n.getValue(`diffEditor.experimental.showMoves`);n.updateValue(`diffEditor.experimental.showMoves`,r)}},yd=class extends Ju{constructor(){super({id:`diffEditor.toggleUseInlineViewWhenSpaceIsLimited`,title:N(103,`Toggle Use Inline View When Space Is Limited`),precondition:m.has(`isInDiffEditor`)})}run(e,...t){let n=e.get(Oa),r=!n.getValue(`diffEditor.useInlineViewWhenSpaceIsLimited`);n.updateValue(`diffEditor.useInlineViewWhenSpaceIsLimited`,r)}},bd=N(104,`Diff Editor`),xd=class extends Ri{constructor(){super({id:`diffEditor.switchSide`,title:N(105,`Switch Side`),icon:k.arrowSwap,precondition:m.has(`isInDiffEditor`),f1:!0,category:bd})}runEditorCommand(e,t,n){let r=Ad(e);if(r instanceof Kt){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}},Sd=class extends Ri{constructor(){super({id:`diffEditor.exitCompareMove`,title:N(106,`Exit Compare Move`),icon:k.close,precondition:B.comparingMovedCode,f1:!1,category:bd,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){let r=Ad(e);r instanceof Kt&&r.exitCompareMove()}},Cd=class extends Ri{constructor(){super({id:`diffEditor.collapseAllUnchangedRegions`,title:N(107,`Collapse All Unchanged Regions`),icon:k.fold,precondition:m.has(`isInDiffEditor`),f1:!0,category:bd})}runEditorCommand(e,t,...n){let r=Ad(e);r instanceof Kt&&r.collapseAllUnchangedRegions()}},wd=class extends Ri{constructor(){super({id:`diffEditor.showAllUnchangedRegions`,title:N(108,`Show All Unchanged Regions`),icon:k.unfold,precondition:m.has(`isInDiffEditor`),f1:!0,category:bd})}runEditorCommand(e,t,...n){let r=Ad(e);r instanceof Kt&&r.showAllUnchangedRegions()}},Td=class extends Ju{constructor(){super({id:`diffEditor.revert`,title:N(109,`Revert`),f1:!0,category:bd,precondition:m.has(`isInDiffEditor`)})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){let t=Ad(e);t instanceof Kt&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){let n=kd(e,t.originalUri,t.modifiedUri);n instanceof Kt&&n.revertRangeMappings(t.mapping.innerChanges??[])}},Ed=N(110,`Accessible Diff Viewer`),Dd=class e extends Ju{static{this.id=`editor.action.accessibleDiffViewer.next`}constructor(){super({id:e.id,title:N(111,`Go to Next Difference`),category:Ed,precondition:m.has(`isInDiffEditor`),keybinding:{primary:65,weight:100},f1:!0})}run(e){Ad(e)?.accessibleDiffViewerNext()}},Od=class e extends Ju{static{this.id=`editor.action.accessibleDiffViewer.prev`}constructor(){super({id:e.id,title:N(112,`Go to Previous Difference`),category:Ed,precondition:m.has(`isInDiffEditor`),keybinding:{primary:1089,weight:100},f1:!0})}run(e){Ad(e)?.accessibleDiffViewerPrev()}};function kd(e,t,n){return e.get(ji).listDiffEditors().find(e=>{let r=e.getModifiedEditor(),i=e.getOriginalEditor();return r&&r.getModel()?.uri.toString()===n.toString()&&i&&i.getModel()?.uri.toString()===t.toString()})||null}function Ad(e){let t=e.get(ji).listDiffEditors(),n=vo();if(n){for(let e of t)if(e.getContainerDomNode().contains(n))return e}return null}C(_d),C(vd),C(yd),_e.appendMenuItem(X.EditorTitle,{command:{id:new vd().desc.id,title:S(135,`Show Moved Code Blocks`),icon:k.move,toggled:Gs.create(`config.diffEditor.experimental.showMoves`,!0),precondition:m.has(`isInDiffEditor`)},order:10,group:`1_diff`,when:m.has(`isInDiffEditor`)}),C(Td);for(let e of[{icon:k.arrowRight,key:B.diffEditorInlineMode.toNegated()},{icon:k.discard,key:B.diffEditorInlineMode}])_e.appendMenuItem(X.DiffEditorHunkToolbar,{command:{id:new Td().desc.id,title:S(136,`Revert Block`),icon:e.icon},when:m.and(B.diffEditorModifiedWritable,e.key),order:5,group:`primary`}),_e.appendMenuItem(X.DiffEditorSelectionToolbar,{command:{id:new Td().desc.id,title:S(137,`Revert Selection`),icon:e.icon},when:m.and(B.diffEditorModifiedWritable,e.key),order:5,group:`primary`});C(xd),C(Sd),C(Cd),C(wd),_e.appendMenuItem(X.EditorTitle,{command:{id:Dd.id,title:S(138,`Open Accessible Diff Viewer`),precondition:m.has(`isInDiffEditor`)},order:10,group:`2_diff`,when:m.and(B.accessibleDiffViewerVisible.negate(),m.has(`isInDiffEditor`))}),Mn.registerCommandAlias(`editor.action.diffReview.next`,Dd.id),C(Dd),Mn.registerCommandAlias(`editor.action.diffReview.prev`,Od.id),C(Od);var jd=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Md=function(e,t){return function(n,r){t(n,r,e)}},Nd,Pd=new M(`selectionAnchorSet`,!1),Fd=class{static{Nd=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(Nd.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Pd.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){let e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(I.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new pi().appendText(S(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ol(S(850,`Anchor set at {0}:{1}`,e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){let t=this.editor.getPosition();this.editor.setSelection(I.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){let e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Fd=Nd=jd([Md(1,W)],Fd);var Id=class extends F{constructor(){super({id:`editor.action.setSelectionAnchor`,label:N(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:sl(2089,2080),weight:100}})}async run(e,t){Fd.get(t)?.setSelectionAnchor()}},Ld=class extends F{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:N(852,`Go to Selection Anchor`),precondition:Pd})}async run(e,t){Fd.get(t)?.goToSelectionAnchor()}},Rd=class extends F{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:N(853,`Select from Anchor to Cursor`),precondition:Pd,kbOpts:{kbExpr:B.editorTextFocus,primary:sl(2089,2089),weight:100}})}async run(e,t){Fd.get(t)?.selectFromAnchorToCursor()}},zd=class extends F{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:N(854,`Cancel Selection Anchor`),precondition:Pd,kbOpts:{kbExpr:B.editorTextFocus,primary:9,weight:100}})}async run(e,t){Fd.get(t)?.cancelSelectionAnchor()}};L(Fd.ID,Fd,4),j(Id),j(Ld),j(Rd),j(zd);var Bd=O(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,S(855,`Overview ruler marker color for matching brackets.`)),Vd=class extends F{constructor(){super({id:`editor.action.jumpToBracket`,label:N(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:3165,weight:100}})}run(e,t){Gd.get(t)?.jumpToBracket()}},Hd=class extends F{constructor(){super({id:`editor.action.selectToBracket`,label:N(858,`Select to Bracket`),precondition:void 0,metadata:{description:N(859,`Select the text inside and including the brackets or curly braces`),args:[{name:`args`,schema:{type:`object`,properties:{selectBrackets:{type:`boolean`,default:!0}}}}]}})}run(e,t,n){let r=!0;n&&n.selectBrackets===!1&&(r=!1),Gd.get(t)?.selectToBracket(r)}},Ud=class extends F{constructor(){super({id:`editor.action.removeBrackets`,label:N(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:B.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Gd.get(t)?.removeBrackets(this.id)}},Wd=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Gd=class e extends T{static{this.ID=`editor.contrib.bracketMatchingController`}static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new xa(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{this._matchBrackets!==`never`&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;let e=this._editor.getModel(),t=this._editor.getSelections().map(t=>{let n=t.getStartPosition(),r=e.bracketPairs.matchBracket(n),i=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?i=r[1].getStartPosition():r[1].containsPosition(n)&&(i=r[0].getStartPosition());else{let t=e.bracketPairs.findEnclosingBrackets(n);if(t)i=t[1].getStartPosition();else{let t=e.bracketPairs.findNextBracket(n);t&&t.range&&(i=t.range.getStartPosition())}}return i?new I(i.lineNumber,i.column,i.lineNumber,i.column):new I(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{let i=r.getStartPosition(),a=t.bracketPairs.matchBracket(i);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(i),!a)){let e=t.bracketPairs.findNextBracket(i);e&&e.range&&(a=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let o=null,s=null;if(a){a.sort(D.compareRangesUsingStarts);let[t,n]=a;if(o=e?t.getStartPosition():t.getEndPosition(),s=e?n.getEndPosition():n.getStartPosition(),n.containsPosition(i)){let e=o;o=s,s=e}}o&&s&&n.push(new I(o.lineNumber,o.column,s.lineNumber,s.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(n=>{let r=n.getPosition(),i=t.bracketPairs.matchBracket(r);i||=t.bracketPairs.findEnclosingBrackets(r),i&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:i[0],text:``},{range:i[1],text:``}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Y.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:bl(Bd),position:ju.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Y.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`})}_updateBrackets(){if(this._matchBrackets===`never`)return;this._recomputeBrackets();let e=[],t=0;for(let n of this._lastBracketsData){let r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getSelections();if(t.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let n=this._editor.getModel(),r=n.getVersionId(),i=[];this._lastVersionId===r&&(i=this._lastBracketsData);let a=[],o=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];n.isEmpty()&&(a[o++]=n.getStartPosition())}a.length>1&&a.sort(P.compare);let s=[],c=0,l=0,u=i.length;for(let t=0,r=a.length;t<r;t++){let r=a[t];for(;l<u&&i[l].position.isBefore(r);)l++;if(l<u&&i[l].position.equals(r))s[c++]=i[l];else{let t=n.bracketPairs.matchBracket(r,20),i=e._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!t&&this._matchBrackets===`always`&&(t=n.bracketPairs.findEnclosingBrackets(r,20),i=e._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),s[c++]=new Wd(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};L(Gd.ID,Gd,1),j(Hd),j(Vd),j(Ud),_e.appendMenuItem(X.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:S(856,`Go to &&Bracket`)},order:2}),Oc((e,t)=>{let n=e.getColor(br);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)});var Kd=class{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;let n=this._selection.startLineNumber,r=this._selection.startColumn,i=this._selection.endColumn;if(!(this._isMovingLeft&&r===1)&&!(!this._isMovingLeft&&i===e.getLineMaxColumn(n)))if(this._isMovingLeft){let a=new D(n,r-1,n,r),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new D(n,i,n,i),o)}else{let a=new D(n,i,n,i+1),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new D(n,r,n,r),o)}}computeCursorState(e,t){return this._isMovingLeft?new I(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new I(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}},qd=class extends F{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let n=[],r=t.getSelections();for(let e of r)n.push(new Kd(e,this.left));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}},Jd=class extends qd{constructor(){super(!0,{id:`editor.action.moveCarretLeftAction`,label:N(861,`Move Selected Text Left`),precondition:B.writable})}},Yd=class extends qd{constructor(){super(!1,{id:`editor.action.moveCarretRightAction`,label:N(862,`Move Selected Text Right`),precondition:B.writable})}};j(Jd),j(Yd),j(class extends F{constructor(){super({id:`editor.action.transposeLetters`,label:N(863,`Transpose Letters`),precondition:B.writable,kbOpts:{kbExpr:B.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let n=t.getModel(),r=[],i=t.getSelections();for(let e of i){if(!e.isEmpty())continue;let t=e.startLineNumber,i=e.startColumn,a=n.getLineMaxColumn(t);if(t===1&&(i===1||i===2&&a===2))continue;let o=i===a?e.getPosition():lr.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=lr.leftPosition(n,o),c=lr.leftPosition(n,s),l=n.getValueInRange(D.fromPositions(c,s)),u=n.getValueInRange(D.fromPositions(s,o)),d=D.fromPositions(c,o);r.push(new it(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Xd=class e{static{this.sep=`.`}static{this.None=new e(`@@none@@`)}static{this.Empty=new e(``)}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(t){return this.equals(t)||this.value===``||t.value.startsWith(this.value+e.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}},Zd=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Qd=function(e,t){return function(n,r){t(n,r,e)}},$d=Y.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),ef=class e extends T{static{this.baseId=`editor.widget.inlineProgressWidget`}constructor(e,t,n,r,i){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=R(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=R(`span.icon`);this.domNode.append(t),t.classList.add(...w.asClassNameArray(k.loading),`codicon-modifier-spin`);let r=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};r(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&r()})),this._register(V(this.domNode,n.CLICK,e=>{this.delegate.cancel()}))}getId(){return e.baseId+`.`+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}},tf=class extends T{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new un),this._currentWidget=this._register(new un),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,n,r,i){let a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=Iu(()=>{let n=D.fromPositions(e);this._currentDecorations.set([{range:n,options:$d}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(ef,this.id,this._editor,n,t,r))},i??this._showDelay);try{return await n}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};tf=Zd([Qd(2,E)],tf);var nf=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},rf=function(e,t){return function(n,r){t(n,r,e)}},af,of=class{static{af=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new M(`messageVisible`,!1,S(1353,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(af.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new un,this._messageListeners=new A,this._mouseOverMessage=!1,this._editor=e,this._visible=af.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(ol(en(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),en(e)){let n=this._messageListeners.add(Ar(e,{actionHandler:(e,t)=>{this.closeMessage(),It(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new sf(this._editor,t,n.element)}else this._messageWidget.value=new sf(this._editor,t,e);this._messageListeners.add(Ps.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&ti(vo(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(V(this._messageWidget.value.getDomNode(),n.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(V(this._messageWidget.value.getDomNode(),n.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let r;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(r?r.containsPosition(e.target.position)||this.closeMessage():r=new D(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(sf.fadeOut(this._messageWidget.value))}};of=af=nf([rf(1,W),rf(2,_n)],of),z(new(ht.bindToContribution(of.get))({id:`leaveEditorMessage`,precondition:of.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var sf=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener(`animationend`,t)},n=setTimeout(t,110);return e.getDomNode().addEventListener(`animationend`,t),e.getDomNode().classList.add(`fadeOut`),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement(`div`),this._domNode.classList.add(`monaco-editor-overlaymessage`),this._domNode.style.marginLeft=`-6px`;let i=document.createElement(`div`);i.classList.add(`anchor`,`top`),this._domNode.appendChild(i);let a=document.createElement(`div`);typeof r==`string`?(a.classList.add(`message`),a.textContent=r):(r.classList.add(`message`),a.appendChild(r)),this._domNode.appendChild(a);let o=document.createElement(`div`);o.classList.add(`anchor`,`below`),this._domNode.appendChild(o),this._editor.addContentWidget(this),this._domNode.classList.add(`fadeIn`)}dispose(){this._editor.removeContentWidget(this)}getId(){return`messageoverlay`}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle(`below`,e===2)}};L(of.ID,of,4);var cf=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},lf=function(e,t){return function(n,r){t(n,r,e)}},uf=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,n,r,i){let a=await this.getEdit(n,i);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,n,r){let i=await this.getEdit(n,r);if(i)return{edits:[{insertText:i.insertText,title:i.title,kind:i.kind,handledMimeType:i.handledMimeType,yieldTo:i.yieldTo}],dispose(){}}}},df=class e extends uf{static{this.id=`text`}constructor(){super(Xd.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[xc.text],this.pasteMimeTypes=[xc.text]}async getEdit(e,t){let n=e.get(xc.text);if(!n||e.has(xc.uriList))return;let r=await n.asString();return{handledMimeType:xc.text,title:S(980,`Insert Plain Text`),insertText:r,kind:this.kind}}},ff=class extends uf{constructor(){super(Xd.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[xc.uriList],this.pasteMimeTypes=[xc.uriList]}async getEdit(e,t){let n=await hf(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===gd.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?S(981,`Insert Uris`):S(982,`Insert Uri`):n.length>1?S(983,`Insert Paths`):S(984,`Insert Path`),{handledMimeType:xc.uriList,insertText:i,title:a,kind:this.kind}}},pf=class extends uf{constructor(e){super(Xd.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[xc.uriList],this.pasteMimeTypes=[xc.uriList]}async getEdit(e,t){let n=await hf(e);if(!n.length||t.isCancellationRequested)return;let r=Jr(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?mc(t.uri,e):void 0}));if(r.length)return{handledMimeType:xc.uriList,insertText:r.join(` `),title:n.length>1?S(985,`Insert Relative Paths`):S(986,`Insert Relative Path`),kind:this.kind}}};pf=cf([lf(0,Qn)],pf);var mf=class{constructor(){this.kind=new Xd(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:xc.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==Rs.PasteAs&&!r.only?.contains(this.kind))return;let a=await n.get(`text/html`)?.asString();if(!(!a||i.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:S(987,`Insert HTML`),kind:this.kind}]}}};async function hf(e){let t=e.get(xc.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of tu.parse(n))try{r.push({uri:Ot.parse(e),originalText:e})}catch{}return r}var gf={scheme:`*`,hasAccessToAllModels:!0},_f=class extends T{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(gf,new df)),this._register(e.documentDropEditProvider.register(gf,new ff)),this._register(e.documentDropEditProvider.register(gf,new pf(t)))}};_f=cf([lf(0,K),lf(1,Qn)],_f);var vf=class extends T{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(gf,new df)),this._register(e.documentPasteEditProvider.register(gf,new ff)),this._register(e.documentPasteEditProvider.register(gf,new pf(t))),this._register(e.documentPasteEditProvider.register(gf,new mf))}};vf=cf([lf(0,K),lf(1,Qn)],vf);var yf=class e{constructor(){this.value=``,this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let t=this.pos,n=0,r=this.value.charCodeAt(t),i;if(i=e._table[r],typeof i==`number`)return this.pos+=1,{type:i,pos:t,len:1};if(e.isDigitCharacter(r)){i=8;do n+=1,r=this.value.charCodeAt(t+n);while(e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}if(e.isVariableCharacter(r)){i=9;do r=this.value.charCodeAt(t+ ++n);while(e.isVariableCharacter(r)||e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}i=10;do n+=1,r=this.value.charCodeAt(t+n);while(!isNaN(r)&&e._table[r]===void 0&&!e.isDigitCharacter(r)&&!e.isVariableCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}},bf=class{constructor(){this._children=[]}appendChild(e){return e instanceof xf&&this._children[this._children.length-1]instanceof xf?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:n}=e,r=n.children.indexOf(e),i=n.children.slice(0);i.splice(r,1,...t),n._children=i,(function e(t,n){for(let r of t)r.parent=n,e(r.children,r)})(t,n)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof kf)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},xf=class e extends bf{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},Sf=class extends bf{},Cf=class e extends Sf{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:+(e.index>t.index)}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof wf?this._children[0]:void 0}clone(){let t=new e(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},wf=class e extends bf{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof xf&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let t=new e;return this.options.forEach(t.appendChild,t),t}},Tf=class e extends bf{constructor(){super(...arguments),this.regexp=RegExp(``)}resolve(e){let t=this,n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(e=>e instanceof Ef&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof Ef){let r=e[n.index]||``;r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return``}clone(){let t=new e;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?`i`:``)+(this.regexp.global?`g`:``)),t._children=this.children.map(e=>e.clone()),t}},Ef=class e extends bf{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}resolve(e){return this.shorthandName===`upcase`?e?e.toLocaleUpperCase():``:this.shorthandName===`downcase`?e?e.toLocaleLowerCase():``:this.shorthandName===`capitalize`?e?e[0].toLocaleUpperCase()+e.substr(1):``:this.shorthandName===`pascalcase`?e?this._toPascalCase(e):``:this.shorthandName===`camelcase`?e?this._toCamelCase(e):``:this.shorthandName===`kebabcase`?e?this._toKebabCase(e):``:this.shorthandName===`snakecase`?e?this._toSnakeCase(e):``:e&&typeof this.ifValue==`string`?this.ifValue:!e&&typeof this.elseValue==`string`?this.elseValue:e||``}_toKebabCase(e){if(!e.match(/[\p{L}0-9]+/gu))return e;if(!e.match(/[\p{L}0-9]/u))return e.trim().toLowerCase().replace(/^_+|_+$/g,``).replace(/[\s_]+/g,`-`);let t=e.trim().replace(/^_+|_+$/g,``),n=t.match(/\p{Lu}{2,}(?=\p{Lu}\p{Ll}+[0-9]*|[\s_-]|$)|\p{Lu}?\p{Ll}+[0-9]*|\p{Lu}(?=\p{Lu}\p{Ll})|\p{Lu}(?=[\s_-]|$)|[0-9]+/gu);return n?n.map(e=>e.toLowerCase()).join(`-`):t.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).join(`-`)}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(e=>e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((e,t)=>t===0?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,`$1_$2`).replace(/[\s\-]+/g,`_`).toLowerCase()}clone(){return new e(this.index,this.shorthandName,this.ifValue,this.elseValue)}},Df=class e extends Sf{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||``)),t===void 0?!1:(this._children=[new xf(t)],!0)}clone(){let t=new e(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}};function Of(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var kf=class e extends bf{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof Cf&&(e.push(n),t=!t||t.index<n.index?n:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){let{all:e}=this.placeholderInfo;return e}offset(e){let t=0,n=!1;return this.walk(r=>r===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return Of([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof Cf&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Df&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let t=new e;return t._children=this.children.map(e=>e.clone()),t}walk(e){Of(this.children,e)}},Af=class{constructor(){this._scanner=new yf,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,`\\$&`)}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){let r=new kf;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){let n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let r=new Map,i=[];t.walk(e=>(e instanceof Cf&&(e.isFinalTabstop?r.set(0,void 0):!r.has(e.index)&&e.children.length>0?r.set(e.index,e.children):i.push(e)),!0));let a=(e,n)=>{let i=r.get(e.index);if(!i)return;let o=new Cf(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof Cf&&r.has(t.index)&&!n.has(t.index)&&(n.add(t.index),a(t,n),n.delete(t.index))}t.replace(e,[o])},o=new Set;for(let e of i)a(e,o);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(e=>e.index===0)||e.appendChild(new Cf(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let e=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){let t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){let e=this._scanner.next();if(e.type!==0&&e.type!==4&&e.type!==5)return!1}this._token=this._scanner.next()}let n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,`$1`);return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new xf(t)),!0):!1}_parseTabstopOrVariableName(e){let t,n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Cf(Number(t)):new Df(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);let r=new Cf(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new xf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new wf;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(t),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseChoiceElement(e){let t=this._token,n=[];for(;!(this._token.type===2||this._token.type===7);){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;n.push(e)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new xf(n.join(``))),!0)}_parseComplexVariable(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);let r=new Df(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new xf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseTransform(e){let t=new Tf,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0)){e=this._accept(6,!0)||e,n+=e;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let e;if(e=this._accept(5,!0)){e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new xf(e));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);let r=this._accept(8,!0);if(!r)return this._backTo(t),!1;if(!n||this._accept(4))return e.appendChild(new Ef(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let n=this._accept(9,!0);return!n||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Ef(Number(r),n)),!0)}else if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new Ef(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new Ef(Number(r),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let n=this._until(4);if(n)return e.appendChild(new Ef(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new Ef(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type===14?!1:(e.appendChild(new xf(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function jf(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new gi(e,{range:t,text:typeof n.insertText==`string`?Af.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function Mf(e){function t(e,t){return`mimeType`in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}let n=new Map;for(let r of e)for(let i of r.yieldTo??[])for(let a of e)if(a!==r&&t(i,a)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(a)}if(!n.size)return Array.from(e);let r=new Set,i=[];function a(e){if(!e.length)return[];let t=e[0];if(i.includes(t))return console.warn(`Yield to cycle detected`,t),e;if(r.has(t))return a(e.slice(1));let o=[],s=n.get(t);return s&&(i.push(t),o=a(s),i.pop()),r.add(t),[...o,t,...a(e.slice(1))]}return a(Array.from(e))}function Nf(e,t){return t&&(e.stack||e.stacktrace)?S(33,`{0}: {1}`,Ff(e),Pf(e.stack)||Pf(e.stacktrace)):Ff(e)}function Pf(e){return Array.isArray(e)?e.join(`
|
|
2
2
|
`):e}function Ff(e){return e.code===`ERR_UNC_HOST_NOT_ALLOWED`?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof e.code==`string`&&typeof e.errno==`number`&&typeof e.syscall==`string`?S(34,`A system error occurred ({0})`,e.message):e.message||S(35,`An unknown error occurred. Please consult the log for more details.`)}function If(e=null,t=!1){if(!e)return S(36,`An unknown error occurred. Please consult the log for more details.`);if(Array.isArray(e)){let n=Jr(e),r=If(n[0],t);return n.length>1?S(37,`{0} ({1} errors in total)`,r,n.length):r}if(Bo(e))return e;if(e.detail){let n=e.detail;if(n.error)return Nf(n.error,t);if(n.exception)return Nf(n.exception,t)}return e.stack?Nf(e,t):e.message?e.message:S(38,`An unknown error occurred. Please consult the log for more details.`)}var Lf=class extends T{constructor(e){super(),this._onChange=this._register(new h),this.onChange=this._onChange.event,this._checked=!!e.checked,this._title=e.title??e.ariaLabel,this.domNode=R(`button.monaco-switch`),this.domNode.type=`button`,this.domNode.setAttribute(`role`,`switch`),H(this.domNode,R(`.monaco-switch-thumb`)),this._register(pn().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}))),this.setAriaLabel(e.ariaLabel,e.title),this.disabled=!!e.disabled,this._applyState(),this._register(V(this.domNode,n.CLICK,e=>{mr.stop(e,!0),!this.domNode.disabled&&(this._checked=!this._checked,this._applyState(),this._onChange.fire(this._checked))}))}get checked(){return this._checked}set checked(e){this._checked!==e&&(this._checked=e,this._applyState())}get disabled(){return this.domNode.disabled}set disabled(e){this.domNode.disabled=e}setAriaLabel(e,t=e){this.domNode.setAttribute(`aria-label`,e),this._title=t}_applyState(){this.domNode.setAttribute(`aria-checked`,String(this._checked)),this.domNode.classList.toggle(`checked`,this._checked)}},Rf=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},zf=function(e,t){return function(n,r){t(n,r,e)}},Bf=class extends T{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute(`aria-disabled`,`false`),this.el.tabIndex=0,this.el.style.pointerEvents=`auto`,this.el.style.opacity=`1`,this.el.style.cursor=`pointer`,this._enabled=!1):(this.el.setAttribute(`aria-disabled`,`true`),this.el.tabIndex=-1,this.el.style.pointerEvents=`none`,this.el.style.opacity=`0.4`,this.el.style.cursor=`default`,this._enabled=!0),this._enabled=e}constructor(e,t,n={},r,i){super(),this._link=t,this._hoverService=r,this._enabled=!0,this.el=H(e,R(`a.monaco-link`,{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=n.hoverDelegate??Os(`mouse`),this.setTooltip(t.title),this.el.setAttribute(`role`,`button`);let a=this._register(new Ca(this.el,`click`)),o=this._register(new Ca(this.el,`keydown`)),s=Ps.chain(o.event,e=>e.map(e=>new Zt(e)).filter(e=>e.keyCode===3||e.keyCode===10)),c=this._register(new Ca(this.el,Ru.Tap)).event;this._register(Vr.addTarget(this.el));let l=Ps.any(a.event,s,c);this._register(l(e=>{this.enabled&&(mr.stop(e,!0),n?.opener?n.opener(this._link.href):i.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};Bf=Rf([zf(3,_a),zf(4,_n)],Bf);var Vf=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Hf=function(e,t){return function(n,r){t(n,r,e)}},Uf,Wf=`acceptSelectedCodeAction`,Gf=`previewSelectedCodeAction`,Kf=new Set([Wf,Gf,`toggleSectionCodeAction`]),qf=`actionList.remove`,Jf=class{get templateId(){return`header`}renderTemplate(e){e.classList.add(`group-header`);let t=document.createElement(`span`);return e.append(t),{container:e,text:t}}renderElement(e,t,n){n.text.textContent=e.group?.title??e.label??``}disposeTemplate(e){}},Yf=class{get templateId(){return`separator`}renderTemplate(e){e.classList.add(`separator`);let t=document.createElement(`span`);return e.append(t),{container:e,text:t}}renderElement(e,t,n){n.container.classList.toggle(`has-label`,!!e.label),n.text.textContent=e.label??``}disposeTemplate(e){}};function Xf(e){return!!e.submenuActions?.length&&!e.hover?.content||!!e.hover?.expandable}function Zf(e){return Xf(e)&&e.hover?.showIndicator!==!1}var Qf=class{get templateId(){return`action`}constructor(e,t,n,r,i,a,o,s,c,l,u,d){this._supportsPreview=e,this._onRemoveItem=t,this._onShowSubmenu=n,this._reservesSubmenuSpace=r,this._groupTitleByIndex=i,this._linkHandler=a,this._hideDefaultKeybindingTooltip=o,this._stopToolbarPointerPropagation=s,this._registerStandaloneToggle=c,this._registerToolbar=l,this._keybindingService=u,this._openerService=d}renderTemplate(e){e.classList.add(this.templateId);let t=document.createElement(`div`);t.className=`icon`,e.append(t);let n=document.createElement(`span`);n.className=`title`,e.append(n);let r=document.createElement(`span`);r.className=`action-item-badge`,r.ariaHidden=`true`,e.append(r);let i=document.createElement(`span`);i.className=`description`,e.append(i);let a=document.createElement(`span`);a.className=`group-title`,e.append(a);let o=document.createElement(`span`);o.className=`detail`,e.append(o);let s=new oi(e,ea),c=document.createElement(`div`);c.className=`action-list-item-toolbar`,e.append(c);let l=document.createElement(`div`);l.className=`action-list-submenu-indicator`,e.append(l);let u=document.createElement(`div`);return u.className=`action-list-item-inline-toggle`,e.append(u),{container:e,icon:t,text:n,detail:o,badge:r,description:i,groupTitle:a,keybinding:s,toolbar:c,submenuIndicator:l,inlineToggleContainer:u,elementDisposables:new A}}renderElement(e,t,r){if(r.elementDisposables.clear(),e.iconClasses?.length?(r.icon.className=[`icon`,...e.iconClasses].join(` `),r.icon.style.color=``):e.group?.icon?(r.icon.className=w.asClassName(e.group.icon),r.icon.style.color=e.group.icon.color?jn(e.group.icon.color.id):``):(r.icon.className=w.asClassName(k.lightBulb),r.icon.style.color=`var(--vscode-editorLightBulb-foreground)`),!e.item&&!e.standaloneToggle||!e.label)return;if(et(!e.hideIcon,r.icon),e.isSectionToggle){let t=e.group?.icon===k.chevronDown;r.container.setAttribute(`aria-expanded`,String(t))}else r.container.removeAttribute(`aria-expanded`);r.previousClassNames?.length&&r.container.classList.remove(...r.previousClassNames);let i=e.className?.split(/\s+/).filter(e=>e.length>0)??[];if(r.container.classList.toggle(`action-list-custom`,i.length>0),i.length&&r.container.classList.add(...i),r.previousClassNames=i,r.text.textContent=ip(e.label),e.badge?(r.badge.textContent=e.badge,r.badge.style.display=``):(r.badge.textContent=``,r.badge.style.display=`none`),e.keybinding)r.description.textContent=e.keybinding.getLabel(),r.description.style.display=`inline`,r.description.style.letterSpacing=`0.5px`;else if(e.description){if(oc(r.description),typeof e.description==`string`)r.description.textContent=ip(e.description);else{let t=Ar(e.description,{actionHandler:t=>{let n=Ot.parse(t);this._linkHandler?this._linkHandler(n,e):this._openerService.open(n,{allowCommands:!0})}});r.elementDisposables.add(t),r.description.appendChild(t.element)}r.description.style.display=`inline`}else r.description.textContent=``,r.description.style.display=`none`;let a=this._groupTitleByIndex.get(t);a?(r.groupTitle.textContent=a,r.groupTitle.style.display=``):(r.groupTitle.textContent=``,r.groupTitle.style.display=`none`),e.detail?(r.detail.textContent=ip(e.detail),r.detail.style.display=``):(r.detail.textContent=``,r.detail.style.display=`none`),r.container.classList.toggle(`has-detail`,!!e.detail),oc(r.inlineToggleContainer);let o=e.standaloneToggle??e.inlineToggle;if(o){let t=document.createElement(`span`);t.className=`action-list-item-inline-toggle-label`,t.textContent=ip(o.label),e.standaloneToggle||r.inlineToggleContainer.append(t),r.inlineToggleContainer.style.display=``,r.container.classList.toggle(`has-inline-toggle`,!!e.inlineToggle),r.container.classList.toggle(`has-standalone-toggle`,!!e.standaloneToggle);let i=r.elementDisposables.add(new Lf({ariaLabel:o.title??o.label,checked:o.checked,disabled:o.disabled}));r.inlineToggleContainer.append(i.domNode),e.standaloneToggle&&r.elementDisposables.add(this._registerStandaloneToggle(e,i)),r.elementDisposables.add(i.onChange(()=>o.onChange(i.checked))),r.elementDisposables.add(V(r.inlineToggleContainer,n.CLICK,e=>e.stopPropagation()))}else r.inlineToggleContainer.style.display=`none`,r.container.classList.remove(`has-inline-toggle`),r.container.classList.remove(`has-standalone-toggle`);let s=this._keybindingService.lookupKeybinding(Wf)?.getLabel(),c=this._keybindingService.lookupKeybinding(Gf)?.getLabel();r.container.classList.toggle(`option-disabled`,!!e.disabled),e.hover===void 0?e.tooltip?r.container.title=e.tooltip:e.disabled?r.container.title=e.label:e.standaloneToggle||this._hideDefaultKeybindingTooltip?r.container.title=``:s&&c?this._supportsPreview&&e.canPreview?r.container.title=S(1731,`{0} to Apply, {1} to Preview`,s,c):r.container.title=S(1732,`{0} to Apply`,s):r.container.title=``:r.container.title=``,oc(r.toolbar);let l=[...e.toolbarActions??[]];if(e.onRemove&&l.push(ae({id:qf,label:S(1733,`Remove`),class:w.asClassName(k.close),run:async()=>{await e.onRemove(),this._onRemoveItem?.(e)}})),r.container.classList.toggle(`has-toolbar`,l.length>0),l.length>0){let t=new or(r.toolbar);r.elementDisposables.add(t),this._stopToolbarPointerPropagation?(r.elementDisposables.add(xl(r.toolbar,e=>{e.preventDefault(),e.stopPropagation()})),r.elementDisposables.add(V(r.toolbar,n.CLICK,e=>e.stopPropagation())),r.elementDisposables.add(V(r.toolbar,Ru.Tap,e=>e.stopPropagation()))):r.elementDisposables.add(xl(r.toolbar,e=>e.preventDefault())),t.push(l,{icon:!0,label:!1}),r.elementDisposables.add(this._registerToolbar(e,t))}Zf(e)?(r.submenuIndicator.className=`action-list-submenu-indicator has-submenu `+w.asClassName(k.chevronRight),r.submenuIndicator.style.display=``,r.submenuIndicator.style.visibility=``,r.elementDisposables.add(V(r.submenuIndicator,n.CLICK,t=>{t.stopPropagation(),this._onShowSubmenu?.(e)}))):this._reservesSubmenuSpace()?(r.submenuIndicator.className=`action-list-submenu-indicator`,r.submenuIndicator.style.display=``,r.submenuIndicator.style.visibility=`hidden`):(r.submenuIndicator.className=`action-list-submenu-indicator`,r.submenuIndicator.style.display=`none`),Xf(e)?(r.container.setAttribute(`aria-haspopup`,e.hover?.expandable?`dialog`:`menu`),r.container.setAttribute(`aria-expanded`,`false`)):(r.container.removeAttribute(`aria-haspopup`),e.isSectionToggle||r.container.removeAttribute(`aria-expanded`))}disposeTemplate(e){e.keybinding.dispose(),e.elementDisposables.dispose()}};Qf=Vf([Hf(10,Mr),Hf(11,_n)],Qf);var $f=class extends UIEvent{constructor(){super(`acceptSelectedAction`)}},ep=class extends UIEvent{constructor(){super(`previewSelectedAction`)}};function tp(e){if(e.kind===`action`)return e.label}var np=Uf=class extends T{constructor(e,t,r,i,a,o,s,c,l){if(super(),this._supportsPreview=t,this._delegate=i,this._options=o,this._keybindingService=s,this._openerService=c,this._instantiationService=l,this._headerLineHeight=24,this._separatorLineHeight=8,this.cts=this._register(new Gn),this._submenuDisposables=this._register(new A),this._submenuHoverActionElements=[],this._itemMoveAnimation=this._register(new un),this._collapsedSections=new Set,this._filterText=``,this._imeSessionInProgress=!1,this._isMeasuringWidth=!1,this._suppressHover=!1,this._hoverEnabled=!0,this._ignoreInitialHover=!0,this._hasLaidOut=!1,this._filterCts=this._register(new un),this._groupTitleByIndex=new Map,this._standaloneToggles=new Map,this._itemToolbars=new Map,this._onDidRequestLayout=this._register(new h),this.onDidRequestLayout=this._onDidRequestLayout.event,this._visibleMenuItems=r,this._initialFocusItemId=this._options?.initialFocusItemId,this._filterText=this._options?.showFilter?this._options.initialFilterValue??``:``,this.domNode=document.createElement(`div`),this.domNode.classList.add(`actionList`),this._options?.inlineDescription&&this.domNode.classList.add(`inline-description`),this._options?.className){let e=this._options.className.split(/\s+/).filter(e=>e.length>0);e.length>0&&this.domNode.classList.add(...e)}if(this._actionLineHeight=24,this._submenuContainer=document.createElement(`div`),this._submenuContainer.className=`action-list-submenu-panel action-widget`,this._submenuContainer.style.display=`none`,this._options?.persistentHover&&(this._submenuContainer.style.boxSizing=`border-box`),this._submenuContainer.tabIndex=-1,this.domNode.append(this._submenuContainer),this._register(V(this._submenuContainer,`keydown`,e=>{if((e.key===`Enter`||e.key===` `)&&this._currentSubmenuElement?.hover?.tabThroughPanel){let t=qn(e.target)?e.target:void 0;if(t&&this._currentSubmenuElement.hover.getTabbableElements?.().includes(t)){e.stopPropagation();return}}if(e.key!==`ArrowLeft`&&e.key!==`Escape`)return;mr.stop(e,!0);let t=e.key===`Escape`&&this._currentSubmenuWidget!==void 0;if(this._hideSubmenu(),t){this.hide();return}this._setKeyboardNavigation(!0),this._list.domFocus()})),this._register(V(this._submenuContainer,`mouseenter`,()=>{this._cancelSubmenuHide(),this._usesSubmenuPointerIntent()&&(this._cancelSubmenuShow(),this._resetSubmenuPointer())})),this._register(V(this._submenuContainer,`mouseleave`,()=>{this._scheduleSubmenuHide()})),this._register(V(this.domNode,n.MOUSE_LEAVE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer()})),this._usesSubmenuPointerIntent()&&this._register(V(this.domNode,n.MOUSE_MOVE,e=>{qn(e.target)&&this._expandedTrigger?.contains(e.target)&&this._updateSubmenuPointer(e)})),this._register(xt(()=>{this._cancelSubmenuHide(),this._cancelSubmenuShow()})),this._options?.collapsedByDefault)for(let e of this._options.collapsedByDefault)this._collapsedSections.add(e);let u={getHeight:e=>this._getItemHeight(e),getTemplateId:e=>e.kind},d=()=>{let e=this._options?.reserveSubmenuSpace??!0;return e===`always`||e&&this._allMenuItems.some(Zf)};this._list=this._register(new Mt(e,this.domNode,u,[new Qf(this._supportsPreview,e=>this._removeItem(e),e=>this._showSubmenuForItem(e),d,this._groupTitleByIndex,this._options?.linkHandler,this._options?.hideDefaultKeybindingTooltip??!1,this._options?.stopToolbarPointerPropagation??!1,(e,t)=>(this._standaloneToggles.set(e,t),xt(()=>{this._standaloneToggles.get(e)===t&&this._standaloneToggles.delete(e)})),(e,t)=>(this._itemToolbars.set(e,t),this._updateToolbarFocusability(),xt(()=>{this._itemToolbars.get(e)===t&&this._itemToolbars.delete(e)})),this._keybindingService,this._openerService),new Jf,new Yf],{keyboardSupport:!1,typeNavigationEnabled:!this._options?.showFilter&&!this._options?.onType,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:tp},accessibilityProvider:{getAriaLabel:e=>{if(e.kind===`action`){let t=e.label?ip(e?.label):``;if(e.badge&&(t=t+`, `+ip(e.badge)),e.detail&&(t=t+`, `+ip(e.detail)),e.ariaDescription)t=t+`, `+ip(e.ariaDescription);else if(e.description){let n=typeof e.description==`string`?e.description:e.description.value;t=t+`, `+ip(n)}if(e.hover?.content&&!e.ariaDescription&&!e.description){let n=e.hover.content,r=typeof n==`string`?n:en(n)?n.value:qn(n)?n.textContent??void 0:void 0;r&&(!e.detail||ip(e.detail)!==ip(r))&&(t=t+`, `+ip(r))}e.group?.title&&(t=t+`, `+e.group.title);let n=e.standaloneToggle??e.inlineToggle;return n&&(t=e.standaloneToggle?n.checked?S(1734,`{0}, on`,n.label):S(1735,`{0}, off`,n.label):t+`, `+(n.checked?S(1736,`{0}, on`,n.label):S(1737,`{0}, off`,n.label))),e.disabled&&(t=S(1738,`{0}, Disabled Reason: {1}`,t,e.disabled)),e.submenuActions?.length&&(t=S(1739,`{0}, use right arrow to access options`,t)),t}return null},getWidgetAriaLabel:()=>S(1740,`Action Widget`),getSetSize:()=>this._visibleMenuItems.filter(e=>e.kind===`action`).length,getPosInSet:(e,t)=>Math.max(this._visibleMenuItems.slice(0,t+1).filter(e=>e.kind===`action`).length,1),getRole:e=>{switch(e.kind){case`action`:return`option`;case`separator`:return`separator`;default:return`separator`}},getWidgetRole:()=>`listbox`,...a}})),this._list.style(ru),this._register(this._list.onKeyDown(()=>this._setKeyboardNavigation(!0))),this._register(V(this._list.getHTMLElement(),n.MOUSE_MOVE,e=>{(e.movementX!==0||e.movementY!==0)&&this._setKeyboardNavigation(!1)})),this._register(this._list.onMouseClick(e=>this.onListClick(e))),this._register(this._list.onMouseOver(e=>{this._ignoreInitialHover||this.onListHover(e)}));let f=this._register(new un);if(f.value=this._list.onMouseMove(e=>{(e.browserEvent.movementX!==0||e.browserEvent.movementY!==0)&&(f.clear(),this._ignoreInitialHover=!1,this.onListHover(e))}),this._register(this._list.onMouseDown(()=>{f.clear(),this._ignoreInitialHover=!1,this._setKeyboardNavigation(!1)})),this._register(this._list.onDidChangeFocus(()=>{this._updateToolbarFocusability(),this.onFocus()})),this._register(this._list.onDidChangeSelection(e=>this.onListSelection(e))),this._register(this._list.onDidScroll(()=>{this._isMeasuringWidth||this._layoutSubmenu?.()})),this._allMenuItems=[...r],this._options?.showFilter||this._options?.secondaryHeading){this._filterContainer=document.createElement(`div`),this._filterContainer.className=`action-list-filter`;let e=H(this._filterContainer,R(`.action-list-filter-row`));if(this._options?.showFilter){if(this._filterInput=document.createElement(`input`),this._filterInput.type=`text`,this._filterInput.className=`action-list-filter-input`,this._filterInput.placeholder=this._options?.filterPlaceholder??S(1741,`Search...`),this._filterInput.value=this._filterText,this._filterInput.setAttribute(`aria-label`,S(1742,`Filter items`)),e.appendChild(this._filterInput),this._register(V(this._filterInput,n.KEY_DOWN,e=>{if(this._setKeyboardNavigation(!0),e.isComposing||!this._filterInput?.closest(`.action-list-submenu-panel`))return;let t=this._keybindingService.softDispatch(new Zt(e),this._filterInput);(t.kind===2&&t.commandId!==null&&Kf.has(t.commandId)||e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey)&&e.stopPropagation()})),this._register(V(this._filterInput,n.MOUSE_DOWN,()=>this._setKeyboardNavigation(!1))),this._options.tabThroughItemActions&&this._register(V(this._filterInput,`keydown`,e=>this._handleTabThroughPanelKeyDown(e),!0)),this._options.filterAsCombobox){let e=this._list.getHTMLElement();e.id=this._list.domId,this._filterInput.setAttribute(`role`,`combobox`),this._filterInput.setAttribute(`aria-label`,this._filterInput.placeholder),this._filterInput.setAttribute(`aria-autocomplete`,`list`),this._filterInput.setAttribute(`aria-expanded`,`true`),this._filterInput.setAttribute(`aria-controls`,e.id),this._register(this._list.onDidChangeFocus(()=>this._updateFilterActiveDescendant())),this._register(V(this._filterInput,`focus`,()=>this._updateFilterActiveDescendant())),this._register(V(this._filterInput,`blur`,()=>this._updateFilterActiveDescendant())),this._register(Ml(this._filterInput,`keydown`,e=>{if(this._imeSessionInProgress||e.browserEvent.isComposing||e.keyCode===114||e.keyCode===15||e.keyCode===17||e.keyCode===14||e.keyCode===13){e.stopPropagation();return}let t=e.keyCode===16||e.keyCode===18;if(!(!t&&e.keyCode!==3)){if(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey){t&&e.stopPropagation();return}mr.stop(e,!0),e.keyCode===16?this.focusPrevious():e.keyCode===18?this.focusNext():this.acceptSelected()}}))}let t=this._options?.filterActions??[];if(t.length>0){let n=H(e,R(`.action-list-filter-actions`));this._register(new or(n)).push(t,{icon:!0,label:!1})}let r=()=>{let e=this._filterInput.value;this._imeSessionInProgress||e===this._filterText&&!this._filterCts.value?.token.isCancellationRequested||(this._filterText=e,this._applyOrUpdateFilter())};this._register(V(this._filterInput,`compositionstart`,()=>{this._imeSessionInProgress=!0,this._filterCts.value?.cancel()})),this._register(V(this._filterInput,`compositionend`,()=>{this._imeSessionInProgress=!1,r()})),this._register(V(this._filterInput,`input`,r))}if(this._options?.secondaryHeading){let t=H(e,R(`.action-list-filter-label`));t.textContent=this._options.secondaryHeading}}if(this._options?.footerText&&(this._footerContainer=document.createElement(`div`),this._footerContainer.className=`action-list-footer`,this._footerContainer.textContent=this._options.footerText),this._options?.headerText){if(this._headerContainer=document.createElement(`div`),this._headerContainer.className=`action-list-header`,this._options.headerIcon){let e=H(this._headerContainer,R(`span.action-list-header-icon`));e.classList.add(...w.asClassNameArray(this._options.headerIcon)),e.setAttribute(`aria-hidden`,`true`)}let e=H(this._headerContainer,R(`span.action-list-header-text`));if(e.textContent=this._options.headerText,this._register(V(this._headerContainer,n.MOUSE_ENTER,()=>{this._options?.persistentHover?(this._cancelSubmenuShow(),this._resetSubmenuPointer()):this._hideSubmenu()})),this._options.headerLink){let{label:t,uri:n}=this._options.headerLink;e.textContent+=` `,this._register(this._instantiationService.createInstance(Bf,e,{label:t,href:n.toString(!0)},{}))}if(this._options.headerDismiss){let e=this._options.headerDismiss,t=H(this._headerContainer,R(`span.action-list-header-dismiss`));t.appendChild(R(w.asCSSSelector(k.close))),t.tabIndex=0,t.setAttribute(`role`,`button`),t.setAttribute(`aria-label`,S(1743,`Dismiss`));let r=()=>{e(),this.focus(),this._headerContainer?.remove(),this._headerContainer=void 0,this._onDidRequestLayout.fire()};this._register(Es(t,()=>r())),this._register(V(t,n.KEY_DOWN,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())}))}}this._applyFilter(),this._list.length&&this._focusCheckedOrFirst(),this._register(V(this.domNode,`keydown`,e=>{if(e.key===`ArrowRight`&&!e.isComposing){let t=this._list.getFocus();if(t.length>0){let n=this._list.element(t[0]);if(n?.submenuActions?.length||n?.hover?.expandable){mr.stop(e,!0);let r=this._getRowElement(t[0]);r&&(this._showSubmenuForElement(n,r),n.hover?.tabThroughPanel?this._focusFirstTabThroughPanelControl(n,r):this._currentSubmenuWidget?this._currentSubmenuWidget.focus():this._submenuContainer.focus())}}}})),this._register(V(this.domNode,`keydown`,e=>this._handleTabThroughPanelKeyDown(e),!0)),(this._filterInput||this._options?.onType)&&this._register(V(this.domNode,`keydown`,e=>{let t=e.target;(this._options?.onType||this._options?.filterAsCombobox)&&qn(t)&&(Me(t)||t.closest(`button, a, [contenteditable="true"], .action-list-submenu-panel`))||(!this._filterInput||!Du(this._filterInput))&&!e.isComposing&&e.key.length===1&&e.key!==` `&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),e.stopPropagation(),this._filterInput?(this._filterInput.focus(),this._filterInput.value=e.key,this._filterText=e.key,this._applyOrUpdateFilter()):this._options?.onType?.(e.key))}))}_toggleSection(e){let t=this._collapsedSections.has(e);if(t)this._collapsedSections.delete(e);else{this._collapsedSections.add(e);let t=this.getFocusedElement();if(t?.section===e&&!t.isSectionToggle){let t=this._visibleMenuItems.findIndex(t=>t.section===e&&t.isSectionToggle);t>=0&&this._list.setFocus([t])}}this._options?.onDidToggleSection?.(e,this._collapsedSections.has(e)),this._applyFilter(),t&&this._revealFirstItemOfSection(e)}_revealFirstItemOfSection(e){for(let t=0;t<this._list.length;t++){let n=this._list.element(t);if(n.section===e&&!n.isSectionToggle){this._list.reveal(t);return}}}_applyOrUpdateFilter(){if(!this._delegate.onFilter){this._applyFilter();return}let e=this._filterText;this._filterCts.value?.cancel();let t=new Gn;this._filterCts.value=t,this._delegate.onFilter(e,t.token).then(e=>{t.token.isCancellationRequested||(this._allMenuItems=[...e],this._applyFilter(!0))}).catch(()=>{}).finally(()=>{this._filterCts.value===t&&!t.token.isCancellationRequested&&this._filterCts.clear()})}_applyFilter(e=!1,t=!0,n){this._itemMoveAnimation.clear();let r=e?``:this._filterText.toLowerCase(),i=!e&&r.length>0,a=[],o=this._list.getFocus(),s;if(o.length>0&&(s=this._list.element(o[0])),i){let e,t=[],n=!1,i=()=>{e&&n&&a.push(e),a.push(...t),e=void 0,t=[],n=!1},o=e=>{let t=(e.label??``).toLowerCase(),n=typeof e.description==`string`?e.description:e.description?.value??``;return t.includes(r)||n.toLowerCase().includes(r)};for(let r of this._allMenuItems)if(r.kind!==`header`){if(r.kind===`separator`){i(),e=r.label?r:void 0;continue}if(r.showAlways){t.push(r);continue}if(!r.isSectionToggle){if(r.filterItems){let e=o(r)?r.filterItems:r.filterItems.filter(o);e.length>0&&(n=!0,t.push(...e));continue}o(r)&&(n=!0,t.push(r))}}i()}else for(let e of this._allMenuItems){if(e.kind===`header`){a.push(e);continue}if(e.kind===`separator`){if(e.section&&this._collapsedSections.has(e.section))continue;a.push(e);continue}if(e.isSectionToggle&&e.section){let t=this._collapsedSections.has(e.section);a.push({...e,group:{...e.group,icon:t?k.chevronRight:k.chevronDown}});continue}e.section&&this._collapsedSections.has(e.section)||a.push(e)}let c=[],l=!1;for(let e=0;e<a.length;e++)c[e]=l,a[e].kind===`action`&&(l=!0);let u=[],d=!1;for(let e=a.length-1;e>=0;e--){if(a[e].kind===`action`){d=!0;continue}a[e].kind===`separator`&&(u[e]=d,d=!1)}for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.kind!==`separator`)continue;let n=u[e],r=!t.label&&!c[e];(!n||r)&&a.splice(e,1)}this._options?.showGroupTitleOnFirstItem&&this._recomputeGroupTitles(a);let f=this._filterInput&&Du(this._filterInput),p=We(this._list.getHTMLElement());if(this._visibleMenuItems=a,this._list.splice(0,this._list.length,a),t&&this._onDidRequestLayout.fire(),f)this._filterInput?.focus(),this._focusCheckedOrFirst();else if(this._hasLaidOut&&(s||n)){let e=n??s?.item?.id;if(e){for(let t=0;t<this._list.length;t++)if(this._list.element(t).item?.id===e){this._list.setFocus([t]),this._list.reveal(t);break}p&&(this._focusCheckedOrFirst(),this._list.domFocus())}}}get filterContainer(){return this._filterContainer}get footerContainer(){return this._footerContainer}get headerContainer(){return this._headerContainer}get filterInput(){return this._filterInput}get closeAnimation(){return this._options?.closeAnimation}focusCondition(e){return!e.disabled&&e.kind===`action`}_setKeyboardNavigation(e){if(this._keyboardNavigation===e)return;this._keyboardNavigation=e;let t=this._list.getHTMLElement();t.classList.toggle(`keyboard-navigation`,e===!0),t.classList.toggle(`mouse-navigation`,e===!1)}_updateFilterActiveDescendant(){if(!this._filterInput)return;let[e]=this._list.getFocus();Du(this._filterInput)&&e!==void 0?this._filterInput.setAttribute(`aria-activedescendant`,this._list.getElementID(e)):this._filterInput.removeAttribute(`aria-activedescendant`)}focus(){if(this._setKeyboardNavigation(void 0),this._filterInput&&this._options?.focusFilterOnOpen){this._filterInput.focus(),this._focusCheckedOrFirst();return}this._list.domFocus(),this._focusCheckedOrFirst(),this._showTabThroughPanelForFocusedItem()}clearFocus(){this._list.setFocus([])}getFocusedElement(){let e=this._list.getFocus();if(e.length>0)return this._list.element(e[0])}_updateToolbarFocusability(){if(!this._options?.tabThroughItemActions)return;let[e]=this._list.getFocus(),t=e!==void 0&&e<this._list.length?this._list.element(e):void 0;for(let[e,n]of this._itemToolbars)n.setFocusable(e===t)}_focusCheckedOrFirst(){let e=this._suppressHover;this._suppressHover=!0;try{let e=this._initialFocusItemId;if(this._initialFocusItemId=void 0,e)for(let t=0;t<this._list.length;t++){let n=this._list.element(t);if(this.focusCondition(n)&&n.item?.id===e){this._list.setFocus([t]),this._list.reveal(t);return}}let[t]=this._list.getFocus();if(t!==void 0){let e=this._list.element(t);if(e&&this.focusCondition(e)){this._list.reveal(t);return}}for(let e=0;e<this._list.length;e++){let t=this._list.element(e);if(this.focusCondition(t)&&t.item?.checked){this._list.setFocus([e]),this._list.reveal(e);return}}this._list.focusFirst(void 0,this.focusCondition);let n=this._list.getFocus();n.length>0&&this._list.reveal(n[0])}finally{this._suppressHover=e,this._options?.filterAsCombobox&&this._updateFilterActiveDescendant()}}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._filterCts.value?.cancel(),this._filterCts.clear(),this._hideSubmenu()}clearFilter(){return this._filterInput&&this._filterText?(this._filterInput.value=``,this._filterText=``,this._applyOrUpdateFilter(),!0):!1}get hasDynamicHeight(){return this._options?.showFilter?!0:this._allMenuItems.some(e=>e.isSectionToggle)}get lineHeight(){return this._actionLineHeight}_getItemHeight(e){return this._itemHeightWith(e,this._options)}_itemHeightWith(e,t){switch(e.kind){case`header`:return this._headerLineHeight;case`separator`:return e.label?this._actionLineHeight:this._separatorLineHeight;default:return e.inlineToggle?t?.inlineToggleItemHeight??70:e.detail?t?.detailItemHeight??48:this._actionLineHeight}}computeFullHeight(){return this.computeHeightForItems(this._allMenuItems,void 0,this._options)}computeHeightForItems(e,t,n){let r=0;for(let i of e)t&&i.section&&!i.isSectionToggle&&t.has(i.section)||(r+=this._itemHeightWith(i,n));return r}computeListHeight(){let e=this._list.length,t=0;for(let n=0;n<e;n++){let e=this._list.element(n);t+=this._getItemHeight(e)}return t}layout(e,t){this._hasLaidOut=!0,this._list.layout(e,t),this.domNode.style.height=`${e}px`;let n=this.domNode.parentElement;n&&this._filterContainer?.parentElement===n&&n.insertBefore(this._filterContainer,this.domNode),this._layoutSubmenu?.()}computeMaxWidth(e){let t=this._list.length,n=Math.max(e,this._options?.minWidth??0),r=this._options?.maxWidth??1/0,i=Math.max(r,n),a=e=>Math.min(Math.max(e,n),i),o=this._allMenuItems.length;if(o>=50)return a(380);if(o>t){let e=[];for(let n=0;n<t;n++)e.push(this._list.element(n));let n=this._list.renderHeight,r=this._list.scrollTop,i=this._list.getFocus(),o=this._isMeasuringWidth;this._isMeasuringWidth=!0;try{let e=[...this._allMenuItems];this._list.splice(0,t,e);let n=0;for(let t of e)n+=this._getItemHeight(t);this._list.layout(n);let r=this._measureItemWidths(e);return a(Math.max(...r))}finally{try{this._list.splice(0,this._list.length,e),this._list.layout(n),this._list.scrollTop=r;let t=this._suppressHover;this._suppressHover=!0;try{this._list.setFocus(i)}finally{this._suppressHover=t}}finally{this._isMeasuringWidth=o}}}let s=[];for(let e=0;e<t;e++)s.push(this._list.element(e));let c=this._measureItemWidths(s);return a(Math.max(...c))}focusPrevious(){if(this._setKeyboardNavigation(!0),this._focusFilterResult(`previous`))return;if(this._filterInput&&Du(this._filterInput)){this._list.domFocus();let e=this._list.getFocus();if(e.length>0){this._list.focusPrevious(1,!1,void 0,this.focusCondition);let t=this._list.getFocus();t.length>0&&t[0]>=e[0]?this._filterInput.focus():t.length>0&&this._list.reveal(t[0])}else{this._list.focusLast(void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}return}let e=this._list.getFocus();this._list.focusPrevious(1,!0,void 0,this.focusCondition);let t=this._list.getFocus();if(t.length>0){if(this._filterInput&&e.length>0&&t[0]>e[0]){this._list.setFocus([]),this._filterInput.focus();return}this._list.reveal(t[0])}}focusNext(){if(this._setKeyboardNavigation(!0),this._focusFilterResult(`next`))return;if(this._filterInput&&Du(this._filterInput)){if(this._list.domFocus(),this._list.getFocus().length>0){this._list.focusNext(1,!1,void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}else{this._list.focusFirst(void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}return}let e=this._list.getFocus();this._list.focusNext(1,!0,void 0,this.focusCondition);let t=this._list.getFocus();if(t.length>0){if(this._filterInput&&e.length>0&&t[0]<e[0]){this._list.setFocus([]),this._filterInput.focus();return}this._list.reveal(t[0])}}_focusFilterResult(e){if(!this._options?.filterAsCombobox||!this._filterInput||!Du(this._filterInput))return!1;e===`previous`?this._list.focusPrevious(1,!0,void 0,this.focusCondition):this._list.focusNext(1,!0,void 0,this.focusCondition);let[t]=this._list.getFocus();return t!==void 0&&this._list.reveal(t),!0}collapseFocusedSection(){let e=this._getFocusedSection();e&&!this._collapsedSections.has(e)&&this._toggleSection(e)}expandFocusedSection(){let e=this._getFocusedSection();e&&this._collapsedSections.has(e)&&this._toggleSection(e)}toggleFocusedSection(){let e=this._list.getFocus();if(e.length===0)return!1;let t=this._list.element(e[0]);return t.isSectionToggle&&t.section?(this._toggleSection(t.section),!0):!1}_getFocusedSection(){let e=this._list.getFocus();if(e.length===0)return;let t=this._list.element(e[0]);return t.isSectionToggle&&t.section,t.section}acceptSelected(e){let t=this._list.getFocus();if(t.length===0)return;let n=t[0],r=this._list.element(n);if(!this.focusCondition(r))return;let i=e?new ep:new $f;this._list.setSelection([n],i)}onListSelection(e){if(!e.elements.length)return;let t=e.elements[0];if(t.standaloneToggle){this._list.setSelection([]);let e=this._standaloneToggles.get(t);e&&!e.disabled&&(e.checked=!e.checked,t.standaloneToggle.onChange(e.checked));return}if(t.isSectionToggle&&t.section){this._list.setSelection([]);let e=t.section;queueMicrotask(()=>{this._toggleSection(e)});return}let n=Js(e.browserEvent)||e.browserEvent?.type===Ru.Tap;if(n){let t=e.browserEvent.target;if(qn(t)&&(t.closest(`.action-list-item-toolbar`)||t.closest(`.action-list-submenu-indicator`)||t.closest(`.action-list-item-inline-toggle`))){this._list.setSelection([]);return}}if(t.openSubmenuOnClick&&t.submenuActions?.length&&(n||e.browserEvent instanceof $f)){this._list.setSelection([]),this._showSubmenuForItem(t),n||this._currentSubmenuWidget?.focus();return}if(t.item&&this.focusCondition(t)){let n=e.browserEvent instanceof ep;this._delegate.onSelect(t.item,n&&this._supportsPreview)}else this._list.setSelection([])}onFocus(){let e=this._list.getFocus();if(e.length===0)return;let t=e[0],n=this._list.element(t);this._delegate.onFocus?.(n.item),this._suppressHover||(this._options?.persistentHover&&(this._cancelSubmenuShow(),this._resetSubmenuPointer(),this._list.reveal(t)),this._showHoverForElement(n,t))}_removeItem(e){let t=this._allMenuItems.indexOf(e);t>=0&&(this._allMenuItems.splice(t,1),this._applyFilter())}_recomputeGroupTitles(e){this._groupTitleByIndex.clear();let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];r.kind===`action`&&r.group?.title&&!t.has(r.group.title)&&(t.add(r.group.title),this._groupTitleByIndex.set(n,r.group.title))}}_measureItemWidths(e){let t=[];for(let n=0;n<e.length;n++){let r=this._getRowElement(n);r&&(r.style.width=`auto`,t.push({element:r,item:e[n]}))}try{return t.map(({element:e,item:t})=>e.getBoundingClientRect().width+(t.detail?0:this._computeToolbarWidth(t)))}finally{for(let{element:e}of t)e.style.width=``}}_computeToolbarWidth(e){let t=e.toolbarActions?.length??0;return e.onRemove&&t++,t===0?0:t*22+6+10}_getRowElement(e){return e<0?null:this.domNode.ownerDocument.getElementById(this._list.getElementID(e))}_showTabThroughPanelForFocusedItem(){let e=this._list.getFocus();if(e.length===0)return;let t=e[0],n=this._list.element(t);if(!n.hover?.tabThroughPanel)return;let r=this._getRowElement(t);r&&this._showSubmenuForElement(n,r)}_getTabThroughPanelControls(e,t){return e.hover?.tabThroughPanel&&this._currentSubmenuElement!==e&&this._showSubmenuForElement(e,t),{toolbar:this._itemToolbars.get(e),panelControls:[...e.hover?.getTabbableElements?.()??[],...this._submenuHoverActionElements]}}_focusFirstTabThroughPanelControl(e,t){let n=this._getTabThroughPanelControls(e,t);n.toolbar?.length()?n.toolbar.focus(0):(n.panelControls[0]??this._list.getHTMLElement()).focus()}_handleTabThroughPanelKeyDown(e){if(e.isComposing)return;let t=this._list.getFocus();if(t.length===0)return;let n=t[0],r=this._list.element(n);if(!r.hover?.tabThroughPanel&&!this._options?.tabThroughItemActions)return;let i=this._getRowElement(n),a=vo();if(!i||!qn(a))return;let o=this._getTabThroughPanelControls(r,i),s=o.toolbar?.isFocused()??!1,c=this._submenuContainer.contains(a);if((e.key===`ArrowUp`||e.key===`ArrowDown`)&&(s||c)){mr.stop(e,!0),this._list.domFocus(),e.key===`ArrowUp`?this.focusPrevious():this.focusNext();return}if(e.key!==`Tab`||e.ctrlKey||e.metaKey||e.altKey)return;let l;if(e.shiftKey){if(c){let t=o.panelControls.indexOf(a);if(t>0)l=o.panelControls[t-1];else if(o.toolbar?.length()){mr.stop(e,!0),o.toolbar.focus(o.toolbar.length()-1);return}else l=this._list.getHTMLElement()}else if(o.toolbar?.isFocused()){let t=o.toolbar.viewItems.findIndex((e,t)=>o.toolbar?.isFocused(t));if(t>0){mr.stop(e,!0),o.toolbar.focus(t-1);return}l=this._options?.filterAsCombobox?this._filterInput:this._list.getHTMLElement()}}else if(a===this._list.getHTMLElement()||a===this._filterInput){if(o.toolbar?.length()){mr.stop(e,!0),o.toolbar.focus(0);return}l=o.panelControls[0]}else if(o.toolbar?.isFocused()){let t=o.toolbar.viewItems.findIndex((e,t)=>o.toolbar?.isFocused(t));if(t+1<o.toolbar.length()){mr.stop(e,!0),o.toolbar.focus(t+1);return}l=o.panelControls[0]}else{let e=o.panelControls.indexOf(a);e>=0&&(l=o.panelControls[e+1]??this._list.getHTMLElement())}l&&(mr.stop(e,!0),l.focus())}_showHoverForElement(e,t){if(this._currentSubmenuElement===e)return;let n=!!e.hover?.content,r=!!e.submenuActions?.length;if(n||r){let n=this._getRowElement(t);n&&this._showSubmenuForElement(e,n);return}this._options?.persistentHover||this._hideSubmenu()}_showSubmenuForItem(e){let t=this._list.indexOf(e);if(t>=0){let n=this._getRowElement(t);n&&this._showSubmenuForElement(e,n)}}_showSubmenuForElement(e,t){if(!this._hoverEnabled||this._currentSubmenuElement===e)return;this._currentSubmenuElement=e,this._clearSubmenuContainer(),t.setAttribute(`aria-expanded`,`true`),this._expandedTrigger=t,this._submenuPanelClassName=e.hover?.panelClassName,this._submenuPanelClassName&&this._submenuContainer.classList.add(this._submenuPanelClassName);let r=e.hover?.preserveVerticalPosition,i=!!e.submenuActions?.length,a=r?R(`.action-list-submenu-content`):this._submenuContainer,o=r?R(`.action-list-submenu-viewport`,void 0,a):void 0,s=o&&!i?this._submenuDisposables.add(new mu(o,{horizontal:2,vertical:1,consumeMouseWheelIfScrollbarIsNeeded:!0,useShadows:!1})):void 0;s&&o?(this._submenuContainer.appendChild(s.getDomNode()),this._submenuDisposables.add(V(o,n.SCROLL,()=>s.scanDomNode())),this._submenuDisposables.add(V(this._submenuContainer,n.KEY_DOWN,e=>{let t=new Zt(e);(t.equals(12)||t.equals(11))&&(mr.stop(e,!0),s.setScrollPosition({scrollTop:s.getScrollPosition().scrollTop+(t.equals(12)?1:-1)*o.clientHeight}))}))):o&&this._submenuContainer.appendChild(o);let c,l=typeof e.hover?.content==`function`?e.hover.content():e.hover?.content;if(l){if(qn(l))c=l,e.hover?.disposable&&this._register(e.hover.disposable);else{let t=typeof l==`string`?new pi(l):l,n=this._options?.linkHandler,r=Ar(t,{actionHandler:t=>{let r=Ot.parse(t);n?n(r,e):this._openerService.open(r,{allowCommands:!0})}});this._submenuDisposables.add(r),c=r.element}c.classList.add(`action-list-submenu-hover-header`),c.classList.toggle(`content-owns-padding`,e.hover?.contentOwnsPadding===!0),e.submenuActions?.length&&c.classList.add(`has-submenu`),a.appendChild(c)}if(e.hover?.actions?.length){let t=R(`.hover-row.status-bar`),n=H(t,R(`.actions`));for(let t of e.hover.actions){let e=this._keybindingService.lookupKeybinding(t.commandId),r=this._submenuDisposables.add(Wu.render(n,{label:t.label,commandId:t.commandId,run:e=>t.run(e),iconClass:t.iconClass},e?.getLabel()??null));this._submenuHoverActionElements.push(r.actionContainer)}this._submenuContainer.appendChild(t)}this._submenuContainer.style.display=``,this._submenuContainer.style.position=`absolute`,e.hover?.expandable?(this._submenuContainer.setAttribute(`role`,`dialog`),e.label&&this._submenuContainer.setAttribute(`aria-label`,e.label)):this._submenuContainer.removeAttribute(`role`);let u=zu(this.domNode),d=0,f=c?c.offsetWidth:0,p;if(i){let t=this._createSubmenuItems(e.submenuActions),n=this._submenuDisposables.add(this._instantiationService.createInstance(Uf,`submenu`,!1,t,{onHide:()=>{},onSelect:e=>{e.run();let t=this._currentSubmenuElement?.item;this._hideSubmenu(),t&&this._delegate.onSelect(t),this.hide()}},void 0,e.submenuOptions));p=n,n.headerContainer&&a.appendChild(n.headerContainer),n.filterContainer&&a.appendChild(n.filterContainer),a.appendChild(n.domNode),n.footerContainer&&a.appendChild(n.footerContainer),this._currentSubmenuWidget=n,n.clearFocus(),d=n.computeListHeight(),n.layout(d);let r=n.computeMaxWidth(0);f=Math.max(f,r,n.footerContainer?.offsetWidth??0),n.layout(d,f),n.domNode.style.width=`${f}px`,e.submenuOptions&&(this._submenuContainer.style.boxSizing=`border-box`,this._submenuContainer.style.width=`${f+10}px`),this._submenuDisposables.add(n.onDidRequestLayout(()=>{d=n.computeListHeight(),n.layout(d,f),this._layoutSubmenu?.()})),this._submenuDisposables.add(V(a,`keydown`,e=>{e.key===`Escape`?(mr.stop(e,!0),this._hideSubmenu(),this.hide()):e.key===`ArrowLeft`?(mr.stop(e,!0),this._hideSubmenu(),this._setKeyboardNavigation(!0),this._list.domFocus()):e.key===`Enter`||e.key===` `?(mr.stop(e,!0),n.acceptSelected()):e.key===`ArrowDown`?(mr.stop(e,!0),n.focusNext()):e.key===`ArrowUp`&&(mr.stop(e,!0),n.focusPrevious())}))}let m,h,g=()=>{let e=this._currentSubmenuElement;if(!e||this._layoutSubmenu!==g)return;let t=this._list.indexOf(e),n=t>=0?this._getRowElement(t):null,i=this._options?.persistentHover;if(!n&&(!i||!this._allMenuItems.includes(e))){this._hideSubmenu();return}this._expandedTrigger!==n&&(this._expandedTrigger?.hasAttribute(`aria-expanded`)&&this._expandedTrigger.setAttribute(`aria-expanded`,`false`),this._expandedTrigger=n??void 0),n?.setAttribute(`aria-expanded`,`true`);let c=this.domNode.getBoundingClientRect(),l=i||e.hover?.alignToParent,_=l?this.domNode.parentElement?.closest(`.action-widget`)?.getBoundingClientRect()??c:c,v=n?.getBoundingClientRect()??_,y=l||r?ts(this.domNode):1;i&&(this._submenuContainer.style.width=`${_.width/y}px`);let b=this._submenuContainer.getBoundingClientRect(),ee=l?b.width:f+10,te=u.innerWidth-(l?_.right:v.right),ne=_.left,re=l?0:4;if(!l){let e=u.innerWidth-8;ee>e&&(ee=Math.max(e,0)),this._submenuContainer.style.boxSizing=`border-box`,this._submenuContainer.style.width=`${ee}px`}let ie=te>=ee||te>=ne;i&&this._submenuSide&&(this._submenuSide===`right`?te:ne)>=ee&&(ie=this._submenuSide===`right`),i&&(this._submenuSide=ie?`right`:`left`);let ae=ie?_.right-c.left+re:_.left-c.left-ee-re,oe=c.left+ae;oe<4?ae+=4-oe:oe+ee>u.innerWidth-4&&(ae-=oe+ee-(u.innerWidth-4)),this._submenuContainer.style.left=`${ae/y}px`;let se=b.height;r&&(m??=se/y);let ce=m===void 0?se:m*y,le=h===void 0?n&&e.hover?.alignToAnchorTop?v.top-c.top:n?v.top-c.top+(v.height-ce)/2:b.top-c.top:h*y;if(r&&e.hover?.alignToAnchorTop&&o&&p){let e=b.height-o.getBoundingClientRect().height+((p.headerContainer?.offsetHeight??0)+(p.filterContainer?.offsetHeight??0)+(p.footerContainer?.offsetHeight??0)+d)*y;le=Math.min(le,u.innerHeight-c.top-e-8)}let ue=c.top+le+ce;if(ue>u.innerHeight&&!(r&&e.hover?.alignToAnchorTop)&&(le-=ue-u.innerHeight+8),c.top+le<0&&(le=-c.top),r&&(h??=le/y),o&&s){let e=(b.height-s.getDomNode().getBoundingClientRect().height)/y,t=Math.max(0,(u.innerHeight-c.top-le-8)/y-e);o.style.height=`${Math.min(a.getBoundingClientRect().height/y,t)}px`,s.scanDomNode()}else if(o&&p){let e=(b.height-o.getBoundingClientRect().height)/y,t=Math.max(0,(u.innerHeight-c.top-le-8)/y-e),n=(p.headerContainer?.offsetHeight??0)+(p.filterContainer?.offsetHeight??0)+(p.footerContainer?.offsetHeight??0),r=d===0?0:Math.max(this._actionLineHeight,Math.min(d,t-n));p.layout(r,f),o.style.height=`${n+r}px`}this._submenuContainer.style.top=`${le/y}px`};if(this._layoutSubmenu=g,g(),(this._options?.persistentHover||e.hover?.alignToParent||e.hover?.tabThroughPanel||r)&&this._currentSubmenuElement===e){if(!p){let e=this._submenuDisposables.add(new un),t=this._submenuDisposables.add(new ua(`ActionListWidget.hoverPanel`,()=>{e.value||=ar(u,()=>{e.clear(),g()})},u));this._submenuDisposables.add(t.observe(r?a:this._submenuContainer,{box:`border-box`}))}(this._options?.persistentHover||r)&&this._submenuDisposables.add(V(u,n.RESIZE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer(),g()}))}}_createSubmenuItems(e){let t=[],n=e.filter(e=>e instanceof sd).filter(e=>e.actions.length>0);for(let e=0;e<n.length;e++){let r=n[e];r.label&&t.push({kind:`header`,group:{title:r.label},label:r.label});for(let e of r.actions){let n=e,r=n.icon??w.fromId(e.checked?k.check.id:k.blank.id),i=n.hoverContent,a=i?new pi().appendText(`${e.label}\n`).appendMarkdown(i):void 0;t.push({item:e,kind:`action`,label:e.label,description:e.tooltip&&e.tooltip!==e.label?e.tooltip:void 0,group:{title:``,icon:r},hideIcon:!1,hover:a?{content:a}:void 0,tooltip:e.tooltip||e.label,onRemove:n.onRemove,submenuActions:e instanceof sd?[new sd(e.id,``,e.actions)]:void 0})}e<n.length-1&&t.push({kind:`separator`,label:``})}for(let n of e)if(!(n instanceof sd)){let e=n,r=e.icon??w.fromId(n.checked?k.check.id:k.blank.id),i=e.hoverContent,a=i?new pi().appendText(`${n.label}\n`).appendMarkdown(i):void 0;t.push({item:n,kind:`action`,label:n.label,description:n.tooltip&&n.tooltip!==n.label?n.tooltip:void 0,group:{title:``,icon:r},hideIcon:!1,hover:a?{content:a}:void 0,tooltip:n.tooltip||n.label,onRemove:e.onRemove})}return t}_hideSubmenu(){this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._currentSubmenuElement=void 0,this._submenuSide=void 0,this._clearSubmenuContainer(),this._submenuContainer.style.display=`none`}_clearSubmenuContainer(){this._layoutSubmenu=void 0,this._resetSubmenuPointer(),this._submenuContainer.contains(vo())&&this._list.domFocus(),this._submenuDisposables.clear(),this._currentSubmenuWidget=void 0,this._submenuHoverActionElements=[],this._submenuPanelClassName&&=(this._submenuContainer.classList.remove(this._submenuPanelClassName),void 0),this._submenuContainer.removeAttribute(`role`),this._submenuContainer.removeAttribute(`aria-label`),this._expandedTrigger?.hasAttribute(`aria-expanded`)&&this._expandedTrigger.setAttribute(`aria-expanded`,`false`),this._expandedTrigger=void 0,oc(this._submenuContainer),this._submenuContainer.style.width=``,this._submenuContainer.style.boxSizing=this._options?.persistentHover?`border-box`:``}_scheduleSubmenuHide(){this._cancelSubmenuHide(),!this._options?.persistentHover&&(this._submenuHideTimeout=setTimeout(()=>{this._hideSubmenu()},300))}_cancelSubmenuHide(){this._submenuHideTimeout!==void 0&&(clearTimeout(this._submenuHideTimeout),this._submenuHideTimeout=void 0)}_scheduleSubmenuShow(e,t){this._cancelSubmenuShow();let n=this._options?.submenuHoverDelay??500;if(this._usesSubmenuPointerIntent()){n=0;let e=this._submenuPointerOrigin;if(e&&t.clientX!==e.x&&this._currentSubmenuElement&&new Wl(e.x,e.y,this._submenuContainer).contains(t.clientX,t.clientY)){let e=Date.now();this._submenuPointerGraceDeadline??=e+200,n=Math.max(0,this._submenuPointerGraceDeadline-e)}}let r=()=>{this._submenuShowTimeout=void 0;let n=this._list.indexOf(e),r=n>=0?this._getRowElement(n):null;r&&(this._showSubmenuForElement(e,r),this._usesSubmenuPointerIntent()&&this._updateSubmenuPointer(t))};n===0?r():this._submenuShowTimeout=setTimeout(r,n)}_updateSubmenuPointer(e){this._submenuPointerOrigin={x:e.clientX,y:e.clientY},this._submenuPointerGraceDeadline=void 0}_resetSubmenuPointer(){this._submenuPointerOrigin=void 0,this._submenuPointerGraceDeadline=void 0}_usesSubmenuPointerIntent(){return this._options?.persistentHover===!0||this._options?.submenuPointerIntent===!0}_cancelSubmenuShow(){this._submenuShowTimeout!==void 0&&(clearTimeout(this._submenuShowTimeout),this._submenuShowTimeout=void 0)}async onListHover(e){this._setKeyboardNavigation(!1);let t=e.element;if(t&&t.item&&this.focusCondition(t)){let n=typeof e.index==`number`?[e.index]:[],r=vo();if(this._options?.tabThroughItemActions&&this._list.getFocus()[0]!==e.index&&qn(r)&&this.domNode.contains(r)&&r.closest(`.action-list-item-toolbar`)&&this._list.domFocus(),qn(e.browserEvent.target)&&e.browserEvent.target.closest(`.action-list-item-toolbar`)!==null){t.submenuActions?.length||this._cancelSubmenuShow(),this._list.setFocus(this._options?.tabThroughItemActions?n:[]);return}let i=!!(t.submenuActions?.length||t.hover?.content),a=this._suppressHover;(i||this._usesSubmenuPointerIntent())&&(this._suppressHover=!0);try{this._list.setFocus(n)}finally{this._suppressHover=a}if(i){this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._usesSubmenuPointerIntent()&&this._updateSubmenuPointer(e.browserEvent)):(this._usesSubmenuPointerIntent()||this._hideSubmenu(),this._scheduleSubmenuShow(t,e.browserEvent));return}if(this._currentSubmenuElement===t?this._cancelSubmenuHide():(this._cancelSubmenuShow(),this._options?.submenuPointerIntent?this._scheduleSubmenuHide():this._options?.persistentHover||this._hideSubmenu()),this._delegate.onHover&&!t.disabled&&t.kind===`action`&&this._currentSubmenuElement!==t){let n=await this._delegate.onHover(t.item,this.cts.token),r=n?n.canPreview:void 0;r!==t.canPreview&&(t.canPreview=r,typeof e.index==`number`&&(this._list.splice(e.index,1,[t]),this._list.setFocus([e.index])))}}else t&&t.hover?.content&&typeof e.index==`number`&&(this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow()):(this._options?.persistentHover||this._hideSubmenu(),this._scheduleSubmenuShow(t,e.browserEvent)))}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};np=Uf=Vf([Hf(6,Mr),Hf(7,_n),Hf(8,E)],np);var rp=class extends T{get domNode(){return this._widget.domNode}get filterContainer(){return this._widget.filterContainer}get footerContainer(){return this._widget.footerContainer}get headerContainer(){return this._widget.headerContainer}get filterInput(){return this._widget.filterInput}get closeAnimation(){return this._widget.closeAnimation}get widgetClassName(){return this._widgetClassName}get anchorPosition(){if(this._preferredAnchorPosition!==void 0)return this._preferredAnchorPosition;if(this._showAbove!==void 0)return+!!this._showAbove}constructor(e,t,n,r,i,a,o,s,c,l){super(),this._contextViewService=s,this._layoutService=c,this._lastMinWidth=0,this._hasLaidOut=!1,this._anchor=o,this._preferredAnchorPosition=a?.anchorPosition,this._useFullHeight=a?.useFullHeight??!1,this._widgetClassName=a?.widgetClassName,this._widget=this._register(l.createInstance(np,e,t,n,r,i,a)),this._register(this._widget.onDidRequestLayout(()=>{this._hasLaidOut&&(this.layout(this._lastMinWidth),this._contextViewService.layout())}))}focus(){this._widget.focus()}hide(e,t=!0){this._widget.hide(e),t&&this._contextViewService.hideContextView()}clearFilter(){return this._widget.clearFilter()}focusPrevious(){this._widget.focusPrevious()}focusNext(){this._widget.focusNext()}collapseFocusedSection(){this._widget.collapseFocusedSection()}expandFocusedSection(){this._widget.expandFocusedSection()}toggleFocusedSection(){return this._widget.toggleFocusedSection()}acceptSelected(e){this._widget.acceptSelected(e)}hasDynamicHeight(){return this._widget.hasDynamicHeight}computeActionWidgetVerticalChromeHeight(){let e=this.domNode.parentElement?.closest(`.action-widget`);if(!e)return 0;let t=zu(e).getComputedStyle(e),n=e=>Number.parseFloat(e)||0;return n(t.paddingTop)+n(t.paddingBottom)+n(t.borderTopWidth)+n(t.borderBottomWidth)}computeHeight(){let e=this._fixedContentHeight??this._widget.computeListHeight(),t=this._widget.filterContainer?36:0,n=this._widget.footerContainer?32:0,r=this._widget.headerContainer&&!this._widget.headerContainer.hidden?this._widget.headerContainer.offsetHeight||36:0,i=t+n+r,a=zu(this.domNode),o;if(this.hasDynamicHeight()||this._preferredAnchorPosition!==void 0){let e=a.innerHeight,t=ns(this._anchor),n=t.top-a.pageYOffset,r=e-n-t.height-30,s=n;if(this._showAbove===void 0){let e=this._fixedContentHeight??this._widget.computeFullHeight();this._showAbove=this._preferredAnchorPosition===void 0?i+e>r&&s>r:this._preferredAnchorPosition===1}o=Math.max(0,(this._showAbove?s:r)-this.computeActionWidgetVerticalChromeHeight())}else{let e=this._layoutService.getContainer(a).clientHeight,t=this.domNode.getBoundingClientRect().top;o=t>0?e-t-10:e*.7}let s=this._useFullHeight?a.innerHeight:Math.floor(a.innerHeight*.6),c=this._widget.lineHeight;if(this._preferredAnchorPosition!==void 0){let t=Math.min(o,s),n=Math.min(e+i,Math.max(0,t));return Math.max(0,n-i)}let l=Math.min(Math.max(o,c*3+i),s);return Math.min(e+i,l)-i}layout(e,t){this._hasLaidOut=!0,this._lastMinWidth=e,t!==void 0&&(this._fixedContentHeight=t);let n=this.computeHeight();this._widget.layout(n);let r=this._widget.computeMaxWidth(e);return this._cachedMaxWidth=r,this._widget.layout(n,this._cachedMaxWidth),this._cachedMaxWidth}};rp=Vf([Hf(7,Se),Hf(8,rd),Hf(9,E)],rp);function ip(e){return e.replace(/\r\n|\r|\n/g,` `)}var ap=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},op=function(e,t){return function(n,r){t(n,r,e)}};O(`actionBar.toggledBackground`,At,S(1744,`Background color for toggled action items in action bar.`));var sp=`--action-widget-close-start-opacity`,cp=`--action-widget-close-start-transform`,lp={Visible:new M(`codeActionMenuVisible`,!1,S(1745,`Whether the action widget list is visible`)),FilterFocused:new M(`codeActionMenuFilterFocused`,!1,S(1746,`Whether the action widget filter input is focused`))},up=Xt(`actionWidgetService`),dp=class extends T{get isVisible(){return lp.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new un),this._closeAnimation=this._register(new un)}show(e,t,n,r,i,a,o,s,c){let l=lp.Visible.bindTo(this._contextKeyService),u=this._instantiationService.createInstance(rp,e,t,n,r,s,c,i);this._contextViewService.showContextView({getAnchor:()=>i,render:e=>(l.set(!0),this._renderWidget(e,u,o??[],c)),onHide:e=>{l.reset(),this._onWidgetClosed(e)},get anchorPosition(){return u.anchorPosition},focus:()=>u.focus()},a,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}collapseSection(){this._list?.value?.collapseFocusedSection()}expandSection(){this._list?.value?.expandFocusedSection()}toggleSection(){return this._list?.value?.toggleFocusedSection()??!1}clearFilter(){return this._list?.value?.clearFilter()??!1}hide(e){let t=this._list.value,n=this._widgetElement;if(!t||this._closingList===t)return;let r=t.closeAnimation;if(!n||!r||r.duration<=0||!this._hasRequiredAncestorClasses(n,r.requiredAncestorClasses)){this._closingList=t,t.hide(e);return}this._closingList=t;let i=zu(n).getComputedStyle(n);n.style.setProperty(sp,i.opacity),n.style.setProperty(cp,i.transform),n.classList.add(r.className),t.hide(e,!1),this._closeAnimation.value=Iu(()=>{this._list.value===t&&this._contextViewService.hideContextView(e)},r.duration)}clear(){this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement?.style.removeProperty(sp),this._widgetElement?.style.removeProperty(cp),this._widgetElement=void 0,this._list.clear()}_renderWidget(e,t,n,r){let i=document.createElement(`div`);i.classList.add(`action-widget`);let a=t.widgetClassName?.split(/\s+/).filter(Boolean);if(a?.length&&i.classList.add(...a),e.appendChild(i),this._widgetElement=i,this._list.value=t,this._list.value)this._list.value.headerContainer&&i.appendChild(this._list.value.headerContainer),this._list.value.filterContainer&&i.appendChild(this._list.value.filterContainer),i.appendChild(this._list.value.domNode),this._list.value.footerContainer&&i.appendChild(this._list.value.footerContainer);else throw Error(`List has no value`);let o=new A;r?.filterAsCombobox&&o.add(Ml(i,`keydown`,e=>{e.keyCode===9&&!e.browserEvent.isComposing&&(mr.stop(e,!0),this.hide(!0))}));let s=this._list.value.headerContainer;s&&o.add(xl(s,e=>e.preventDefault()));let c=0;o.add(xl(i,()=>{c=Date.now()+1e3}));let l=document.createElement(`div`),u=e.appendChild(l);u.classList.add(`context-view-block`),o.add(xl(u,e=>e.stopPropagation()));let d=0;if(n.length){let e=this._createActionBar(`.action-widget-action-bar`,n);e&&(i.appendChild(e.getContainer().parentElement),o.add(e),d=e.getContainer().offsetWidth)}let f=this._list.value?.layout(d);i.style.width=`${f}px`;let p=lp.FilterFocused.bindTo(this._contextKeyService);if(o.add({dispose:()=>p.reset()}),this._list.value?.filterInput){let e=this._list.value.filterInput;o.add(V(e,`focus`,()=>p.set(!0))),o.add(V(e,`blur`,()=>p.set(!1)))}let m=o.add(kr(e)),h=o.add(new un);return o.add(m.onDidFocus(()=>h.clear())),o.add(m.onDidBlur(()=>{let t=()=>{let n=c-Date.now();if(n>0){h.value=Iu(t,n);return}let r=vo();r&&(e.contains(r)||r.closest(`.action-widget-hover`)||r.closest(`.action-list-submenu-panel`))||this.hide(!0)};h.value=Iu(t,75)})),o}_createActionBar(e,t){if(!t.length)return;let n=new or(R(e));return n.push(t,{icon:!1,label:!0}),n}_hasRequiredAncestorClasses(e,t){if(!t?.length)return!0;for(let n=e;n;n=n.parentElement)if(t.every(e=>n.classList.contains(e)))return!0;return!1}_onWidgetClosed(e){if(this._closingList===this._list.value){this.clear();return}this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement=void 0,this._list.value?.hide(e)}};dp=ap([op(0,Se),op(1,W),op(2,E)],dp),vs(up,dp,1);var fp=1100;C(class extends Ju{constructor(){super({id:`hideCodeActionWidget`,title:N(1747,`Hide action widget`),precondition:lp.Visible,keybinding:{weight:fp,primary:9,secondary:[1033]}})}run(e){e.get(up).hide(!0)}}),C(class extends Ju{constructor(){super({id:`clearFilterCodeActionWidget`,title:N(1748,`Clear action widget filter`),precondition:m.and(lp.Visible,lp.FilterFocused),keybinding:{weight:1101,primary:9}})}run(e){let t=e.get(up);t instanceof dp&&(t.clearFilter()||t.hide(!0))}}),C(class extends Ju{constructor(){super({id:`selectPrevCodeAction`,title:N(1749,`Select previous action`),precondition:lp.Visible,keybinding:{weight:fp,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){let t=e.get(up);t instanceof dp&&t.focusPrevious()}}),C(class extends Ju{constructor(){super({id:`selectNextCodeAction`,title:N(1750,`Select next action`),precondition:lp.Visible,keybinding:{weight:fp,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){let t=e.get(up);t instanceof dp&&t.focusNext()}}),C(class extends Ju{constructor(){super({id:`collapseSectionCodeAction`,title:N(1751,`Collapse section`),precondition:m.and(lp.Visible,lp.FilterFocused.negate()),keybinding:{weight:fp,primary:15}})}run(e){let t=e.get(up);t instanceof dp&&t.collapseSection()}}),C(class extends Ju{constructor(){super({id:`expandSectionCodeAction`,title:N(1752,`Expand section`),precondition:m.and(lp.Visible,lp.FilterFocused.negate()),keybinding:{weight:fp,primary:17}})}run(e){let t=e.get(up);t instanceof dp&&t.expandSection()}}),C(class extends Ju{constructor(){super({id:`toggleSectionCodeAction`,title:N(1753,`Toggle section`),precondition:m.and(lp.Visible,lp.FilterFocused.negate()),keybinding:{weight:fp,primary:10}})}run(e){let t=e.get(up);t instanceof dp&&(t.toggleSection()||t.acceptSelected())}}),C(class extends Ju{constructor(){super({id:Wf,title:N(1754,`Accept selected action`),precondition:lp.Visible,keybinding:{weight:fp,primary:3,secondary:[2137]}})}run(e){let t=e.get(up);t instanceof dp&&t.acceptSelected()}}),C(class extends Ju{constructor(){super({id:Gf,title:N(1755,`Preview selected action`),precondition:lp.Visible,keybinding:{weight:fp,primary:2051}})}run(e){let t=e.get(up);t instanceof dp&&t.acceptSelected(!0)}});var pp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},mp=function(e,t){return function(n,r){t(n,r,e)}},hp,gp=class extends T{static{hp=this}static{this.baseId=`editor.widget.postEditWidget`}constructor(e,t,n,r,i,a,o,s,c,l,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=i,this.edits=a,this.onSelectNewEdit=o,this.additionalActions=s,this._keybindingService=l,this._actionWidgetService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(xt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(xt((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(e=>{this.dispose()})),this._register(Ps.runAndSubscribe(l.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){this.button.element.title=this._keybindingService.appendKeybinding(this.showCommand.label,this.showCommand.id)}create(){this.domNode=R(`.post-edit-widget`),this.button=this._register(new Le(this.domNode,{supportIcons:!0})),this.button.label=`$(insert)`,this._register(V(this.domNode,n.CLICK,()=>this.showSelector()))}getId(){return hp.baseId+`.`+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){let e=ms(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show(`postEditWidget`,!1,this.edits.allEdits.map((e,t)=>({kind:`action`,item:e,label:e.title,disabled:!1,canPreview:!1,group:{title:``,icon:w.fromId(t===this.edits.activeEditIndex?k.check.id:k.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:e=>{this._actionWidgetService.hide(!1);let t=this.edits.allEdits.findIndex(t=>t===e);if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}};gp=hp=pp([mp(8,W),mp(9,Mr),mp(10,up)],gp);var _p=class extends T{constructor(e,t,n,r,i,a,o,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._getAdditionalActions=i,this._instantiationService=a,this._bulkEditService=o,this._notificationService=s,this._currentWidget=this._register(new un),this._register(Ps.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,n,r,i){if(!e.length||!this._editor.hasModel())return;let a=this._editor.getModel(),o=t.allEdits.at(t.activeEditIndex);if(!o)return;let s=async a=>{let o=this._editor.getModel();o&&(await o.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:a,allEdits:t.allEdits},n,r,i))},c=(r,i)=>{Br(r)||(this._notificationService.error(i),n&&this.show(e[0],t,s))},l=new pe(this._editor,3,void 0,i),u;try{u=await wu(r(o,l.token),l.token)}catch(e){return c(e,S(991,`Error resolving edit '{0}':
|
|
3
3
|
{1}`,o.title,If(e)))}finally{l.dispose()}if(i.isCancellationRequested)return;let d=jf(a.uri,e,u),f=e[0],p=a.deltaDecorations([],[{range:f,options:{description:`paste-line-suffix`,stickiness:0}}]);this._editor.focus();let m,h;try{m=await this._bulkEditService.apply(d,{editor:this._editor,token:i}),h=a.getDecorationRange(p[0])}catch(e){return c(e,S(992,`Error applying edit '{0}':
|
|
4
4
|
{1}`,o.title,If(e)))}finally{a.deltaDecorations(p,[])}i.isCancellationRequested||n&&m.isApplied&&t.allEdits.length>1&&this.show(h??f,t,s)}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(gp,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};_p=pp([mp(5,E),mp(6,Dt),mp(7,hi)],_p);var vp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},yp=function(e,t){return function(n,r){t(n,r,e)}},bp,xp=`editor.changePasteType`,Sp=`editor.pasteAs.preferences`,Cp=new M(`pasteWidgetVisible`,!1,S(971,`Whether the paste widget is showing`)),wp=`application/vnd.code.copymetadata`,Tp=class extends T{static{bp=this}static{this.ID=`editor.contrib.copyPasteActionController`}static get(e){return e.getContribution(bp.ID)}constructor(e,t,n,r,i,a,o,s,c,l){super(),this._logService=n,this._bulkEditService=r,this._clipboardService=i,this._commandService=a,this._configService=o,this._languageFeaturesService=s,this._quickInputService=c,this._progressService=l,this._editor=e,this._register(e.onWillCopy(e=>this.handleCopy(e))),this._register(e.onWillCut(e=>this.handleCopy(e))),this._register(e.onWillPaste(e=>this.handlePaste(e))),this._pasteProgressManager=this._register(new tf(`pasteIntoEditor`,e,t)),this._postPasteWidgetManager=this._register(t.createInstance(_p,`pasteIntoEditor`,e,Cp,{id:xp,label:S(972,`Show paste options...`)},()=>bp._configureDefaultAction?[bp._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace(`CopyPasteController.pasteAs`),this._editor.focus();try{this._logService.trace(`Before calling editor.action.clipboardPasteAction`),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand(`editor.action.clipboardPasteAction`)}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){if(this._logService.trace(`CopyPasteController#handleCopy`),!this._editor.hasTextFocus()||(this._clipboardService.clearInternalState?.(),!this.isPasteAsEnabled()))return;let t=this._editor.getModel(),n=this._editor._getViewModel(),r=this._editor.getSelections();if(!t||!n||!r?.length)return;let i={multicursorText:e.dataToCopy.multicursorText??null,pasteOnNewLine:e.dataToCopy.isFromEmptySelection,mode:null},a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(e=>!!e.prepareDocumentPaste);if(!a.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:i});return}let o=new _o,s=a.flatMap(e=>e.copyMimeTypes??[]),c=ps();this.setCopyMetadata(e.clipboardData,{id:c,providerCopyMimeTypes:s,defaultPastePayload:i});let l=a.map(n=>({providerMimeTypes:n.copyMimeTypes,operation:Ga(r=>n.prepareDocumentPaste(t,e.dataToCopy.sourceRanges,o,r).catch(e=>{console.error(e)}))}));bp._currentCopyOperation?.operations.forEach(e=>e.operation.cancel()),bp._currentCopyOperation={handle:c,operations:l}}async handlePaste(e){if(this._logService.trace(`CopyPasteController#handlePaste for id : `,e.metadata?.id),!this._editor.hasTextFocus())return;let t=e.toExternalVSDataTransfer();if(!t)return;t.delete(wp),of.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;let n=this._editor.getModel(),r=this._editor.getSelections();if(!r?.length||!n||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;let i=this.fetchCopyMetadata(e);this._logService.trace(`CopyPasteController#handlePaste with metadata : `,i?.id,` and text.length : `,e.clipboardData.getData(`text/plain`).length);let a=Array.from(e.clipboardData.files).map(e=>e.type),o=[...e.clipboardData.types,...a,...i?.providerCopyMimeTypes??[],xc.uriList],s=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(e=>{let t=this._pasteAsActionContext?.preferred;return t&&!this.providerMatchesPreference(e,t)?!1:e.pasteMimeTypes?.some(e=>Xc(e,o))});if(!s.length){this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(r,this._pasteAsActionContext.preferred),e.setHandled());return}e.setHandled(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,s,r,t,i):this.doPasteInline(s,r,t,i,e.browserEvent)}showPasteAsNoEditMessage(e,t){let n=`only`in t?t.only.value:`preferences`in t?t.preferences.length?t.preferences.map(e=>e.value).join(`, `):S(973,`empty`):t.providerId;of.get(this._editor)?.showMessage(S(974,`No paste edits for '{0}' found`,n),e[0].getStartPosition())}doPasteInline(e,t,n,r,i){this._logService.trace(`CopyPasteController#doPasteInline`);let a=this._editor;if(!a.hasModel())return;let o=new pe(a,3,void 0),s=Ga(async a=>{let c=this._editor;if(!c.hasModel())return;let l=c.getModel(),u=new A,d=u.add(new Gn(a));u.add(o.token.onCancellationRequested(()=>d.cancel()));let f=d.token;try{if(await this.mergeInDataFromCopy(e,n,r,f),f.isCancellationRequested)return;let a=e.filter(e=>this.isSupportedPasteProvider(e,n));if(!a.length||a.length===1&&a[0]instanceof df)return this.applyDefaultPasteHandler(n,r,f,i);let o={triggerKind:Rs.Automatic},s=await this.getPasteEdits(a,n,l,t,o,f);if(u.add(s),f.isCancellationRequested)return;if(s.edits.length===1&&s.edits[0].provider instanceof df)return this.applyDefaultPasteHandler(n,r,f,i);if(s.edits.length){let e=c.getOption(97).showPasteSelector===`afterPaste`;return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(l,s.edits),allEdits:s.edits},e,async(e,n)=>{if(!e.provider.resolveDocumentPasteEdit)return e;let r=e.provider.resolveDocumentPasteEdit(e,n),i=new ds,a=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),S(975,`Resolving paste edit for '{0}'. Click to cancel`,e.title),ve(Promise.race([i.p,r]),n),{cancel:()=>i.cancel()},0);return a&&(e.insertText=a.insertText,e.additionalEdit=a.additionalEdit),e},f)}await this.applyDefaultPasteHandler(n,r,f,i)}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),S(976,`Running paste handlers. Click to cancel and do basic paste`),s,{cancel:async()=>{s.cancel(),!o.token.isCancellationRequested&&await this.applyDefaultPasteHandler(n,r,o.token,i)}}).finally(()=>{o.dispose()}),this._currentPasteOperation=s}showPasteAsPick(e,t,n,r,i){this._logService.trace(`CopyPasteController#showPasteAsPick`);let a=Ga(async o=>{let s=this._editor;if(!s.hasModel())return;let c=s.getModel(),l=new A,u=l.add(new pe(s,3,void 0,o));try{if(await this.mergeInDataFromCopy(t,r,i,u.token),u.token.isCancellationRequested)return;let a=t.filter(t=>this.isSupportedPasteProvider(t,r,e));e&&(a=a.filter(t=>this.providerMatchesPreference(t,e)));let o={triggerKind:Rs.PasteAs,only:e&&`only`in e?e.only:void 0},s=l.add(await this.getPasteEdits(a,r,c,n,o,u.token));if(u.token.isCancellationRequested)return;if(e&&(s={edits:s.edits.filter(t=>`only`in e?e.only.contains(t.kind):`preferences`in e?e.preferences.some(e=>e.contains(t.kind)):e.providerId===t.provider.id),dispose:s.dispose}),!s.edits.length){e&&this.showPasteAsNoEditMessage(n,e);return}let d;if(e)d=s.edits.at(0);else{let e={id:`editor.pasteAs.default`,label:S(977,`Configure default paste action`),edit:void 0},t=await this._quickInputService.pick([...s.edits.map(e=>({label:e.title,description:e.kind?.value,edit:e})),...bp._configureDefaultAction?[gc({type:`separator`}),{label:bp._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:S(978,`Select Paste Action`)});if(t===e){bp._configureDefaultAction?.run();return}d=t?.edit}if(!d)return;let f=jf(c.uri,n,d);await this._bulkEditService.apply(f,{editor:this._editor})}finally{l.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:S(979,`Running paste handlers`)},()=>a)}setCopyMetadata(e,t){this._logService.trace(`CopyPasteController#setCopyMetadata new id : `,t.id),e.setData(wp,JSON.stringify(t))}fetchCopyMetadata(e){this._logService.trace(`CopyPasteController#fetchCopyMetadata`);let t=e.clipboardData.getData(wp);if(t)try{return JSON.parse(t)}catch{return}if(e.metadata)return{defaultPastePayload:{mode:e.metadata.mode,multicursorText:e.metadata.multicursorText??null,pasteOnNewLine:!!e.metadata.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,n,r){if(this._logService.trace(`CopyPasteController#mergeInDataFromCopy with metadata : `,n?.id),n?.id&&bp._currentCopyOperation?.handle===n.id){let n=bp._currentCopyOperation.operations.filter(t=>e.some(e=>e.pasteMimeTypes.some(e=>Xc(e,t.providerMimeTypes)))).map(e=>e.operation),i=await Promise.all(n);if(r.isCancellationRequested)return;for(let e of i.reverse())if(e)for(let[n,r]of e)t.replace(n,r)}if(!t.has(xc.uriList)){let e=await this._clipboardService.readResources();if(r.isCancellationRequested)return;e.length&&t.append(xc.uriList,Vo(tu.create(e)))}}async getPasteEdits(e,t,n,r,i,a){let o=new A;return{edits:Mf(Jr(await ve(Promise.all(e.map(async e=>{try{let s=await e.provideDocumentPasteEdits?.(n,r,t,i,a);return s&&o.add(s),s?.edits?.map(t=>({...t,provider:e}))}catch(e){Br(e)||console.error(e);return}})),a)??[]).flat().filter(e=>!i.only||i.only.contains(e.kind))),dispose:()=>o.dispose()}}async applyDefaultPasteHandler(e,t,n,r){let i=await(e.get(xc.text)??e.get(`text`))?.asString()??``;if(n.isCancellationRequested)return;let a={clipboardEvent:r,text:i,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._logService.trace(`CopyPasteController#applyDefaultPasteHandler for id : `,t?.id),this._editor.trigger(`keyboard`,`paste`,a)}isSupportedPasteProvider(e,t,n){return e.pasteMimeTypes?.some(e=>t.matches(e))?!n||this.providerMatchesPreference(e,n):!1}providerMatchesPreference(e,t){return`only`in t?e.providedPasteEditKinds.some(e=>t.only.contains(e)):`preferences`in t?e.providedPasteEditKinds.some(e=>t.preferences.some(t=>t.contains(e))):e.id===t.providerId}getInitialActiveEditIndex(e,t){let n=this._configService.getValue(Sp,{resource:e.uri});for(let e of Array.isArray(n)?n:[]){let n=new Xd(e),r=t.findIndex(e=>n.contains(e.kind));if(r>=0)return r}return 0}};Tp=bp=vp([yp(1,E),yp(2,Bl),yp(3,Dt),yp(4,Ou),yp(5,nr),yp(6,Oa),yp(7,K),yp(8,zi),yp(9,Fl)],Tp);var Ep=`9_cutcopypaste`,Dp=Oo||document.queryCommandSupported&&document.queryCommandSupported(`cut`),Op=Oo||document.queryCommandSupported&&document.queryCommandSupported(`copy`),kp=navigator.clipboard===void 0||$r?document.queryCommandSupported&&document.queryCommandSupported(`paste`):!0;function Ap(e){return e.register(),e}var jp=Dp?Ap(new rn({id:`editor.action.clipboardCutAction`,precondition:void 0,kbOpts:Oo?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:X.MenubarEditMenu,group:`2_ccp`,title:S(864,`Cu&&t`),order:1},{menuId:X.EditorContext,group:Ep,title:S(865,`Cut`),when:B.writable,order:1},{menuId:X.CommandPalette,group:``,title:S(866,`Cut`),order:1},{menuId:X.SimpleEditorContext,group:Ep,title:S(867,`Cut`),when:B.writable,order:1}]})):void 0,Mp=Op?Ap(new rn({id:`editor.action.clipboardCopyAction`,precondition:void 0,kbOpts:Oo?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:X.MenubarEditMenu,group:`2_ccp`,title:S(868,`&&Copy`),order:2},{menuId:X.EditorContext,group:Ep,title:S(869,`Copy`),order:2},{menuId:X.CommandPalette,group:``,title:S(870,`Copy`),order:1},{menuId:X.SimpleEditorContext,group:Ep,title:S(871,`Copy`),order:2}]})):void 0;_e.appendMenuItem(X.MenubarEditMenu,{submenu:X.MenubarCopy,title:N(876,`Copy As`),group:`2_ccp`,order:3}),_e.appendMenuItem(X.EditorContext,{submenu:X.EditorContextCopy,title:N(877,`Copy As`),group:Ep,order:3}),_e.appendMenuItem(X.EditorContext,{submenu:X.EditorContextShare,title:N(878,`Share`),group:`11_share`,order:-1,when:m.and(m.notEquals(`resourceScheme`,`output`),B.editorTextFocus)}),_e.appendMenuItem(X.ExplorerContext,{submenu:X.ExplorerContextShare,title:N(879,`Share`),group:`11_share`,order:-1});var Np=kp?Ap(new rn({id:`editor.action.clipboardPasteAction`,precondition:void 0,kbOpts:Oo?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:X.MenubarEditMenu,group:`2_ccp`,title:S(872,`&&Paste`),order:4},{menuId:X.EditorContext,group:Ep,title:S(873,`Paste`),when:B.writable,order:4},{menuId:X.CommandPalette,group:``,title:S(874,`Paste`),order:1},{menuId:X.SimpleEditorContext,group:Ep,title:S(875,`Paste`),when:B.writable,order:4}]})):void 0,Pp=class extends F{constructor(){super({id:`editor.action.clipboardCopyWithSyntaxHighlightingAction`,label:N(880,`Copy with Syntax Highlighting`),precondition:void 0,kbOpts:{kbExpr:B.textInputFocus,primary:0,weight:100}})}run(e,t){let n=e.get(Bl),r=e.get(Ou);n.trace(`ExecCommandCopyWithSyntaxHighlightingAction#run`),t.hasModel()&&(!t.getOption(45)&&t.getSelection().isEmpty()||(Fa.forceCopyWithSyntaxHighlighting=!0,t.focus(),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)`),Fp(t,r),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)`),Fa.forceCopyWithSyntaxHighlighting=!1))}};function Fp(e,t){if(Fa.electronBugWorkaroundCopyEventHasFired=!1,e.getContainerDomNode().ownerDocument.execCommand(`copy`),Oo&&Fa.electronBugWorkaroundCopyEventHasFired===!1){let{dataToCopy:n}=jl(e._getViewModel(),void 0,$r);t.writeText(n.text)}}function Ip(e,t){e&&(e.addImplementation(1e4,`code-editor`,(e,n)=>{let r=e.get(Bl),i=e.get(Ou);r.trace(`registerExecCommandImpl (addImplementation code-editor for : `,t,`)`);let a=e.get(ji).getFocusedCodeEditor();if(a&&a.hasTextFocus()&&a.hasModel()){let e=a.getOption(45),n=a.getSelection();return n&&n.isEmpty()&&!e||(a.getOption(171)&&t===`cut`?(Lp(a),r.trace(`registerExecCommandImpl (before execCommand copy)`),Fp(a,i),a.trigger(void 0,`cut`,void 0),r.trace(`registerExecCommandImpl (after execCommand copy)`)):(Lp(a),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),t===`copy`?Fp(a,i):a.getContainerDomNode().ownerDocument.execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`))),!0}return!1}),e.addImplementation(0,`generic-dom`,(e,n)=>{let r=e.get(Bl);return r.trace(`registerExecCommandImpl (addImplementation generic-dom for : `,t,`)`),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),nu().execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`),!0}))}function Lp(e){if(e.getOption(171)){let t=hn.get(e.getId());t&&t.handleWillCopy()}}Ip(jp,`cut`),Ip(Mp,`copy`),Np&&(Np.addImplementation(1e4,`code-editor`,(e,t)=>{let n=e.get(Bl);n.trace(`registerExecCommandImpl (addImplementation code-editor for : paste)`);let r=e.get(ji),i=e.get(Ou),a=r.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(171)){let e=hn.get(a.getId());e&&e.handleWillPaste()}n.trace(`registerExecCommandImpl (before triggerPaste)`);let e=i.triggerPaste(Ho().vscodeWindowId);return e?(n.trace(`registerExecCommandImpl (triggerPaste defined)`),e.then(async()=>(n.trace(`registerExecCommandImpl (after triggerPaste)`),Tp.get(a)?.finishedPaste()??Promise.resolve()))):(n.trace(`registerExecCommandImpl (triggerPaste undefined)`),Hl?(n.trace(`registerExecCommandImpl (Paste handling on web)`),(async()=>{let e=await i.readText();if(e!==``){let t=Rc.INSTANCE.get(e),r=!1,i=null,o=null;t&&(r=a.getOption(45)&&!!t.isFromEmptySelection,i=t.multicursorText===void 0?null:t.multicursorText,o=t.mode),n.trace(`registerExecCommandImpl (clipboardText.length : `,e.length,` id : `,t?.id,`)`),a.trigger(`keyboard`,`paste`,{text:e,pasteOnNewLine:r,multicursorText:i,mode:o})}})()):!0)}return!1}),Np.addImplementation(0,`generic-dom`,(e,t)=>(e.get(Bl).trace(`registerExecCommandImpl (addImplementation generic-dom for : paste)`),e.get(Ou).triggerPaste(Ho().vscodeWindowId)??!1))),Op&&j(Pp);var Rp=new class{constructor(){this.QuickFix=new Xd(`quickfix`),this.Refactor=new Xd(`refactor`),this.RefactorExtract=this.Refactor.append(`extract`),this.RefactorInline=this.Refactor.append(`inline`),this.RefactorMove=this.Refactor.append(`move`),this.RefactorRewrite=this.Refactor.append(`rewrite`),this.Notebook=new Xd(`notebook`),this.Source=new Xd(`source`),this.SourceOrganizeImports=this.Source.append(`organizeImports`),this.SourceFixAll=this.Source.append(`fixAll`),this.SurroundWith=this.Refactor.append(`surround`)}},zp;(function(e){e.Refactor=`refactor`,e.RefactorPreview=`refactor preview`,e.Lightbulb=`lightbulb`,e.Default=`other (default)`,e.SourceAction=`source action`,e.QuickFix=`quick fix action`,e.FixAll=`fix all`,e.OrganizeImports=`organize imports`,e.AutoFix=`auto fix`,e.QuickFixHover=`quick fix hover window`,e.OnSave=`save participants`,e.ProblemsView=`problems view`})(zp||={});function Bp(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some(n=>Hp(t,n,e.include))||!e.includeSourceActions&&Rp.Source.contains(t))}function Vp(e,t){let n=t.kind?new Xd(t.kind):void 0;return!(e.include&&(!n||!e.include.contains(n))||e.excludes&&n&&e.excludes.some(t=>Hp(n,t,e.include))||!e.includeSourceActions&&n&&Rp.Source.contains(n)||e.onlyIncludePreferredActions&&!t.isPreferred)}function Hp(e,t,n){return!(!t.contains(e)||n&&t.contains(n))}var Up=class e{static fromUser(t,n){return!t||typeof t!=`object`?new e(n.kind,n.apply,!1):new e(e.getKindFromUser(t,n.kind),e.getApplyFromUser(t,n.apply),e.getPreferredUser(t))}static getApplyFromUser(e,t){switch(typeof e.apply==`string`?e.apply.toLowerCase():``){case`first`:return`first`;case`never`:return`never`;case`ifsingle`:return`ifSingle`;default:return t}}static getKindFromUser(e,t){return typeof e.kind==`string`?new Xd(e.kind):t}static getPreferredUser(e){return typeof e.preferred==`boolean`?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}},Wp=class{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(e){Tu(e)}t&&(this.action.edit=t.edit)}return this}},Gp=`editor.action.codeAction`,Kp=`editor.action.quickFix`,qp=`editor.action.autoFix`,Jp=`editor.action.refactor`,Yp=`editor.action.sourceAction`,Xp=`editor.action.organizeImports`,Zp=`editor.action.fixAll`,Qp=1e3,$p=class e extends T{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:t},{action:n}){return t.isAI&&!n.isAI?1:!t.isAI&&n.isAI?-1:ec(t.diagnostics)?ec(n.diagnostics)?e.codeActionsPreferredComparator(t,n):-1:ec(n.diagnostics)?1:e.codeActionsPreferredComparator(t,n)}constructor(t,n,r){super(),this.documentation=n,this._register(r),this.allActions=[...t].sort(e.codeActionsComparator),this.validActions=this.allActions.filter(({action:e})=>!e.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Rp.QuickFix.contains(new Xd(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},em={actions:[],documentation:void 0};async function tm(e,t,n,r,i,a){let o=r.filter||{},s={...o,excludes:[...o.excludes||[],Rp.Notebook]},c={only:o.include?.value,trigger:r.type},l=new Di(t,a),u=nm(e,t,r.type===2?s:o),d=new A,f=u.map(async e=>{let r=setTimeout(()=>i.report(e),1250);try{let r=await e.provideCodeActions(t,n,c,l.token);if(l.token.isCancellationRequested)return r?.dispose(),em;r&&d.add(r);let i=(r?.actions||[]).filter(e=>e&&Vp(o,e)),a=im(e,i,o.include);return{actions:i.map(t=>new Wp(t,e)),documentation:a}}catch(e){if(Br(e))throw e;return Tu(e),em}finally{clearTimeout(r)}}),p=e.onDidChange(()=>{Xe(e.all(t),u)||l.cancel()});try{let n=await Promise.all(f),i=n.map(e=>e.actions).flat(),a=new $p(i,[...Jr(n.map(e=>e.documentation)),...rm(e,t,r,i)],d);return d.add(a),a}catch(e){throw d.dispose(),e}finally{p.dispose(),l.dispose()}}function nm(e,t,n){return e.all(t).filter(e=>e.providedCodeActionKinds?e.providedCodeActionKinds.some(e=>Bp(n,new Xd(e))):!0)}function*rm(e,t,n,r){if(t&&r.length)for(let i of e.all(t))i._getAdditionalMenuItems&&(yield*i._getAdditionalMenuItems?.({trigger:n.type,only:n.filter?.include?.value},r.map(e=>e.action)))}function im(e,t,n){if(!e.documentation)return;let r=e.documentation.map(e=>({kind:new Xd(e.kind),command:e.command}));if(n){let e;for(let t of r)t.kind.contains(n)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return e?.command}for(let e of t)if(e.kind){for(let t of r)if(t.kind.contains(new Xd(e.kind)))return t.command}}var am;(function(e){e.OnSave=`onSave`,e.FromProblemsView=`fromProblemsView`,e.FromCodeActions=`fromCodeActions`,e.FromAILightbulb=`fromAILightbulb`,e.FromProblemsHover=`fromProblemsHover`})(am||={});async function om(e,t,n,r,i=x.None){let a=e.get(Dt),o=e.get(nr),s=e.get(du),c=e.get(hi),l=e.get(Go);if(s.publicLog2(`codeAction.applyCodeAction`,{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:n}),l.playSignal(xo.codeActionTriggered),await t.resolve(i),!i.isCancellationRequested&&!(t.action.edit?.edits.length&&!(await a.apply(t.action.edit,{editor:r?.editor,label:t.action.title,quotableLabel:t.action.title,code:`undoredo.codeAction`,respectAutoSaveConfig:n!==am.OnSave,showPreview:r?.preview,reason:Rn.codeAction({kind:t.action.kind,providerId:ue.fromExtensionId(t.provider?.extensionId)})})).isApplied)){if(t.action.command)try{await o.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(e){let t=sm(e);c.error(typeof t==`string`?t:S(881,`An unknown error occurred while applying the code action`))}setTimeout(()=>l.playSignal(xo.codeActionApplied),Qp)}}function sm(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}Mn.registerCommand(`_executeCodeActionProvider`,async function(e,t,n,r,i){if(!(t instanceof Ot))throw Lu();let{codeActionProvider:a}=e.get(K),o=e.get(bt).getModel(t);if(!o)throw Lu();let s=I.isISelection(n)?I.liftSelection(n):D.isIRange(n)?o.validateRange(n):void 0;if(!s)throw Lu();let c=typeof r==`string`?new Xd(r):void 0,l=await tm(a,o,s,{type:1,triggerAction:zp.Default,filter:{includeSourceActions:!0,include:c}},co.None,x.None),u=[],d=Math.min(l.validActions.length,typeof i==`number`?i:0);for(let e=0;e<d;e++)u.push(l.validActions[e].resolve(x.None));try{return await Promise.all(u),l.validActions.map(e=>e.action)}finally{setTimeout(()=>l.dispose(),100)}});var cm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},lm=function(e,t){return function(n,r){t(n,r,e)}},um,dm=class{static{um=this}static{this.codeActionCommands=[Jp,Gp,Yp,Xp,Zp]}constructor(e){this.keybindingService=e}getResolver(){let e=new zo(()=>this.keybindingService.getKeybindings().filter(e=>um.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return e.command===`editor.action.organizeImports`?t={kind:Rp.SourceOrganizeImports.value}:e.command===`editor.action.fixAll`&&(t={kind:Rp.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...Up.fromUser(t,{kind:Xd.None,apply:`never`})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;let n=new Xd(e.kind);return t.filter(e=>e.kind.contains(n)).filter(t=>t.preferred?e.isPreferred:!0).reduceRight((e,t)=>e?e.kind.contains(t.kind)?t:e:t,void 0)}};dm=um=cm([lm(0,Mr)],dm),O(`symbolIcon.arrayForeground`,Ns,S(1569,`The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.booleanForeground`,Ns,S(1570,`The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.classForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},S(1571,`The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.colorForeground`,Ns,S(1572,`The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.constantForeground`,Ns,S(1573,`The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.constructorForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},S(1574,`The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.enumeratorForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},S(1575,`The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.enumeratorMemberForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},S(1576,`The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.eventForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},S(1577,`The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.fieldForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},S(1578,`The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.fileForeground`,Ns,S(1579,`The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.folderForeground`,Ns,S(1580,`The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.functionForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},S(1581,`The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.interfaceForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},S(1582,`The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.keyForeground`,Ns,S(1583,`The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.keywordForeground`,Ns,S(1584,`The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.methodForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},S(1585,`The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.moduleForeground`,Ns,S(1586,`The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.namespaceForeground`,Ns,S(1587,`The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.nullForeground`,Ns,S(1588,`The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.numberForeground`,Ns,S(1589,`The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.objectForeground`,Ns,S(1590,`The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.operatorForeground`,Ns,S(1591,`The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.packageForeground`,Ns,S(1592,`The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.propertyForeground`,Ns,S(1593,`The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.referenceForeground`,Ns,S(1594,`The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.snippetForeground`,Ns,S(1595,`The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.stringForeground`,Ns,S(1596,`The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.structForeground`,Ns,S(1597,`The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.textForeground`,Ns,S(1598,`The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.typeParameterForeground`,Ns,S(1599,`The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.unitForeground`,Ns,S(1600,`The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.variableForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},S(1601,`The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`));var fm=Object.freeze({kind:Xd.Empty,title:S(917,`More Actions...`)}),pm=Object.freeze([{kind:Rp.QuickFix,title:S(918,`Quick Fix`)},{kind:Rp.RefactorExtract,title:S(919,`Extract`),icon:k.wrench},{kind:Rp.RefactorInline,title:S(920,`Inline`),icon:k.wrench},{kind:Rp.RefactorRewrite,title:S(921,`Rewrite`),icon:k.wrench},{kind:Rp.RefactorMove,title:S(922,`Move`),icon:k.wrench},{kind:Rp.SurroundWith,title:S(923,`Surround With`),icon:k.surroundWith},{kind:Rp.Source,title:S(924,`Source Action`),icon:k.symbolFile},fm]);function mm(e,t,n){if(!t)return e.map(e=>({kind:`action`,item:e,group:fm,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!e.action.edit?.edits.length}));let r=pm.map(e=>({group:e,actions:[]}));for(let t of e){let e=t.action.kind?new Xd(t.action.kind):Xd.None;for(let n of r)if(n.group.kind.contains(e)){n.actions.push(t);break}}let i=[];for(let e of r)if(e.actions.length){i.push({kind:`header`,group:e.group});for(let t of e.actions){let r=e.group;i.push({kind:`action`,item:t,group:t.action.isAI?{title:r.title,kind:r.kind,icon:k.sparkle}:r,label:t.action.title,disabled:!!t.action.disabled,keybinding:n(t.action)})}}return i}var hm=new M(`supportedCodeAction`,``),gm=class extends T{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new fu),this.ignoreLightbulbOff=!1,this._register(this._markerService.onMarkerChanged(e=>this._onMarkerChanges(e))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){let t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){let t=this._editor.getModel();t&&e.some(e=>mo(e,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:zp.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;let t=this._editor.getSelection();if(e.type===1)return t;let n=this._editor.getOption(73).enabled;if(!(n===al.Off&&!this.ignoreLightbulbOff)){if(n===al.Off||n===al.On)return t;if(n===al.OnCode){if(!t.isEmpty())return t;let e=this._editor.getModel(),{lineNumber:n,column:r}=t.getPosition(),i=e.getLineContent(n);if(i.length===0)return;if(r===1){if(/\s/.test(i[0]))return}else if(r===e.getLineMaxColumn(n)){if(/\s/.test(i[i.length-1]))return}else if(/\s/.test(i[r-2])&&/\s/.test(i[r-1]))return}return t}}},_m;(function(e){e.Empty={type:0};class t{constructor(e,t,n){this.trigger=e,this.position=t,this._cancellablePromise=n,this.type=1,this.actions=n.catch(e=>{if(Br(e))return vm;throw e})}cancel(){this._cancellablePromise.cancel()}}e.Triggered=t})(_m||={});var vm=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),ym=class extends T{constructor(e,t,n,r,i,a){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=i,this._configurationService=a,this._codeActionOracle=this._register(new un),this._state=_m.Empty,this._onDidChangeState=this._register(new h),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new un),this._disposed=!1,this._ignoreLightbulbOff=!1,this._supportedCodeActions=hm.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(_m.Empty,!0))}_settingEnabledNearbyQuickfixes(){let e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue(`editor.codeActionWidget.includeNearbyQuickFixes`,{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(_m.Empty),this.codeActionsDisposable.clear();let e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){let t=this._registry.all(e).flatMap(e=>e.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(` `));let n=new gm(this._editor,this._markerService,t=>{if(!t){this.setState(_m.Empty);return}let n=t.selection.getStartPosition(),r=Ga(async n=>{if(this._settingEnabledNearbyQuickfixes()&&t.trigger.type===1&&(t.trigger.triggerAction===zp.QuickFix||t.trigger.filter?.include?.contains(Rp.QuickFix))){let r=new A,i=!1;try{let a=r.add(await tm(this._registry,e,t.selection,t.trigger,co.None,n)),o=[...a.allActions];if(n.isCancellationRequested)return vm;let s=a.validActions?.some(e=>e.action.kind&&Rp.QuickFix.contains(new Xd(e.action.kind))&&!e.action.isAI),c=this._markerService.read({resource:e.uri});if(s){for(let e of a.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...c.filter(e=>e.relatedInformation)]);let e=this._setCodeActions({validActions:a.validActions,allActions:o,documentation:a.documentation,hasAutoFix:a.hasAutoFix,hasAIFix:a.hasAIFix,allAIFixes:a.allAIFixes,dispose:()=>r.dispose()});return i=!0,e}else if(!s&&c.length>0){let s=t.selection.getPosition(),l=s,u=Number.MAX_VALUE,d=[...a.validActions];for(let i of c){let f=i.endColumn,p=i.endLineNumber,m=i.startLineNumber;if(p===s.lineNumber||m===s.lineNumber){l=new P(p,f);let i={type:t.trigger.type,triggerAction:t.trigger.triggerAction,filter:{include:t.trigger.filter?.include?t.trigger.filter?.include:Rp.QuickFix},autoApply:t.trigger.autoApply,context:{notAvailableMessage:t.trigger.context?.notAvailableMessage||``,position:l}},m=new I(l.lineNumber,l.column,l.lineNumber,l.column),h=r.add(await tm(this._registry,e,m,i,co.None,n));if(n.isCancellationRequested)return vm;if(h.validActions.length!==0){for(let e of h.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...c.filter(e=>e.relatedInformation)]);a.allActions.length===0&&o.push(...h.allActions),Math.abs(s.column-f)<u?d.unshift(...h.validActions):d.push(...h.validActions)}u=Math.abs(s.column-f)}}let f=d.filter((e,t,n)=>n.findIndex(t=>t.action.title===e.action.title)===t);f.sort((e,t)=>e.action.isPreferred&&!t.action.isPreferred?-1:!e.action.isPreferred&&t.action.isPreferred||e.action.isAI&&!t.action.isAI?1:!e.action.isAI&&t.action.isAI?-1:0);let p=this._setCodeActions({validActions:f,allActions:o,documentation:a.documentation,hasAutoFix:a.hasAutoFix,hasAIFix:a.hasAIFix,allAIFixes:a.allAIFixes,dispose:()=>r.dispose()});return i=!0,p}}finally{i||r.dispose()}}if(t.trigger.type===1){let r=await tm(this._registry,e,t.selection,t.trigger,co.None,n);return n.isCancellationRequested?(r.dispose(),vm):this._setCodeActions(r)}let r=await tm(this._registry,e,t.selection,t.trigger,co.None,n);return n.isCancellationRequested?(r.dispose(),vm):this._setCodeActions(r)});t.trigger.type===1&&this._progressService?.showWhile(r,250);let i=new _m.Triggered(t.trigger,n,r),a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&i.type===1&&i.trigger.type===2&&this._state.position!==i.position),a?setTimeout(()=>{this.setState(i)},500):this.setState(i)},void 0);n.ignoreLightbulbOff=this._ignoreLightbulbOff,this._codeActionOracle.value=n,this._codeActionOracle.value.trigger({type:2,triggerAction:zp.Default})}else this._supportedCodeActions.reset()}_setCodeActions(e){return this.codeActionsDisposable.value=e,e}takeCodeActions(e){if(this.codeActionsDisposable.value===e)return this.codeActionsDisposable.clearAndLeak(),e}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.clear()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}},bm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},xm=function(e,t){return function(n,r){t(n,r,e)}},Sm,Cm=v(`gutter-lightbulb`,k.lightBulb,S(925,`Icon which spawns code actions menu from the gutter when there is no space in the editor.`)),wm=v(`gutter-lightbulb-auto-fix`,k.lightbulbAutofix,S(926,`Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.`)),Tm=v(`gutter-lightbulb-sparkle`,k.lightbulbSparkle,S(927,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.`)),Em=v(`gutter-lightbulb-aifix-auto-fix`,k.lightbulbSparkleAutofix,S(928,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.`)),Dm=v(`gutter-lightbulb-sparkle-filled`,k.sparkleFilled,S(929,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.`)),Om;(function(e){e.Hidden={type:0};class t{constructor(e,t,n,r){this.actions=e,this.trigger=t,this.editorPosition=n,this.widgetPosition=r,this.type=1}}e.Showing=t})(Om||={});function km(e,t,n,r,i=!1){if(e.validActions.length<=0)return;let a,o=!1;e.allAIFixes?(a=i?Dm:k.sparkleFilled,e.validActions.length===1&&(o=!0)):a=e.hasAutoFix?e.hasAIFix?i?Em:k.lightbulbSparkleAutofix:i?wm:k.lightbulbAutofix:e.hasAIFix?i?Tm:k.lightbulbSparkle:i?Cm:k.lightBulb;let s;return s=o?S(930,`Run: {0}`,e.validActions[0].action.title):e.hasAutoFix&&n?S(931,`Show Code Actions. Preferred Quick Fix Available ({0})`,n):!e.hasAutoFix&&r?S(932,`Show Code Actions ({0})`,r):S(933,`Show Code Actions`),{actions:e,trigger:t,icon:a,autoRun:o,title:s,isGutter:i}}var Am=class extends T{static{Sm=this}static{this.GUTTER_DECORATION=Y.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:w.asClassName(k.lightBulb),glyphMargin:{position:Kr.Left},stickiness:1})}static{this.ID=`editor.contrib.lightbulbWidget`}static{this._posPref=[0]}static _computeLightBulbInfo(e,t,n,r){if(e.type===1)return km(e.actions,e.trigger,n,r,t)}constructor(e,t){super(),this._editor=e,this._keybindingService=t,this.onlyWithEmptySelection=!1,this._onClick=this._register(new h),this.onClick=this._onClick.event,this._state=na(this,Om.Hidden),this._gutterState=na(this,Om.Hidden),this._combinedInfo=J(this,e=>{let t=this._gutterState.read(e);if(t.type===1)return Sm._computeLightBulbInfo(t,!0,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e));let n=this._state.read(e);if(n.type===1)return Sm._computeLightBulbInfo(n,!1,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e))}),this._iconClasses=[],this.lightbulbClasses=[`codicon-`+Cm.id,`codicon-`+Em.id,`codicon-`+wm.id,`codicon-`+Tm.id,`codicon-`+Dm.id],this._preferredKbLabel=na(this,void 0),this._quickFixKbLabel=na(this,void 0),this.gutterDecoration=Sm.GUTTER_DECORATION,this._domNode=R(`div.lightBulbWidget`),this._domNode.role=`listbox`,this._register(Vr.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(e=>{let t=this._editor.getModel(),n=this._state.get();(n.type!==1||!t||n.editorPosition.lineNumber>=t.getLineCount())&&this.hide();let r=this._gutterState.get();(r.type!==1||!t||r.editorPosition.lineNumber>=t.getLineCount())&&this.gutterHide()})),this._register(zc(this._domNode,e=>{let t=this._state.get();if(t.type!==1)return;this._editor.focus(),e.preventDefault();let{top:n,height:r}=ms(this._domNode),i=this._editor.getOption(75),a=Math.floor(i/3);t.widgetPosition.position!==null&&t.widgetPosition.position.lineNumber<t.editorPosition.lineNumber&&(a+=i),this._onClick.fire({x:e.posx,y:n+r+a,actions:t.actions,trigger:t.trigger})})),this._register(V(this._domNode,`mouseenter`,e=>{(e.buttons&1)==1&&this.hide()})),this._register(Ps.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.autoFix`)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.quickFix`)?.getLabel()??void 0,void 0)})),this._register(a(e=>{let t=this._combinedInfo.read(e);this._updateLightBulbTitleAndIcon(t),this._updateGutterDecorationOptions(t)})),this._register(this._editor.onMouseDown(async e=>{if(!e.target.element||!this.lightbulbClasses.some(t=>e.target.element&&e.target.element.classList.contains(t)))return;let t=this._gutterState.get();if(t.type!==1)return;this._editor.focus();let{top:n,height:r}=ms(e.target.element),i=this._editor.getOption(75),a=Math.floor(i/3);t.widgetPosition.position!==null&&t.widgetPosition.position.lineNumber<t.editorPosition.lineNumber&&(a+=i),this._onClick.fire({x:e.event.posx,y:n+r+a,actions:t.actions,trigger:t.trigger})}))}dispose(){super.dispose(),this._editor.removeContentWidget(this),this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID)}getId(){return`LightBulbWidget`}getDomNode(){return this._domNode}getPosition(){let e=this._state.get();return e.type===1?e.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0||this.onlyWithEmptySelection&&!this._editor.getSelection()?.isEmpty()||!this._editor.hasTextFocus()||this._editor.getOptions().get(73).enabled===al.Off)return this.gutterHide(),this.hide();let r=this._editor.getModel();if(!r)return this.gutterHide(),this.hide();let{lineNumber:i,column:a}=r.validatePosition(n),o=r.getOptions().tabSize,s=this._editor.getOptions().get(59),c=ha(r.getLineContent(i),o),l=s.spaceWidth*c>22,u=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1),d=this._editor.getLineDecorations(i),f=!1;if(d)for(let e of d){let t=e.options.glyphMarginClassName;if(t&&!this.lightbulbClasses.some(e=>t.includes(e))){f=!0;break}}let p=i,m=1;if(!l){let o=e=>{let t=r.getLineContent(e);return/^\s*$|^\s+/.test(t)||t.length<=m};if(i>1&&!u(i-1)){let a=i===r.getLineCount(),s=i>1&&o(i-1),c=!a&&o(i+1),l=o(i),u=!c&&!s;if(!c&&!s&&!f)return this._gutterState.set(new Om.Showing(e,t,n,{position:{lineNumber:p,column:m},preference:Sm._posPref}),void 0),this.renderGutterLightbub(),this.hide();s||a||s&&!l?--p:(c||u&&l)&&(p+=1)}else if(i===1&&(i===r.getLineCount()||!o(i+1)&&!o(i)))if(this._gutterState.set(new Om.Showing(e,t,n,{position:{lineNumber:p,column:m},preference:Sm._posPref}),void 0),f)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(i<r.getLineCount()&&!u(i+1))p+=1;else if(a*s.spaceWidth<22)return this.hide();m=/^\S\s*$/.test(r.getLineContent(p))?2:1}this._state.set(new Om.Showing(e,t,n,{position:{lineNumber:p,column:m},preference:Sm._posPref}),void 0),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());let h=e.validActions,g=e.validActions[0].action.kind;if(h.length!==1||!g){this._editor.layoutContentWidget(this);return}this._editor.layoutContentWidget(this)}hide(){this._state.get()!==Om.Hidden&&(this._state.set(Om.Hidden,void 0),this._editor.layoutContentWidget(this))}gutterHide(){this._gutterState.get()!==Om.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this._gutterState.set(Om.Hidden,void 0))}_updateLightBulbTitleAndIcon(e){this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],!(!e||e.isGutter)&&(this._domNode.title=e.title,this._iconClasses=w.asClassNameArray(e.icon),this._domNode.classList.add(...this._iconClasses))}_updateGutterDecorationOptions(e){!e||!e.isGutter||(this.gutterDecoration=Y.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:w.asClassName(e.icon),glyphMargin:{position:Kr.Left},stickiness:1}))}renderGutterLightbub(){let e=this._editor.getSelection();e&&(this._gutterDecorationID===void 0?this._addGutterDecoration(e.startLineNumber):this._updateGutterDecoration(this._gutterDecorationID,e.startLineNumber))}_addGutterDecoration(e){this._editor.changeDecorations(t=>{this._gutterDecorationID=t.addDecoration(new D(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(n=>{n.changeDecoration(e,new D(t,0,t,0)),n.changeDecorationOptions(e,this.gutterDecoration)})}};Am=Sm=bm([xm(1,Mr)],Am);var jm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Mm=function(e,t){return function(n,r){t(n,r,e)}},Nm,Pm=`quickfix-edit-highlight`,Fm=class extends T{static{Nm=this}static{this.ID=`editor.contrib.codeActionController`}static get(e){return e.getContribution(Nm.ID)}constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(),this._commandService=o,this._configurationService=s,this._actionWidgetService=c,this._instantiationService=l,this._progressService=u,this._keybindingService=d,this._activeCodeActions=this._register(new un),this._showDisabled=!1,this._disposed=!1,this._onlyLightBulbWithEmptySelection=!1,this._lightBulbInfoObs=na(this,void 0),this._preferredKbLabel=na(this,void 0),this._quickFixKbLabel=na(this,void 0),this._editor=e,this._model=this._register(new ym(this._editor,i.codeActionProvider,t,n,a,s)),this._register(this._model.onDidChangeState(e=>this.update(e))),this._register(Ps.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.autoFix`)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.quickFix`)?.getLabel()??void 0,void 0)})),this._lightBulbWidget=new zo(()=>{let e=this._editor.getContribution(Am.ID);return e&&(this._register(e.onClick(e=>this.showCodeActionsFromLightbulb(e.actions,e))),e.onlyWithEmptySelection=this._onlyLightBulbWithEmptySelection),e}),this._resolver=r.createInstance(dm),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){let t=e.validActions[0],n=t.action.command;n&&n.id===`inlineChat.start`&&n.arguments&&n.arguments.length>=1&&n.arguments[0]&&(n.arguments[0]={...n.arguments[0],autoSend:!1}),await this.applyCodeAction(t,!1,!1,am.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,r){if(!this._editor.hasModel())return;of.get(this._editor)?.closeMessage();let i=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:r,context:{notAvailableMessage:e,position:i}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,n,r){let i=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(om,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:zp.QuickFix,filter:{}}),i.done()}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==1){this.hideLightBulbWidget(),this._lightBulbInfoObs.set(void 0,void 0);return}let t;try{t=this._model.takeCodeActions(await e.actions)}catch(e){ye(e);return}if(t){if(this._disposed){t.dispose();return}if(this._editor.getSelection()?.startLineNumber!==e.position.lineNumber){t.dispose();return}if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),this._lightBulbInfoObs.set(km(t,e.trigger,this._preferredKbLabel.get(),this._quickFixKbLabel.get()),void 0),e.trigger.type===1){if(e.trigger.filter?.include){let n=this.tryGetValidActionToApply(e.trigger,t);if(n){try{this.hideLightBulbWidget(),await this.applyCodeAction(n,!1,!1,am.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){let n=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(n&&n.action.disabled){of.get(this._editor)?.showMessage(n.action.disabled,e.trigger.context.position),t.dispose();return}}}let n=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!n&&!t.validActions.length)){of.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:n,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply===`first`&&t.validActions.length===0||e.autoApply===`ifSingle`&&t.allActions.length===1))return t.allActions.find(({action:e})=>e.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===`first`&&t.validActions.length>0||e.autoApply===`ifSingle`&&t.validActions.length===1))return t.validActions[0]}static{this.DECORATION=Y.register({description:`quickfix-highlight`,className:Pm})}async showCodeActionList(e,t,n){let r=this._editor.createDecorationsCollection(),i=this._editor.getDomNode();if(!i)return;let a=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!a.length)return;let o=P.isIPosition(t)?this.toCoords(t):t;this._actionWidgetService.show(`codeActionWidget`,!0,mm(a,this._shouldShowHeaders(),this._resolver.getResolver()),{onSelect:async(e,t)=>{this.applyCodeAction(e,!0,!!t,n.fromLightbulb?am.FromAILightbulb:am.FromCodeActions),this._actionWidgetService.hide(!1),r.clear()},onHide:e=>{this._editor?.focus(),r.clear()},onHover:async(e,t)=>{if(t.isCancellationRequested)return;let n=!1,r=e.action.kind;if(r){let e=new Xd(r);n=[Rp.RefactorExtract,Rp.RefactorInline,Rp.RefactorRewrite,Rp.RefactorMove,Rp.Source].some(t=>t.contains(e))}return{canPreview:n||!!e.action.edit?.edits.length}},onFocus:e=>{if(e&&e.action){let t=e.action.ranges,n=e.action.diagnostics;if(r.clear(),t&&t.length>0){let e=n&&n?.length>1?n.map(e=>({range:e,options:Nm.DECORATION})):t.map(e=>({range:e,options:Nm.DECORATION}));r.set(e)}else if(n&&n.length>0){let e=n.map(e=>({range:e,options:Nm.DECORATION}));r.set(e);let t=n[0];if(t.startLineNumber&&t.startColumn){let e=this._editor.getModel()?.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn})?.word;zt(S(914,`Context: {0} at line {1} and column {2}.`,e,t.startLineNumber,t.startColumn))}}}else r.clear()}},o,i,this._getActionBarActions(e,t,n))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();let t=this._editor.getScrolledVisiblePosition(e),n=ms(this._editor.getDomNode());return{x:n.left+t.left,y:n.top+t.top+t.height}}_shouldShowHeaders(){let e=this._editor?.getModel();return this._configurationService.getValue(`editor.codeActionWidget.showHeaders`,{resource:e?.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];let r=e.documentation.map(e=>({id:e.id,label:e.title,tooltip:e.tooltip??``,class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(e.id,...e.arguments??[])}));return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:`hideMoreActions`,label:S(915,`Hide Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:`showMoreActions`,label:S(916,`Show Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};Fm=Nm=jm([Mm(1,os),Mm(2,W),Mm(3,E),Mm(4,K),Mm(5,Hc),Mm(6,nr),Mm(7,Oa),Mm(8,up),Mm(9,E),Mm(10,Hc),Mm(11,Mr)],Fm),Oc((e,t)=>{((e,n)=>{n&&t.addRule(`.monaco-editor ${e} { background-color: ${n}; }`)})(`.quickfix-edit-highlight`,e.getColor(zl));let n=e.getColor(wc);n&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${ei(e.type)?`dotted`:`solid`} ${n}; box-sizing: border-box; }`)});function Im(e){return m.regex(hm.keys()[0],RegExp(`(\\s|^)`+d(e.value)+`\\b`))}var Lm={type:`object`,defaultSnippets:[{body:{kind:``}}],properties:{kind:{type:`string`,description:S(882,`Kind of the code action to run.`)},apply:{type:`string`,description:S(883,`Controls when the returned actions are applied.`),default:`ifSingle`,enum:[`first`,`ifSingle`,`never`],enumDescriptions:[S(884,`Always apply the first returned code action.`),S(885,`Apply the first returned code action if it is the only one.`),S(886,`Do not apply the returned code actions.`)]},preferred:{type:`boolean`,default:!1,description:S(887,`Controls if only preferred code actions should be returned.`)}}};function Rm(e,t,n,r,i=zp.Default){e.hasModel()&&Fm.get(e)?.manualTriggerAtCurrentPosition(t,i,n,r)}var zm=class extends Ri{constructor(){super({id:Kp,title:N(904,`Quick Fix...`),precondition:m.and(B.writable,B.hasCodeActionsProvider),icon:k.lightBulb,f1:!0,keybinding:{when:B.textInputFocus,primary:2137,weight:100},menu:{id:X.InlineChatEditorAffordance,group:`1_quickfix`,order:0,when:m.and(B.writable,B.hasCodeActionsProvider)}})}runEditorCommand(e,t){return Rm(t,S(888,`No code actions available`),void 0,void 0,zp.QuickFix)}},Bm=class extends ht{constructor(){super({id:Gp,precondition:m.and(B.writable,B.hasCodeActionsProvider),metadata:{description:`Trigger a code action`,args:[{name:`args`,schema:Lm}]}})}runEditorCommand(e,t,n){let r=Up.fromUser(n,{kind:Xd.Empty,apply:`ifSingle`});return Rm(t,typeof n?.kind==`string`?r.preferred?S(889,`No preferred code actions for '{0}' available`,n.kind):S(890,`No code actions for '{0}' available`,n.kind):r.preferred?S(891,`No preferred code actions available`):S(892,`No code actions available`),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}},Vm=class extends F{constructor(){super({id:Jp,label:N(905,`Refactor...`),precondition:m.and(B.writable,B.hasCodeActionsProvider),kbOpts:{kbExpr:B.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:`1_modification`,order:2,when:m.and(B.writable,Im(Rp.Refactor))},metadata:{description:`Refactor...`,args:[{name:`args`,schema:Lm}]}})}run(e,t,n){let r=Up.fromUser(n,{kind:Rp.Refactor,apply:`never`});return Rm(t,typeof n?.kind==`string`?r.preferred?S(893,`No preferred refactorings for '{0}' available`,n.kind):S(894,`No refactorings for '{0}' available`,n.kind):r.preferred?S(895,`No preferred refactorings available`):S(896,`No refactorings available`),{include:Rp.Refactor.contains(r.kind)?r.kind:Xd.None,onlyIncludePreferredActions:r.preferred},r.apply,zp.Refactor)}},Hm=class extends F{constructor(){super({id:Yp,label:N(906,`Source Action...`),precondition:m.and(B.writable,B.hasCodeActionsProvider),contextMenuOpts:{group:`1_modification`,order:2.1,when:m.and(B.writable,Im(Rp.Source))},metadata:{description:`Source Action...`,args:[{name:`args`,schema:Lm}]}})}run(e,t,n){let r=Up.fromUser(n,{kind:Rp.Source,apply:`never`});return Rm(t,typeof n?.kind==`string`?r.preferred?S(897,`No preferred source actions for '{0}' available`,n.kind):S(898,`No source actions for '{0}' available`,n.kind):r.preferred?S(899,`No preferred source actions available`):S(900,`No source actions available`),{include:Rp.Source.contains(r.kind)?r.kind:Xd.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,zp.SourceAction)}},Um=class extends F{constructor(){super({id:Xp,label:N(907,`Organize Imports`),precondition:m.and(B.writable,Im(Rp.SourceOrganizeImports)),kbOpts:{kbExpr:B.textInputFocus,primary:1581,weight:100},metadata:{description:N(908,`Organize imports in the current file. Also called 'Optimize Imports' by some tools`)}})}run(e,t){return Rm(t,S(901,`No organize imports action available`),{include:Rp.SourceOrganizeImports,includeSourceActions:!0},`ifSingle`,zp.OrganizeImports)}},Wm=class extends F{constructor(){super({id:Zp,label:N(909,`Fix All`),precondition:m.and(B.writable,Im(Rp.SourceFixAll))})}run(e,t){return Rm(t,S(902,`No fix all action available`),{include:Rp.SourceFixAll,includeSourceActions:!0},`ifSingle`,zp.FixAll)}},Gm=class extends F{constructor(){super({id:qp,label:N(910,`Auto Fix...`),precondition:m.and(B.writable,Im(Rp.QuickFix)),kbOpts:{kbExpr:B.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Rm(t,S(903,`No auto fixes available`),{include:Rp.QuickFix,onlyIncludePreferredActions:!0},`ifSingle`,zp.AutoFix)}};L(Fm.ID,Fm,3),L(Am.ID,Am,4),C(zm),j(Vm),j(Hm),j(Um),j(Gm),j(Wm),z(new Bm),Wn.as(Ko.Configuration).registerConfiguration({...yu,properties:{"editor.codeActionWidget.showHeaders":{type:`boolean`,scope:6,description:S(911,`Enable/disable showing group headers in the Code Action menu.`),default:!0}}}),Wn.as(Ko.Configuration).registerConfiguration({...yu,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:`boolean`,scope:6,description:S(912,`Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.`),default:!0}}}),Wn.as(Ko.Configuration).registerConfiguration({...yu,properties:{"editor.codeActions.triggerOnFocusChange":{type:`boolean`,scope:6,markdownDescription:S(913,`Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.`,"`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});var Km=class e{constructor(){this.lenses=[]}static{this.Empty=new e}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){xi(e)&&(this._store??=new A,this._store.add(e));for(let n of e.lenses)this.lenses.push({symbol:n,provider:t})}};async function qm(e,t,n){let r=e.ordered(t),i=new Map,a=new Km,o=r.map(async(e,r)=>{i.set(e,r);try{let r=await Promise.resolve(e.provideCodeLenses(t,n));r&&a.add(r,e)}catch(e){Tu(e)}});return await Promise.all(o),n.isCancellationRequested?(a.dispose(),Km.Empty):(a.lenses=a.lenses.sort((e,t)=>e.symbol.range.startLineNumber<t.symbol.range.startLineNumber?-1:e.symbol.range.startLineNumber>t.symbol.range.startLineNumber?1:i.get(e.provider)<i.get(t.provider)?-1:i.get(e.provider)>i.get(t.provider)?1:e.symbol.range.startColumn<t.symbol.range.startColumn?-1:+(e.symbol.range.startColumn>t.symbol.range.startColumn)),a)}Mn.registerCommand(`_executeCodeLensProvider`,function(e,...t){let[n,r]=t;q(Ot.isUri(n)),q(typeof r==`number`||!r);let{codeLensProvider:i}=e.get(K),a=e.get(bt).getModel(n);if(!a)throw Lu();let o=[],s=new A;return qm(i,a,x.None).then(e=>{s.add(e);let t=[];for(let n of e.lenses)r==null||n.symbol.command?o.push(n.symbol):r-- >0&&n.provider.resolveCodeLens&&t.push(Promise.resolve(n.provider.resolveCodeLens(a,n.symbol,x.None)).then(e=>o.push(e||n.symbol)));return Promise.all(t)}).then(()=>o).finally(()=>{setTimeout(()=>s.dispose(),100)})});var Jm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ym=function(e,t){return function(n,r){t(n,r,e)}},Xm=Xt(`ICodeLensCache`),Zm=class{constructor(e,t){this.lineCount=e,this.data=t}},Qm=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw Error(`not supported`)}},this._cache=new Zo(20,.75),Fn(He,()=>e.remove(`codelens/cache`,1));let t=`codelens/cache2`,n=e.get(t,1,`{}`);this._deserialize(n);let r=Ps.filter(e.onWillSaveState,e=>e.reason===yc.SHUTDOWN);Ps.once(r)(n=>{e.store(t,this._serialize(),1,1)})}put(e,t){let n=t.lenses.map(e=>({range:e.symbol.range,command:e.symbol.command&&{id:``,title:e.symbol.command?.title}})),r=new Km;r.add({lenses:n},this._fakeProvider);let i=new Zm(e.getLineCount(),r);this._cache.set(e.uri.toString(),i)}get(e){let t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){let e=Object.create(null);for(let[t,n]of this._cache){let r=new Set;for(let e of n.data.lenses)r.add(e.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{let t=JSON.parse(e);for(let e in t){let n=t[e],r=[];for(let e of n.lines)r.push({range:new D(e,1,e,11)});let i=new Km;i.add({lenses:r},this._fakeProvider),this._cache.set(e,new Zm(n.lineCount,i))}}catch{}}};Qm=Jm([Ym(0,Qc)],Qm),vs(Xm,Qm,1);var $m=class{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement(`div`)}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute(`monaco-visible-view-zone`)}},eh=class e{static{this._idPool=0}constructor(t,n){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=t,this._id=`codelens.widget-${e._idPool++}`,this.updatePosition(n),this._domNode=document.createElement(`span`),this._domNode.className=`codelens-decoration`}withCommands(t,n){this._commands.clear();let r=[],i=!1;for(let n=0;n<t.length;n++){let a=t[n];if(a&&(i=!0,a.command)){let i=le(a.command.title.trim());if(a.command.id){let t=`c${e._idPool++}`;r.push(R(`a`,{id:t,title:a.command.tooltip,role:`button`},...i)),this._commands.set(t,a.command)}else r.push(R(`span`,{title:a.command.tooltip},...i));n+1<t.length&&r.push(R(`span`,void 0,`\xA0|\xA0`))}}i?(Is(this._domNode,...r),this._isEmpty&&n&&this._domNode.classList.add(`fadein`),this._isEmpty=!1):Is(this._domNode,R(`span`,void 0,`no commands`))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){let t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}},th=class{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){let t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let e=0,n=t.length;e<n;e++)this._addDecorationsCallbacks[e](t[e])}},nh=Y.register({collapseOnReplaceEdit:!0,description:`codelens`}),rh=class{constructor(e,t,n,r,i,a){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let o,s=[];this._data.forEach((e,t)=>{e.symbol.command&&s.push(e.symbol),n.addDecoration({range:e.symbol.range,options:nh},e=>this._decorationIds[t]=e),o=o?D.plusRange(o,e.symbol.range):D.lift(e.symbol.range)}),this._viewZone=new $m(o.startLineNumber-1,i,a),this._viewZoneId=r.addZone(this._viewZone),s.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(s,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new eh(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&=(this._editor.removeContentWidget(this._contentWidget),void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{let n=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(n&&D.isEmpty(r.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((e,n)=>{t.addDecoration({range:e.symbol.range,options:nh},e=>this._decorationIds[n]=e)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){let n=e.getDecorationRange(this._decorationIds[t]);n&&(this._data[t].symbol.range=n)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){let n=e[t];if(n){let{symbol:e}=this._data[t];e.command=n.command||e.command}}}getCommand(e){return this._contentWidget?.getCommand(e)}getLineNumber(){let e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){let t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}},ih=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ah=function(e,t){return function(n,r){t(n,r,e)}},oh=class{static{this.ID=`css.editor.codeLens`}constructor(e,t,n,r,i,a){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=i,this._codeLensCache=a,this._disposables=new A,this._localToDispose=new A,this._lenses=[],this._oldCodeLensModels=new A,this._provideCodeLensDebounce=n.for(t.codeLensProvider,`CodeLensProvide`,{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,`CodeLensResolve`,{min:250,salt:`resolve`}),this._resolveCodeLensesScheduler=new xa(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(e=>{(e.hasChanged(59)||e.hasChanged(25)||e.hasChanged(24))&&this._updateLensStyle(),e.hasChanged(23)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._resolveCodeLensesScheduler.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){let e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61)),t=this._editor.getOption(25);return(!t||t<5)&&(t=this._editor.getOption(61)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){let{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(24),r=this._editor.getOption(59),{style:i}=this._editor.getContainerDomNode();i.setProperty(`--vscode-editorCodeLens-lineHeight`,`${e}px`),i.setProperty(`--vscode-editorCodeLens-fontSize`,`${t}px`),i.setProperty(`--vscode-editorCodeLens-fontFeatureSettings`,r.fontFeatureSettings),n&&(i.setProperty(`--vscode-editorCodeLens-fontFamily`,n),i.setProperty(`--vscode-editorCodeLens-fontFamilyDefault`,Hi.fontFamily)),this._editor.changeViewZones(t=>{for(let n of this._lenses)n.updateHeight(e,t)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();let e=this._editor.getModel();if(!e||!this._editor.getOption(23)||e.isTooLargeForTokenization())return;let t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&Iu(()=>{t===this._codeLensCache.get(e)&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(let t of this._languageFeaturesService.codeLensProvider.all(e))if(typeof t.onDidChange==`function`){let e=t.onDidChange(()=>n.schedule());this._localToDispose.add(e)}let n=new xa(()=>{let t=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=Ga(t=>qm(this._languageFeaturesService.codeLensProvider,e,t)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r),n.delay=this._provideCodeLensDebounce.update(e,Date.now()-t),this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},ye)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(xt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let n=[],r=-1;this._lenses.forEach(e=>{!e.isValid()||r===e.getLineNumber()?n.push(e):(e.update(t),r=e.getLineNumber())});let i=new th;n.forEach(e=>{e.dispose(i,t),this._lenses.splice(this._lenses.indexOf(e),1)}),i.commit(e)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(xt(()=>{if(this._editor.getModel()){let e=Ra.capture(this._editor);this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{this._disposeAllLenses(e,t)})}),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(e=>{if(e.target.type!==9)return;let t=e.target.element;if(t?.tagName===`SPAN`&&(t=t.parentElement),t?.tagName===`A`)for(let e of this._lenses){let n=e.getCommand(t);if(n){this._commandService.executeCommand(n.id,...n.arguments||[]).catch(e=>this._notificationService.error(e));break}}})),n.schedule()}_disposeAllLenses(e,t){let n=new th;for(let e of this._lenses)e.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t=this._editor.getModel().getLineCount(),n=[],r;for(let i of e.lenses){let e=i.symbol.range.startLineNumber;e<1||e>t||(r&&r[r.length-1].symbol.range.startLineNumber===e?r.push(i):(r=[i],n.push(r)))}if(!n.length&&!this._lenses.length)return;let i=Ra.capture(this._editor),a=this._getLayoutInfo();this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let r=new th,i=0,o=0;for(;o<n.length&&i<this._lenses.length;){let e=n[o][0].symbol.range.startLineNumber,s=this._lenses[i].getLineNumber();s<e?(this._lenses[i].dispose(r,t),this._lenses.splice(i,1)):s===e?(this._lenses[i].updateCodeLensSymbols(n[o],r),o++,i++):(this._lenses.splice(i,0,new rh(n[o],this._editor,r,t,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),i++,o++)}for(;i<this._lenses.length;)this._lenses[i].dispose(r,t),this._lenses.splice(i,1);for(;o<n.length;)this._lenses.push(new rh(n[o],this._editor,r,t,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),o++;r.commit(e)})}),i.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;let e=this._editor.getModel();if(!e)return;let t=[],n=[];if(this._lenses.forEach(r=>{let i=r.computeIfNecessary(e);i&&(t.push(i),n.push(r))}),t.length===0){this._oldCodeLensModels.clear();return}let r=Date.now(),i=Ga(r=>{let i=t.map((t,i)=>{let a=Array(t.length),o=t.map((t,n)=>!t.symbol.command&&typeof t.provider.resolveCodeLens==`function`?Promise.resolve(t.provider.resolveCodeLens(e,t.symbol,r)).then(e=>{a[n]=e},Tu):(a[n]=t.symbol,Promise.resolve(void 0)));return Promise.all(o).then(()=>{!r.isCancellationRequested&&!n[i].isDisposed()&&n[i].updateCommands(a)})});return Promise.all(i)});this._resolveCodeLensesPromise=i,this._resolveCodeLensesPromise.then(()=>{let t=this._resolveCodeLensesDebounce.update(e,Date.now()-r);this._resolveCodeLensesScheduler.delay=t,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},e=>{ye(e),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}};oh=ih([ah(1,K),ah(2,nl),ah(3,nr),ah(4,hi),ah(5,Xm)],oh),L(oh.ID,oh,1),j(class extends F{constructor(){super({id:`codelens.showLensesInCurrentLine`,precondition:B.hasCodeLensProvider,label:N(935,`Show CodeLens Commands for Current Line`)})}async run(e,t){if(!t.hasModel())return;let n=e.get(zi),r=e.get(nr),i=e.get(hi),a=t.getSelection().positionLineNumber,o=t.getContribution(oh.ID);if(!o)return;let s=await o.getModel();if(!s)return;let c=[];for(let e of s.lenses)e.symbol.command&&e.symbol.range.startLineNumber===a&&c.push({label:e.symbol.command.title,command:e.symbol.command});if(c.length===0)return;let l=await n.pick(c,{canPickMany:!1,placeHolder:S(934,`Select a command`)});if(!l)return;let u=l.command;if(s.isDisposed){let e=(await o.getModel())?.lenses.find(e=>e.symbol.range.startLineNumber===a&&e.symbol.command?.title===u.title);if(!e||!e.symbol.command)return;u=e.symbol.command}try{await r.executeCommand(u.id,...u.arguments||[])}catch(e){i.error(e)}}});var sh=class{constructor(e,t,n,r){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=r,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}},ch=class{constructor(e,t,n,r,i,a){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=i,this.supportsMarkerHover=a,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}},lh=class{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(let e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}},uh=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}},dh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},fh=function(e,t){return function(n,r){t(n,r,e)}},ph=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){let r=t.range,i=t.color,a=new U(new Vc(Math.round(255*i.red),Math.round(255*i.green),Math.round(255*i.blue),i.alpha)),o=U.Format.CSS.formatRGB(a),s=U.Format.CSS.formatHSL(a),c=U.Format.CSS.formatHexA(a,!0),l=[];return l.push({label:o,textEdit:{range:r,text:o}}),l.push({label:s,textEdit:{range:r,text:s}}),l.push({label:c,textEdit:{range:r,text:c}}),l}};ph=dh([fh(0,ia)],ph);var mh=class extends T{constructor(e,t){super(),this._register(e.colorProvider.register(`*`,new ph(t)))}};mh=dh([fh(0,K),fh(1,ia)],mh);async function hh(e,t,n,r=`auto`){return bh(new _h,e,t,n,r)}function gh(e,t,n,r){return Promise.resolve(n.provideColorPresentations(e,t,r))}var _h=class{constructor(){}async compute(e,t,n,r){let i=await e.provideDocumentColors(t,n);if(Array.isArray(i))for(let t of i)r.push({colorInfo:t,provider:e});return Array.isArray(i)}},vh=class{constructor(){}async compute(e,t,n,r){let i=await e.provideDocumentColors(t,n);if(Array.isArray(i))for(let e of i)r.push({range:e.range,color:[e.color.red,e.color.green,e.color.blue,e.color.alpha]});return Array.isArray(i)}},yh=class{constructor(e){this.colorInfo=e}async compute(e,t,n,r){let i=await e.provideColorPresentations(t,this.colorInfo,x.None);return Array.isArray(i)&&r.push(...i),Array.isArray(i)}};async function bh(e,t,n,r,i){let a=!1,o,s=[],c=t.ordered(n);for(let t=c.length-1;t>=0;t--){let l=c[t];if(i!==`always`&&l instanceof ph)o=l;else try{await e.compute(l,n,r,s)&&(a=!0)}catch(e){Tu(e)}}return a?s:o&&i!==`never`?(await e.compute(o,n,r,s),s):[]}function xh(e,t){let{colorProvider:n}=e.get(K),r=e.get(bt).getModel(t);if(!r)throw Lu();return{model:r,colorProviderRegistry:n,defaultColorDecoratorsEnablement:e.get(Oa).getValue(`editor.defaultColorDecorators`,{resource:t})}}var Sh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ch=function(e,t){return function(n,r){t(n,r,e)}},wh,Th=Object.create({}),Eh=class extends T{static{wh=this}static{this.ID=`editor.contrib.colorDetector`}static{this.RECOMPUTE_TIME=1e3}static{this.colorDecoratorInnerWidthInEm=.8}static{this.colorDecoratorMarginInEm=.2}constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new A),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new Dh),this._colorDecorationClassRefs=this._register(new A),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new qs(this._editor));let i=this._editor.getContainerDomNode();i.style.setProperty(`--vscode-colorPicker-colorDecoratorWidth`,`${wh.colorDecoratorInnerWidthInEm}em`),i.style.setProperty(`--vscode-colorPicker-colorDecoratorMargin`,`${wh.colorDecoratorMarginInEm}em`),this._register(xt(()=>{i.style.removeProperty(`--vscode-colorPicker-colorDecoratorWidth`),i.style.removeProperty(`--vscode-colorPicker-colorDecoratorMargin`)})),this._debounceInformation=r.for(n.colorProvider,`Document Colors`,{min:wh.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(e=>{let t=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(168);let n=t!==this._isColorDecoratorsEnabled||e.hasChanged(27),r=e.hasChanged(168);(n||r)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(168),this.updateColors()}isEnabled(){let e=this._editor.getModel();if(!e)return!1;let t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n==`object`){let e=n.colorDecorators;if(e&&e.enable!==void 0&&!e.enable)return e.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled){this.removeAllDecorations();return}let e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new fu,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Ga(async e=>{let t=this._editor.getModel();if(!t)return[];let n=new Nn(!1),r=await hh(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,n.elapsed()),r});try{let e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){ye(e)}}stop(){this._timeoutTimer&&=(this._timeoutTimer.cancel(),null),this._computePromise&&=(this._computePromise.cancel(),null),this._localToDispose.clear()}updateDecorations(e){let t=e.map(e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:Y.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((t,n)=>this._colorDatas.set(t,e[n]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();let t=[],n=wh.colorDecoratorInnerWidthInEm+2*wh.colorDecoratorMarginInEm,r=this._editor.getOption(27);for(let i=0;i<e.length&&t.length<r;i++){let{red:r,green:a,blue:o,alpha:s}=e[i].colorInfo.color,c=new Vc(Math.round(r*255),Math.round(a*255),Math.round(o*255),s),l=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,u=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:l}));t.push({range:{startLineNumber:e[i].colorInfo.range.startLineNumber,startColumn:e[i].colorInfo.range.startColumn,endLineNumber:e[i].colorInfo.range.endLineNumber,endColumn:e[i].colorInfo.range.endColumn},options:{description:`colorDetector`,before:{content:`\xA0`,inlineClassName:`${u.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:Th,widthInEm:n}}})}let i=r<e.length?r:!1;this._decoratorLimitReporter.update(e.length,i),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){let t=this._editor.getModel();if(!t)return null;let n=t.getDecorationsInRange(D.fromPositions(e,e)).filter(e=>this._colorDatas.has(e.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Eh=wh=Sh([Ch(1,Oa),Ch(2,K),Ch(3,nl)],Eh);var Dh=class extends T{constructor(){super(...arguments),this._onDidChange=this._register(new h),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}},Oh=`editor.action.showHover`,kh=`editor.action.showDefinitionPreviewHover`,Ah=`editor.action.hideHover`,jh=`editor.action.scrollUpHover`,Mh=`editor.action.scrollDownHover`,Nh=`editor.action.scrollLeftHover`,Ph=`editor.action.scrollRightHover`,Fh=`editor.action.pageUpHover`,Ih=`editor.action.pageDownHover`,Lh=`editor.action.goToTopHover`,Rh=`editor.action.goToBottomHover`,zh=`editor.action.increaseHoverVerbosityLevel`,Bh=S(1160,`Increase Hover Verbosity Level`),Vh=`editor.action.decreaseHoverVerbosityLevel`,Hh=S(1161,`Decrease Hover Verbosity Level`),Uh=`editor.action.hideLongLineWarningHover`,Wh=`editor.action.inlineSuggest.commit`,Gh=`editor.action.inlineSuggest.commitAlternativeAction`,Kh=`editor.action.inlineSuggest.showPrevious`,qh=`editor.action.inlineSuggest.showNext`,Jh=`editor.action.inlineSuggest.jump`,Yh=`editor.action.inlineSuggest.hide`,Xh=`editor.action.inlineSuggest.toggleShowCollapsed`,Zh=`editor.action.inlineSuggest.renameSymbol`,Qh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},$h=function(e,t){return function(n,r){t(n,r,e)}},eg,tg=class extends T{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=$t(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar===`always`),this.sessionPosition=void 0,this.position=J(this,e=>{let t=this.model.read(e)?.primaryGhostText.read(e);if(!this.alwaysShowToolbar.read(e)||!t||t.parts.length===0)return this.sessionPosition=void 0,null;let n=t.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==t.lineNumber&&(this.sessionPosition=void 0);let r=new P(t.lineNumber,Math.min(n,this.sessionPosition?.column??2**53-1));return this.sessionPosition=r,r}),this._register(Xl((t,n)=>{let r=this.model.read(t);if(!r||!this.alwaysShowToolbar.read(t))return;let i=J(t=>{let n=t.store.add(this.instantiationService.createInstance(ig.hot.read(t),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(n),t.store.add(xt(()=>e.removeContentWidget(n))),t.store.add(a(e=>{this.position.read(e)&&r.lastTriggerKind.read(e)!==mn.Explicit&&r.triggerExplicitly()})),n}),o=Ci(this,(e,t)=>!!this.position.read(e)||!!t);n.add(a(e=>{o.read(e)&&i.read(e)}))}))}};tg=Qh([$h(2,E)],tg);var ng=v(`inline-suggestion-hints-next`,k.chevronRight,S(1270,`Icon for show next parameter hint.`)),rg=v(`inline-suggestion-hints-previous`,k.chevronLeft,S(1271,`Icon for show previous parameter hint.`)),ig=class extends T{static{eg=this}static{this.hot=el(this)}static{this._dropDownVisible=!1}static get dropDownVisible(){return this._dropDownVisible}static{this.id=0}createCommandAction(e,t,n){let r=new ln(e,t,n,!0,()=>this._commandService.executeCommand(e));return r.tooltip=this.keybindingService.appendKeybinding(t,e,this._contextKeyService),r}constructor(e,t,n,r,i,o,s,c,l,u,d,f,p){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=i,this._extraCommands=o,this._warning=s,this._relayout=c,this._commandService=l,this.keybindingService=d,this._contextKeyService=f,this._menuService=p,this.id=`InlineSuggestionHintsContentWidget${eg.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=J(e=>{let t=this._warning.read(e);if(t)return typeof t.message==`string`?t.message:e.store.add(Ar(t.message)).element}),this._warningMessageNode=_.div({class:`warningMessage`,style:{maxWidth:400,margin:4,marginBottom:4,display:J(e=>this._warning.read(e)?`block`:`none`)}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=Hr(`div.inlineSuggestionsHints`,{className:this.withBorder?`monaco-hover monaco-hover-content`:``},[this._warningMessageNode.element,Hr(`div@toolBar`)]),this.previousAction=this._register(this.createCommandAction(Kh,S(1272,`Previous`),w.asClassName(rg))),this.availableSuggestionCountAction=this._register(new ln(`inlineSuggestionHints.availableSuggestionCount`,``,void 0,!1)),this.nextAction=this._register(this.createCommandAction(qh,S(1273,`Next`),w.asClassName(ng))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(X.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new xa(()=>{this.availableSuggestionCountAction.label=``},100)),this.disableButtonsDebounced=this._register(new xa(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(a(e=>{this._warningMessageContentNode.read(e),this._warningMessageNode.readEffect(e),this._relayout()})),this.toolBar=this._register(u.createInstance(sg,this.nodes.toolBar,X.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith(`primary`)},actionViewItemProvider:(e,t)=>{if(e instanceof Rr)return u.createInstance(og,e,void 0);if(e===this.availableSuggestionCountAction){let t=new ag(void 0,e,{label:!0,icon:!1});return t.setClass(`availableSuggestionCount`),t}},telemetrySource:`InlineSuggestionToolbar`})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(e=>{eg._dropDownVisible=e})),this._register(a(e=>{this._position.read(e),this.editor.layoutContentWidget(this)})),this._register(a(e=>{let t=this._suggestionCount.read(e),n=this._currentSuggestionIdx.read(e);t===void 0?this.clearAvailableSuggestionCountLabelDebounced.schedule():(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${n+1}/${t}`),t!==void 0&&t>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(a(e=>{let t=this._extraCommands.read(e).map(e=>({class:void 0,id:e.command.id,enabled:!0,tooltip:e.command.tooltip||``,label:e.command.title,run:()=>this._commandService.executeCommand(e.command.id,...e.command.arguments??[])}));for(let[e,n]of this.inlineCompletionsActionsMenus.getActions())for(let e of n)e instanceof Rr&&t.push(e);t.length>0&&t.unshift(new Er),this.toolBar.setAdditionalSecondaryActions(t)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};ig=eg=Qh([$h(8,nr),$h(9,E),$h(10,Mr),$h(11,W),$h(12,Wa)],ig);var ag=class extends tt{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}},og=class extends Ac{updateLabel(){let e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){let t=Hr(`div.keybinding`).root;this._register(new oi(t,ea,{disableTitle:!0,...Ye})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add(`inlineSuggestionStatusBarItemLabel`)}}updateTooltip(){}},sg=class extends Gl{constructor(e,t,n,r,i,a,o,s,c){super(e,{resetMenu:t,...n},r,i,a,o,s,c),this.menuId=t,this.options2=n,this.menuService=r,this.contextKeyService=i,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){let{primary:e,secondary:t}=Ia(this.menu.getActions(this.options2?.menuOptions),this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions);t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),e.push(...this.additionalPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Xe(this.prependedPrimaryActions,e,(e,t)=>e===t)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Xe(this.additionalActions,e,(e,t)=>e===t)||(this.additionalActions=e,this.updateToolbar())}};sg=Qh([$h(3,Wa),$h(4,W),$h(5,Ur),$h(6,Mr),$h(7,nr),$h(8,du)],sg);function cg(e,t,n){let r=ms(e);return!(t<r.left+3||t>r.left+r.width-3||n<r.top+3||n>r.top+r.height-3)}function lg(e,t,n){return e===`on`?!0:e===`off`?!1:ug(t,n.event)}function ug(e,t){return e===`altKey`?t.ctrlKey||t.metaKey:t.altKey}var dg=class{constructor(e,t,n,r){this.value=e,this.isComplete=t,this.hasLoadingMessage=n,this.options=r}},fg=class extends T{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new h),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new pg(e=>this._triggerAsyncComputation(e),0)),this._syncComputationScheduler=this._register(new pg(e=>this._triggerSyncComputation(e),0)),this._loadingMessageScheduler=this._register(new pg(e=>this._triggerLoadingMessage(e),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&=(this._asyncIterable.cancel(),null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=Yu(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(let t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0,e)}catch(e){ye(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){this._state===3&&this._setState(4,e)}_fireResult(e){if(this._state===1||this._state===2)return;let t=this._state===0,n=this._state===4;this._onResult.fire(new dg(this._result.slice(0),t,n,e))}start(e,t){if(e===0)this._state===0&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&=(this._asyncIterable.cancel(),null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}},pg=class extends T{constructor(e,t){super(),this._scheduler=this._register(new xa(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}},mg=class{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new h,this._onDidResize=new h,this._sashListener=new A,this._size=new Ui(0,0),this._minSize=new Ui(0,0),this._maxSize=new Ui(2**53-1,2**53-1),this.domNode=document.createElement(`div`),this._eastSash=new gu(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new gu(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new gu(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:Ta.North}),this._southSash=new gu(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:Ta.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,n=0;this._sashListener.add(Ps.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(Ps.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(n=r.currentX-r.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(n=-(r.currentX-r.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Ps.any(this._eastSash.onDidReset,this._westSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Ps.any(this._northSash.onDidReset,this._southSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,n,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){let{height:n,width:r}=this._minSize,{height:i,width:a}=this._maxSize;e=Math.max(n,Math.min(i,e)),t=Math.max(r,Math.min(a,t));let o=new Ui(t,e);Ui.equals(o,this._size)||(this.domNode.style.height=e+`px`,this.domNode.style.width=t+`px`,this._size=o,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}},hg=30,gg=24,_g=class extends T{constructor(e,t=new Ui(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new mg),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position=`absolute`,this._resizableNode.minSize=Ui.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(e=>{this._resize(new Ui(e.dimension.width,e.dimension.height)),e.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?P.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!(!t||!n))return ms(t).top+n.top-hg}_availableVerticalSpaceBelow(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;let r=ms(t),i=Zc(t.ownerDocument.body),a=r.top+n.top+n.height;return i.height-a-gg}_findPositionPreference(e,t){let n=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),r=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),i=Math.min(e,Math.min(Math.max(r,n),e)),a;return a=this._editor.getOption(69).above?i<=r?1:2:i<=n?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}},vg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},yg=function(e,t){return function(n,r){t(n,r,e)}},bg,xg=30,Sg=class extends _g{static{bg=this}static{this.ID=`editor.contrib.resizableContentHoverWidget`}static{this._lastDimensions=new Ui(0,0)}get isVisibleFromKeyboard(){return this._renderedHover?.source===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,n,r,i){let a=new Ui(150,e.getOption(75)+8);super(e,a),this._configurationService=n,this._accessibilityService=r,this._keybindingService=i,this._hover=this._register(new qr(!0)),this._onDidResize=this._register(new h),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new h),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new h),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=a,this._hoverVisibleKey=B.hoverVisible.bindTo(t),this._hoverFocusedKey=B.hoverFocused.bindTo(t),H(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex=`50`,this._resizableNode.domNode.className=`monaco-resizable-hover`,this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(59)&&this._updateFont()}));let o=this._register(kr(this._resizableNode.domNode));this._register(o.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(o.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(e=>{this._onDidScroll.fire(e)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return bg.ID}static _applyDimensions(e,t,n){let r=typeof t==`number`?`${t}px`:t,i=typeof n==`number`?`${n}px`:n;e.style.width=r,e.style.height=i}_setContentsDomNodeDimensions(e,t){let n=this._hover.contentsDomNode;return bg._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){let n=this._hover.containerDomNode;return bg._applyDimensions(n,e,t)}_setScrollableElementDimensions(e,t){let n=this._hover.scrollbar.getDomNode();return bg._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){let r=typeof t==`number`?`${t}px`:t,i=typeof n==`number`?`${n}px`:n;e.style.maxWidth=r,e.style.maxHeight=i}_setHoverWidgetMaxDimensions(e,t){bg._applyMaxDimensions(this._hover.contentsDomNode,e,t),bg._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),bg._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty(`--vscode-hover-maxWidth`,typeof e==`number`?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions(`none`,`none`),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){let e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Ui(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){bg._lastDimensions=new Ui(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){let e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){let e=this._findAvailableSpaceVertically();if(!e)return;let t=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(e=>{t+=e.clientHeight}),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty(`--vscode-hover-whiteSpace`,`nowrap`),this._hover.containerDomNode.style.setProperty(`--vscode-hover-sourceWhiteSpace`,`nowrap`);let e=Array.from(this._hover.contentsDomNode.children).some(e=>e.scrollWidth>e.clientWidth);return this._hover.containerDomNode.style.removeProperty(`--vscode-hover-whiteSpace`),this._hover.containerDomNode.style.removeProperty(`--vscode-hover-sourceWhiteSpace`),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;let e=this._isHoverTextOverflowing(),t=this._contentWidth===void 0?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidth<t?Zc(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth}isMouseGettingCloser(e,t){if(!this._renderedHover)return!1;if(this._renderedHover.initialMousePosX===void 0||this._renderedHover.initialMousePosY===void 0)return this._renderedHover.initialMousePosX=e,this._renderedHover.initialMousePosY=t,!1;let n=ms(this.getDomNode());this._renderedHover.closestMouseDistance===void 0&&(this._renderedHover.closestMouseDistance=Cg(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,n.left,n.top,n.width,n.height));let r=Cg(e,t,n.left,n.top,n.width,n.height);return r>this._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,r),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle(`hidden`,!e)}_updateFont(){let{fontSize:e,lineHeight:t}=this._editor.getOption(59),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName(`code`)).forEach(e=>this._editor.applyFontInfo(e))}_updateContent(e){let t=this._hover.contentsDomNode;t.style.paddingBottom=``,t.textContent=``,t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){let e=Math.max(this._editor.getLayoutInfo().height/4,250,bg._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,bg._lastDimensions.width);this._resizableNode.maxSize=new Ui(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);let t=Qu(this._hover.containerDomNode),n=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,n)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();let r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&Mu(this._configurationService.getValue(`accessibility.verbosity.hover`)===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding(`editor.action.accessibleView`)?.getAriaLabel()??``);r&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+`, `+r)}hide(){if(!this._renderedHover)return;let e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new Ui(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){let e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions(`auto`,`auto`),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new Ui(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){let e=this._contentWidth===void 0?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Ui(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();let e=this._hover.contentsDomNode,t=Qu(e),n=Ja(e)+2;if(this._resizableNode.layout(t,n),this._setHoverWidgetDimensions(n,t),t=Qu(e),n=Ja(e),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(t,n),this._renderedHover?.showAtPosition){let e=Qu(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(e,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-xg})}scrollRight(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+xg})}pageUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Sg=bg=vg([yg(1,W),yg(2,Oa),yg(3,li),yg(4,Mr)],Sg);function Cg(e,t,n,r,i,a){let o=n+i/2,s=r+a/2,c=Math.max(Math.abs(e-o)-i/2,0),l=Math.max(Math.abs(t-s)-a/2,0);return Math.sqrt(c*c+l*l)}var wg=class e{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];let n=e.getModel(),r=t.range.startLineNumber;if(r>n.getLineCount())return[];let i=n.getLineMaxColumn(r);return e.getLineDecorations(r).filter(e=>{if(e.options.isWholeLine)return!0;let n=e.range.startLineNumber===r?e.range.startColumn:1,a=e.range.endLineNumber===r?e.range.endColumn:i;if(e.options.showIfCollapsed){if(n>t.range.startColumn+1||t.range.endColumn-1>a)return!1}else if(n>t.range.startColumn||t.range.endColumn>a)return!1;return!0})}computeAsync(t,n){let r=t.anchor;if(!this._editor.hasModel()||!r)return hc.EMPTY;let i=e._getLineDecorations(this._editor,r);return hc.merge(this._participants.map(e=>e.computeAsync?e.computeAsync(r,i,t.source,n):hc.EMPTY))}computeSync(t){if(!this._editor.hasModel())return[];let n=t.anchor,r=e._getLineDecorations(this._editor,n),i=[];for(let e of this._participants)i=i.concat(e.computeSync(n,r,t.source));return Jr(i)}},Tg=class{constructor(e,t,n){this.hoverParts=e,this.isComplete=t,this.options=n}filter(e){let t=this.hoverParts.filter(t=>t.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new Eg(this,t,this.isComplete,this.options)}},Eg=class extends Tg{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}},Dg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Og=function(e,t){return function(n,r){t(n,r,e)}},kg=R,Ag=class extends T{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=kg(`div.hover-row.status-bar`),this.hoverElement.tabIndex=0,this.actionsElement=H(this.hoverElement,kg(`div.actions`))}addAction(e){let t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;this._hasContent=!0;let r=this._register(Wu.render(this.actionsElement,e,n));return this._register(this._hoverService.setupManagedHover(Os(`element`),r.actionContainer,r.actionRenderedLabel)),this.actions.push(r),r}append(e){let t=H(this.actionsElement,e);return this._hasContent=!0,t}};Ag=Dg([Og(0,Mr),Og(1,_a)],Ag);var jg=class e{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){let e=this._findScopeDecorationIds.map(e=>this._editor.getModel().getDecorationRange(e)).filter(e=>!!e);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){let t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){let t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(t){let n=this._editor.getModel().getDecorationsInRange(t);for(let t of n){let n=t.options;if(n===e._FIND_MATCH_DECORATION||n===e._FIND_MATCH_NO_OVERVIEW_DECORATION||n===e._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(t.id)}return 0}setCurrentFindMatch(t){let n=null,r=0;if(t)for(let e=0,i=this._decorations.length;e<i;e++){let i=this._editor.getModel().getDecorationRange(this._decorations[e]);if(t.equalsRange(i)){n=this._decorations[e],r=e+1;break}}return(this._highlightedDecorationId!==null||n!==null)&&this._editor.changeDecorations(t=>{if(this._highlightedDecorationId!==null&&(t.changeDecorationOptions(this._highlightedDecorationId,e._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),n!==null&&(this._highlightedDecorationId=n,t.changeDecorationOptions(this._highlightedDecorationId,e._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(t.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),n!==null){let r=this._editor.getModel().getDecorationRange(n);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){let e=r.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);r=new D(r.startLineNumber,r.startColumn,e,t)}this._rangeHighlightDecorationId=t.addDecoration(r,e._RANGE_HIGHLIGHT_DECORATION)}}),r}set(t,n){this._editor.changeDecorations(r=>{let i=e._FIND_MATCH_DECORATION,a=[];if(t.length>1e3){i=e._FIND_MATCH_NO_OVERVIEW_DECORATION;let n=this._editor.getModel().getLineCount(),r=this._editor.getLayoutInfo().height/n,o=Math.max(2,Math.ceil(3/r)),s=t[0].range.startLineNumber,c=t[0].range.endLineNumber;for(let n=1,r=t.length;n<r;n++){let r=t[n].range;c+o>=r.startLineNumber?r.endLineNumber>c&&(c=r.endLineNumber):(a.push({range:new D(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),s=r.startLineNumber,c=r.endLineNumber)}a.push({range:new D(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let o=Array(t.length);for(let e=0,n=t.length;e<n;e++)o[e]={range:t[e].range,options:i};this._decorations=r.deltaDecorations(this._decorations,o),this._overviewRulerApproximateDecorations=r.deltaDecorations(this._overviewRulerApproximateDecorations,a),this._rangeHighlightDecorationId&&=(r.removeDecoration(this._rangeHighlightDecorationId),null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(e=>r.removeDecoration(e)),this._findScopeDecorationIds=[]),n?.length&&(this._findScopeDecorationIds=n.map(t=>r.addDecoration(t,e._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){let n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.endLineNumber>e.lineNumber)&&(r.endLineNumber<e.lineNumber||!(r.endColumn>e.column)))return r}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;t<n;t++){let n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.startLineNumber<e.lineNumber)&&(r.startLineNumber>e.lineNumber||!(r.startColumn<e.column)))return r}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}static{this._CURRENT_FIND_MATCH_DECORATION=Y.register({description:`current-find-match`,stickiness:1,zIndex:13,className:`currentFindMatch`,inlineClassName:`currentFindMatchInline`,showIfCollapsed:!0,overviewRuler:{color:bl(ge),position:ju.Center},minimap:{color:bl(ut),position:1}})}static{this._FIND_MATCH_DECORATION=Y.register({description:`find-match`,stickiness:1,zIndex:10,className:`findMatch`,inlineClassName:`findMatchInline`,showIfCollapsed:!0,overviewRuler:{color:bl(ge),position:ju.Center},minimap:{color:bl(ut),position:1}})}static{this._FIND_MATCH_NO_OVERVIEW_DECORATION=Y.register({description:`find-match-no-overview`,stickiness:1,className:`findMatch`,showIfCollapsed:!0})}static{this._FIND_MATCH_ONLY_OVERVIEW_DECORATION=Y.register({description:`find-match-only-overview`,stickiness:1,overviewRuler:{color:bl(ge),position:ju.Center}})}static{this._RANGE_HIGHLIGHT_DECORATION=Y.register({description:`find-range-highlight`,stickiness:1,className:`rangeHighlight`,isWholeLine:!0})}static{this._FIND_SCOPE_DECORATION=Y.register({description:`find-scope`,className:`findScope`,isWholeLine:!0})}},Mg=class{constructor(e,t,n){this._editorSelection=e,this._ranges=t,this._replaceStrings=n,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){let e=[];for(let t=0;t<this._ranges.length;t++)e.push({range:this._ranges[t],text:this._replaceStrings[t]});e.sort((e,t)=>D.compareRangesUsingStarts(e.range,t.range));let n=[],r=e[0];for(let t=1;t<e.length;t++)r.range.endLineNumber===e[t].range.startLineNumber&&r.range.endColumn===e[t].range.startColumn?(r.range=r.range.plusRange(e[t].range),r.text+=e[t].text):(n.push(r),r=e[t]);n.push(r);for(let e of n)t.addEditOperation(e.range,e.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}};function Ng(e,t){if(e&&e[0]!==``){let n=Pg(e,t,`-`),r=Pg(e,t,`_`);return n&&!r?Fg(e,t,`-`):!n&&r?Fg(e,t,`_`):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():Cr(e[0][0])&&t.length>0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}else return t}function Pg(e,t,n){return e[0].indexOf(n)!==-1&&t.indexOf(n)!==-1&&e[0].split(n).length===t.split(n).length}function Fg(e,t,n){let r=t.split(n),i=e[0].split(n),a=``;return r.forEach((e,t)=>{a+=Ng([i[t]],e)+n}),a.slice(0,-1)}var Ig=class{constructor(e){this.staticValue=e,this.kind=0}},Lg=class{constructor(e){this.pieces=e,this.kind=1}},Rg=class e{static fromStaticValue(t){return new e([zg.staticValue(t)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new Ig(``):e.length===1&&e[0].staticValue!==null?this._state=new Ig(e[0].staticValue):this._state=new Lg(e)}buildReplaceString(t,n){if(this._state.kind===0)return n?Ng(t,this._state.staticValue):this._state.staticValue;let r=``;for(let n=0,i=this._state.pieces.length;n<i;n++){let i=this._state.pieces[n];if(i.staticValue!==null){r+=i.staticValue;continue}let a=e._substitute(i.matchIndex,t);if(i.caseOps!==null&&i.caseOps.length>0){let e=[],t=i.caseOps.length,n=0;for(let r=0,o=a.length;r<o;r++){if(n>=t){e.push(a.slice(r));break}switch(i.caseOps[n]){case`U`:e.push(a[r].toUpperCase());break;case`u`:e.push(a[r].toUpperCase()),n++;break;case`L`:e.push(a[r].toLowerCase());break;case`l`:e.push(a[r].toLowerCase()),n++;break;default:e.push(a[r])}}a=e.join(``)}r+=a}return r}static _substitute(e,t){if(t===null)return``;if(e===0)return t[0];let n=``;for(;e>0;){if(e<t.length)return(t[e]||``)+n;n=String(e%10)+n,e=Math.floor(e/10)}return`$`+n}},zg=class e{static staticValue(t){return new e(t,-1,null)}static caseOps(t,n){return new e(null,t,n)}constructor(e,t,n){this.staticValue=e,this.matchIndex=t,!n||n.length===0?this.caseOps=null:this.caseOps=n.slice(0)}},Bg=class{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=``}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,n){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=zg.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),this._result[this._resultLen++]=zg.caseOps(e,n),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=zg.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),new Rg(this._result)}};function Vg(e){if(!e||e.length===0)return new Rg(null);let t=[],n=new Bg(e);for(let r=0,i=e.length;r<i;r++){let a=e.charCodeAt(r);if(a===92){if(r++,r>=i)break;let a=e.charCodeAt(r);switch(a){case 92:n.emitUnchanged(r-1),n.emitStatic(`\\`,r+1);break;case 110:n.emitUnchanged(r-1),n.emitStatic(`
|