@vizejs/vite-plugin-musea 0.434.0 → 0.435.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-CnzIyKMy.js → MonacoEditor-C6-OM4rx.js} +2 -2
- package/dist/gallery/assets/{cssMode-DZ_me5CG.js → cssMode-kZp9vGyZ.js} +1 -1
- package/dist/gallery/assets/{editor.api-CjD4Hpms.js → editor.api-CpUU3jle.js} +1 -1
- package/dist/gallery/assets/{freemarker2-F7z49Hfe.js → freemarker2-D5_Pj5tY.js} +1 -1
- package/dist/gallery/assets/{handlebars-Dt4eGgf-.js → handlebars-ux7frveE.js} +1 -1
- package/dist/gallery/assets/{html-B1zmbcur.js → html-BU0IpgLn.js} +1 -1
- package/dist/gallery/assets/{htmlMode-DmDwpA4v.js → htmlMode-CqXwq-nu.js} +1 -1
- package/dist/gallery/assets/index-CrkJRuVg.css +1 -0
- package/dist/gallery/assets/{index-vJ3ftuqF.js → index-D6mDN2I1.js} +5 -5
- package/dist/gallery/assets/{javascript-CLKbyvz8.js → javascript-txd9nrN7.js} +1 -1
- package/dist/gallery/assets/{jsonMode-sms9-L2I.js → jsonMode-DAbcL0Jz.js} +1 -1
- package/dist/gallery/assets/{liquid-CesACmVT.js → liquid-BdyYsrIh.js} +1 -1
- package/dist/gallery/assets/{lspLanguageFeatures-C8BR-41u.js → lspLanguageFeatures-CfjzHGkK.js} +1 -1
- package/dist/gallery/assets/{mdx-Cd93KUo_.js → mdx-1iMCwsiN.js} +1 -1
- package/dist/gallery/assets/{python-8gi7tgMv.js → python-BRtYkuEE.js} +1 -1
- package/dist/gallery/assets/{razor-sOyhBXSy.js → razor-BPyA1ww0.js} +1 -1
- package/dist/gallery/assets/{register-C-_4TcWq.js → register-C9LCBsWs.js} +2 -2
- package/dist/gallery/assets/{toggleHighContrast-BCHobRx5.js → toggleHighContrast-E00HvVlx.js} +1 -1
- package/dist/gallery/assets/{tsMode-BkQQD7P8.js → tsMode-Y1UROKNu.js} +1 -1
- package/dist/gallery/assets/{typescript-XiwOdN8G.js → typescript-CHz12rTH.js} +1 -1
- package/dist/gallery/assets/{vs-Coo3fK7w.js → vs-nn7WiqyP.js} +3 -3
- package/dist/gallery/assets/{workers-Cypb28_F.js → workers-nP6TruC_.js} +1 -1
- package/dist/gallery/assets/{xml-CN1ixSLs.js → xml-VQqfw16g.js} +1 -1
- package/dist/gallery/assets/{yaml-l30MdsZA.js → yaml-C3rGF1G5.js} +1 -1
- package/dist/gallery/index.html +2 -2
- package/package.json +4 -4
- package/dist/gallery/assets/index-C4vm-yqv.css +0 -1
package/dist/gallery/assets/{toggleHighContrast-BCHobRx5.js → toggleHighContrast-E00HvVlx.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,Ci as ye,Cl as be,Cn as xe,Co as Se,Cr as Ce,Cs as we,Ct as Te,Cu as Ee,D as De,Da as Oe,Dc as ke,Dd as Ae,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 x,Ed as S,Ei as Ve,El as He,En as Ue,Eo as We,Er as Ge,Es as Ke,Et as qe,Eu as Je,F as Ye,Fa as Xe,Fc as C,Fd as Ze,Fi as Qe,Fl as $e,Fn as et,Fo as tt,Fr as nt,Fs as rt,Ft as it,Fu as at,G as ot,Ga as st,Gc as w,Gd as ct,Gi as lt,Gl as ut,Gn as dt,Go as ft,Gr as pt,Gs as mt,Gt as ht,Gu as gt,H as _t,Ha as vt,Hc as yt,Hd as bt,Hi as xt,Hl as St,Hn as Ct,Ho as wt,Hr as Tt,Hs as T,Ht as Et,Hu as Dt,I as Ot,Ia as E,Ic as D,Id as kt,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 O,Jt as Kt,Ju as qt,K as Jt,Ka as Yt,Kc as Xt,Kd as Zt,Ki as Qt,Kl as k,Kn as $t,Ko as en,Kr as tn,Ks as nn,Kt as rn,Ku as an,L as on,La as sn,Lc as cn,Ld as ln,Li as un,Ll as dn,Ln as fn,Lo as pn,Lr as mn,Ls as hn,Lt as gn,Lu as _n,M as vn,Ma as yn,Mc as A,Md as bn,Mi as xn,Ml as Sn,Mn as Cn,Mo as wn,Mr as Tn,Ms as En,Mt as Dn,Mu as On,N as kn,Na as An,Nc as jn,Nd as Mn,Ni as Nn,Nl as Pn,Nn as Fn,No as In,Nr as Ln,Ns as Rn,Nt as zn,Nu as Bn,O as Vn,Oa as Hn,Oc as Un,Od as Wn,Oi as Gn,Ol as Kn,On as qn,Oo as Jn,Or as Yn,Os as Xn,Ot as Zn,Ou as Qn,P as $n,Pa as er,Pc as tr,Pd as nr,Pi as rr,Pl as ir,Pn as ar,Po as or,Pr as sr,Ps as cr,Pt as lr,Pu as ur,Q as dr,Qa as fr,Qc as pr,Qd as mr,Qi as hr,Ql as gr,Qn as _r,Qo as vr,Qr as yr,Qs as br,Qt as xr,Qu as Sr,R as Cr,Ra as wr,Rc as Tr,Rd as Er,Ri as Dr,Rl as Or,Rn as kr,Ro as Ar,Rr as jr,Rs as Mr,Rt as Nr,Ru as Pr,S as Fr,Sa as Ir,Sc as Lr,Sd as Rr,Si as zr,Sl as Br,Sn as Vr,So as Hr,Sr as Ur,Ss as Wr,St as Gr,Su as Kr,T as qr,Ta as Jr,Tc as Yr,Td as j,Ti as Xr,Tl as Zr,Tn as Qr,To as $r,Tr as ei,Ts as ti,Tt as ni,Tu as ri,U as ii,Ua as ai,Uc as M,Ud as oi,Ui as si,Ul as ci,Un as li,Uo as ui,Ur as di,Us as N,Ut as fi,Uu as pi,V as mi,Va as hi,Vc as gi,Vd as _i,Vi as vi,Vl as yi,Vn as bi,Vo as xi,Vr as Si,Vs as P,Vt as Ci,Vu as wi,W as Ti,Wa as Ei,Wc as Di,Wd as Oi,Wi as ki,Wl as Ai,Wn as ji,Wo as Mi,Wr as Ni,Ws as Pi,Wt as Fi,Wu as Ii,X as Li,Xa as Ri,Xc as zi,Xd as Bi,Xi as Vi,Xl as Hi,Xn as Ui,Xo as Wi,Xr as Gi,Xs as F,Xt as Ki,Xu as qi,Y as Ji,Ya as Yi,Yc as I,Yd as Xi,Yi as Zi,Yl as L,Yn as Qi,Yo as $i,Yr as ea,Ys as R,Yt as ta,Yu as na,Z as ra,Za as ia,Zc as aa,Zd as oa,Zi as sa,Zl as ca,Zn as la,Zo as z,Zr as ua,Zs as da,Zt as fa,Zu as pa,_a as ma,_c as ha,_d as B,_f as V,_i as ga,_l as _a,_n as va,_o as ya,_r as ba,_s as xa,_t as Sa,_u as Ca,aa as wa,ac as Ta,ad as Ea,af as Da,ai as Oa,al as H,an as ka,ao as Aa,ar as ja,as as Ma,at as Na,au as Pa,b as Fa,ba as Ia,bc as La,bd as U,bi as Ra,bl as za,bn as Ba,bo as Va,br as Ha,bs as Ua,bt as Wa,bu as Ga,ca as Ka,cc as qa,cd as Ja,cf as Ya,ci as Xa,cl as Za,cn as Qa,co as $a,cr as eo,cs as to,ct as no,cu as ro,da as io,dc as ao,dd as oo,df as so,di as co,dl as lo,dn as uo,do as fo,dr as po,ds as mo,dt as ho,du as go,ea as _o,ec as vo,ed as yo,ef as bo,ei as xo,el as So,en as Co,eo as wo,er as To,es as Eo,et as Do,eu as Oo,fa as ko,fc as Ao,fd as jo,ff as Mo,fi as No,fl as Po,fn as Fo,fo as Io,fr as Lo,fs as Ro,ft as zo,fu as Bo,g as Vo,ga as Ho,gc as Uo,gd as Wo,gf as Go,gi as Ko,gl as qo,gn as Jo,go as Yo,gr as Xo,gs as Zo,gt as Qo,gu as $o,h as es,ha as ts,hc as ns,hd as rs,hf as is,hi as as,hl as os,hn as ss,ho as cs,hr as ls,hs as us,ht as ds,hu as fs,ia as ps,ic as ms,id as hs,if as gs,ii as _s,il as vs,in as ys,io as W,ir as bs,is as xs,it as Ss,iu as Cs,j as ws,ja as Ts,jc as G,jd as Es,ji as Ds,jl as Os,jn as ks,jo as As,jr as js,js as Ms,jt as Ns,ju as Ps,k as Fs,ka as Is,kc as Ls,kd as Rs,ki as zs,kl as Bs,kn as Vs,ko as Hs,kr as Us,ks as Ws,kt as Gs,ku as Ks,la as qs,lc as Js,ld as Ys,lf as Xs,li as Zs,ll as Qs,ln as $s,lo as ec,lr as tc,ls as nc,lt as rc,lu as ic,ma as ac,mc as oc,md as sc,mf as cc,mi as lc,ml as uc,mn as dc,mo as fc,mr as pc,ms as mc,mt as hc,mu as gc,na as _c,nc as vc,nd as yc,nf as bc,ni as xc,nl as K,nn as Sc,no as q,nr as Cc,ns as wc,nt as Tc,nu as Ec,oa as Dc,oc as Oc,od as kc,of as Ac,oi as jc,ol as Mc,on as Nc,oo as Pc,or as Fc,os as Ic,ot as Lc,ou as Rc,pa as zc,pc as Bc,pd as Vc,pf as Hc,pi as Uc,pl as Wc,pn as Gc,po as Kc,pr as qc,ps as Jc,pt as Yc,pu as Xc,q as Zc,qa as Qc,qc as $c,qd as el,qi as tl,ql as nl,qn as rl,qo as il,qr as al,qs as ol,qt as sl,qu as cl,ra as ll,rc as ul,rd as dl,rf as fl,ri as pl,rl as ml,rn as hl,ro as gl,rr as _l,rs as vl,rt as yl,ru as bl,sa as xl,sc as Sl,sd as Cl,sf as wl,si as Tl,sl as El,sn as Dl,so as Ol,sr as kl,ss as Al,st as jl,su as Ml,ta as Nl,tc as Pl,td as Fl,tf as Il,ti as Ll,tl as Rl,tn as zl,to as Bl,tr as Vl,ts as Hl,tt as Ul,tu as Wl,ua as Gl,uc as Kl,ud as ql,uf as Jl,ui as Yl,ul as Xl,un as Zl,uo as Ql,ur as $l,us as eu,ut as tu,uu as nu,v as ru,va as iu,vc as au,vd as ou,vf as J,vi as su,vl as cu,vn as lu,vo as uu,vr as Y,vs as du,vt as fu,vu as pu,w as mu,wa as hu,wc as gu,wd as _u,wi as vu,wl as X,wn as yu,wo as bu,wr as xu,ws as Su,wt as Cu,wu,x as Tu,xa as Eu,xc as Z,xd as Du,xi as Ou,xl as ku,xn as Au,xo as ju,xr as Mu,xs as Nu,xt as Pu,xu as Fu,y as Iu,ya as Lu,yc as Ru,yd as zu,yi as Bu,yl as Vu,yn as Hu,yo as Uu,yr as Wu,ys as Gu,yt as Ku,yu as qu,z as Ju,za as Yu,zc as Xu,zd as Zu,zi as Qu,zl as $u,zn as ed,zo as td,zr as nd,zs as rd,zt as id,zu as ad}from"./editor.api-CjD4Hpms.js";var od=class extends Ru{constructor(){super({id:`diffEditor.toggleCollapseUnchangedRegions`,title:J(101,`Toggle Collapse Unchanged Regions`),icon:D.map,toggled:m.has(`config.diffEditor.hideUnchangedRegions.enabled`),precondition:m.has(`isInDiffEditor`),menu:{when:m.has(`isInDiffEditor`),id:Z.EditorTitle,order:22,group:`navigation`}})}run(e,...t){let n=e.get(xa),r=!n.getValue(`diffEditor.hideUnchangedRegions.enabled`);n.updateValue(`diffEditor.hideUnchangedRegions.enabled`,r)}},sd=class extends Ru{constructor(){super({id:`diffEditor.toggleShowMovedCodeBlocks`,title:J(102,`Toggle Show Moved Code Blocks`),precondition:m.has(`isInDiffEditor`)})}run(e,...t){let n=e.get(xa),r=!n.getValue(`diffEditor.experimental.showMoves`);n.updateValue(`diffEditor.experimental.showMoves`,r)}},cd=class extends Ru{constructor(){super({id:`diffEditor.toggleUseInlineViewWhenSpaceIsLimited`,title:J(103,`Toggle Use Inline View When Space Is Limited`),precondition:m.has(`isInDiffEditor`)})}run(e,...t){let n=e.get(xa),r=!n.getValue(`diffEditor.useInlineViewWhenSpaceIsLimited`);n.updateValue(`diffEditor.useInlineViewWhenSpaceIsLimited`,r)}},ld=J(104,`Diff Editor`),ud=class extends Pi{constructor(){super({id:`diffEditor.switchSide`,title:J(105,`Switch Side`),icon:D.arrowSwap,precondition:m.has(`isInDiffEditor`),f1:!0,category:ld})}runEditorCommand(e,t,n){let r=yd(e);if(r instanceof Kt){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}},dd=class extends Pi{constructor(){super({id:`diffEditor.exitCompareMove`,title:J(106,`Exit Compare Move`),icon:D.close,precondition:z.comparingMovedCode,f1:!1,category:ld,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){let r=yd(e);r instanceof Kt&&r.exitCompareMove()}},fd=class extends Pi{constructor(){super({id:`diffEditor.collapseAllUnchangedRegions`,title:J(107,`Collapse All Unchanged Regions`),icon:D.fold,precondition:m.has(`isInDiffEditor`),f1:!0,category:ld})}runEditorCommand(e,t,...n){let r=yd(e);r instanceof Kt&&r.collapseAllUnchangedRegions()}},pd=class extends Pi{constructor(){super({id:`diffEditor.showAllUnchangedRegions`,title:J(108,`Show All Unchanged Regions`),icon:D.unfold,precondition:m.has(`isInDiffEditor`),f1:!0,category:ld})}runEditorCommand(e,t,...n){let r=yd(e);r instanceof Kt&&r.showAllUnchangedRegions()}},md=class extends Ru{constructor(){super({id:`diffEditor.revert`,title:J(109,`Revert`),f1:!0,category:ld,precondition:m.has(`isInDiffEditor`)})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){let t=yd(e);t instanceof Kt&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){let n=vd(e,t.originalUri,t.modifiedUri);n instanceof Kt&&n.revertRangeMappings(t.mapping.innerChanges??[])}},hd=J(110,`Accessible Diff Viewer`),gd=class e extends Ru{static{this.id=`editor.action.accessibleDiffViewer.next`}constructor(){super({id:e.id,title:J(111,`Go to Next Difference`),category:hd,precondition:m.has(`isInDiffEditor`),keybinding:{primary:65,weight:100},f1:!0})}run(e){yd(e)?.accessibleDiffViewerNext()}},_d=class e extends Ru{static{this.id=`editor.action.accessibleDiffViewer.prev`}constructor(){super({id:e.id,title:J(112,`Go to Previous Difference`),category:hd,precondition:m.has(`isInDiffEditor`),keybinding:{primary:1089,weight:100},f1:!0})}run(e){yd(e)?.accessibleDiffViewerPrev()}};function vd(e,t,n){return e.get(Di).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 yd(e){let t=e.get(Di).listDiffEditors(),n=Za();if(n){for(let e of t)if(e.getContainerDomNode().contains(n))return e}return null}x(od),x(sd),x(cd),_e.appendMenuItem(Z.EditorTitle,{command:{id:new cd().desc.id,title:V(135,`Use Inline View When Space Is Limited`),toggled:m.has(`config.diffEditor.useInlineViewWhenSpaceIsLimited`),precondition:m.has(`isInDiffEditor`)},order:11,group:`1_diff`,when:m.and(z.diffEditorRenderSideBySideInlineBreakpointReached,m.has(`isInDiffEditor`))}),_e.appendMenuItem(Z.EditorTitle,{command:{id:new sd().desc.id,title:V(136,`Show Moved Code Blocks`),icon:D.move,toggled:Ls.create(`config.diffEditor.experimental.showMoves`,!0),precondition:m.has(`isInDiffEditor`)},order:10,group:`1_diff`,when:m.has(`isInDiffEditor`)}),x(md);for(let e of[{icon:D.arrowRight,key:z.diffEditorInlineMode.toNegated()},{icon:D.discard,key:z.diffEditorInlineMode}])_e.appendMenuItem(Z.DiffEditorHunkToolbar,{command:{id:new md().desc.id,title:V(137,`Revert Block`),icon:e.icon},when:m.and(z.diffEditorModifiedWritable,e.key),order:5,group:`primary`}),_e.appendMenuItem(Z.DiffEditorSelectionToolbar,{command:{id:new md().desc.id,title:V(138,`Revert Selection`),icon:e.icon},when:m.and(z.diffEditorModifiedWritable,e.key),order:5,group:`primary`});x(ud),x(dd),x(fd),x(pd),_e.appendMenuItem(Z.EditorTitle,{command:{id:gd.id,title:V(139,`Open Accessible Diff Viewer`),precondition:m.has(`isInDiffEditor`)},order:10,group:`2_diff`,when:m.and(z.accessibleDiffViewerVisible.negate(),m.has(`isInDiffEditor`))}),jn.registerCommandAlias(`editor.action.diffReview.next`,gd.id),x(gd),jn.registerCommandAlias(`editor.action.diffReview.prev`,_d.id),x(_d);var bd=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},xd=function(e,t){return function(n,r){t(n,r,e)}},Sd,Cd=new A(`selectionAnchorSet`,!1),wd=class{static{Sd=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(Sd.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Cd.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(P.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new li().appendText(V(834,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),$c(V(835,`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(P.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()}};wd=Sd=bd([xd(1,G)],wd);var Td=class extends N{constructor(){super({id:`editor.action.setSelectionAnchor`,label:J(836,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:ln(2089,2080),weight:100}})}async run(e,t){wd.get(t)?.setSelectionAnchor()}},Ed=class extends N{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:J(837,`Go to Selection Anchor`),precondition:Cd})}async run(e,t){wd.get(t)?.goToSelectionAnchor()}},Dd=class extends N{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:J(838,`Select from Anchor to Cursor`),precondition:Cd,kbOpts:{kbExpr:z.editorTextFocus,primary:ln(2089,2089),weight:100}})}async run(e,t){wd.get(t)?.selectFromAnchorToCursor()}},Od=class extends N{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:J(839,`Cancel Selection Anchor`),precondition:Cd,kbOpts:{kbExpr:z.editorTextFocus,primary:9,weight:100}})}async run(e,t){wd.get(t)?.cancelSelectionAnchor()}};F(wd.ID,wd,4),O(Td),O(Ed),O(Dd),O(Od);var kd=E(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,V(840,`Overview ruler marker color for matching brackets.`)),Ad=class extends N{constructor(){super({id:`editor.action.jumpToBracket`,label:J(842,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:3165,weight:100}})}run(e,t){Pd.get(t)?.jumpToBracket()}},jd=class extends N{constructor(){super({id:`editor.action.selectToBracket`,label:J(843,`Select to Bracket`),precondition:void 0,metadata:{description:J(844,`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),Pd.get(t)?.selectToBracket(r)}},Md=class extends N{constructor(){super({id:`editor.action.removeBrackets`,label:J(845,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Pd.get(t)?.removeBrackets(this.id)}},Nd=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Pd=class e extends j{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 Cl(()=>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 P(i.lineNumber,i.column,i.lineNumber,i.column):new P(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(T.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 P(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:pl(kd),position:Su.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(M.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 Nd(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};F(Pd.ID,Pd,1),O(jd),O(Ad),O(Md),_e.appendMenuItem(Z.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:V(841,`Go to &&Bracket`)},order:2}),xc((e,t)=>{let n=e.getColor(yr);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)});var Fd=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 T(n,r-1,n,r),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new T(n,i,n,i),o)}else{let a=new T(n,i,n,i+1),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new T(n,r,n,r),o)}}computeCursorState(e,t){return this._isMovingLeft?new P(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new P(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}},Id=class extends N{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 Fd(e,this.left));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}},Ld=class extends Id{constructor(){super(!0,{id:`editor.action.moveCarretLeftAction`,label:J(846,`Move Selected Text Left`),precondition:z.writable})}},Rd=class extends Id{constructor(){super(!1,{id:`editor.action.moveCarretRightAction`,label:J(847,`Move Selected Text Right`),precondition:z.writable})}};O(Ld),O(Rd),O(class extends N{constructor(){super({id:`editor.action.transposeLetters`,label:J(848,`Transpose Letters`),precondition:z.writable,kbOpts:{kbExpr:z.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():cr.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=cr.leftPosition(n,o),c=cr.leftPosition(n,s),l=n.getValueInRange(T.fromPositions(c,s)),u=n.getValueInRange(T.fromPositions(s,o)),d=T.fromPositions(c,o);r.push(new rt(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var zd=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))}},Bd=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},Vd=function(e,t){return function(n,r){t(n,r,e)}},Hd=Y.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0}}),Ud=class e extends j{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=I(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=I(`span.icon`);this.domNode.append(t),t.classList.add(...C.asClassNameArray(D.loading),`codicon-modifier-spin`);let n=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};n(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&n()})),this._register(K(this.domNode,pr.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)}},Wd=class extends j{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Ae),this._currentWidget=this._register(new Ae),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=oo(()=>{let n=T.fromPositions(e);this._currentDecorations.set([{range:n,options:Hd}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Ud,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()}};Wd=Bd([Vd(2,w)],Wd);var Gd=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},Kd=function(e,t){return function(n,r){t(n,r,e)}},qd,Jd=class{static{qd=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new A(`messageVisible`,!1,V(1333,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(qd.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Ae,this._messageListeners=new S,this._mouseOverMessage=!1,this._editor=e,this._visible=qd.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if($c($t(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),$t(e)){let n=this._messageListeners.add(kr(e,{actionHandler:(e,t)=>{this.closeMessage(),It(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new Yd(this._editor,t,n.element)}else this._messageWidget.value=new Yd(this._editor,t,e);this._messageListeners.add(Du.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&ku(Za(),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(K(this._messageWidget.value.getDomNode(),pr.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(K(this._messageWidget.value.getDomNode(),pr.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(n?n.containsPosition(e.target.position)||this.closeMessage():n=new T(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Yd.fadeOut(this._messageWidget.value))}};Jd=qd=Gd([Kd(1,G),Kd(2,gn)],Jd),R(new(mt.bindToContribution(Jd.get))({id:`leaveEditorMessage`,precondition:Jd.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var Yd=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)}};F(Jd.ID,Jd,4);var Xd=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},Zd=function(e,t){return function(n,r){t(n,r,e)}},Qd=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(){}}}},$d=class e extends Qd{static{this.id=`text`}constructor(){super(zd.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[mc.text],this.pasteMimeTypes=[mc.text]}async getEdit(e,t){let n=e.get(mc.text);if(!n||e.has(mc.uriList))return;let r=await n.asString();return{handledMimeType:mc.text,title:V(965,`Insert Plain Text`),insertText:r,kind:this.kind}}},ef=class extends Qd{constructor(){super(zd.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[mc.uriList],this.pasteMimeTypes=[mc.uriList]}async getEdit(e,t){let n=await rf(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===Ks.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?V(966,`Insert Uris`):V(967,`Insert Uri`):n.length>1?V(968,`Insert Paths`):V(969,`Insert Path`),{handledMimeType:mc.uriList,insertText:i,title:a,kind:this.kind}}},tf=class extends Qd{constructor(e){super(zd.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[mc.uriList],this.pasteMimeTypes=[mc.uriList]}async getEdit(e,t){let n=await rf(e);if(!n.length||t.isCancellationRequested)return;let r=gc(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?oc(t.uri,e):void 0}));if(r.length)return{handledMimeType:mc.uriList,insertText:r.join(` `),title:n.length>1?V(970,`Insert Relative Paths`):V(971,`Insert Relative Path`),kind:this.kind}}};tf=Xd([Zd(0,Zn)],tf);var nf=class{constructor(){this.kind=new zd(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:mc.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==As.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:V(972,`Insert HTML`),kind:this.kind}]}}};async function rf(e){let t=e.get(mc.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of Yl.parse(n))try{r.push({uri:On.parse(e),originalText:e})}catch{}return r}var af={scheme:`*`,hasAccessToAllModels:!0},of=class extends j{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(af,new $d)),this._register(e.documentDropEditProvider.register(af,new ef)),this._register(e.documentDropEditProvider.register(af,new tf(t)))}};of=Xd([Zd(0,q),Zd(1,Zn)],of);var sf=class extends j{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(af,new $d)),this._register(e.documentPasteEditProvider.register(af,new ef)),this._register(e.documentPasteEditProvider.register(af,new tf(t))),this._register(e.documentPasteEditProvider.register(af,new nf))}};sf=Xd([Zd(0,q),Zd(1,Zn)],sf);var cf=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}}},lf=class{constructor(){this._children=[]}appendChild(e){return e instanceof uf&&this._children[this._children.length-1]instanceof uf?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 vf)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},uf=class e extends lf{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},df=class extends lf{},ff=class e extends df{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 pf?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}},pf=class e extends lf{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof uf&&(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}},mf=class e extends lf{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 hf&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof hf){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}},hf=class e extends lf{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)}},gf=class e extends df{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 uf(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 _f(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var vf=class e extends lf{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof ff&&(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 _f([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof ff&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof gf&&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){_f(this.children,e)}},yf=class{constructor(){this._scanner=new cf,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 vf;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 ff&&(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 ff(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof ff&&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 ff(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 uf(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 ff(Number(t)):new gf(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 ff(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new uf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new pf;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 uf(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 gf(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new uf("${"+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 mf,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 uf(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 hf(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 hf(Number(r),n)),!0)}else if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new hf(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 hf(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type===14?!1:(e.appendChild(new uf(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function bf(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new fi(e,{range:t,text:typeof n.insertText==`string`?yf.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function xf(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 Sf(e,t){return t&&(e.stack||e.stacktrace)?V(33,`{0}: {1}`,wf(e),Cf(e.stack)||Cf(e.stacktrace)):wf(e)}function Cf(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,Ci as ye,Cl as be,Cn as xe,Co as Se,Cr as Ce,Cs as we,Ct as Te,Cu as Ee,D as De,Da as Oe,Dc as ke,Dd as Ae,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 x,Ed as S,Ei as Ve,El as He,En as Ue,Eo as We,Er as Ge,Es as Ke,Et as qe,Eu as Je,F as Ye,Fa as Xe,Fc as C,Fd as Ze,Fi as Qe,Fl as $e,Fn as et,Fo as tt,Fr as nt,Fs as rt,Ft as it,Fu as at,G as ot,Ga as st,Gc as w,Gd as ct,Gi as lt,Gl as ut,Gn as dt,Go as ft,Gr as pt,Gs as mt,Gt as ht,Gu as gt,H as _t,Ha as vt,Hc as yt,Hd as bt,Hi as xt,Hl as St,Hn as Ct,Ho as wt,Hr as Tt,Hs as T,Ht as Et,Hu as Dt,I as Ot,Ia as E,Ic as D,Id as kt,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 O,Jt as Kt,Ju as qt,K as Jt,Ka as Yt,Kc as Xt,Kd as Zt,Ki as Qt,Kl as k,Kn as $t,Ko as en,Kr as tn,Ks as nn,Kt as rn,Ku as an,L as on,La as sn,Lc as cn,Ld as ln,Li as un,Ll as dn,Ln as fn,Lo as pn,Lr as mn,Ls as hn,Lt as gn,Lu as _n,M as vn,Ma as yn,Mc as A,Md as bn,Mi as xn,Ml as Sn,Mn as Cn,Mo as wn,Mr as Tn,Ms as En,Mt as Dn,Mu as On,N as kn,Na as An,Nc as jn,Nd as Mn,Ni as Nn,Nl as Pn,Nn as Fn,No as In,Nr as Ln,Ns as Rn,Nt as zn,Nu as Bn,O as Vn,Oa as Hn,Oc as Un,Od as Wn,Oi as Gn,Ol as Kn,On as qn,Oo as Jn,Or as Yn,Os as Xn,Ot as Zn,Ou as Qn,P as $n,Pa as er,Pc as tr,Pd as nr,Pi as rr,Pl as ir,Pn as ar,Po as or,Pr as sr,Ps as cr,Pt as lr,Pu as ur,Q as dr,Qa as fr,Qc as pr,Qd as mr,Qi as hr,Ql as gr,Qn as _r,Qo as vr,Qr as yr,Qs as br,Qt as xr,Qu as Sr,R as Cr,Ra as wr,Rc as Tr,Rd as Er,Ri as Dr,Rl as Or,Rn as kr,Ro as Ar,Rr as jr,Rs as Mr,Rt as Nr,Ru as Pr,S as Fr,Sa as Ir,Sc as Lr,Sd as Rr,Si as zr,Sl as Br,Sn as Vr,So as Hr,Sr as Ur,Ss as Wr,St as Gr,Su as Kr,T as qr,Ta as Jr,Tc as Yr,Td as j,Ti as Xr,Tl as Zr,Tn as Qr,To as $r,Tr as ei,Ts as ti,Tt as ni,Tu as ri,U as ii,Ua as ai,Uc as M,Ud as oi,Ui as si,Ul as ci,Un as li,Uo as ui,Ur as di,Us as N,Ut as fi,Uu as pi,V as mi,Va as hi,Vc as gi,Vd as _i,Vi as vi,Vl as yi,Vn as bi,Vo as xi,Vr as Si,Vs as P,Vt as Ci,Vu as wi,W as Ti,Wa as Ei,Wc as Di,Wd as Oi,Wi as ki,Wl as Ai,Wn as ji,Wo as Mi,Wr as Ni,Ws as Pi,Wt as Fi,Wu as Ii,X as Li,Xa as Ri,Xc as zi,Xd as Bi,Xi as Vi,Xl as Hi,Xn as Ui,Xo as Wi,Xr as Gi,Xs as F,Xt as Ki,Xu as qi,Y as Ji,Ya as Yi,Yc as I,Yd as Xi,Yi as Zi,Yl as L,Yn as Qi,Yo as $i,Yr as ea,Ys as R,Yt as ta,Yu as na,Z as ra,Za as ia,Zc as aa,Zd as oa,Zi as sa,Zl as ca,Zn as la,Zo as z,Zr as ua,Zs as da,Zt as fa,Zu as pa,_a as ma,_c as ha,_d as B,_f as V,_i as ga,_l as _a,_n as va,_o as ya,_r as ba,_s as xa,_t as Sa,_u as Ca,aa as wa,ac as Ta,ad as Ea,af as Da,ai as Oa,al as H,an as ka,ao as Aa,ar as ja,as as Ma,at as Na,au as Pa,b as Fa,ba as Ia,bc as La,bd as U,bi as Ra,bl as za,bn as Ba,bo as Va,br as Ha,bs as Ua,bt as Wa,bu as Ga,ca as Ka,cc as qa,cd as Ja,cf as Ya,ci as Xa,cl as Za,cn as Qa,co as $a,cr as eo,cs as to,ct as no,cu as ro,da as io,dc as ao,dd as oo,df as so,di as co,dl as lo,dn as uo,do as fo,dr as po,ds as mo,dt as ho,du as go,ea as _o,ec as vo,ed as yo,ef as bo,ei as xo,el as So,en as Co,eo as wo,er as To,es as Eo,et as Do,eu as Oo,fa as ko,fc as Ao,fd as jo,ff as Mo,fi as No,fl as Po,fn as Fo,fo as Io,fr as Lo,fs as Ro,ft as zo,fu as Bo,g as Vo,ga as Ho,gc as Uo,gd as Wo,gf as Go,gi as Ko,gl as qo,gn as Jo,go as Yo,gr as Xo,gs as Zo,gt as Qo,gu as $o,h as es,ha as ts,hc as ns,hd as rs,hf as is,hi as as,hl as os,hn as ss,ho as cs,hr as ls,hs as us,ht as ds,hu as fs,ia as ps,ic as ms,id as hs,if as gs,ii as _s,il as vs,in as ys,io as W,ir as bs,is as xs,it as Ss,iu as Cs,j as ws,ja as Ts,jc as G,jd as Es,ji as Ds,jl as Os,jn as ks,jo as As,jr as js,js as Ms,jt as Ns,ju as Ps,k as Fs,ka as Is,kc as Ls,kd as Rs,ki as zs,kl as Bs,kn as Vs,ko as Hs,kr as Us,ks as Ws,kt as Gs,ku as Ks,la as qs,lc as Js,ld as Ys,lf as Xs,li as Zs,ll as Qs,ln as $s,lo as ec,lr as tc,ls as nc,lt as rc,lu as ic,ma as ac,mc as oc,md as sc,mf as cc,mi as lc,ml as uc,mn as dc,mo as fc,mr as pc,ms as mc,mt as hc,mu as gc,na as _c,nc as vc,nd as yc,nf as bc,ni as xc,nl as K,nn as Sc,no as q,nr as Cc,ns as wc,nt as Tc,nu as Ec,oa as Dc,oc as Oc,od as kc,of as Ac,oi as jc,ol as Mc,on as Nc,oo as Pc,or as Fc,os as Ic,ot as Lc,ou as Rc,pa as zc,pc as Bc,pd as Vc,pf as Hc,pi as Uc,pl as Wc,pn as Gc,po as Kc,pr as qc,ps as Jc,pt as Yc,pu as Xc,q as Zc,qa as Qc,qc as $c,qd as el,qi as tl,ql as nl,qn as rl,qo as il,qr as al,qs as ol,qt as sl,qu as cl,ra as ll,rc as ul,rd as dl,rf as fl,ri as pl,rl as ml,rn as hl,ro as gl,rr as _l,rs as vl,rt as yl,ru as bl,sa as xl,sc as Sl,sd as Cl,sf as wl,si as Tl,sl as El,sn as Dl,so as Ol,sr as kl,ss as Al,st as jl,su as Ml,ta as Nl,tc as Pl,td as Fl,tf as Il,ti as Ll,tl as Rl,tn as zl,to as Bl,tr as Vl,ts as Hl,tt as Ul,tu as Wl,ua as Gl,uc as Kl,ud as ql,uf as Jl,ui as Yl,ul as Xl,un as Zl,uo as Ql,ur as $l,us as eu,ut as tu,uu as nu,v as ru,va as iu,vc as au,vd as ou,vf as J,vi as su,vl as cu,vn as lu,vo as uu,vr as Y,vs as du,vt as fu,vu as pu,w as mu,wa as hu,wc as gu,wd as _u,wi as vu,wl as X,wn as yu,wo as bu,wr as xu,ws as Su,wt as Cu,wu,x as Tu,xa as Eu,xc as Z,xd as Du,xi as Ou,xl as ku,xn as Au,xo as ju,xr as Mu,xs as Nu,xt as Pu,xu as Fu,y as Iu,ya as Lu,yc as Ru,yd as zu,yi as Bu,yl as Vu,yn as Hu,yo as Uu,yr as Wu,ys as Gu,yt as Ku,yu as qu,z as Ju,za as Yu,zc as Xu,zd as Zu,zi as Qu,zl as $u,zn as ed,zo as td,zr as nd,zs as rd,zt as id,zu as ad}from"./editor.api-CpUU3jle.js";var od=class extends Ru{constructor(){super({id:`diffEditor.toggleCollapseUnchangedRegions`,title:J(101,`Toggle Collapse Unchanged Regions`),icon:D.map,toggled:m.has(`config.diffEditor.hideUnchangedRegions.enabled`),precondition:m.has(`isInDiffEditor`),menu:{when:m.has(`isInDiffEditor`),id:Z.EditorTitle,order:22,group:`navigation`}})}run(e,...t){let n=e.get(xa),r=!n.getValue(`diffEditor.hideUnchangedRegions.enabled`);n.updateValue(`diffEditor.hideUnchangedRegions.enabled`,r)}},sd=class extends Ru{constructor(){super({id:`diffEditor.toggleShowMovedCodeBlocks`,title:J(102,`Toggle Show Moved Code Blocks`),precondition:m.has(`isInDiffEditor`)})}run(e,...t){let n=e.get(xa),r=!n.getValue(`diffEditor.experimental.showMoves`);n.updateValue(`diffEditor.experimental.showMoves`,r)}},cd=class extends Ru{constructor(){super({id:`diffEditor.toggleUseInlineViewWhenSpaceIsLimited`,title:J(103,`Toggle Use Inline View When Space Is Limited`),precondition:m.has(`isInDiffEditor`)})}run(e,...t){let n=e.get(xa),r=!n.getValue(`diffEditor.useInlineViewWhenSpaceIsLimited`);n.updateValue(`diffEditor.useInlineViewWhenSpaceIsLimited`,r)}},ld=J(104,`Diff Editor`),ud=class extends Pi{constructor(){super({id:`diffEditor.switchSide`,title:J(105,`Switch Side`),icon:D.arrowSwap,precondition:m.has(`isInDiffEditor`),f1:!0,category:ld})}runEditorCommand(e,t,n){let r=yd(e);if(r instanceof Kt){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}},dd=class extends Pi{constructor(){super({id:`diffEditor.exitCompareMove`,title:J(106,`Exit Compare Move`),icon:D.close,precondition:z.comparingMovedCode,f1:!1,category:ld,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){let r=yd(e);r instanceof Kt&&r.exitCompareMove()}},fd=class extends Pi{constructor(){super({id:`diffEditor.collapseAllUnchangedRegions`,title:J(107,`Collapse All Unchanged Regions`),icon:D.fold,precondition:m.has(`isInDiffEditor`),f1:!0,category:ld})}runEditorCommand(e,t,...n){let r=yd(e);r instanceof Kt&&r.collapseAllUnchangedRegions()}},pd=class extends Pi{constructor(){super({id:`diffEditor.showAllUnchangedRegions`,title:J(108,`Show All Unchanged Regions`),icon:D.unfold,precondition:m.has(`isInDiffEditor`),f1:!0,category:ld})}runEditorCommand(e,t,...n){let r=yd(e);r instanceof Kt&&r.showAllUnchangedRegions()}},md=class extends Ru{constructor(){super({id:`diffEditor.revert`,title:J(109,`Revert`),f1:!0,category:ld,precondition:m.has(`isInDiffEditor`)})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){let t=yd(e);t instanceof Kt&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){let n=vd(e,t.originalUri,t.modifiedUri);n instanceof Kt&&n.revertRangeMappings(t.mapping.innerChanges??[])}},hd=J(110,`Accessible Diff Viewer`),gd=class e extends Ru{static{this.id=`editor.action.accessibleDiffViewer.next`}constructor(){super({id:e.id,title:J(111,`Go to Next Difference`),category:hd,precondition:m.has(`isInDiffEditor`),keybinding:{primary:65,weight:100},f1:!0})}run(e){yd(e)?.accessibleDiffViewerNext()}},_d=class e extends Ru{static{this.id=`editor.action.accessibleDiffViewer.prev`}constructor(){super({id:e.id,title:J(112,`Go to Previous Difference`),category:hd,precondition:m.has(`isInDiffEditor`),keybinding:{primary:1089,weight:100},f1:!0})}run(e){yd(e)?.accessibleDiffViewerPrev()}};function vd(e,t,n){return e.get(Di).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 yd(e){let t=e.get(Di).listDiffEditors(),n=Za();if(n){for(let e of t)if(e.getContainerDomNode().contains(n))return e}return null}x(od),x(sd),x(cd),_e.appendMenuItem(Z.EditorTitle,{command:{id:new cd().desc.id,title:V(135,`Use Inline View When Space Is Limited`),toggled:m.has(`config.diffEditor.useInlineViewWhenSpaceIsLimited`),precondition:m.has(`isInDiffEditor`)},order:11,group:`1_diff`,when:m.and(z.diffEditorRenderSideBySideInlineBreakpointReached,m.has(`isInDiffEditor`))}),_e.appendMenuItem(Z.EditorTitle,{command:{id:new sd().desc.id,title:V(136,`Show Moved Code Blocks`),icon:D.move,toggled:Ls.create(`config.diffEditor.experimental.showMoves`,!0),precondition:m.has(`isInDiffEditor`)},order:10,group:`1_diff`,when:m.has(`isInDiffEditor`)}),x(md);for(let e of[{icon:D.arrowRight,key:z.diffEditorInlineMode.toNegated()},{icon:D.discard,key:z.diffEditorInlineMode}])_e.appendMenuItem(Z.DiffEditorHunkToolbar,{command:{id:new md().desc.id,title:V(137,`Revert Block`),icon:e.icon},when:m.and(z.diffEditorModifiedWritable,e.key),order:5,group:`primary`}),_e.appendMenuItem(Z.DiffEditorSelectionToolbar,{command:{id:new md().desc.id,title:V(138,`Revert Selection`),icon:e.icon},when:m.and(z.diffEditorModifiedWritable,e.key),order:5,group:`primary`});x(ud),x(dd),x(fd),x(pd),_e.appendMenuItem(Z.EditorTitle,{command:{id:gd.id,title:V(139,`Open Accessible Diff Viewer`),precondition:m.has(`isInDiffEditor`)},order:10,group:`2_diff`,when:m.and(z.accessibleDiffViewerVisible.negate(),m.has(`isInDiffEditor`))}),jn.registerCommandAlias(`editor.action.diffReview.next`,gd.id),x(gd),jn.registerCommandAlias(`editor.action.diffReview.prev`,_d.id),x(_d);var bd=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},xd=function(e,t){return function(n,r){t(n,r,e)}},Sd,Cd=new A(`selectionAnchorSet`,!1),wd=class{static{Sd=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(Sd.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Cd.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(P.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new li().appendText(V(834,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),$c(V(835,`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(P.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()}};wd=Sd=bd([xd(1,G)],wd);var Td=class extends N{constructor(){super({id:`editor.action.setSelectionAnchor`,label:J(836,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:ln(2089,2080),weight:100}})}async run(e,t){wd.get(t)?.setSelectionAnchor()}},Ed=class extends N{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:J(837,`Go to Selection Anchor`),precondition:Cd})}async run(e,t){wd.get(t)?.goToSelectionAnchor()}},Dd=class extends N{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:J(838,`Select from Anchor to Cursor`),precondition:Cd,kbOpts:{kbExpr:z.editorTextFocus,primary:ln(2089,2089),weight:100}})}async run(e,t){wd.get(t)?.selectFromAnchorToCursor()}},Od=class extends N{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:J(839,`Cancel Selection Anchor`),precondition:Cd,kbOpts:{kbExpr:z.editorTextFocus,primary:9,weight:100}})}async run(e,t){wd.get(t)?.cancelSelectionAnchor()}};F(wd.ID,wd,4),O(Td),O(Ed),O(Dd),O(Od);var kd=E(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,V(840,`Overview ruler marker color for matching brackets.`)),Ad=class extends N{constructor(){super({id:`editor.action.jumpToBracket`,label:J(842,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:3165,weight:100}})}run(e,t){Pd.get(t)?.jumpToBracket()}},jd=class extends N{constructor(){super({id:`editor.action.selectToBracket`,label:J(843,`Select to Bracket`),precondition:void 0,metadata:{description:J(844,`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),Pd.get(t)?.selectToBracket(r)}},Md=class extends N{constructor(){super({id:`editor.action.removeBrackets`,label:J(845,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:z.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Pd.get(t)?.removeBrackets(this.id)}},Nd=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Pd=class e extends j{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 Cl(()=>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 P(i.lineNumber,i.column,i.lineNumber,i.column):new P(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(T.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 P(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:pl(kd),position:Su.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(M.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 Nd(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};F(Pd.ID,Pd,1),O(jd),O(Ad),O(Md),_e.appendMenuItem(Z.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:V(841,`Go to &&Bracket`)},order:2}),xc((e,t)=>{let n=e.getColor(yr);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)});var Fd=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 T(n,r-1,n,r),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new T(n,i,n,i),o)}else{let a=new T(n,i,n,i+1),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new T(n,r,n,r),o)}}computeCursorState(e,t){return this._isMovingLeft?new P(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new P(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}},Id=class extends N{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 Fd(e,this.left));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}},Ld=class extends Id{constructor(){super(!0,{id:`editor.action.moveCarretLeftAction`,label:J(846,`Move Selected Text Left`),precondition:z.writable})}},Rd=class extends Id{constructor(){super(!1,{id:`editor.action.moveCarretRightAction`,label:J(847,`Move Selected Text Right`),precondition:z.writable})}};O(Ld),O(Rd),O(class extends N{constructor(){super({id:`editor.action.transposeLetters`,label:J(848,`Transpose Letters`),precondition:z.writable,kbOpts:{kbExpr:z.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():cr.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=cr.leftPosition(n,o),c=cr.leftPosition(n,s),l=n.getValueInRange(T.fromPositions(c,s)),u=n.getValueInRange(T.fromPositions(s,o)),d=T.fromPositions(c,o);r.push(new rt(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var zd=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))}},Bd=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},Vd=function(e,t){return function(n,r){t(n,r,e)}},Hd=Y.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0}}),Ud=class e extends j{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=I(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=I(`span.icon`);this.domNode.append(t),t.classList.add(...C.asClassNameArray(D.loading),`codicon-modifier-spin`);let n=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};n(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&n()})),this._register(K(this.domNode,pr.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)}},Wd=class extends j{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Ae),this._currentWidget=this._register(new Ae),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=oo(()=>{let n=T.fromPositions(e);this._currentDecorations.set([{range:n,options:Hd}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Ud,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()}};Wd=Bd([Vd(2,w)],Wd);var Gd=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},Kd=function(e,t){return function(n,r){t(n,r,e)}},qd,Jd=class{static{qd=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new A(`messageVisible`,!1,V(1333,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(qd.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Ae,this._messageListeners=new S,this._mouseOverMessage=!1,this._editor=e,this._visible=qd.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if($c($t(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),$t(e)){let n=this._messageListeners.add(kr(e,{actionHandler:(e,t)=>{this.closeMessage(),It(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new Yd(this._editor,t,n.element)}else this._messageWidget.value=new Yd(this._editor,t,e);this._messageListeners.add(Du.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&ku(Za(),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(K(this._messageWidget.value.getDomNode(),pr.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(K(this._messageWidget.value.getDomNode(),pr.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(n?n.containsPosition(e.target.position)||this.closeMessage():n=new T(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Yd.fadeOut(this._messageWidget.value))}};Jd=qd=Gd([Kd(1,G),Kd(2,gn)],Jd),R(new(mt.bindToContribution(Jd.get))({id:`leaveEditorMessage`,precondition:Jd.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var Yd=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)}};F(Jd.ID,Jd,4);var Xd=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},Zd=function(e,t){return function(n,r){t(n,r,e)}},Qd=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(){}}}},$d=class e extends Qd{static{this.id=`text`}constructor(){super(zd.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[mc.text],this.pasteMimeTypes=[mc.text]}async getEdit(e,t){let n=e.get(mc.text);if(!n||e.has(mc.uriList))return;let r=await n.asString();return{handledMimeType:mc.text,title:V(965,`Insert Plain Text`),insertText:r,kind:this.kind}}},ef=class extends Qd{constructor(){super(zd.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[mc.uriList],this.pasteMimeTypes=[mc.uriList]}async getEdit(e,t){let n=await rf(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===Ks.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?V(966,`Insert Uris`):V(967,`Insert Uri`):n.length>1?V(968,`Insert Paths`):V(969,`Insert Path`),{handledMimeType:mc.uriList,insertText:i,title:a,kind:this.kind}}},tf=class extends Qd{constructor(e){super(zd.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[mc.uriList],this.pasteMimeTypes=[mc.uriList]}async getEdit(e,t){let n=await rf(e);if(!n.length||t.isCancellationRequested)return;let r=gc(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?oc(t.uri,e):void 0}));if(r.length)return{handledMimeType:mc.uriList,insertText:r.join(` `),title:n.length>1?V(970,`Insert Relative Paths`):V(971,`Insert Relative Path`),kind:this.kind}}};tf=Xd([Zd(0,Zn)],tf);var nf=class{constructor(){this.kind=new zd(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:mc.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==As.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:V(972,`Insert HTML`),kind:this.kind}]}}};async function rf(e){let t=e.get(mc.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of Yl.parse(n))try{r.push({uri:On.parse(e),originalText:e})}catch{}return r}var af={scheme:`*`,hasAccessToAllModels:!0},of=class extends j{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(af,new $d)),this._register(e.documentDropEditProvider.register(af,new ef)),this._register(e.documentDropEditProvider.register(af,new tf(t)))}};of=Xd([Zd(0,q),Zd(1,Zn)],of);var sf=class extends j{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(af,new $d)),this._register(e.documentPasteEditProvider.register(af,new ef)),this._register(e.documentPasteEditProvider.register(af,new tf(t))),this._register(e.documentPasteEditProvider.register(af,new nf))}};sf=Xd([Zd(0,q),Zd(1,Zn)],sf);var cf=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}}},lf=class{constructor(){this._children=[]}appendChild(e){return e instanceof uf&&this._children[this._children.length-1]instanceof uf?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 vf)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},uf=class e extends lf{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},df=class extends lf{},ff=class e extends df{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 pf?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}},pf=class e extends lf{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof uf&&(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}},mf=class e extends lf{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 hf&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof hf){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}},hf=class e extends lf{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)}},gf=class e extends df{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 uf(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 _f(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var vf=class e extends lf{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof ff&&(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 _f([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof ff&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof gf&&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){_f(this.children,e)}},yf=class{constructor(){this._scanner=new cf,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 vf;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 ff&&(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 ff(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof ff&&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 ff(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 uf(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 ff(Number(t)):new gf(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 ff(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new uf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new pf;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 uf(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 gf(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new uf("${"+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 mf,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 uf(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 hf(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 hf(Number(r),n)),!0)}else if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new hf(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 hf(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type===14?!1:(e.appendChild(new uf(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function bf(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new fi(e,{range:t,text:typeof n.insertText==`string`?yf.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function xf(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 Sf(e,t){return t&&(e.stack||e.stacktrace)?V(33,`{0}: {1}`,wf(e),Cf(e.stack)||Cf(e.stacktrace)):wf(e)}function Cf(e){return Array.isArray(e)?e.join(`
|
|
2
2
|
`):e}function wf(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`?V(34,`A system error occurred ({0})`,e.message):e.message||V(35,`An unknown error occurred. Please consult the log for more details.`)}function Tf(e=null,t=!1){if(!e)return V(36,`An unknown error occurred. Please consult the log for more details.`);if(Array.isArray(e)){let n=gc(e),r=Tf(n[0],t);return n.length>1?V(37,`{0} ({1} errors in total)`,r,n.length):r}if(bc(e))return e;if(e.detail){let n=e.detail;if(n.error)return Sf(n.error,t);if(n.exception)return Sf(n.exception,t)}return e.stack?Sf(e,t):e.message?e.message:V(38,`An unknown error occurred. Please consult the log for more details.`)}var Ef=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},Df=function(e,t){return function(n,r){t(n,r,e)}},Of,kf=`acceptSelectedCodeAction`,Af=`previewSelectedCodeAction`,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){}},Mf=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.text.textContent=e.label??``}disposeTemplate(e){}},Nf=class{get templateId(){return`action`}constructor(e,t,n,r,i,a,o,s,c){this._supportsPreview=e,this._onRemoveItem=t,this._onShowSubmenu=n,this._hasAnySubmenuActions=r,this._groupTitleByIndex=i,this._linkHandler=a,this._hideDefaultKeybindingTooltip=o,this._keybindingService=s,this._openerService=c}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`,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 Cu(e,Zu),c=document.createElement(`div`);c.className=`action-list-item-toolbar`,e.append(c);let l=document.createElement(`div`);return l.className=`action-list-submenu-indicator`,e.append(l),{container:e,icon:t,text:n,detail:o,badge:r,description:i,groupTitle:a,keybinding:s,toolbar:c,submenuIndicator:l,elementDisposables:new S}}renderElement(e,t,n){if(n.elementDisposables.clear(),e.group?.icon?(n.icon.className=C.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=An(e.group.icon.color.id))):(n.icon.className=C.asClassName(D.lightBulb),n.icon.style.color=`var(--vscode-editorLightBulb-foreground)`),!e.item||!e.label)return;if(Kn(!e.hideIcon,n.icon),e.isSectionToggle){let t=e.group?.icon===D.chevronDown;n.container.setAttribute(`aria-expanded`,String(t))}else n.container.removeAttribute(`aria-expanded`);if(n.previousClassName&&n.container.classList.remove(n.previousClassName),n.container.classList.toggle(`action-list-custom`,!!e.className),e.className&&n.container.classList.add(e.className),n.previousClassName=e.className,n.text.textContent=zf(e.label),e.badge?(n.badge.textContent=e.badge,n.badge.style.display=``):(n.badge.textContent=``,n.badge.style.display=`none`),e.keybinding)n.description.textContent=e.keybinding.getLabel(),n.description.style.display=`inline`,n.description.style.letterSpacing=`0.5px`;else if(e.description){if(Mc(n.description),typeof e.description==`string`)n.description.textContent=zf(e.description);else{let t=kr(e.description,{actionHandler:t=>{let n=On.parse(t);this._linkHandler?this._linkHandler(n,e):this._openerService.open(n,{allowCommands:!0})}});n.elementDisposables.add(t),n.description.appendChild(t.element)}n.description.style.display=`inline`}else n.description.textContent=``,n.description.style.display=`none`;let r=this._groupTitleByIndex.get(t);r?(n.groupTitle.textContent=r,n.groupTitle.style.display=``):(n.groupTitle.textContent=``,n.groupTitle.style.display=`none`),e.detail?(n.detail.textContent=zf(e.detail),n.detail.style.display=``):(n.detail.textContent=``,n.detail.style.display=`none`);let i=this._keybindingService.lookupKeybinding(kf)?.getLabel(),a=this._keybindingService.lookupKeybinding(Af)?.getLabel();n.container.classList.toggle(`option-disabled`,!!e.disabled),e.hover===void 0?e.tooltip?n.container.title=e.tooltip:e.disabled?n.container.title=e.label:this._hideDefaultKeybindingTooltip?n.container.title=``:i&&a?this._supportsPreview&&e.canPreview?n.container.title=V(1705,`{0} to Apply, {1} to Preview`,i,a):n.container.title=V(1706,`{0} to Apply`,i):n.container.title=``:n.container.title=``,Mc(n.toolbar);let o=[...e.toolbarActions??[]];if(e.onRemove&&o.push(ae({id:`actionList.remove`,label:V(1707,`Remove`),class:C.asClassName(D.close),run:async()=>{await e.onRemove(),this._onRemoveItem?.(e)}})),n.container.classList.toggle(`has-toolbar`,o.length>0),o.length>0){let e=new Fn(n.toolbar);n.elementDisposables.add(e),e.push(o,{icon:!0,label:!1})}e.submenuActions?.length&&!e.hover?.content?(n.submenuIndicator.className=`action-list-submenu-indicator has-submenu `+C.asClassName(D.chevronRight),n.submenuIndicator.style.display=``,n.submenuIndicator.style.visibility=``,n.elementDisposables.add(K(n.submenuIndicator,pr.CLICK,t=>{t.stopPropagation(),this._onShowSubmenu?.(e)}))):this._hasAnySubmenuActions?(n.submenuIndicator.className=`action-list-submenu-indicator`,n.submenuIndicator.style.display=``,n.submenuIndicator.style.visibility=`hidden`):(n.submenuIndicator.className=`action-list-submenu-indicator`,n.submenuIndicator.style.display=`none`)}disposeTemplate(e){e.keybinding.dispose(),e.elementDisposables.dispose()}};Nf=Ef([Df(7,jr),Df(8,gn)],Nf);var Pf=class extends UIEvent{constructor(){super(`acceptSelectedAction`)}},Ff=class extends UIEvent{constructor(){super(`previewSelectedAction`)}};function If(e){if(e.kind===`action`)return e.label}var Lf=Of=class extends j{constructor(e,t,n,r,i,a,o,s,c){if(super(),this._supportsPreview=t,this._delegate=r,this._options=a,this._keybindingService=o,this._openerService=s,this._instantiationService=c,this._headerLineHeight=24,this._separatorLineHeight=8,this.cts=this._register(new ou),this._submenuDisposables=this._register(new S),this._collapsedSections=new Set,this._filterText=``,this._suppressHover=!1,this._hasLaidOut=!1,this._filterCts=this._register(new Ae),this._groupTitleByIndex=new Map,this._onDidRequestLayout=this._register(new U),this.onDidRequestLayout=this._onDidRequestLayout.event,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._submenuContainer.tabIndex=-1,this.domNode.append(this._submenuContainer),this._register(K(this._submenuContainer,`mouseenter`,()=>{this._cancelSubmenuHide()})),this._register(K(this._submenuContainer,`mouseleave`,()=>{this._scheduleSubmenuHide()})),this._register(bn(()=>{this._cancelSubmenuHide(),this._cancelSubmenuShow()})),this._options?.collapsedByDefault)for(let e of this._options.collapsedByDefault)this._collapsedSections.add(e);let l={getHeight:e=>this._getItemHeight(e),getTemplateId:e=>e.kind},u=(this._options?.reserveSubmenuSpace??!0)&&n.some(e=>!!e.submenuActions?.length&&!e.hover?.content);if(this._list=this._register(new et(e,this.domNode,l,[new Nf(this._supportsPreview,e=>this._removeItem(e),e=>this._showSubmenuForItem(e),u,this._groupTitleByIndex,this._options?.linkHandler,this._options?.hideDefaultKeybindingTooltip??!1,this._keybindingService,this._openerService),new jf,new Mf],{keyboardSupport:!1,typeNavigationEnabled:!this._options?.showFilter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:If},accessibilityProvider:{getAriaLabel:e=>{if(e.kind===`action`){let t=e.label?zf(e?.label):``;if(e.detail&&(t=t+`, `+zf(e.detail)),e.ariaDescription)t=t+`, `+zf(e.ariaDescription);else if(e.description){let n=typeof e.description==`string`?e.description:e.description.value;t=t+`, `+zf(n)}if(e.hover?.content&&!e.ariaDescription&&!e.description){let n=e.hover.content,r=typeof n==`string`?n:$t(n)?n.value:Br(n)?n.textContent??void 0:void 0;r&&(!e.detail||zf(e.detail)!==zf(r))&&(t=t+`, `+zf(r))}return e.group?.title&&(t=t+`, `+e.group.title),e.disabled&&(t=V(1708,`{0}, Disabled Reason: {1}`,t,e.disabled)),e.submenuActions?.length&&(t=V(1709,`{0}, use right arrow to access options`,t)),t}return null},getWidgetAriaLabel:()=>V(1710,`Action Widget`),getRole:e=>{switch(e.kind){case`action`:return`option`;case`separator`:return`separator`;default:return`separator`}},getWidgetRole:()=>`listbox`,...i}})),this._list.style(Zl),this._register(this._list.onMouseClick(e=>this.onListClick(e))),this._register(this._list.onMouseOver(e=>this.onListHover(e))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(e=>this.onListSelection(e))),this._allMenuItems=[...n],this._options?.showFilter||this._options?.secondaryHeading){this._filterContainer=document.createElement(`div`),this._filterContainer.className=`action-list-filter`;let e=H(this._filterContainer,I(`.action-list-filter-row`));if(this._options?.showFilter){this._filterInput=document.createElement(`input`),this._filterInput.type=`text`,this._filterInput.className=`action-list-filter-input`,this._filterInput.placeholder=this._options?.filterPlaceholder??V(1711,`Search...`),this._filterInput.setAttribute(`aria-label`,V(1712,`Filter items`)),e.appendChild(this._filterInput);let t=this._options?.filterActions??[];if(t.length>0){let n=H(e,I(`.action-list-filter-actions`));this._register(new Fn(n)).push(t,{icon:!0,label:!1})}this._register(K(this._filterInput,`input`,()=>{this._filterText=this._filterInput.value,this._applyOrUpdateFilter()}))}if(this._options?.secondaryHeading){let t=H(e,I(`.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,I(`span.action-list-header-icon`));e.classList.add(...C.asClassNameArray(this._options.headerIcon)),e.setAttribute(`aria-hidden`,`true`)}let e=H(this._headerContainer,I(`span.action-list-header-text`));e.textContent=this._options.headerText}this._applyFilter(),this._list.length&&this._focusCheckedOrFirst(),this._register(K(this.domNode,`keydown`,e=>{if(e.key===`ArrowRight`){let t=this._list.getFocus();if(t.length>0){let n=this._list.element(t[0]);if(n?.submenuActions?.length){aa.stop(e,!0);let r=this._getRowElement(t[0]);r&&(this._showSubmenuForElement(n,r),this._currentSubmenuWidget?.focus())}}}})),this._filterInput&&this._register(K(this.domNode,`keydown`,e=>{this._filterInput&&!za(this._filterInput)&&e.key.length===1&&e.key!==` `&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(this._filterInput.focus(),this._filterInput.value=e.key,this._filterText=e.key,this._applyOrUpdateFilter(),e.preventDefault(),e.stopPropagation())}))}_toggleSection(e){this._collapsedSections.has(e)?this._collapsedSections.delete(e):this._collapsedSections.add(e),this._options?.onDidToggleSection?.(e,this._collapsedSections.has(e)),this._applyFilter()}_applyOrUpdateFilter(){if(!this._delegate.onFilter){this._applyFilter();return}let e=this._filterText;this._filterCts.value?.cancel();let t=new ou;this._filterCts.value=t,this._delegate.onFilter(e,t.token).then(e=>{t.token.isCancellationRequested||(this._allMenuItems=[...e],this._applyFilter(!0))}).catch(()=>{})}_applyFilter(e=!1,t=!0){let n=e?``:this._filterText.toLowerCase(),r=!e&&n.length>0,i=[],a=this._list.getFocus(),o;if(a.length>0&&(o=this._list.element(a[0])),r){let e,t=[],r=!1,a=()=>{e&&r&&i.push(e),i.push(...t),e=void 0,t=[],r=!1},o=e=>{let t=(e.label??``).toLowerCase(),r=typeof e.description==`string`?e.description:e.description?.value??``;return t.includes(n)||r.toLowerCase().includes(n)};for(let n of this._allMenuItems)if(n.kind!==`header`){if(n.kind===`separator`){a(),e=n.label?n:void 0;continue}if(n.showAlways){t.push(n);continue}n.isSectionToggle||o(n)&&(r=!0,t.push(n))}a()}else for(let e of this._allMenuItems){if(e.kind===`header`){i.push(e);continue}if(e.kind===`separator`){if(e.section&&this._collapsedSections.has(e.section))continue;i.push(e);continue}if(e.isSectionToggle&&e.section){let t=this._collapsedSections.has(e.section);i.push({...e,group:{...e.group,icon:t?D.chevronRight:D.chevronDown}});continue}e.section&&this._collapsedSections.has(e.section)||i.push(e)}let s=[],c=!1;for(let e=0;e<i.length;e++)s[e]=c,i[e].kind===`action`&&(c=!0);let l=[],u=!1;for(let e=i.length-1;e>=0;e--){if(i[e].kind===`action`){u=!0;continue}i[e].kind===`separator`&&(l[e]=u,u=!1)}for(let e=i.length-1;e>=0;e--){let t=i[e];if(t.kind!==`separator`)continue;let n=l[e],r=!t.label&&!s[e];(!n||r)&&i.splice(e,1)}this._options?.showGroupTitleOnFirstItem&&this._recomputeGroupTitles(i);let d=this._filterInput&&za(this._filterInput);if(this._list.splice(0,this._list.length,i),t&&this._onDidRequestLayout.fire(),d)this._filterInput?.focus(),this._focusCheckedOrFirst();else if(this._hasLaidOut&&o){let e=o.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),this._list.domFocus();break}}}}get filterContainer(){return this._filterContainer}get footerContainer(){return this._footerContainer}get headerContainer(){return this._headerContainer}get filterInput(){return this._filterInput}focusCondition(e){return!e.disabled&&e.kind===`action`}focus(){if(this._filterInput&&this._options?.focusFilterOnOpen){this._filterInput.focus(),this._focusCheckedOrFirst();return}this._list.domFocus(),this._focusCheckedOrFirst()}clearFocus(){this._list.setFocus([])}getFocusedElement(){let e=this._list.getFocus();if(e.length>0)return this._list.element(e[0])}_focusCheckedOrFirst(){this._suppressHover=!0;try{for(let e=0;e<this._list.length;e++){let t=this._list.element(e);if(t.kind===`action`&&t.item?.checked){this._list.setFocus([e]),this._list.reveal(e);return}}this._list.focusFirst(void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}finally{this._suppressHover=!1}}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){switch(e.kind){case`header`:return this._headerLineHeight;case`separator`:return e.label?this._actionLineHeight:this._separatorLineHeight;default:return e.detail?this._options?.detailItemHeight??48:this._actionLineHeight}}computeFullHeight(){let e=0;for(let t of this._allMenuItems)e+=this._getItemHeight(t);return e}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`,this._filterContainer&&this._filterContainer.parentElement&&this._filterContainer.parentElement.insertBefore(this._filterContainer,this.domNode)}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=n,s=this._allMenuItems.length;if(s>=50)return a(380);if(s>t){let e=[];for(let n=0;n<t;n++)e.push(this._list.element(n));let n=[...this._allMenuItems];this._list.splice(0,t,n);let r=0;for(let e of n)r+=this._getItemHeight(e);this._list.layout(r);let i=[];for(let e=0;e<n.length;e++){let t=this._getRowElement(e);if(t){t.style.width=`auto`;let r=t.getBoundingClientRect().width;t.style.width=``,i.push(r+this._computeToolbarWidth(n[e]))}}return o=a(Math.max(...i)),this._list.splice(0,n.length,e),o}let c=[];for(let e=0;e<t;e++){let t=this._getRowElement(e);if(t){t.style.width=`auto`;let n=t.getBoundingClientRect().width;t.style.width=``,c.push(n+this._computeToolbarWidth(this._list.element(e)))}}return a(Math.max(...c))}focusPrevious(){if(this._filterInput&&za(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._filterInput&&za(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])}}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 Ff:new Pf;this._list.setSelection([n],i)}onListSelection(e){if(!e.elements.length)return;let t=e.elements[0];if(t.isSectionToggle&&t.section){this._list.setSelection([]);let e=t.section;queueMicrotask(()=>{this._toggleSection(e)});return}if(be(e.browserEvent)){let t=e.browserEvent.target;if(Br(t)&&(t.closest(`.action-list-item-toolbar`)||t.closest(`.action-list-submenu-indicator`))){this._list.setSelection([]);return}}if(t.item&&this.focusCondition(t)){let n=e.browserEvent instanceof Ff;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._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))}}_computeToolbarWidth(e){let t=e.toolbarActions?.length??0;return e.onRemove&&t++,t===0?0:t*22+6}_getRowElement(e){return this.domNode.ownerDocument.getElementById(this._list.getElementID(e))}_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._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._currentSubmenuElement===e)return;this._submenuDisposables.clear(),this._currentSubmenuElement=e,this._clearSubmenuContainer();let n,r=e.hover?.content;if(r){if(Br(r))n=r,e.hover?.disposable&&this._register(e.hover.disposable);else{let t=typeof r==`string`?new li(r):r,i=this._options?.linkHandler,a=kr(t,{actionHandler:t=>{let n=On.parse(t);i?i(n,e):this._openerService.open(n,{allowCommands:!0})}});this._submenuDisposables.add(a),n=a.element}n.classList.add(`action-list-submenu-hover-header`),e.submenuActions?.length&&n.classList.add(`has-submenu`),this._submenuContainer.appendChild(n)}let i=!!e.submenuActions?.length;this._submenuContainer.style.display=``,this._submenuContainer.style.position=`absolute`,this._submenuContainer.removeAttribute(`role`);let a=t.getBoundingClientRect(),o=this.domNode.getBoundingClientRect(),s=_a(this.domNode),c=0,l=n?n.offsetWidth:0;if(i){let t=[],n=e.submenuActions.filter(e=>e instanceof Xu).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=0;e<r.actions.length;e++){let n=r.actions[e],i=n,a=i.icon??C.fromId(n.checked?D.check.id:D.blank.id),o=i.hoverContent;t.push({item:n,kind:`action`,label:n.label,description:n.tooltip||void 0,group:{title:``,icon:a},hideIcon:!1,hover:o?{content:o}:{},onRemove:i.onRemove})}e<n.length-1&&t.push({kind:`separator`,label:``})}for(let n of e.submenuActions)if(!(n instanceof Xu)){let e=n;t.push({item:n,kind:`action`,label:n.label,description:n.tooltip||void 0,group:{title:``},hideIcon:!1,hover:{},onRemove:e.onRemove})}let r=this._submenuDisposables.add(this._instantiationService.createInstance(Of,`submenu`,!1,t,{onHide:()=>{},onSelect:e=>{e.run();let t=this._currentSubmenuElement?.item;this._hideSubmenu(),t&&this._delegate.onSelect(t),this.hide()}},void 0,void 0));this._submenuContainer.appendChild(r.domNode),this._currentSubmenuWidget=r,r.clearFocus(),c=r.computeListHeight(),r.layout(c);let i=r.computeMaxWidth(0);l=Math.max(l,i),r.layout(c,l),r.domNode.style.width=`${l}px`,this._submenuDisposables.add(K(r.domNode,`keydown`,e=>{if(e.key===`ArrowLeft`||e.key===`Escape`)aa.stop(e,!0),this._hideSubmenu(),this._list.domFocus();else if(e.key===`Enter`){aa.stop(e,!0);let t=r.getFocusedElement();if(t?.item){t.item.run();let e=this._currentSubmenuElement?.item;this._hideSubmenu(),e&&this._delegate.onSelect(e),this.hide()}}else e.key===`ArrowDown`?(aa.stop(e,!0),r.focusNext()):e.key===`ArrowUp`&&(aa.stop(e,!0),r.focusPrevious())}))}let u=s.innerWidth-a.right,d=o.left,f=l+10;u>=f||u>=d?this._submenuContainer.style.left=`${o.right-o.left+4}px`:this._submenuContainer.style.left=`${-f-4}px`;let p=n?n.offsetHeight:0,m=c+p,h=s.innerHeight,g=a.height,_=a.top-o.top+(g-m)/2,v=o.top+_+m;v>h&&(_-=v-h+8),o.top+_<0&&(_=-o.top),this._submenuContainer.style.top=`${_}px`}_hideSubmenu(){this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._submenuDisposables.clear(),this._currentSubmenuWidget=void 0,this._currentSubmenuElement=void 0,this._clearSubmenuContainer(),this._submenuContainer.style.display=`none`}_clearSubmenuContainer(){this._submenuContainer.contains(Za())&&this._list.domFocus(),Mc(this._submenuContainer)}_scheduleSubmenuHide(){this._cancelSubmenuHide(),this._submenuHideTimeout=setTimeout(()=>{this._hideSubmenu()},300)}_cancelSubmenuHide(){this._submenuHideTimeout!==void 0&&(clearTimeout(this._submenuHideTimeout),this._submenuHideTimeout=void 0)}_scheduleSubmenuShow(e,t){this._cancelSubmenuShow(),this._submenuShowTimeout=setTimeout(()=>{this._submenuShowTimeout=void 0;let n=typeof t==`number`?this._getRowElement(t):null;n&&this._showSubmenuForElement(e,n)},500)}_cancelSubmenuShow(){this._submenuShowTimeout!==void 0&&(clearTimeout(this._submenuShowTimeout),this._submenuShowTimeout=void 0)}async onListHover(e){let t=e.element;if(t&&t.item&&this.focusCondition(t)){if(Br(e.browserEvent.target)&&e.browserEvent.target.closest(`.action-list-item-toolbar`)!==null){t.submenuActions?.length||this._cancelSubmenuShow(),this._list.setFocus([]);return}let n=!!(t.submenuActions?.length||t.hover?.content);if(n&&(this._suppressHover=!0),this._list.setFocus(typeof e.index==`number`?[e.index]:[]),n&&(this._suppressHover=!1),n){this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow()):(this._hideSubmenu(),this._scheduleSubmenuShow(t,e.index));return}if(this._currentSubmenuElement===t?this._cancelSubmenuHide():(this._cancelSubmenuShow(),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._hideSubmenu(),this._scheduleSubmenuShow(t,e.index)))}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Lf=Of=Ef([Df(6,jr),Df(7,gn),Df(8,w)],Lf);var Rf=class extends j{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 anchorPosition(){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._widget=this._register(l.createInstance(Lf,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){this._widget.hide(e),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=_a(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._widget.computeListHeight(),t=this._widget.filterContainer?36:0,n=this._widget.footerContainer?32:0,r=this._widget.headerContainer?this._widget.headerContainer.offsetHeight||36:0,i=t+n+r,a=_a(this.domNode),o;if(this.hasDynamicHeight()){let e=a.innerHeight,t=qe(this._anchor),n=t.top-a.pageYOffset,r=e-n-t.height-30,s=n;if(this._showAbove===void 0){let e=i+this._widget.computeFullHeight();this._showAbove=e>r&&s>r}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=Math.floor(a.innerHeight*.6),c=this._widget.lineHeight,l=Math.min(Math.max(o,c*3+i),s);return Math.min(e+i,l)-i}layout(e){this._hasLaidOut=!0,this._lastMinWidth=e;let t=this.computeHeight();this._widget.layout(t);let n=this._widget.computeMaxWidth(e);return this._cachedMaxWidth=n,this._widget.layout(t,this._cachedMaxWidth),this._cachedMaxWidth}};Rf=Ef([Df(7,Vr),Df(8,Te),Df(9,w)],Rf);function zf(e){return e.replace(/\r\n|\r|\n/g,` `)}var Bf=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},Vf=function(e,t){return function(n,r){t(n,r,e)}};E(`actionBar.toggledBackground`,At,V(1713,`Background color for toggled action items in action bar.`));var Hf={Visible:new A(`codeActionMenuVisible`,!1,V(1714,`Whether the action widget list is visible`)),FilterFocused:new A(`codeActionMenuFilterFocused`,!1,V(1715,`Whether the action widget filter input is focused`))},Uf=Xt(`actionWidgetService`),Wf=class extends j{get isVisible(){return Hf.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Ae)}show(e,t,n,r,i,a,o,s,c){let l=Hf.Visible.bindTo(this._contextKeyService),u=this._instantiationService.createInstance(Rf,e,t,n,r,s,c,i);this._contextViewService.showContextView({getAnchor:()=>i,render:e=>(l.set(!0),this._renderWidget(e,u,o??[])),onHide:e=>{l.reset(),this._onWidgetClosed(e)},get anchorPosition(){return u.anchorPosition}},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){this._list.value?.hide(e),this._list.clear()}_renderWidget(e,t,n){let r=document.createElement(`div`);if(r.classList.add(`action-widget`),e.appendChild(r),this._list.value=t,this._list.value)this._list.value.headerContainer&&r.appendChild(this._list.value.headerContainer),this._list.value.filterContainer&&r.appendChild(this._list.value.filterContainer),r.appendChild(this._list.value.domNode),this._list.value.footerContainer&&r.appendChild(this._list.value.footerContainer);else throw Error(`List has no value`);let i=new S,a=this._list.value.headerContainer;a&&i.add(Rl(a,e=>e.preventDefault()));let o=document.createElement(`div`),s=e.appendChild(o);s.classList.add(`context-view-block`),i.add(Rl(s,e=>e.stopPropagation()));let c=document.createElement(`div`),l=e.appendChild(c);l.classList.add(`context-view-pointerBlock`),i.add(K(l,pr.POINTER_MOVE,()=>l.remove())),i.add(Rl(l,()=>l.remove()));let u=0;if(n.length){let e=this._createActionBar(`.action-widget-action-bar`,n);e&&(r.appendChild(e.getContainer().parentElement),i.add(e),u=e.getContainer().offsetWidth)}let d=this._list.value?.layout(u);r.style.width=`${d}px`,this._list.value?.focus();let f=Hf.FilterFocused.bindTo(this._contextKeyService);if(i.add({dispose:()=>f.reset()}),this._list.value?.filterInput){let e=this._list.value.filterInput;i.add(K(e,`focus`,()=>f.set(!0))),i.add(K(e,`blur`,()=>f.set(!1)))}let p=i.add(Os(e));return i.add(p.onDidBlur(()=>{let e=Za();e?.closest(`.action-widget-hover`)||e?.closest(`.action-list-submenu-panel`)||this.hide(!0)})),i}_createActionBar(e,t){if(!t.length)return;let n=new Fn(I(e));return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){this._list.value?.hide(e)}};Wf=Bf([Vf(0,Vr),Vf(1,G),Vf(2,w)],Wf),us(Uf,Wf,1);var Gf=1100;x(class extends Ru{constructor(){super({id:`hideCodeActionWidget`,title:J(1716,`Hide action widget`),precondition:Hf.Visible,keybinding:{weight:Gf,primary:9,secondary:[1033]}})}run(e){e.get(Uf).hide(!0)}}),x(class extends Ru{constructor(){super({id:`clearFilterCodeActionWidget`,title:J(1717,`Clear action widget filter`),precondition:m.and(Hf.Visible,Hf.FilterFocused),keybinding:{weight:1101,primary:9}})}run(e){let t=e.get(Uf);t instanceof Wf&&(t.clearFilter()||t.hide(!0))}}),x(class extends Ru{constructor(){super({id:`selectPrevCodeAction`,title:J(1718,`Select previous action`),precondition:Hf.Visible,keybinding:{weight:Gf,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){let t=e.get(Uf);t instanceof Wf&&t.focusPrevious()}}),x(class extends Ru{constructor(){super({id:`selectNextCodeAction`,title:J(1719,`Select next action`),precondition:Hf.Visible,keybinding:{weight:Gf,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){let t=e.get(Uf);t instanceof Wf&&t.focusNext()}}),x(class extends Ru{constructor(){super({id:`collapseSectionCodeAction`,title:J(1720,`Collapse section`),precondition:m.and(Hf.Visible,Hf.FilterFocused.negate()),keybinding:{weight:Gf,primary:15}})}run(e){let t=e.get(Uf);t instanceof Wf&&t.collapseSection()}}),x(class extends Ru{constructor(){super({id:`expandSectionCodeAction`,title:J(1721,`Expand section`),precondition:m.and(Hf.Visible,Hf.FilterFocused.negate()),keybinding:{weight:Gf,primary:17}})}run(e){let t=e.get(Uf);t instanceof Wf&&t.expandSection()}}),x(class extends Ru{constructor(){super({id:`toggleSectionCodeAction`,title:J(1722,`Toggle section`),precondition:m.and(Hf.Visible,Hf.FilterFocused.negate()),keybinding:{weight:Gf,primary:10}})}run(e){let t=e.get(Uf);t instanceof Wf&&(t.toggleSection()||t.acceptSelected())}}),x(class extends Ru{constructor(){super({id:kf,title:J(1723,`Accept selected action`),precondition:Hf.Visible,keybinding:{weight:Gf,primary:3,secondary:[2137]}})}run(e){let t=e.get(Uf);t instanceof Wf&&t.acceptSelected()}}),x(class extends Ru{constructor(){super({id:Af,title:J(1724,`Preview selected action`),precondition:Hf.Visible,keybinding:{weight:Gf,primary:2051}})}run(e){let t=e.get(Uf);t instanceof Wf&&t.acceptSelected(!0)}});var Kf=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},qf=function(e,t){return function(n,r){t(n,r,e)}},Jf,Yf=class extends j{static{Jf=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(bn(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(bn((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(e=>{this.dispose()})),this._register(Du.runAndSubscribe(l.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){this.button.element.title=this._keybindingService.appendKeybinding(this.showCommand.label,this.showCommand.id)}create(){this.domNode=I(`.post-edit-widget`),this.button=this._register(new Le(this.domNode,{supportIcons:!0})),this.button.label=`$(insert)`,this._register(K(this.domNode,pr.CLICK,()=>this.showSelector()))}getId(){return Jf.baseId+`.`+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){let e=Po(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:C.fromId(t===this.edits.activeEditIndex?D.check.id:D.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)}};Yf=Jf=Kf([qf(8,G),qf(9,jr),qf(10,Uf)],Yf);var Xf=class extends j{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 Ae),this._register(Du.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)=>{Mo(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 sc(r(o,l.token),l.token)}catch(e){return c(e,V(976,`Error resolving edit '{0}':
|
|
3
3
|
{1}`,o.title,Tf(e)))}finally{l.dispose()}if(i.isCancellationRequested)return;let d=bf(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,V(977,`Error applying edit '{0}':
|
|
4
4
|
{1}`,o.title,Tf(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(Yf,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};Xf=Kf([qf(5,w),qf(6,Et),qf(7,di)],Xf);var Zf=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},Qf=function(e,t){return function(n,r){t(n,r,e)}},$f,ep=`editor.changePasteType`,tp=`editor.pasteAs.preferences`,np=new A(`pasteWidgetVisible`,!1,V(956,`Whether the paste widget is showing`)),rp=`application/vnd.code.copymetadata`,ip=class extends j{static{$f=this}static{this.ID=`editor.contrib.copyPasteActionController`}static get(e){return e.getContribution($f.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 Wd(`pasteIntoEditor`,e,t)),this._postPasteWidgetManager=this._register(t.createInstance(Xf,`pasteIntoEditor`,e,np,{id:ep,label:V(957,`Show paste options...`)},()=>$f._configureDefaultAction?[$f._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 co,s=a.flatMap(e=>e.copyMimeTypes??[]),c=as();this.setCopyMetadata(e.clipboardData,{id:c,providerCopyMimeTypes:s,defaultPastePayload:i});let l=a.map(n=>({providerMimeTypes:n.copyMimeTypes,operation:ql(r=>n.prepareDocumentPaste(t,e.dataToCopy.sourceRanges,o,r).catch(e=>{console.error(e)}))}));$f._currentCopyOperation?.operations.forEach(e=>e.operation.cancel()),$f._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(rp),Jd.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??[],mc.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=>Uc(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(`, `):V(958,`empty`):t.providerId;Jd.get(this._editor)?.showMessage(V(959,`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=ql(async a=>{let c=this._editor;if(!c.hasModel())return;let l=c.getModel(),u=new S,d=u.add(new ou(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 $d)return this.applyDefaultPasteHandler(n,r,f,i);let o={triggerKind:As.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 $d)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 Ea,a=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),V(960,`Resolving paste edit for '{0}'. Click to cancel`,e.title),Vc(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(),V(961,`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=ql(async o=>{let s=this._editor;if(!s.hasModel())return;let c=s.getModel(),l=new S,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:As.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:V(962,`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})),...$f._configureDefaultAction?[gs({type:`separator`}),{label:$f._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:V(963,`Select Paste Action`)});if(t===e){$f._configureDefaultAction?.run();return}d=t?.edit}if(!d)return;let f=bf(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:V(964,`Running paste handlers`)},()=>a)}setCopyMetadata(e,t){this._logService.trace(`CopyPasteController#setCopyMetadata new id : `,t.id),e.setData(rp,JSON.stringify(t))}fetchCopyMetadata(e){this._logService.trace(`CopyPasteController#fetchCopyMetadata`);let t=e.clipboardData.getData(rp);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&&$f._currentCopyOperation?.handle===n.id){let n=$f._currentCopyOperation.operations.filter(t=>e.some(e=>e.pasteMimeTypes.some(e=>Uc(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(mc.uriList)){let e=await this._clipboardService.readResources();if(r.isCancellationRequested)return;e.length&&t.append(mc.uriList,No(Yl.create(e)))}}async getPasteEdits(e,t,n,r,i,a){let o=new S;return{edits:xf(gc(await Vc(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){Mo(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(mc.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(tp,{resource:e.uri});for(let e of Array.isArray(n)?n:[]){let n=new zd(e),r=t.findIndex(e=>n.contains(e.kind));if(r>=0)return r}return 0}};ip=$f=Zf([Qf(1,w),Qf(2,Pl),Qf(3,Et),Qf(4,xe),Qf(5,tr),Qf(6,xa),Qf(7,q),Qf(8,Fi),Qf(9,kl)],ip);var ap=`9_cutcopypaste`,op=Oi||document.queryCommandSupported(`cut`),sp=Oi||document.queryCommandSupported(`copy`),cp=navigator.clipboard===void 0||is?document.queryCommandSupported(`paste`):!0;function lp(e){return e.register(),e}var up=op?lp(new nn({id:`editor.action.clipboardCutAction`,precondition:void 0,kbOpts:Oi?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:`2_ccp`,title:V(849,`Cu&&t`),order:1},{menuId:Z.EditorContext,group:ap,title:V(850,`Cut`),when:z.writable,order:1},{menuId:Z.CommandPalette,group:``,title:V(851,`Cut`),order:1},{menuId:Z.SimpleEditorContext,group:ap,title:V(852,`Cut`),when:z.writable,order:1}]})):void 0,dp=sp?lp(new nn({id:`editor.action.clipboardCopyAction`,precondition:void 0,kbOpts:Oi?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:`2_ccp`,title:V(853,`&&Copy`),order:2},{menuId:Z.EditorContext,group:ap,title:V(854,`Copy`),order:2},{menuId:Z.CommandPalette,group:``,title:V(855,`Copy`),order:1},{menuId:Z.SimpleEditorContext,group:ap,title:V(856,`Copy`),order:2}]})):void 0;_e.appendMenuItem(Z.MenubarEditMenu,{submenu:Z.MenubarCopy,title:J(861,`Copy As`),group:`2_ccp`,order:3}),_e.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextCopy,title:J(862,`Copy As`),group:ap,order:3}),_e.appendMenuItem(Z.EditorContext,{submenu:Z.EditorContextShare,title:J(863,`Share`),group:`11_share`,order:-1,when:m.and(m.notEquals(`resourceScheme`,`output`),z.editorTextFocus)}),_e.appendMenuItem(Z.ExplorerContext,{submenu:Z.ExplorerContextShare,title:J(864,`Share`),group:`11_share`,order:-1});var fp=cp?lp(new nn({id:`editor.action.clipboardPasteAction`,precondition:void 0,kbOpts:Oi?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:Z.MenubarEditMenu,group:`2_ccp`,title:V(857,`&&Paste`),order:4},{menuId:Z.EditorContext,group:ap,title:V(858,`Paste`),when:z.writable,order:4},{menuId:Z.CommandPalette,group:``,title:V(859,`Paste`),order:1},{menuId:Z.SimpleEditorContext,group:ap,title:V(860,`Paste`),when:z.writable,order:4}]})):void 0,pp=class extends N{constructor(){super({id:`editor.action.clipboardCopyWithSyntaxHighlightingAction`,label:J(865,`Copy with Syntax Highlighting`),precondition:void 0,kbOpts:{kbExpr:z.textInputFocus,primary:0,weight:100}})}run(e,t){let n=e.get(Pl),r=e.get(xe);n.trace(`ExecCommandCopyWithSyntaxHighlightingAction#run`),t.hasModel()&&(!t.getOption(45)&&t.getSelection().isEmpty()||(Oa.forceCopyWithSyntaxHighlighting=!0,t.focus(),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)`),mp(t,r),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)`),Oa.forceCopyWithSyntaxHighlighting=!1))}};function mp(e,t){if(Oa.electronBugWorkaroundCopyEventHasFired=!1,e.getContainerDomNode().ownerDocument.execCommand(`copy`),Oi&&Oa.electronBugWorkaroundCopyEventHasFired===!1){let{dataToCopy:n}=Tl(e._getViewModel(),void 0,is);t.writeText(n.text)}}function hp(e,t){e&&(e.addImplementation(1e4,`code-editor`,(e,n)=>{let r=e.get(Pl),i=e.get(xe);r.trace(`registerExecCommandImpl (addImplementation code-editor for : `,t,`)`);let a=e.get(Di).getFocusedCodeEditor();if(a&&a.hasTextFocus()&&a.hasModel()){let e=a.getOption(45),n=a.getSelection();return n&&n.isEmpty()&&!e||(a.getOption(170)&&t===`cut`?(gp(a),r.trace(`registerExecCommandImpl (before execCommand copy)`),mp(a,i),a.trigger(void 0,`cut`,void 0),r.trace(`registerExecCommandImpl (after execCommand copy)`)):(gp(a),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),t===`copy`?mp(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(Pl);return r.trace(`registerExecCommandImpl (addImplementation generic-dom for : `,t,`)`),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),El().execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`),!0}))}function gp(e){if(e.getOption(170)){let t=mn.get(e.getId());t&&t.handleWillCopy()}}hp(up,`cut`),hp(dp,`copy`),fp&&(fp.addImplementation(1e4,`code-editor`,(e,t)=>{let n=e.get(Pl);n.trace(`registerExecCommandImpl (addImplementation code-editor for : paste)`);let r=e.get(Di),i=e.get(xe),a=r.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(170)){let e=mn.get(a.getId());e&&e.handleWillPaste()}n.trace(`registerExecCommandImpl (before triggerPaste)`);let e=i.triggerPaste(Qs().vscodeWindowId);return e?(n.trace(`registerExecCommandImpl (triggerPaste defined)`),e.then(async()=>(n.trace(`registerExecCommandImpl (after triggerPaste)`),ip.get(a)?.finishedPaste()??Promise.resolve()))):(n.trace(`registerExecCommandImpl (triggerPaste undefined)`),ct?(n.trace(`registerExecCommandImpl (Paste handling on web)`),(async()=>{let e=await i.readText();if(e!==``){let t=jc.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}),fp.addImplementation(0,`generic-dom`,(e,t)=>(e.get(Pl).trace(`registerExecCommandImpl (addImplementation generic-dom for : paste)`),e.get(xe).triggerPaste(Qs().vscodeWindowId)??!1))),sp&&O(pp);var _p=new class{constructor(){this.QuickFix=new zd(`quickfix`),this.Refactor=new zd(`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 zd(`notebook`),this.Source=new zd(`source`),this.SourceOrganizeImports=this.Source.append(`organizeImports`),this.SourceFixAll=this.Source.append(`fixAll`),this.SurroundWith=this.Refactor.append(`surround`)}},vp;(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`})(vp||={});function yp(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some(n=>xp(t,n,e.include))||!e.includeSourceActions&&_p.Source.contains(t))}function bp(e,t){let n=t.kind?new zd(t.kind):void 0;return!(e.include&&(!n||!e.include.contains(n))||e.excludes&&n&&e.excludes.some(t=>xp(n,t,e.include))||!e.includeSourceActions&&n&&_p.Source.contains(n)||e.onlyIncludePreferredActions&&!t.isPreferred)}function xp(e,t,n){return!(!t.contains(e)||n&&t.contains(n))}var Sp=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 zd(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}},Cp=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){cc(e)}t&&(this.action.edit=t.edit)}return this}},wp=`editor.action.codeAction`,Tp=`editor.action.quickFix`,Ep=`editor.action.autoFix`,Dp=`editor.action.refactor`,Op=`editor.action.sourceAction`,kp=`editor.action.organizeImports`,Ap=`editor.action.fixAll`,jp=1e3,Mp=class e extends j{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:Fu(t.diagnostics)?Fu(n.diagnostics)?e.codeActionsPreferredComparator(t,n):-1:Fu(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&&_p.QuickFix.contains(new zd(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},Np={actions:[],documentation:void 0};async function Pp(e,t,n,r,i,a){let o=r.filter||{},s={...o,excludes:[...o.excludes||[],_p.Notebook]},c={only:o.include?.value,trigger:r.type},l=new Ci(t,a),u=Fp(e,t,r.type===2?s:o),d=new S,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(),Np;r&&d.add(r);let i=(r?.actions||[]).filter(e=>e&&bp(o,e)),a=Lp(e,i,o.include);return{actions:i.map(t=>new Cp(t,e)),documentation:a}}catch(e){if(Mo(e))throw e;return cc(e),Np}finally{clearTimeout(r)}}),p=e.onDidChange(()=>{pu(e.all(t),u)||l.cancel()});try{let n=await Promise.all(f),i=n.map(e=>e.actions).flat(),a=new Mp(i,[...gc(n.map(e=>e.documentation)),...Ip(e,t,r,i)],d);return d.add(a),a}catch(e){throw d.dispose(),e}finally{p.dispose(),l.dispose()}}function Fp(e,t,n){return e.all(t).filter(e=>e.providedCodeActionKinds?e.providedCodeActionKinds.some(e=>yp(n,new zd(e))):!0)}function*Ip(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 Lp(e,t,n){if(!e.documentation)return;let r=e.documentation.map(e=>({kind:new zd(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 zd(e.kind)))return t.command}}var Rp;(function(e){e.OnSave=`onSave`,e.FromProblemsView=`fromProblemsView`,e.FromCodeActions=`fromCodeActions`,e.FromAILightbulb=`fromAILightbulb`,e.FromProblemsHover=`fromProblemsHover`})(Rp||={});async function zp(e,t,n,r,i=B.None){let a=e.get(Et),o=e.get(tr),s=e.get(au),c=e.get(di),l=e.get(Lo);if(s.publicLog2(`codeAction.applyCodeAction`,{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:n}),l.playSignal(po.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!==Rp.OnSave,showPreview:r?.preview,reason:Ln.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=Bp(e);c.error(typeof t==`string`?t:V(866,`An unknown error occurred while applying the code action`))}setTimeout(()=>l.playSignal(po.codeActionApplied),jp)}}function Bp(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}jn.registerCommand(`_executeCodeActionProvider`,async function(e,t,n,r,i){if(!(t instanceof On))throw so();let{codeActionProvider:a}=e.get(q),o=e.get(yt).getModel(t);if(!o)throw so();let s=P.isISelection(n)?P.liftSelection(n):T.isIRange(n)?o.validateRange(n):void 0;if(!s)throw so();let c=typeof r==`string`?new zd(r):void 0,l=await Pp(a,o,s,{type:1,triggerAction:vp.Default,filter:{includeSourceActions:!0,include:c}},eo.None,B.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(B.None));try{return await Promise.all(u),l.validActions.map(e=>e.action)}finally{setTimeout(()=>l.dispose(),100)}});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},Hp=function(e,t){return function(n,r){t(n,r,e)}},Up,Wp=class{static{Up=this}static{this.codeActionCommands=[Dp,wp,Op,kp,Ap]}constructor(e){this.keybindingService=e}getResolver(){let e=new yc(()=>this.keybindingService.getKeybindings().filter(e=>Up.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return e.command===`editor.action.organizeImports`?t={kind:_p.SourceOrganizeImports.value}:e.command===`editor.action.fixAll`&&(t={kind:_p.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...Sp.fromUser(t,{kind:zd.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 zd(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)}};Wp=Up=Vp([Hp(0,jr)],Wp),E(`symbolIcon.arrayForeground`,Ts,V(1547,`The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.booleanForeground`,Ts,V(1548,`The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.classForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},V(1549,`The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.colorForeground`,Ts,V(1550,`The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.constantForeground`,Ts,V(1551,`The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.constructorForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},V(1552,`The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.enumeratorForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},V(1553,`The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.enumeratorMemberForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},V(1554,`The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.eventForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},V(1555,`The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.fieldForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},V(1556,`The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.fileForeground`,Ts,V(1557,`The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.folderForeground`,Ts,V(1558,`The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.functionForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},V(1559,`The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.interfaceForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},V(1560,`The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.keyForeground`,Ts,V(1561,`The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.keywordForeground`,Ts,V(1562,`The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.methodForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},V(1563,`The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.moduleForeground`,Ts,V(1564,`The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.namespaceForeground`,Ts,V(1565,`The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.nullForeground`,Ts,V(1566,`The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.numberForeground`,Ts,V(1567,`The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.objectForeground`,Ts,V(1568,`The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.operatorForeground`,Ts,V(1569,`The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.packageForeground`,Ts,V(1570,`The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.propertyForeground`,Ts,V(1571,`The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.referenceForeground`,Ts,V(1572,`The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.snippetForeground`,Ts,V(1573,`The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.stringForeground`,Ts,V(1574,`The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.structForeground`,Ts,V(1575,`The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.textForeground`,Ts,V(1576,`The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.typeParameterForeground`,Ts,V(1577,`The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.unitForeground`,Ts,V(1578,`The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),E(`symbolIcon.variableForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},V(1579,`The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`));var Gp=Object.freeze({kind:zd.Empty,title:V(902,`More Actions...`)}),Kp=Object.freeze([{kind:_p.QuickFix,title:V(903,`Quick Fix`)},{kind:_p.RefactorExtract,title:V(904,`Extract`),icon:D.wrench},{kind:_p.RefactorInline,title:V(905,`Inline`),icon:D.wrench},{kind:_p.RefactorRewrite,title:V(906,`Rewrite`),icon:D.wrench},{kind:_p.RefactorMove,title:V(907,`Move`),icon:D.wrench},{kind:_p.SurroundWith,title:V(908,`Surround With`),icon:D.surroundWith},{kind:_p.Source,title:V(909,`Source Action`),icon:D.symbolFile},Gp]);function qp(e,t,n){if(!t)return e.map(e=>({kind:`action`,item:e,group:Gp,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!e.action.edit?.edits.length}));let r=Kp.map(e=>({group:e,actions:[]}));for(let t of e){let e=t.action.kind?new zd(t.action.kind):zd.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:D.sparkle}:r,label:t.action.title,disabled:!!t.action.disabled,keybinding:n(t.action)})}}return i}var Jp=new A(`supportedCodeAction`,``),Yp=class extends j{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new Ja),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=>ao(e,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:vp.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===Qc.Off&&!this.ignoreLightbulbOff)){if(n===Qc.Off||n===Qc.On)return t;if(n===Qc.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}}},Xp;(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(Mo(e))return Zp;throw e})}cancel(){this._cancellablePromise.cancel()}}e.Triggered=t})(Xp||={});var Zp=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),Qp=class extends j{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 Ae),this._state=Xp.Empty,this._onDidChangeState=this._register(new U),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new Ae),this._disposed=!1,this._ignoreLightbulbOff=!1,this._supportedCodeActions=Jp.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(Xp.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(Xp.Empty);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 Yp(this._editor,this._markerService,t=>{if(!t){this.setState(Xp.Empty);return}let n=t.selection.getStartPosition(),r=ql(async n=>{if(this._settingEnabledNearbyQuickfixes()&&t.trigger.type===1&&(t.trigger.triggerAction===vp.QuickFix||t.trigger.filter?.include?.contains(_p.QuickFix))){let r=await Pp(this._registry,e,t.selection,t.trigger,eo.None,n);this.codeActionsDisposable.value=r;let i=[...r.allActions];if(n.isCancellationRequested)return r.dispose(),Zp;let a=r.validActions?.some(e=>e.action.kind&&_p.QuickFix.contains(new zd(e.action.kind))&&!e.action.isAI),o=this._markerService.read({resource:e.uri});if(a){for(let e of r.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...o.filter(e=>e.relatedInformation)]);return{validActions:r.validActions,allActions:i,documentation:r.documentation,hasAutoFix:r.hasAutoFix,hasAIFix:r.hasAIFix,allAIFixes:r.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=r}}}else if(!a&&o.length>0){let a=t.selection.getPosition(),s=a,c=Number.MAX_VALUE,l=[...r.validActions];for(let u of o){let d=u.endColumn,f=u.endLineNumber,p=u.startLineNumber;if(f===a.lineNumber||p===a.lineNumber){s=new M(f,d);let u={type:t.trigger.type,triggerAction:t.trigger.triggerAction,filter:{include:t.trigger.filter?.include?t.trigger.filter?.include:_p.QuickFix},autoApply:t.trigger.autoApply,context:{notAvailableMessage:t.trigger.context?.notAvailableMessage||``,position:s}},p=new P(s.lineNumber,s.column,s.lineNumber,s.column),m=await Pp(this._registry,e,p,u,eo.None,n);if(n.isCancellationRequested)return m.dispose(),Zp;if(m.validActions.length!==0){for(let e of m.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...o.filter(e=>e.relatedInformation)]);r.allActions.length===0&&i.push(...m.allActions),Math.abs(a.column-d)<c?l.unshift(...m.validActions):l.push(...m.validActions)}c=Math.abs(a.column-d)}}let u=l.filter((e,t,n)=>n.findIndex(t=>t.action.title===e.action.title)===t);return u.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),{validActions:u,allActions:i,documentation:r.documentation,hasAutoFix:r.hasAutoFix,hasAIFix:r.hasAIFix,allAIFixes:r.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=r}}}}if(t.trigger.type===1){let r=await Pp(this._registry,e,t.selection,t.trigger,eo.None,n);return this.codeActionsDisposable.value=r,r}let r=await Pp(this._registry,e,t.selection,t.trigger,eo.None,n);return this.codeActionsDisposable.value=r,r});t.trigger.type===1&&this._progressService?.showWhile(r,250);let i=new Xp.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:vp.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.dispose()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}},$p=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},em=function(e,t){return function(n,r){t(n,r,e)}},tm,nm=Vs(`gutter-lightbulb`,D.lightBulb,V(910,`Icon which spawns code actions menu from the gutter when there is no space in the editor.`)),rm=Vs(`gutter-lightbulb-auto-fix`,D.lightbulbAutofix,V(911,`Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.`)),im=Vs(`gutter-lightbulb-sparkle`,D.lightbulbSparkle,V(912,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.`)),am=Vs(`gutter-lightbulb-aifix-auto-fix`,D.lightbulbSparkleAutofix,V(913,`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=Vs(`gutter-lightbulb-sparkle-filled`,D.sparkleFilled,V(914,`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.`)),sm;(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})(sm||={});function cm(e,t,n,r,i=!1){if(e.validActions.length<=0)return;let a,o=!1;e.allAIFixes?(a=i?om:D.sparkleFilled,e.validActions.length===1&&(o=!0)):a=e.hasAutoFix?e.hasAIFix?i?am:D.lightbulbSparkleAutofix:i?rm:D.lightbulbAutofix:e.hasAIFix?i?im:D.lightbulbSparkle:i?nm:D.lightBulb;let s;return s=o?V(915,`Run: {0}`,e.validActions[0].action.title):e.hasAutoFix&&n?V(916,`Show Code Actions. Preferred Quick Fix Available ({0})`,n):!e.hasAutoFix&&r?V(917,`Show Code Actions ({0})`,r):V(918,`Show Code Actions`),{actions:e,trigger:t,icon:a,autoRun:o,title:s,isGutter:i}}var lm=class extends j{static{tm=this}static{this.GUTTER_DECORATION=Y.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:C.asClassName(D.lightBulb),glyphMargin:{position:Wr.Left},stickiness:1})}static{this.ID=`editor.contrib.lightbulbWidget`}static{this._posPref=[0]}static _computeLightBulbInfo(e,t,n,r){if(e.type===1)return cm(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 U),this.onClick=this._onClick.event,this._state=St(this,sm.Hidden),this._gutterState=St(this,sm.Hidden),this._combinedInfo=L(this,e=>{let t=this._gutterState.read(e);if(t.type===1)return tm._computeLightBulbInfo(t,!0,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e));let n=this._state.read(e);if(n.type===1)return tm._computeLightBulbInfo(n,!1,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e))}),this._iconClasses=[],this.lightbulbClasses=[`codicon-`+nm.id,`codicon-`+am.id,`codicon-`+rm.id,`codicon-`+im.id,`codicon-`+om.id],this._preferredKbLabel=St(this,void 0),this._quickFixKbLabel=St(this,void 0),this.gutterDecoration=tm.GUTTER_DECORATION,this._domNode=I(`div.lightBulbWidget`),this._domNode.role=`listbox`,this._register(zr.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(ml(this._domNode,e=>{let t=this._state.get();if(t.type!==1)return;this._editor.focus(),e.preventDefault();let{top:n,height:r}=Po(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(K(this._domNode,`mouseenter`,e=>{(e.buttons&1)==1&&this.hide()})),this._register(Du.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(k(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}=Po(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===Qc.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=ua(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 sm.Showing(e,t,n,{position:{lineNumber:p,column:m},preference:tm._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 sm.Showing(e,t,n,{position:{lineNumber:p,column:m},preference:tm._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 sm.Showing(e,t,n,{position:{lineNumber:p,column:m},preference:tm._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()!==sm.Hidden&&(this._state.set(sm.Hidden,void 0),this._editor.layoutContentWidget(this))}gutterHide(){this._gutterState.get()!==sm.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this._gutterState.set(sm.Hidden,void 0))}_updateLightBulbTitleAndIcon(e){this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],!(!e||e.isGutter)&&(this._domNode.title=e.title,this._iconClasses=C.asClassNameArray(e.icon),this._domNode.classList.add(...this._iconClasses))}_updateGutterDecorationOptions(e){!e||!e.isGutter||(this.gutterDecoration=Y.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:C.asClassName(e.icon),glyphMargin:{position:Wr.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 T(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 T(t,0,t,0)),n.changeDecorationOptions(e,this.gutterDecoration)})}};lm=tm=$p([em(1,jr)],lm);var um=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},dm=function(e,t){return function(n,r){t(n,r,e)}},fm,pm=`quickfix-edit-highlight`,mm=class extends j{static{fm=this}static{this.ID=`editor.contrib.codeActionController`}static get(e){return e.getContribution(fm.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 Ae),this._showDisabled=!1,this._disposed=!1,this._onlyLightBulbWithEmptySelection=!1,this._lightBulbInfoObs=St(this,void 0),this._preferredKbLabel=St(this,void 0),this._quickFixKbLabel=St(this,void 0),this._editor=e,this._model=this._register(new Qp(this._editor,i.codeActionProvider,t,n,a,s)),this._register(this._model.onDidChangeState(e=>this.update(e))),this._register(Du.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 yc(()=>{let e=this._editor.getContribution(lm.ID);return e&&(this._register(e.onClick(e=>this.showCodeActionsFromLightbulb(e.actions,e))),e.onlyWithEmptySelection=this._onlyLightBulbWithEmptySelection),e}),this._resolver=r.createInstance(Wp),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,Rp.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;Jd.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(zp,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:vp.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=await e.actions}catch(e){Hc(e);return}if(!this._disposed&&this._editor.getSelection()?.startLineNumber===e.position.lineNumber)if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),this._lightBulbInfoObs.set(cm(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,Rp.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){let n=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(n&&n.action.disabled){Jd.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)){Jd.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=M.isIPosition(t)?this.toCoords(t):t;this._actionWidgetService.show(`codeActionWidget`,!0,qp(a,this._shouldShowHeaders(),this._resolver.getResolver()),{onSelect:async(e,t)=>{this.applyCodeAction(e,!0,!!t,n.fromLightbulb?Rp.FromAILightbulb:Rp.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 zd(r);n=[_p.RefactorExtract,_p.RefactorInline,_p.RefactorRewrite,_p.RefactorMove,_p.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:fm.DECORATION})):t.map(e=>({range:e,options:fm.DECORATION}));r.set(e)}else if(n&&n.length>0){let e=n.map(e=>({range:e,options:fm.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(V(899,`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=Po(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:V(900,`Hide Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:`showMoreActions`,label:V(901,`Show Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};mm=fm=um([dm(1,Wa),dm(2,G),dm(3,w),dm(4,q),dm(5,Fc),dm(6,tr),dm(7,xa),dm(8,Uf),dm(9,w),dm(10,Fc),dm(11,jr)],mm),xc((e,t)=>{((e,n)=>{n&&t.addRule(`.monaco-editor ${e} { background-color: ${n}; }`)})(`.quickfix-edit-highlight`,e.getColor(Nl));let n=e.getColor(_c);n&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Xr(e.type)?`dotted`:`solid`} ${n}; box-sizing: border-box; }`)});function hm(e){return m.regex(Jp.keys()[0],RegExp(`(\\s|^)`+pi(e.value)+`\\b`))}var gm={type:`object`,defaultSnippets:[{body:{kind:``}}],properties:{kind:{type:`string`,description:V(867,`Kind of the code action to run.`)},apply:{type:`string`,description:V(868,`Controls when the returned actions are applied.`),default:`ifSingle`,enum:[`first`,`ifSingle`,`never`],enumDescriptions:[V(869,`Always apply the first returned code action.`),V(870,`Apply the first returned code action if it is the only one.`),V(871,`Do not apply the returned code actions.`)]},preferred:{type:`boolean`,default:!1,description:V(872,`Controls if only preferred code actions should be returned.`)}}};function _m(e,t,n,r,i=vp.Default){e.hasModel()&&mm.get(e)?.manualTriggerAtCurrentPosition(t,i,n,r)}var vm=class extends Pi{constructor(){super({id:Tp,title:J(889,`Quick Fix...`),precondition:m.and(z.writable,z.hasCodeActionsProvider),icon:D.lightBulb,f1:!0,keybinding:{when:z.textInputFocus,primary:2137,weight:100},menu:{id:Z.InlineChatEditorAffordance,group:`1_quickfix`,order:0,when:m.and(z.writable,z.hasCodeActionsProvider)}})}runEditorCommand(e,t){return _m(t,V(873,`No code actions available`),void 0,void 0,vp.QuickFix)}},ym=class extends mt{constructor(){super({id:wp,precondition:m.and(z.writable,z.hasCodeActionsProvider),metadata:{description:`Trigger a code action`,args:[{name:`args`,schema:gm}]}})}runEditorCommand(e,t,n){let r=Sp.fromUser(n,{kind:zd.Empty,apply:`ifSingle`});return _m(t,typeof n?.kind==`string`?r.preferred?V(874,`No preferred code actions for '{0}' available`,n.kind):V(875,`No code actions for '{0}' available`,n.kind):r.preferred?V(876,`No preferred code actions available`):V(877,`No code actions available`),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}},bm=class extends N{constructor(){super({id:Dp,label:J(890,`Refactor...`),precondition:m.and(z.writable,z.hasCodeActionsProvider),kbOpts:{kbExpr:z.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:`1_modification`,order:2,when:m.and(z.writable,hm(_p.Refactor))},metadata:{description:`Refactor...`,args:[{name:`args`,schema:gm}]}})}run(e,t,n){let r=Sp.fromUser(n,{kind:_p.Refactor,apply:`never`});return _m(t,typeof n?.kind==`string`?r.preferred?V(878,`No preferred refactorings for '{0}' available`,n.kind):V(879,`No refactorings for '{0}' available`,n.kind):r.preferred?V(880,`No preferred refactorings available`):V(881,`No refactorings available`),{include:_p.Refactor.contains(r.kind)?r.kind:zd.None,onlyIncludePreferredActions:r.preferred},r.apply,vp.Refactor)}},xm=class extends N{constructor(){super({id:Op,label:J(891,`Source Action...`),precondition:m.and(z.writable,z.hasCodeActionsProvider),contextMenuOpts:{group:`1_modification`,order:2.1,when:m.and(z.writable,hm(_p.Source))},metadata:{description:`Source Action...`,args:[{name:`args`,schema:gm}]}})}run(e,t,n){let r=Sp.fromUser(n,{kind:_p.Source,apply:`never`});return _m(t,typeof n?.kind==`string`?r.preferred?V(882,`No preferred source actions for '{0}' available`,n.kind):V(883,`No source actions for '{0}' available`,n.kind):r.preferred?V(884,`No preferred source actions available`):V(885,`No source actions available`),{include:_p.Source.contains(r.kind)?r.kind:zd.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,vp.SourceAction)}},Sm=class extends N{constructor(){super({id:kp,label:J(892,`Organize Imports`),precondition:m.and(z.writable,hm(_p.SourceOrganizeImports)),kbOpts:{kbExpr:z.textInputFocus,primary:1581,weight:100},metadata:{description:J(893,`Organize imports in the current file. Also called 'Optimize Imports' by some tools`)}})}run(e,t){return _m(t,V(886,`No organize imports action available`),{include:_p.SourceOrganizeImports,includeSourceActions:!0},`ifSingle`,vp.OrganizeImports)}},Cm=class extends N{constructor(){super({id:Ap,label:J(894,`Fix All`),precondition:m.and(z.writable,hm(_p.SourceFixAll))})}run(e,t){return _m(t,V(887,`No fix all action available`),{include:_p.SourceFixAll,includeSourceActions:!0},`ifSingle`,vp.FixAll)}},wm=class extends N{constructor(){super({id:Ep,label:J(895,`Auto Fix...`),precondition:m.and(z.writable,hm(_p.QuickFix)),kbOpts:{kbExpr:z.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return _m(t,V(888,`No auto fixes available`),{include:_p.QuickFix,onlyIncludePreferredActions:!0},`ifSingle`,vp.AutoFix)}};F(mm.ID,mm,3),F(lm.ID,lm,4),x(vm),O(bm),O(xm),O(Sm),O(wm),O(Cm),R(new ym),Un.as(Ro.Configuration).registerConfiguration({...Gr,properties:{"editor.codeActionWidget.showHeaders":{type:`boolean`,scope:6,description:V(896,`Enable/disable showing group headers in the Code Action menu.`),default:!0}}}),Un.as(Ro.Configuration).registerConfiguration({...Gr,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:`boolean`,scope:6,description:V(897,`Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.`),default:!0}}}),Un.as(Ro.Configuration).registerConfiguration({...Gr,properties:{"editor.codeActions.triggerOnFocusChange":{type:`boolean`,scope:6,markdownDescription:V(898,`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 Tm=class e{constructor(){this.lenses=[]}static{this.Empty=new e}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){Es(e)&&(this._store??=new S,this._store.add(e));for(let n of e.lenses)this.lenses.push({symbol:n,provider:t})}};async function Em(e,t,n){let r=e.ordered(t),i=new Map,a=new Tm,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){cc(e)}});return await Promise.all(o),n.isCancellationRequested?(a.dispose(),Tm.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)}jn.registerCommand(`_executeCodeLensProvider`,function(e,...t){let[n,r]=t;Bi(On.isUri(n)),Bi(typeof r==`number`||!r);let{codeLensProvider:i}=e.get(q),a=e.get(yt).getModel(n);if(!a)throw so();let o=[],s=new S;return Em(i,a,B.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,B.None)).then(e=>o.push(e||n.symbol)));return Promise.all(t)}).then(()=>o).finally(()=>{setTimeout(()=>s.dispose(),100)})});var Dm=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},Om=function(e,t){return function(n,r){t(n,r,e)}},km=Xt(`ICodeLensCache`),Am=class{constructor(e,t){this.lineCount=e,this.data=t}},jm=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw Error(`not supported`)}},this._cache=new Uo(20,.75),Me(Go,()=>e.remove(`codelens/cache`,1));let t=`codelens/cache2`,n=e.get(t,1,`{}`);this._deserialize(n);let r=Du.filter(e.onWillSaveState,e=>e.reason===dc.SHUTDOWN);Du.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 Tm;r.add({lenses:n},this._fakeProvider);let i=new Am(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 T(e,1,e,11)});let i=new Tm;i.add({lenses:r},this._fakeProvider),this._cache.set(e,new Am(n.lineCount,i))}}catch{}}};jm=Dm([Om(0,Gc)],jm),us(km,jm,1);var Mm=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`)}},Nm=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(I(`a`,{id:t,title:a.command.tooltip,role:`button`},...i)),this._commands.set(t,a.command)}else r.push(I(`span`,{title:a.command.tooltip},...i));n+1<t.length&&r.push(I(`span`,void 0,`\xA0|\xA0`))}}i?(Zr(this._domNode,...r),this._isEmpty&&n&&this._domNode.classList.add(`fadein`),this._isEmpty=!1):Zr(this._domNode,I(`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}},Pm=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])}},Fm=Y.register({collapseOnReplaceEdit:!0,description:`codelens`}),Im=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:Fm},e=>this._decorationIds[t]=e),o=o?T.plusRange(o,e.symbol.range):T.lift(e.symbol.range)}),this._viewZone=new Mm(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 Nm(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&&T.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:Fm},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)))}}},Lm=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},Rm=function(e,t){return function(n,r){t(n,r,e)}},zm=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 S,this._localToDispose=new S,this._lenses=[],this._oldCodeLensModels=new S,this._provideCodeLensDebounce=n.for(t.codeLensProvider,`CodeLensProvide`,{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,`CodeLensResolve`,{min:250,salt:`resolve`}),this._resolveCodeLensesScheduler=new Cl(()=>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`,Ri.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&&oo(()=>{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 Cl(()=>{let t=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=ql(t=>Em(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()},Hc)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(bn(()=>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 Pm;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(bn(()=>{if(this._editor.getModel()){let e=ja.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 Pm;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=ja.capture(this._editor),a=this._getLayoutInfo();this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let r=new Pm,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 Im(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 Im(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=ql(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},cc):(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=>{Hc(e),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}};zm=Lm([Rm(1,q),Rm(2,Sa),Rm(3,tr),Rm(4,di),Rm(5,km)],zm),F(zm.ID,zm,1),O(class extends N{constructor(){super({id:`codelens.showLensesInCurrentLine`,precondition:z.hasCodeLensProvider,label:J(920,`Show CodeLens Commands for Current Line`)})}async run(e,t){if(!t.hasModel())return;let n=e.get(Fi),r=e.get(tr),i=e.get(di),a=t.getSelection().positionLineNumber,o=t.getContribution(zm.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:V(919,`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 Bm=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}},Vm=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}},Hm=class{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(let e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}},Um=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}},Wm=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},Gm=function(e,t){return function(n,r){t(n,r,e)}},Km=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 W(new Pc(Math.round(255*i.red),Math.round(255*i.green),Math.round(255*i.blue),i.alpha)),o=W.Format.CSS.formatRGB(a),s=W.Format.CSS.formatHSL(a),c=W.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}};Km=Wm([Gm(0,$i)],Km);var qm=class extends j{constructor(e,t){super(),this._register(e.colorProvider.register(`*`,new Km(t)))}};qm=Wm([Gm(0,q),Gm(1,$i)],qm);async function Jm(e,t,n,r=`auto`){return $m(new Xm,e,t,n,r)}function Ym(e,t,n,r){return Promise.resolve(n.provideColorPresentations(e,t,r))}var Xm=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)}},Zm=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)}},Qm=class{constructor(e){this.colorInfo=e}async compute(e,t,n,r){let i=await e.provideColorPresentations(t,this.colorInfo,B.None);return Array.isArray(i)&&r.push(...i),Array.isArray(i)}};async function $m(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 Km)o=l;else try{await e.compute(l,n,r,s)&&(a=!0)}catch(e){cc(e)}}return a?s:o&&i!==`never`?(await e.compute(o,n,r,s),s):[]}function eh(e,t){let{colorProvider:n}=e.get(q),r=e.get(yt).getModel(t);if(!r)throw so();return{model:r,colorProviderRegistry:n,defaultColorDecoratorsEnablement:e.get(xa).getValue(`editor.defaultColorDecorators`,{resource:t})}}var th=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},nh=function(e,t){return function(n,r){t(n,r,e)}},rh,ih=Object.create({}),ah=class extends j{static{rh=this}static{this.ID=`editor.contrib.colorDetector`}static{this.RECOMPUTE_TIME=1e3}constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new S),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new oh),this._colorDecorationClassRefs=this._register(new S),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new zs(this._editor)),this._debounceInformation=r.for(n.colorProvider,`Document Colors`,{min:rh.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(167);let n=t!==this._isColorDecoratorsEnabled||e.hasChanged(27),r=e.hasChanged(167);(n||r)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167),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)return;let e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Ja,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=ql(async e=>{let t=this._editor.getModel();if(!t)return[];let n=new ve(!1),r=await Jm(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){Hc(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=this._editor.getOption(27);for(let r=0;r<e.length&&t.length<n;r++){let{red:n,green:i,blue:a,alpha:o}=e[r].colorInfo.color,s=new Pc(Math.round(n*255),Math.round(i*255),Math.round(a*255),o),c=`rgba(${s.r}, ${s.g}, ${s.b}, ${s.a})`,l=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:c}));t.push({range:{startLineNumber:e[r].colorInfo.range.startLineNumber,startColumn:e[r].colorInfo.range.startColumn,endLineNumber:e[r].colorInfo.range.endLineNumber,endColumn:e[r].colorInfo.range.endColumn},options:{description:`colorDetector`,before:{content:`\xA0`,inlineClassName:`${l.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:ih}}})}let r=n<e.length?n:!1;this._decoratorLimitReporter.update(e.length,r),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(T.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)}};ah=rh=th([nh(1,xa),nh(2,q),nh(3,Sa)],ah);var oh=class extends j{constructor(){super(...arguments),this._onDidChange=this._register(new U),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}},sh=`editor.action.showHover`,ch=`editor.action.showDefinitionPreviewHover`,lh=`editor.action.hideHover`,uh=`editor.action.scrollUpHover`,dh=`editor.action.scrollDownHover`,fh=`editor.action.scrollLeftHover`,ph=`editor.action.scrollRightHover`,mh=`editor.action.pageUpHover`,hh=`editor.action.pageDownHover`,gh=`editor.action.goToTopHover`,_h=`editor.action.goToBottomHover`,vh=`editor.action.increaseHoverVerbosityLevel`,yh=V(1145,`Increase Hover Verbosity Level`),bh=`editor.action.decreaseHoverVerbosityLevel`,xh=V(1146,`Decrease Hover Verbosity Level`),Sh=`editor.action.hideLongLineWarningHover`,Ch=`editor.action.inlineSuggest.commit`,wh=`editor.action.inlineSuggest.commitAlternativeAction`,Th=`editor.action.inlineSuggest.showPrevious`,Eh=`editor.action.inlineSuggest.showNext`,Dh=`editor.action.inlineSuggest.jump`,Oh=`editor.action.inlineSuggest.hide`,kh=`editor.action.inlineSuggest.toggleShowCollapsed`,Ah=`editor.action.inlineSuggest.renameSymbol`,jh=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},Mh=function(e,t){return function(n,r){t(n,r,e)}},Nh,Ph=class extends j{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=$u(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar===`always`),this.sessionPosition=void 0,this.position=L(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 M(t.lineNumber,Math.min(n,this.sessionPosition?.column??2**53-1));return this.sessionPosition=r,r}),this._register(Ht((t,n)=>{let r=this.model.read(t);if(!r||!this.alwaysShowToolbar.read(t))return;let i=L(t=>{let n=t.store.add(this.instantiationService.createInstance(Lh.hot.read(t),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(n),t.store.add(bn(()=>e.removeContentWidget(n))),t.store.add(k(e=>{this.position.read(e)&&r.lastTriggerKind.read(e)!==pn.Explicit&&r.triggerExplicitly()})),n}),a=ir(this,(e,t)=>!!this.position.read(e)||!!t);n.add(k(e=>{a.read(e)&&i.read(e)}))}))}};Ph=jh([Mh(2,w)],Ph);var Fh=Vs(`inline-suggestion-hints-next`,D.chevronRight,V(1250,`Icon for show next parameter hint.`)),Ih=Vs(`inline-suggestion-hints-previous`,D.chevronLeft,V(1251,`Icon for show previous parameter hint.`)),Lh=class extends j{static{Nh=this}static{this.hot=qc(this)}static{this._dropDownVisible=!1}static get dropDownVisible(){return this._dropDownVisible}static{this.id=0}createCommandAction(e,t,n){let r=new cn(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,a,o,s,c,l,u,d,f){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=i,this._extraCommands=a,this._warning=o,this._relayout=s,this._commandService=c,this.keybindingService=u,this._contextKeyService=d,this._menuService=f,this.id=`InlineSuggestionHintsContentWidget${Nh.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=L(e=>{let t=this._warning.read(e);if(t)return typeof t.message==`string`?t.message:e.store.add(kr(t.message)).element}),this._warningMessageNode=X.div({class:`warningMessage`,style:{maxWidth:400,margin:4,marginBottom:4,display:L(e=>this._warning.read(e)?`block`:`none`)}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=cu(`div.inlineSuggestionsHints`,{className:this.withBorder?`monaco-hover monaco-hover-content`:``},[this._warningMessageNode.element,cu(`div@toolBar`)]),this.previousAction=this._register(this.createCommandAction(Th,V(1252,`Previous`),C.asClassName(Ih))),this.availableSuggestionCountAction=this._register(new cn(`inlineSuggestionHints.availableSuggestionCount`,``,void 0,!1)),this.nextAction=this._register(this.createCommandAction(Eh,V(1253,`Next`),C.asClassName(Fh))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Z.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Cl(()=>{this.availableSuggestionCountAction.label=``},100)),this.disableButtonsDebounced=this._register(new Cl(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(k(e=>{this._warningMessageContentNode.read(e),this._warningMessageNode.readEffect(e),this._relayout()})),this.toolBar=this._register(l.createInstance(Bh,this.nodes.toolBar,Z.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith(`primary`)},actionViewItemProvider:(e,t)=>{if(e instanceof Lr)return l.createInstance(zh,e,void 0);if(e===this.availableSuggestionCountAction){let t=new Rh(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=>{Nh._dropDownVisible=e})),this._register(k(e=>{this._position.read(e),this.editor.layoutContentWidget(this)})),this._register(k(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(k(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 Lr&&t.push(e);t.length>0&&t.unshift(new Tr),this.toolBar.setAdditionalSecondaryActions(t)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Lh=Nh=jh([Mh(8,tr),Mh(9,w),Mh(10,jr),Mh(11,G),Mh(12,La)],Lh);var Rh=class extends ar{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(){}},zh=class extends Sc{updateLabel(){let e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){let t=cu(`div.keybinding`).root;this._register(new Cu(t,Zu,{disableTitle:!0,...ni})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add(`inlineSuggestionStatusBarItemLabel`)}}updateTooltip(){}},Bh=class extends zl{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}=ka(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){pu(this.prependedPrimaryActions,e,(e,t)=>e===t)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){pu(this.additionalActions,e,(e,t)=>e===t)||(this.additionalActions=e,this.updateToolbar())}};Bh=jh([Mh(3,La),Mh(4,G),Mh(5,Au),Mh(6,jr),Mh(7,tr),Mh(8,au)],Bh);function Vh(e,t,n){let r=Po(e);return!(t<r.left+3||t>r.left+r.width-3||n<r.top+3||n>r.top+r.height-3)}function Hh(e,t,n){return e===`on`?!0:e===`off`?!1:Uh(t,n.event)}function Uh(e,t){return e===`altKey`?t.ctrlKey||t.metaKey:t.altKey}var Wh=class{constructor(e,t,n,r){this.value=e,this.isComplete=t,this.hasLoadingMessage=n,this.options=r}},Gh=class extends j{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new U),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new Kh(e=>this._triggerAsyncComputation(e),0)),this._syncComputationScheduler=this._register(new Kh(e=>this._triggerSyncComputation(e),0)),this._loadingMessageScheduler=this._register(new Kh(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=Ys(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){Hc(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 Wh(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}},Kh=class extends j{constructor(e,t){super(),this._scheduler=this._register(new Cl(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}},qh=class{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new U,this._onDidResize=new U,this._sashListener=new S,this._size=new zi(0,0),this._minSize=new zi(0,0),this._maxSize=new zi(2**53-1,2**53-1),this.domNode=document.createElement(`div`),this._eastSash=new va(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new va(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new va(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:Jo.North}),this._southSash=new va(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:Jo.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(Du.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(Du.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(Du.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(Du.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 zi(t,e);zi.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}},Jh=30,Yh=24,Xh=class extends j{constructor(e,t=new zi(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new qh),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position=`absolute`,this._resizableNode.minSize=zi.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 zi(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?M.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!(!t||!n))return Po(t).top+n.top-Jh}_availableVerticalSpaceBelow(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;let r=Po(t),i=Xl(t.ownerDocument.body),a=r.top+n.top+n.height;return i.height-a-Yh}_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)}},Zh=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},Qh=function(e,t){return function(n,r){t(n,r,e)}},$h,eg=30,tg=class extends Xh{static{$h=this}static{this.ID=`editor.contrib.resizableContentHoverWidget`}static{this._lastDimensions=new zi(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 zi(150,e.getOption(75)+8);super(e,a),this._configurationService=n,this._accessibilityService=r,this._keybindingService=i,this._hover=this._register(new Yc(!0)),this._onDidResize=this._register(new U),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new U),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new U),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=a,this._hoverVisibleKey=z.hoverVisible.bindTo(t),this._hoverFocusedKey=z.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(Os(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 $h.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 $h._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){let n=this._hover.containerDomNode;return $h._applyDimensions(n,e,t)}_setScrollableElementDimensions(e,t){let n=this._hover.scrollbar.getDomNode();return $h._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){$h._applyMaxDimensions(this._hover.contentsDomNode,e,t),$h._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),$h._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 zi(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){$h._lastDimensions=new zi(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?Xl(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=Po(this.getDomNode());this._renderedHover.closestMouseDistance===void 0&&(this._renderedHover.closestMouseDistance=ng(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,n.left,n.top,n.width,n.height));let r=ng(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,$h._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,$h._lastDimensions.width);this._resizableNode.maxSize=new zi(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=os(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&&ds(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 zi(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 zi(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 zi(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();let e=this._hover.contentsDomNode,t=os(e),n=qo(e)+2;if(this._resizableNode.layout(t,n),this._setHoverWidgetDimensions(n,t),t=os(e),n=qo(e),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(t,n),this._renderedHover?.showAtPosition){let e=os(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-eg})}scrollRight(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+eg})}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})}};tg=$h=Zh([Qh(1,G),Qh(2,xa),Qh(3,ai),Qh(4,jr)],tg);function ng(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 rg=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 hs.EMPTY;let i=e._getLineDecorations(this._editor,r);return hs.merge(this._participants.map(e=>e.computeAsync?e.computeAsync(r,i,t.source,n):hs.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 gc(i)}},ig=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 ag(this,t,this.isComplete,this.options)}},ag=class extends ig{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}},og=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},sg=function(e,t){return function(n,r){t(n,r,e)}},cg=I,lg=class extends j{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=cg(`div.hover-row.status-bar`),this.hoverElement.tabIndex=0,this.actionsElement=H(this.hoverElement,cg(`div.actions`))}addAction(e){let t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;this._hasContent=!0;let r=this._register(zo.render(this.actionsElement,e,n));return this._register(this._hoverService.setupManagedHover(bs(`element`),r.actionContainer,r.actionRenderedLabel)),this.actions.push(r),r}append(e){let t=H(this.actionsElement,e);return this._hasContent=!0,t}};lg=og([sg(0,jr),sg(1,fa)],lg);var ug=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 T(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 T(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),s=r.startLineNumber,c=r.endLineNumber)}a.push({range:new T(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:pl(ge),position:Su.Center},minimap:{color:pl(lt),position:1}})}static{this._FIND_MATCH_DECORATION=Y.register({description:`find-match`,stickiness:1,zIndex:10,className:`findMatch`,inlineClassName:`findMatchInline`,showIfCollapsed:!0,overviewRuler:{color:pl(ge),position:Su.Center},minimap:{color:pl(lt),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:pl(ge),position:Su.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})}},dg=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)=>T.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 fg(e,t){if(e&&e[0]!==``){let n=pg(e,t,`-`),r=pg(e,t,`_`);return n&&!r?mg(e,t,`-`):!n&&r?mg(e,t,`_`):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():Dt(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 mg(e,t,n){let r=t.split(n),i=e[0].split(n),a=``;return r.forEach((e,t)=>{a+=fg([i[t]],e)+n}),a.slice(0,-1)}var hg=class{constructor(e){this.staticValue=e,this.kind=0}},gg=class{constructor(e){this.pieces=e,this.kind=1}},_g=class e{static fromStaticValue(t){return new e([vg.staticValue(t)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new hg(``):e.length===1&&e[0].staticValue!==null?this._state=new hg(e[0].staticValue):this._state=new gg(e)}buildReplaceString(t,n){if(this._state.kind===0)return n?fg(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}},vg=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)}},yg=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++]=vg.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),this._result[this._resultLen++]=vg.caseOps(e,n),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=vg.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),new _g(this._result)}};function bg(e){if(!e||e.length===0)return new _g(null);let t=[],n=new yg(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(`
|