@arcgis/coding-components 5.2.0-next.106 → 5.2.0-next.108
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/cdn/{Y3RD24PA.js → 25DS4NAV.js} +2 -2
- package/dist/cdn/{2YJMSLBY.js → 2F63EE2U.js} +2 -2
- package/dist/cdn/{LWIX4BHD.js → 2J4KPRKE.js} +2 -2
- package/dist/cdn/{FQOANF2G.js → 2PANAQNE.js} +2 -2
- package/dist/cdn/{O5VTBJWD.js → 2SMUB2AN.js} +2 -2
- package/dist/cdn/{ZZDJOW42.js → 2XRE5BCZ.js} +2 -2
- package/dist/cdn/{V4HDH7ZM.js → 2ZK67ZH5.js} +2 -2
- package/dist/cdn/{HCNKB3RA.js → 2ZPTX5XB.js} +2 -2
- package/dist/cdn/{5KM3AKLY.js → 3K2R5VGI.js} +2 -2
- package/dist/cdn/{7VS5GHCL.js → 3XSWIAUA.js} +2 -2
- package/dist/cdn/{7IS2FKEF.js → 4GNE5NUG.js} +2 -2
- package/dist/cdn/{QWTKPYW7.js → 4UEUAUDI.js} +2 -2
- package/dist/cdn/{JI422GNR.js → 5BRNAKOA.js} +2 -2
- package/dist/cdn/{6CZQZTMF.js → 5EQ47LC5.js} +2 -2
- package/dist/cdn/{EJQAPUJS.js → 62O2SN6X.js} +2 -2
- package/dist/cdn/{T2SRJU3Q.js → 66KMFF5K.js} +2 -2
- package/dist/cdn/{SUSHGSN5.js → 725GI7GH.js} +2 -2
- package/dist/cdn/{4TJFIFRU.js → 75S5WTKO.js} +2 -2
- package/dist/cdn/{BHSILWSL.js → 77VUY2BM.js} +2 -2
- package/dist/cdn/{YKJS4OIT.js → 7E4UUC3A.js} +2 -2
- package/dist/cdn/{7CO7POPG.js → 7HKEWW2S.js} +3 -3
- package/dist/cdn/A52XS6Q3.js +2 -0
- package/dist/cdn/{VFJCPUWU.js → ABKMAWM7.js} +2 -2
- package/dist/cdn/{H4TDHI2Q.js → AFQVHEDP.js} +2 -2
- package/dist/cdn/{WBN7AYGG.js → AWGCDNNG.js} +2 -2
- package/dist/cdn/{J7HO6RTJ.js → BQ2ABCKR.js} +2 -2
- package/dist/cdn/{FM45ZTLA.js → BQZRKAOC.js} +2 -2
- package/dist/cdn/{Y7KC4KFN.js → CANP72B6.js} +2 -2
- package/dist/cdn/{OTJIHBW2.js → CDPLT3P6.js} +2 -2
- package/dist/cdn/{DCWOXZNV.js → CGOWYFRJ.js} +2 -2
- package/dist/cdn/{ZXM7ND6Q.js → CQL63XNG.js} +2 -2
- package/dist/cdn/{IEPJZHSS.js → D45B6SJX.js} +2 -2
- package/dist/cdn/{53BLLGWD.js → DE7DTRJU.js} +2 -2
- package/dist/cdn/{UZD32YRD.js → DEATLTXZ.js} +2 -2
- package/dist/cdn/{7OK7ZF7N.js → DIPC5YOM.js} +2 -2
- package/dist/cdn/{2VEQTRYC.js → DM652BN5.js} +2 -2
- package/dist/cdn/{WF2ENOGH.js → DNGLNDJE.js} +2 -2
- package/dist/cdn/{H6RQVSYM.js → DUIJO5RQ.js} +1 -1
- package/dist/cdn/{QNTJG5AA.js → E2ISDDZI.js} +2 -2
- package/dist/cdn/{XEK22IDA.js → E4NVOXNZ.js} +1 -1
- package/dist/cdn/{PDL4ZTCL.js → EFSTKTYF.js} +2 -2
- package/dist/cdn/{UYCJKS7C.js → ENGKQDUR.js} +2 -2
- package/dist/cdn/{6NHGNIVD.js → ENGVAUVW.js} +2 -2
- package/dist/cdn/{3YUOOZQC.js → ETWIM3JN.js} +2 -2
- package/dist/cdn/{2TM3P5BM.js → FGLIEVP7.js} +2 -2
- package/dist/cdn/{NHREAORV.js → FM67B7TX.js} +2 -2
- package/dist/cdn/{XG3S7JQW.js → FNJBXM4D.js} +2 -2
- package/dist/cdn/{SG2BKJM5.js → FNZPH4EB.js} +2 -2
- package/dist/cdn/{RKHLMCND.js → FRU35NCB.js} +2 -2
- package/dist/cdn/{7Z6G332Z.js → FZNEFP52.js} +1 -1
- package/dist/cdn/{UFF53OEH.js → GBYEDBHX.js} +2 -2
- package/dist/cdn/{QLSHKD7Y.js → GFGWPQAZ.js} +2 -2
- package/dist/cdn/{EU5ETQGL.js → HAWD73AL.js} +2 -2
- package/dist/cdn/{46HXMXDY.js → HP4PQDFV.js} +2 -2
- package/dist/cdn/{7627LBHY.js → HP6QCNY5.js} +2 -2
- package/dist/cdn/{H5EGZU2S.js → HREC4KDD.js} +1 -1
- package/dist/cdn/{YO6TWJFE.js → I46H3BJ3.js} +2 -2
- package/dist/cdn/{OVP6UXO6.js → IIAV7M3T.js} +2 -2
- package/dist/cdn/{WSXKO7QU.js → ILP7TRTY.js} +2 -2
- package/dist/cdn/{DFRZVVZZ.js → IVIOEWS4.js} +2 -2
- package/dist/cdn/{VVY2ZBRC.js → IXY56EA3.js} +2 -2
- package/dist/cdn/{7DK3ZTRU.js → IY4WENNM.js} +2 -2
- package/dist/cdn/{RWKSK7LJ.js → JB2WFUP4.js} +2 -2
- package/dist/cdn/{3IIYWUMQ.js → JE5OL4CR.js} +2 -2
- package/dist/cdn/{XC2AMQB3.js → JFQLJOMX.js} +2 -2
- package/dist/cdn/{3ATJ32U4.js → K2IJOGRA.js} +2 -2
- package/dist/cdn/{CLAJKAD4.js → KCD2HNNA.js} +2 -2
- package/dist/cdn/{QU5CZLK5.js → KY6GW77P.js} +2 -2
- package/dist/cdn/{ZYCEN3JJ.js → KZ6GNR2I.js} +2 -2
- package/dist/cdn/{CEVSS7MF.js → L7BKLGBU.js} +2 -2
- package/dist/cdn/{7BW4HK2A.js → LGXTHIN5.js} +2 -2
- package/dist/cdn/{RABQPAZP.js → LIXWDXFR.js} +2 -2
- package/dist/cdn/{OHFJJGVA.js → LSZP7GSG.js} +2 -2
- package/dist/cdn/{FWLDBXUC.js → M5IITRSK.js} +2 -2
- package/dist/cdn/{Y4MQH574.js → MFBYQCHS.js} +2 -2
- package/dist/cdn/{TUQPDQ74.js → ML6NV6LG.js} +2 -2
- package/dist/cdn/{JIAPMYH4.js → MVJVWVFK.js} +2 -2
- package/dist/cdn/{MXOZNCTB.js → N7RO5U5Z.js} +2 -2
- package/dist/cdn/{CLPF64WZ.js → NCLDVE2T.js} +2 -2
- package/dist/cdn/{DSQ2DQQL.js → NE365JK4.js} +2 -2
- package/dist/cdn/{DOGQU7EL.js → NIGQKZIF.js} +2 -2
- package/dist/cdn/NMJ7T7FN.js +2 -0
- package/dist/cdn/{DAVBQKOS.js → NRXVZLS2.js} +2 -2
- package/dist/cdn/{E557OH6C.js → NYYE7KLB.js} +2 -2
- package/dist/cdn/{O3NHJWA2.js → O7ZGR2OB.js} +2 -2
- package/dist/cdn/{5HKDO4SX.js → OCP4ARTL.js} +1 -1
- package/dist/cdn/{KXTNFBJX.js → OJMQQYME.js} +2 -2
- package/dist/cdn/{6W4UAJL7.js → P4YHKVWH.js} +2 -2
- package/dist/cdn/{HZI3CRZA.js → P5HU7ICX.js} +2 -2
- package/dist/cdn/{3QA7M6CT.js → PAKESORJ.js} +2 -2
- package/dist/cdn/{2SCD7KX4.js → PDXSTE5T.js} +2 -2
- package/dist/cdn/{GKYUW47U.js → PQE425PV.js} +2 -2
- package/dist/cdn/{JKD3QPJA.js → Q2YI4ERF.js} +2 -2
- package/dist/cdn/{5BDVHLU3.js → QG4I7JWY.js} +2 -2
- package/dist/cdn/{2PRBQXD6.js → QVQ2F4FZ.js} +2 -2
- package/dist/cdn/{3UMM4HXE.js → RDYUIP6P.js} +2 -2
- package/dist/cdn/{J4I4EROF.js → RQHNMC7T.js} +1 -1
- package/dist/cdn/{U2T7AGOO.js → RSPHBMSI.js} +2 -2
- package/dist/cdn/{FPYDAXFV.js → S7CSURUU.js} +2 -2
- package/dist/cdn/{US4PNDUP.js → SAUJPNYU.js} +2 -2
- package/dist/cdn/{CPU5A7GB.js → SCA6T4TV.js} +2 -2
- package/dist/cdn/{C7FU7YNV.js → SO2TOJKE.js} +2 -2
- package/dist/cdn/{TV6OFPQZ.js → SYPFKXIW.js} +2 -2
- package/dist/cdn/{FSNJ6CYL.js → TCTFWJLH.js} +1 -1
- package/dist/cdn/{ADOCXALG.js → TEKFIWYR.js} +2 -2
- package/dist/cdn/{4VR6NKWG.js → TMDKU727.js} +2 -2
- package/dist/cdn/{XZXSPFYV.js → TPJHGX2T.js} +2 -2
- package/dist/cdn/{LEFE3FVL.js → U3D2E7KO.js} +1 -1
- package/dist/cdn/{2ZNNQF33.js → UFXE4IZN.js} +2 -2
- package/dist/cdn/{2WB7S5TQ.js → UG7MOB3R.js} +1 -1
- package/dist/cdn/{6JE7UXRZ.js → UGBUL6DG.js} +2 -2
- package/dist/cdn/{KM6YSFH6.js → UJVMH76M.js} +2 -2
- package/dist/cdn/{HNPCFI2T.js → UT4ZW2KH.js} +2 -2
- package/dist/cdn/{DDDIP43Y.js → VFM5ICS4.js} +2 -2
- package/dist/cdn/{NE7AQ3M2.js → VFWMGYZC.js} +2 -2
- package/dist/cdn/{CSJQLSJC.js → VNVJ2BIK.js} +2 -2
- package/dist/cdn/{EPZJ7KZC.js → VWWU4OF5.js} +2 -2
- package/dist/cdn/{VWAHKT2W.js → W2GZ6TKY.js} +2 -2
- package/dist/cdn/{RSXNN7RZ.js → W4MLCR2O.js} +2 -2
- package/dist/cdn/{YMZOK6SL.js → W6TU7B2X.js} +2 -2
- package/dist/cdn/{6NKJB46V.js → WAXOC3S3.js} +2 -2
- package/dist/cdn/{SA3CPVD5.js → WD5XAJT4.js} +2 -2
- package/dist/cdn/WJUWXPOD.js +2 -0
- package/dist/cdn/{WLWSPMNE.js → WLHRNSKP.js} +2 -2
- package/dist/cdn/{JMC6K5HI.js → X2TKI5ZL.js} +2 -2
- package/dist/cdn/{43C5J4GE.js → X4E3DMKU.js} +2 -2
- package/dist/cdn/X6ZVSZ5Q.js +2 -0
- package/dist/cdn/{BFPEJYVB.js → XHS2XIEP.js} +1 -1
- package/dist/cdn/{CNEKU4E5.js → XJ3QBO7H.js} +2 -2
- package/dist/cdn/{32JFHGOY.js → XK5WF47X.js} +2 -2
- package/dist/cdn/{NKXS3GN7.js → XRZNOWZH.js} +2 -2
- package/dist/cdn/{PU5GFLJW.js → XW5A7HTW.js} +2 -2
- package/dist/cdn/{WYJEPX44.js → YA5TTPKE.js} +2 -2
- package/dist/cdn/{CMRUQ3BN.js → YD6KUKDR.js} +3 -3
- package/dist/cdn/{FT5ERUIM.js → YFZ6IT57.js} +2 -2
- package/dist/cdn/{UOUMWCH7.js → YH2P46T6.js} +2 -2
- package/dist/cdn/{Z6466HTT.js → YHSEYWV5.js} +2 -2
- package/dist/cdn/{MZMKV7FA.js → YIJ2W5SY.js} +1 -1
- package/dist/cdn/{3HICEKL5.js → YNL5IR5N.js} +2 -2
- package/dist/cdn/{MKNN7Z33.js → YYCILDRG.js} +2 -2
- package/dist/cdn/Z2AWGG54.js +2 -0
- package/dist/cdn/{LSWMYSG5.js → Z2MOMLO4.js} +2 -2
- package/dist/cdn/{BXWGMUCF.js → ZG7GR73C.js} +2 -2
- package/dist/cdn/{KLBYHXFF.js → ZZQOEEAM.js} +2 -2
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/ArcadeDebuggerPreviewTabsState.js +1 -1
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +1 -1
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/bigquery.js +1 -1
- package/dist/chunks/colorize.js +1 -1
- package/dist/chunks/debugger-value-components.js +1 -1
- package/dist/chunks/debugger-value-styles.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/functional.js +1 -1
- package/dist/chunks/language-defaults-base.js +1 -1
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/monaco-theme.js +1 -1
- package/dist/chunks/oracle.js +1 -1
- package/dist/chunks/postgres.js +1 -1
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/setup-monaco-theme.js +1 -1
- package/dist/chunks/sql-expr-defaults.js +1 -1
- package/dist/chunks/sql-expr-mode.js +1 -1
- package/dist/chunks/sql-expr-service-accessors.js +1 -1
- package/dist/chunks/sql-layer-defaults.js +1 -1
- package/dist/chunks/sql-layer-mode.js +1 -1
- package/dist/chunks/sqlServer.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utilities.js +1 -1
- package/dist/chunks/utils.js +1 -1
- package/dist/chunks/utils2.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +1 -1
- package/dist/components/arcgis-arcade-debugger-console/customElement.js +1 -1
- package/dist/components/arcgis-arcade-debugger-output/customElement.js +1 -1
- package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
- package/dist/components/arcgis-arcade-results/customElement.js +1 -1
- package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
- package/dist/components/arcgis-code-editor/customElement.js +1 -1
- package/dist/components/arcgis-code-editor-shell/customElement.js +1 -1
- package/dist/components/arcgis-code-viewer/customElement.js +1 -1
- package/dist/components/arcgis-editor-variables/customElement.js +1 -1
- package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
- package/dist/components/arcgis-sql-layer-editor/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +6 -6
- package/dist/cdn/2D4U4CLP.js +0 -2
- package/dist/cdn/P4HNDIFA.js +0 -2
- package/dist/cdn/QAMR6MWW.js +0 -2
- package/dist/cdn/SGH4ISZJ.js +0 -2
- package/dist/cdn/WYJB4DB6.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{$ as Pe,$a as vt,$b as JD,$c as at,$d as sc,$e as z0,$f as oR,$g as ER,$h as XR,$i as It,$j as Hk,$k as h1,A as Cs,Aa as jb,Ab as jD,Ac as Mi,Ad as Y,Ae as lg,Af as fg,Ag as uC,Ah as SC,Ai as Wg,Aj as Cc,Ak as Yk,B as uD,Ba as Kb,Bb as fi,Bc as U,Bd as R,Be as Pi,Bf as sn,Bg as gC,Bh as wC,Bi as Bg,Bj as qg,Bk as tm,C as ql,Ca as Ao,Cb as KD,Cc as Ht,Cd as ic,Ce as Ds,Cf as lc,Cg as mc,Ch as FR,Ci as ak,Cj as Hs,Ck as AC,D as gD,Da as Yl,Db as Jl,Dc as Le,Dd as S0,De as ii,Df as lC,Dg as wg,Dh as HR,Di as dk,Dj as Lk,Dk as FC,E as mD,Ea as xD,Eb as _e,Ec as H,Ed as Z,Ee as M0,Ef as Ci,Eg as CR,Eh as _c,Ei as ct,Ej as Ek,Ek as HC,F as Qo,Fa as ID,Fb as qD,Fc as pt,Fd as S,Fe as N0,Ff as Ts,Fg as SR,Fh as Er,Fi as kr,Fj as Dk,Fk as Xk,G as pD,Ga as LD,Gb as et,Gc as ft,Gd as X,Ge as cg,Gf as X0,Gg as mC,Gh as Qe,Gi as Os,Gj as Mt,Gk as Qk,H as Ye,Ha as Gu,Hb as GD,Hc as on,Hd as Ka,He as Fo,Hf as cC,Hg as wR,Hh as cn,Hi as Vg,Hj as mn,Hk as Jk,I as ju,Ia as ED,Ib as wo,Ic as Vn,Id as w0,Ie as ac,If as Q0,Ig as yR,Ih as WR,Ii as lk,Ij as Gg,Ik as im,J as Gl,Ja as $u,Jb as $D,Jc as Ua,Jd as y0,Je as Ho,Jf as _g,Jg as yg,Jh as BR,Ji as ck,Jj as $g,Jk as fn,K as Pa,Ka as qb,Kb as Qb,Kc as a0,Kd as zn,Ke as Xa,Kf as Ce,Kg as ad,Kh as ld,Ki as hk,Kj as Io,Kk as e1,L as Ku,La as Zu,Lb as ZD,Lc as B,Ld as x0,Le as P0,Lf as K,Lg as xg,Lh as ce,Li as Fi,Lj as Rk,Lk as WC,M as bo,Ma as Ss,Mb as Jb,Mc as se,Md as ig,Me as O0,Mf as an,Mg as pC,Mh as yC,Mi as As,Mj as go,Mk as t1,N as Oa,Na as Yu,Nb as _i,Nc as Ae,Nd as og,Ne as hg,Nf as lt,Ng as fC,Nh as Dr,Ni as uk,Nj as kk,Nk as i1,O as ut,Oa as ue,Ob as za,Oc as ve,Od as ng,Oe as Rs,Of as vg,Og as Ig,Oh as VR,Oi as vc,Oj as Si,Ok as om,P as Bb,Pa as gt,Pb as _t,Pc as M,Pd as Ls,Pe as A0,Pf as Ct,Pg as xR,Ph as zR,Pi as fd,Pj as Tk,Pk as o1,Q as pe,Qa as DD,Qb as qt,Qc as d0,Qd as xr,Qe as dc,Qf as cc,Qg as Lg,Qh as ho,Qi as bc,Qj as Mk,Qk as n1,R as T,Ra as RD,Rb as ne,Rc as ee,Rd as qa,Re as ug,Rf as J0,Rg as IR,Rh as UR,Ri as $i,Rj as Lo,Rk as r1,S as E,Sa as Wa,Sb as ki,Sc as Q,Sd as oc,Se as rC,Sf as Gi,Sh as jR,Si as gk,Sj as kC,Sk as s1,T as Re,Ta as Xu,Tb as YD,Tc as si,Td as I0,Te as Qa,Tf as dn,Tg as Eg,Th as cd,Ti as mk,Tj as Nk,Tk as a1,U as fD,Ua as Kt,Ub as Ju,Uc as $t,Ud as L0,Ue as F0,Uf as eR,Ug as jn,Uh as KR,Ui as qe,Uj as Pk,Uk as nm,V as qu,Va as Xl,Vb as XD,Vc as l0,Vd as Ga,Ve as sC,Vf as od,Vg as Dg,Vh as qR,Vi as zg,Vj as TC,Vk as wc,W as xt,Wa as kD,Wb as eg,Wc as q,Wd as Ni,We as H0,Wf as Ms,Wg as Rg,Wh as GR,Wi as pk,Wj as Ok,Wk as d1,X as xe,Xa as TD,Xb as eC,Xc as Ki,Xd as nc,Xe as gg,Xf as nd,Xg as Kn,Xh as $R,Xi as Fs,Xj as Ak,Xk as bd,Y as z,Ya as Gb,Yb as QD,Yc as ai,Yd as rn,Ye as W0,Yf as bg,Yg as _C,Yi as Tr,Yj as Fk,Yk as l1,Z as Vb,Za as pi,Zb as tn,Zc as c0,Zd as E0,Ze as B0,Zf as tR,Zg as LR,Zh as ZR,Zi as Mr,Zj as Zg,Zk as c1,_ as oe,_a as MD,_b as Te,_c as yo,_d as rc,_e as V0,_f as iR,_h as YR,_i as Nr,_j as pn,_k as yc,a as p,aa as zb,ab as ND,ac as e0,ad as ge,ae as iC,af as Xe,ag as nR,ah as kg,ai as QR,aj as Pr,ak as Yg,al as BC,b as x,ba as je,bb as PD,bc as tt,bd as vi,be as rg,bf as Oi,bg as hc,bh as qn,bi as JR,bj as gn,bk as wt,bl as rm,c as Ra,ca as Oo,cb as Qu,cc as Ti,cd as lo,ce as ae,cf as U0,cg as rR,ch as DR,ci as hd,cj as LC,ck as MC,cl as u1,d as Hb,da as _D,db as Co,dc as Sr,dd as nn,de as ei,df as j0,dg as sR,dh as Tg,di as xC,dj as oi,dk as Ws,dl as sm,e as de,ea as vD,eb as So,ec as t0,ed as h0,ee as ti,ef as Ja,eg as hC,eh as Mg,ei as ud,ej as Ie,ek as Wk,el as Bo,f as De,fa as Ei,fb as OD,fc as i0,fd as u0,fe as Zt,ff as Ai,fg as aR,fh as dd,fi as J,fj as EC,fk as Et,fl as g1,g as Xt,ga as br,gb as $b,gc as wr,gd as tC,ge as D0,gf as Ve,gg as dR,gh as RR,gi as Fg,gj as $n,gk as Eo,gl as m1,h as ka,ha as Di,hb as AD,hc as ys,hd as qi,he as $a,hf as mg,hg as lR,hh as vC,hi as gd,hj as fk,hk as Xg,hl as p1,i as zi,ia as $l,ib as FD,ic as o0,id as g0,ie as sg,if as aC,ig as cR,ih as kR,ii as he,ij as Lt,ik as Bk,il as f1,j as Ze,ja as Jo,jb as Ba,jc as xs,jd as Qt,je as Be,jf as co,jg as Cg,jh as Ng,ji as md,jj as _d,jk as Vk,k as Ta,ka as Oe,kb as HD,kc as so,kd as m0,ke as Za,kf as Yt,kg as hR,kh as bC,ki as pd,kj as Ug,kk as zk,l as aD,la as Aa,lb as Zb,lc as n0,ld as ja,le as Me,lf as dC,lg as uc,lh as Pg,li as Rr,lj as DC,lk as Uk,m as dD,ma as bD,mb as WD,mc as ke,md as p0,me as xo,mf as K0,mg as rd,mh as TR,mi as IC,mj as RC,mk as Qg,n as zu,na as gi,nb as Ql,nc as ao,nd as f0,ne as R0,nf as Wo,ng as sd,nh as MR,ni as ek,nj as _k,nk as jk,o as Uu,oa as CD,ob as BD,oc as ji,od as ec,oe as Ir,of as ed,og as uR,oh as NR,oi as tk,oj as vk,ok as Kk,p as lD,pa as Fa,pb as VD,pc as j,pd as dt,pe as k0,pf as me,pg as gR,ph as PR,pi as uo,pj as jg,pk as qk,q as Ma,qa as SD,qb as Yb,qc as Is,qd as _0,qe as ag,qf as q0,qg as mR,qh as pc,qi as hn,qj as Kg,qk as Gk,r as Wb,ra as Ha,rb as ws,rc as W,rd as v0,re as Un,rf as V,rg as pR,rh as Og,ri as un,rj as bk,rk as $k,s as bs,sa as Bn,sb as zD,sc as r0,sd as b0,se as Es,sf as G0,sg as fR,sh as Ke,si as Hg,sj as vd,sk as Ge,t as ro,ta as wD,tb as UD,tc as ri,td as C0,te as dg,tf as $0,tg as _R,th as it,ti as ik,tj as Ck,tk as NC,u as fe,ua as mi,ub as D,uc as Gt,ud as tg,ue as oC,uf as pg,ug as Ns,uh as ln,ui as ok,uj as Sk,uk as Jg,v as vr,va as Zl,vb as Ri,vc as s0,vd as nt,ve as T0,vf as Z0,vg as Lr,vh as OR,vi as nk,vj as wk,vk as em,w as cD,wa as mt,wb as Xb,wc as yr,wd as O,we as w,wf as td,wg as gc,wh as AR,wi as rk,wj as yk,wk as PC,x as Na,xa as Cr,xb as Va,xc as $,xd as tc,xe as Ya,xf as id,xg as vR,xh as Ag,xi as sk,xj as St,xk as Zk,y as Ui,ya as Ub,yb as re,yd as Jt,ye as bi,yf as Y0,yg as bR,yh as fc,yi as Ps,yj as xk,yk as Sc,z as hD,za as yD,zb as en,zc as bt,zd as At,ze as nC,zf as ks,zg as Sg,zh as CC,zi as Gn,zj as Ik,zk as OC}from"./DSQ2DQQL.js";var am=class extends at{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:x(101,"Toggle Collapse Unchanged Regions"),icon:B.map,toggled:M.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:M.has("isInDiffEditor"),menu:{when:M.has("isInDiffEditor"),id:q.EditorTitle,order:22,group:"navigation"}})}run(e,...t){let i=e.get(ae),o=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}},xc=class extends at{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:x(102,"Toggle Show Moved Code Blocks"),precondition:M.has("isInDiffEditor")})}run(e,...t){let i=e.get(ae),o=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",o)}},Ic=class extends at{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:x(103,"Toggle Use Inline View When Space Is Limited"),precondition:M.has("isInDiffEditor")})}run(e,...t){let i=e.get(ae),o=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}},Ec=x(104,"Diff Editor"),dm=class extends Jt{constructor(){super({id:"diffEditor.switchSide",title:x(105,"Switch Side"),icon:B.arrowSwap,precondition:M.has("isInDiffEditor"),f1:!0,category:Ec})}runEditorCommand(e,t,i){let o=Bs(e);if(o instanceof Hs){if(i&&i.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}},lm=class extends Jt{constructor(){super({id:"diffEditor.exitCompareMove",title:x(106,"Exit Compare Move"),icon:B.close,precondition:w.comparingMovedCode,f1:!1,category:Ec,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){let o=Bs(e);o instanceof Hs&&o.exitCompareMove()}},cm=class extends Jt{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:x(107,"Collapse All Unchanged Regions"),icon:B.fold,precondition:M.has("isInDiffEditor"),f1:!0,category:Ec})}runEditorCommand(e,t,...i){let o=Bs(e);o instanceof Hs&&o.collapseAllUnchangedRegions()}},hm=class extends Jt{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:x(108,"Show All Unchanged Regions"),icon:B.unfold,precondition:M.has("isInDiffEditor"),f1:!0,category:Ec})}runEditorCommand(e,t,...i){let o=Bs(e);o instanceof Hs&&o.showAllUnchangedRegions()}},Cd=class extends at{constructor(){super({id:"diffEditor.revert",title:x(109,"Revert"),f1:!0,category:Ec,precondition:M.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){let t=Bs(e);t instanceof Hs&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){let i=wP(e,t.originalUri,t.modifiedUri);i instanceof Hs&&i.revertRangeMappings(t.mapping.innerChanges??[])}},_1=x(110,"Accessible Diff Viewer"),Sd=class r extends at{static{this.id="editor.action.accessibleDiffViewer.next"}constructor(){super({id:r.id,title:x(111,"Go to Next Difference"),category:_1,precondition:M.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){Bs(e)?.accessibleDiffViewerNext()}},Lc=class r extends at{static{this.id="editor.action.accessibleDiffViewer.prev"}constructor(){super({id:r.id,title:x(112,"Go to Previous Difference"),category:_1,precondition:M.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){Bs(e)?.accessibleDiffViewerPrev()}};function wP(r,e,t){return r.get(Le).listDiffEditors().find(n=>{let s=n.getModifiedEditor(),a=n.getOriginalEditor();return s&&s.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function Bs(r){let t=r.get(Le).listDiffEditors(),i=wr();if(i){for(let o of t)if(o.getContainerDomNode().contains(i))return o}return null}ge(am);ge(xc);ge(Ic);ai.appendMenuItem(q.EditorTitle,{command:{id:new Ic().desc.id,title:p(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(w.diffEditorRenderSideBySideInlineBreakpointReached,M.has("isInDiffEditor"))});ai.appendMenuItem(q.EditorTitle,{command:{id:new xc().desc.id,title:p(136,"Show Moved Code Blocks"),icon:B.move,toggled:d0.create("config.diffEditor.experimental.showMoves",!0),precondition:M.has("isInDiffEditor")},order:10,group:"1_diff",when:M.has("isInDiffEditor")});ge(Cd);for(let r of[{icon:B.arrowRight,key:w.diffEditorInlineMode.toNegated()},{icon:B.discard,key:w.diffEditorInlineMode}])ai.appendMenuItem(q.DiffEditorHunkToolbar,{command:{id:new Cd().desc.id,title:p(137,"Revert Block"),icon:r.icon},when:M.and(w.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),ai.appendMenuItem(q.DiffEditorSelectionToolbar,{command:{id:new Cd().desc.id,title:p(138,"Revert Selection"),icon:r.icon},when:M.and(w.diffEditorModifiedWritable,r.key),order:5,group:"primary"});ge(dm);ge(lm);ge(cm);ge(hm);ai.appendMenuItem(q.EditorTitle,{command:{id:Sd.id,title:p(139,"Open Accessible Diff Viewer"),precondition:M.has("isInDiffEditor")},order:10,group:"2_diff",when:M.and(w.accessibleDiffViewerVisible.negate(),M.has("isInDiffEditor"))});ve.registerCommandAlias("editor.action.diffReview.next",Sd.id);ge(Sd);ve.registerCommandAlias("editor.action.diffReview.prev",Lc.id);ge(Lc);var yP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},xP=function(r,e){return function(t,i){e(t,i,r)}},VC,um=new ee("selectionAnchorSet",!1),Or=class{static{VC=this}static{this.ID="editor.contrib.selectionAnchorController"}static get(e){return e.getContribution(VC.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=um.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(X.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new ct().appendText(p(834,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),bt(p(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(X.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()}};Or=VC=yP([xP(1,Q)],Or);var zC=class extends O{constructor(){super({id:"editor.action.setSelectionAnchor",label:x(836,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:w.editorTextFocus,primary:Ye(2089,2080),weight:100}})}async run(e,t){Or.get(t)?.setSelectionAnchor()}},UC=class extends O{constructor(){super({id:"editor.action.goToSelectionAnchor",label:x(837,"Go to Selection Anchor"),precondition:um})}async run(e,t){Or.get(t)?.goToSelectionAnchor()}},jC=class extends O{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:x(838,"Select from Anchor to Cursor"),precondition:um,kbOpts:{kbExpr:w.editorTextFocus,primary:Ye(2089,2089),weight:100}})}async run(e,t){Or.get(t)?.selectFromAnchorToCursor()}},KC=class extends O{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:x(839,"Cancel Selection Anchor"),precondition:um,kbOpts:{kbExpr:w.editorTextFocus,primary:9,weight:100}})}async run(e,t){Or.get(t)?.cancelSelectionAnchor()}};Z(Or.ID,Or,4);R(zC);R(UC);R(jC);R(KC);var IP=K("editorOverviewRuler.bracketMatchForeground","#A0A0A0",p(840,"Overview ruler marker color for matching brackets.")),qC=class extends O{constructor(){super({id:"editor.action.jumpToBracket",label:x(842,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:w.editorTextFocus,primary:3165,weight:100}})}run(e,t){Vs.get(t)?.jumpToBracket()}},GC=class extends O{constructor(){super({id:"editor.action.selectToBracket",label:x(843,"Select to Bracket"),precondition:void 0,metadata:{description:x(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,i){let o=!0;i&&i.selectBrackets===!1&&(o=!1),Vs.get(t)?.selectToBracket(o)}},$C=class extends O{constructor(){super({id:"editor.action.removeBrackets",label:x(845,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:w.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Vs.get(t)?.removeBrackets(this.id)}},ZC=class{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}},Vs=class r extends E{static{this.ID="editor.contrib.bracketMatchingController"}static get(e){return e.getContribution(r.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Oe(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.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(i=>{let o=i.getStartPosition(),n=e.bracketPairs.matchBracket(o),s=null;if(n)n[0].containsPosition(o)&&!n[1].containsPosition(o)?s=n[1].getStartPosition():n[1].containsPosition(o)&&(s=n[0].getStartPosition());else{let a=e.bracketPairs.findEnclosingBrackets(o);if(a)s=a[1].getStartPosition();else{let d=e.bracketPairs.findNextBracket(o);d&&d.range&&(s=d.range.getStartPosition())}}return s?new X(s.lineNumber,s.column,s.lineNumber,s.column):new X(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(o=>{let n=o.getStartPosition(),s=t.bracketPairs.matchBracket(n);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(n),!s)){let l=t.bracketPairs.findNextBracket(n);l&&l.range&&(s=t.bracketPairs.matchBracket(l.range.getStartPosition()))}let a=null,d=null;if(s){s.sort(S.compareRangesUsingStarts);let[l,c]=s;if(a=e?l.getStartPosition():l.getEndPosition(),d=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(n)){let h=a;a=d,d=h}}a&&d&&i.push(new X(a.lineNumber,a.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(i=>{let o=i.getPosition(),n=t.bracketPairs.matchBracket(o);n||(n=t.bracketPairs.findEnclosingBrackets(o)),n&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:n[0],text:""},{range:n[1],text:""}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=J.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",inlineClassName:"bracket-match-inline",overviewRuler:{color:it(IP),position:Ni.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=J.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 i of this._lastBracketsData){let o=i.brackets;o&&(e[t++]={range:o[0],options:i.options},e[t++]={range:o[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getModel(),i=t.getVersionId(),o=[];this._lastVersionId===i&&(o=this._lastBracketsData);let n=[],s=0;for(let h=0,u=e.length;h<u;h++){let g=e[h];g.isEmpty()&&(n[s++]=g.getStartPosition())}n.length>1&&n.sort(H.compare);let a=[],d=0,l=0,c=o.length;for(let h=0,u=n.length;h<u;h++){let g=n[h];for(;l<c&&o[l].position.isBefore(g);)l++;if(l<c&&o[l].position.equals(g))a[d++]=o[l];else{let m=t.bracketPairs.matchBracket(g,20),f=r._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(g,20),f=r._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[d++]=new ZC(g,m,f)}}this._lastBracketsData=a,this._lastVersionId=i}};Z(Vs.ID,Vs,1);R(GC);R(qC);R($C);ai.appendMenuItem(q.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:p(841,"Go to &&Bracket")},order:2});ln((r,e)=>{let t=r.getColor(OR);t&&e.addRule(`.monaco-editor .bracket-match-inline { color: ${t} !important; }`)});var gm=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 i=this._selection.startLineNumber,o=this._selection.startColumn,n=this._selection.endColumn;if(!(this._isMovingLeft&&o===1)&&!(!this._isMovingLeft&&n===e.getLineMaxColumn(i)))if(this._isMovingLeft){let s=new S(i,o-1,i,o),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new S(i,n,i,n),a)}else{let s=new S(i,n,i,n+1),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new S(i,o,i,o),a)}}computeCursorState(e,t){return this._isMovingLeft?new X(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new X(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}};var mm=class extends O{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let i=[],o=t.getSelections();for(let n of o)i.push(new gm(n,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}},YC=class extends mm{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:x(846,"Move Selected Text Left"),precondition:w.writable})}},XC=class extends mm{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:x(847,"Move Selected Text Right"),precondition:w.writable})}};R(YC);R(XC);var QC=class extends O{constructor(){super({id:"editor.action.transposeLetters",label:x(848,"Transpose Letters"),precondition:w.writable,kbOpts:{kbExpr:w.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let i=t.getModel(),o=[],n=t.getSelections();for(let s of n){if(!s.isEmpty())continue;let a=s.startLineNumber,d=s.startColumn,l=i.getLineMaxColumn(a);if(a===1&&(d===1||d===2&&l===2))continue;let c=d===l?s.getPosition():og.rightPosition(i,s.getPosition().lineNumber,s.getPosition().column),h=og.leftPosition(i,c),u=og.leftPosition(i,h),g=i.getValueInRange(S.fromPositions(u,h)),m=i.getValueInRange(S.fromPositions(h,c)),f=S.fromPositions(u,c);o.push(new zn(f,m+g))}o.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}};R(QC);var LP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},EP=function(r,e){return function(t,i){e(t,i,r)}},DP=J.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:$u,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),JC=class r extends E{static{this.baseId="editor.widget.inlineProgressWidget"}constructor(e,t,i,o,n){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=n,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(o),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=W(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;let t=W("span.icon");this.domNode.append(t),t.classList.add(...se.asClassNameArray(B.loading),"codicon-modifier-spin");let i=()=>{let o=this.editor.getOption(75);this.domNode.style.height=`${o}px`,this.domNode.style.width=`${Math.ceil(.8*o)}px`};i(),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(61)||o.hasChanged(75))&&i()})),this._register(ne(this.domNode,ke.CLICK,o=>{this.delegate.cancel()}))}getId(){return r.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 E{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Re),this._currentWidget=this._register(new Re),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,o,n){let s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=Di(()=>{let a=S.fromPositions(e);this._currentDecorations.set([{range:a,options:DP}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(JC,this.id,this._editor,a,t,o))},n??this._showDelay);try{return await i}finally{this._currentOperation===s&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};wd=LP([EP(2,U)],wd);var We=class r{static{this.sep="."}static{this.None=new r("@@none@@")}static{this.Empty=new r("")}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+r.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new r((this.value?[this.value,...e]:e).join(r.sep))}};var RP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},v1=function(r,e){return function(t,i){e(t,i,r)}},pm,Wt=class{static{pm=this}static{this.ID="editor.contrib.messageController"}static{this.MESSAGE_VISIBLE=new ee("messageVisible",!1,p(1333,"Whether the editor is currently showing an inline message"))}static get(e){return e.getContribution(pm.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Re,this._messageListeners=new T,this._mouseOverMessage=!1,this._editor=e,this._visible=pm.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(bt(Os(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Os(e)){let o=this._messageListeners.add(As(e,{actionHandler:(n,s)=>{this.closeMessage(),Tk(this._openerService,n,s.isTrusted)}}));this._messageWidget.value=new Dc(this._editor,t,o.element)}else this._messageWidget.value=new Dc(this._editor,t,e);this._messageListeners.add(xe.debounce(this._editor.onDidBlurEditorText,(o,n)=>n,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&t0(wr(),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(ne(this._messageWidget.value.getDomNode(),ke.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ne(this._messageWidget.value.getDomNode(),ke.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(o=>{o.target.position&&(i?i.containsPosition(o.target.position)||this.closeMessage():i=new S(t.lineNumber-3,1,o.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Dc.fadeOut(this._messageWidget.value))}};Wt=pm=RP([v1(1,Q),v1(2,go)],Wt);var kP=nt.bindToContribution(Wt.get);Y(new kP({id:"leaveEditorMessage",precondition:Wt.MESSAGE_VISIBLE,handler:r=>r.closeMessage(),kbOpts:{weight:130,primary:9}}));var Dc=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},o){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";let n=document.createElement("div");n.classList.add("anchor","top"),this._domNode.appendChild(n);let s=document.createElement("div");typeof o=="string"?(s.classList.add("message"),s.textContent=o):(o.classList.add("message"),s.appendChild(o)),this._domNode.appendChild(s);let a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),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)}};Z(Wt.ID,Wt,4);var tS=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Rc=function(r,e){return function(t,i){e(t,i,r)}},kc=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,o,n){let s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,o){let n=await this.getEdit(i,o);if(n)return{edits:[{insertText:n.insertText,title:n.title,kind:n.kind,handledMimeType:n.handledMimeType,yieldTo:n.yieldTo}],dispose(){}}}},Zn=class r extends kc{static{this.id="text"}constructor(){super(We.Empty.append("text","plain")),this.id=r.id,this.dropMimeTypes=[Zt.text],this.pasteMimeTypes=[Zt.text]}async getEdit(e,t){let i=e.get(Zt.text);if(!i||e.has(Zt.uriList))return;let o=await i.asString();return{handledMimeType:Zt.text,title:p(965,"Insert Plain Text"),insertText:o,kind:this.kind}}},fm=class extends kc{constructor(){super(We.Empty.append("uri","path","absolute")),this.dropMimeTypes=[Zt.uriList],this.pasteMimeTypes=[Zt.uriList]}async getEdit(e,t){let i=await b1(e);if(!i.length||t.isCancellationRequested)return;let o=0,n=i.map(({uri:a,originalText:d})=>a.scheme===gt.file?a.fsPath:(o++,d)).join(" "),s;return o>0?s=i.length>1?p(966,"Insert Uris"):p(967,"Insert Uri"):s=i.length>1?p(968,"Insert Paths"):p(969,"Insert Path"),{handledMimeType:Zt.uriList,insertText:n,title:s,kind:this.kind}}},_m=class extends kc{constructor(e){super(We.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[Zt.uriList],this.pasteMimeTypes=[Zt.uriList]}async getEdit(e,t){let i=await b1(e);if(!i.length||t.isCancellationRequested)return;let o=pi(i.map(({uri:n})=>{let s=this._workspaceContextService.getWorkspaceFolder(n);return s?f0(s.uri,n):void 0}));if(o.length)return{handledMimeType:Zt.uriList,insertText:o.join(" "),title:i.length>1?p(970,"Insert Relative Paths"):p(971,"Insert Relative Path"),kind:this.kind}}};_m=tS([Rc(0,Lo)],_m);var eS=class{constructor(){this.kind=new We("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Zt.text}]}async provideDocumentPasteEdits(e,t,i,o,n){if(o.triggerKind!==ac.PasteAs&&!o.only?.contains(this.kind))return;let a=await i.get("text/html")?.asString();if(!(!a||n.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:p(972,"Insert HTML"),kind:this.kind}]}}};async function b1(r){let e=r.get(Zt.uriList);if(!e)return[];let t=await e.asString(),i=[];for(let o of Pg.parse(t))try{i.push({uri:ue.parse(o),originalText:o})}catch{}return i}var zs={scheme:"*",hasAccessToAllModels:!0},vm=class extends E{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(zs,new Zn)),this._register(e.documentDropEditProvider.register(zs,new fm)),this._register(e.documentDropEditProvider.register(zs,new _m(t)))}};vm=tS([Rc(0,V),Rc(1,Lo)],vm);var bm=class extends E{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(zs,new Zn)),this._register(e.documentPasteEditProvider.register(zs,new fm)),this._register(e.documentPasteEditProvider.register(zs,new _m(t))),this._register(e.documentPasteEditProvider.register(zs,new eS))}};bm=tS([Rc(0,V),Rc(1,Lo)],bm);var iS=class r{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 e=this.pos,t=0,i=this.value.charCodeAt(e),o;if(o=r._table[i],typeof o=="number")return this.pos+=1,{type:o,pos:e,len:1};if(r.isDigitCharacter(i)){o=8;do t+=1,i=this.value.charCodeAt(e+t);while(r.isDigitCharacter(i));return this.pos+=t,{type:o,pos:e,len:t}}if(r.isVariableCharacter(i)){o=9;do i=this.value.charCodeAt(e+ ++t);while(r.isVariableCharacter(i)||r.isDigitCharacter(i));return this.pos+=t,{type:o,pos:e,len:t}}o=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof r._table[i]>"u"&&!r.isDigitCharacter(i)&&!r.isVariableCharacter(i));return this.pos+=t,{type:o,pos:e,len:t}}},Ar=class{constructor(){this._children=[]}appendChild(e){return e instanceof Bt&&this._children[this._children.length-1]instanceof Bt?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:i}=e,o=i.children.indexOf(e),n=i.children.slice(0);n.splice(o,1,...t),i._children=n,(function s(a,d){for(let l of a)l.parent=d,s(l.children,l)})(t,i)}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 yd)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}},Bt=class r extends Ar{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new r(this.value)}},Cm=class extends Ar{},Zi=class r extends Cm{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Us?this._children[0]:void 0}clone(){let e=new r(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}},Us=class r extends Ar{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Bt&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new r;return this.options.forEach(e.appendChild,e),e}},oS=class r extends Ar{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){let t=this,i=!1,o=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(n=>n instanceof Vo&&!!n.elseValue)&&(o=this._replace([])),o}_replace(e){let t="";for(let i of this._children)if(i instanceof Vo){let o=e[i.index]||"";o=i.resolve(o),t+=o}else t+=i.toString();return t}toString(){return""}clone(){let e=new r;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}},Vo=class r extends Ar{constructor(e,t,i,o){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=o}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 i=e.trim().replace(/^_+|_+$/g,""),o=i.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 o?o.map(n=>n.toLowerCase()).join("-"):i.split(/[\s_-]+/).filter(n=>n.length>0).map(n=>n.toLowerCase()).join("-")}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((i,o)=>o===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,"$1_$2").replace(/[\s\-]+/g,"_").toLowerCase()}clone(){return new r(this.index,this.shorthandName,this.ifValue,this.elseValue)}},Fr=class r extends Cm{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Bt(t)],!0):!1}clone(){let e=new r(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}};function C1(r,e){let t=[...r];for(;t.length>0;){let i=t.shift();if(!e(i))break;t.unshift(...i.children)}}var yd=class r extends Ar{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(i){return i instanceof Zi&&(e.push(i),t=!t||t.index<i.index?i: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,i=!1;return this.walk(o=>o===e?(i=!0,!1):(t+=o.len(),!0)),i?t:-1}fullLen(e){let t=0;return C1([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof Zi&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Fr&&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 e=new r;return e._children=this.children.map(t=>t.clone()),e}walk(e){C1(this.children,e)}},Hi=class{constructor(){this._scanner=new iS,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,i){let o=new yd;return this.parseFragment(e,o),this.ensureFinalTabstop(o,i??!1,t??!1),o}parseFragment(e,t){let i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let o=new Map,n=[];t.walk(d=>(d instanceof Zi&&(d.isFinalTabstop?o.set(0,void 0):!o.has(d.index)&&d.children.length>0?o.set(d.index,d.children):n.push(d)),!0));let s=(d,l)=>{let c=o.get(d.index);if(!c)return;let h=new Zi(d.index);h.transform=d.transform;for(let u of c){let g=u.clone();h.appendChild(g),g instanceof Zi&&o.has(g.index)&&!l.has(g.index)&&(l.add(g.index),s(g,l),l.delete(g.index))}t.replace(d,[h])},a=new Set;for(let d of n)s(d,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(n=>n.index===0)||e.appendChild(new Zi(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}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 o=this._scanner.next();if(o.type!==0&&o.type!==4&&o.type!==5)return!1}this._token=this._scanner.next()}let i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_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 Bt(t)),!0):!1}_parseTabstopOrVariableName(e){let t,i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Zi(Number(t)):new Fr(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t,i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);let n=new Zi(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new Bt("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else if(n.index>0&&this._accept(7)){let s=new Us;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(s),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i)}_parseChoiceElement(e){let t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let o;if((o=this._accept(5,!0))?o=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||o:o=this._accept(void 0,!0),!o)return this._backTo(t),!1;i.push(o)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Bt(i.join(""))),!0)}_parseComplexVariable(e){let t,i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);let n=new Fr(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new Bt("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i)}_parseTransform(e){let t=new oS,i="",o="";for(;!this._accept(6);){let n;if(n=this._accept(5,!0)){n=this._accept(6,!0)||n,i+=n;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let n;if(n=this._accept(5,!0)){n=this._accept(5,!0)||this._accept(6,!0)||n,t.appendChild(new Bt(n));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){o+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,o)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let o=this._accept(8,!0);if(o)if(i){if(this._accept(4))return e.appendChild(new Vo(Number(o))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Vo(Number(o))),!0;else 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 Vo(Number(o),n)),!0)}else if(this._accept(11)){let n=this._until(4);if(n)return e.appendChild(new Vo(Number(o),void 0,n,void 0)),!0}else if(this._accept(12)){let n=this._until(4);if(n)return e.appendChild(new Vo(Number(o),void 0,void 0,n)),!0}else if(this._accept(13)){let n=this._until(1);if(n){let s=this._until(4);if(s)return e.appendChild(new Vo(Number(o),void 0,n,s)),!0}}else{let n=this._until(4);if(n)return e.appendChild(new Vo(Number(o),void 0,void 0,n)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Bt(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}};function Sm(r,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new Gg(r,{range:i,text:typeof t.insertText=="string"?Hi.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function wm(r){function e(s,a){return"mimeType"in s?s.mimeType===a.handledMimeType:!!a.kind&&s.kind.contains(a.kind)}let t=new Map;for(let s of r)for(let a of s.yieldTo??[])for(let d of r)if(d!==s&&e(a,d)){let l=t.get(s);l||(l=[],t.set(s,l)),l.push(d)}if(!t.size)return Array.from(r);let i=new Set,o=[];function n(s){if(!s.length)return[];let a=s[0];if(o.includes(a))return console.warn("Yield to cycle detected",a),s;if(i.has(a))return n(s.slice(1));let d=[],l=t.get(a);return l&&(o.push(a),d=n(l),o.pop()),i.add(a),[...d,a,...n(s.slice(1))]}return n(Array.from(r))}function nS(r,e){return e&&(r.stack||r.stacktrace)?p(33,"{0}: {1}",w1(r),S1(r.stack)||S1(r.stacktrace)):w1(r)}function S1(r){return Array.isArray(r)?r.join(`
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{$ as Pe,$a as vt,$b as JD,$c as at,$d as sc,$e as z0,$f as oR,$g as ER,$h as XR,$i as It,$j as Hk,$k as h1,A as Cs,Aa as jb,Ab as jD,Ac as Mi,Ad as Y,Ae as lg,Af as fg,Ag as uC,Ah as SC,Ai as Wg,Aj as Cc,Ak as Yk,B as uD,Ba as Kb,Bb as fi,Bc as U,Bd as R,Be as Pi,Bf as sn,Bg as gC,Bh as wC,Bi as Bg,Bj as qg,Bk as tm,C as ql,Ca as Ao,Cb as KD,Cc as Ht,Cd as ic,Ce as Ds,Cf as lc,Cg as mc,Ch as FR,Ci as ak,Cj as Hs,Ck as AC,D as gD,Da as Yl,Db as Jl,Dc as Le,Dd as S0,De as ii,Df as lC,Dg as wg,Dh as HR,Di as dk,Dj as Lk,Dk as FC,E as mD,Ea as xD,Eb as _e,Ec as H,Ed as Z,Ee as M0,Ef as Ci,Eg as CR,Eh as _c,Ei as ct,Ej as Ek,Ek as HC,F as Qo,Fa as ID,Fb as qD,Fc as pt,Fd as S,Fe as N0,Ff as Ts,Fg as SR,Fh as Er,Fi as kr,Fj as Dk,Fk as Xk,G as pD,Ga as LD,Gb as et,Gc as ft,Gd as X,Ge as cg,Gf as X0,Gg as mC,Gh as Qe,Gi as Os,Gj as Mt,Gk as Qk,H as Ye,Ha as Gu,Hb as GD,Hc as on,Hd as Ka,He as Fo,Hf as cC,Hg as wR,Hh as cn,Hi as Vg,Hj as mn,Hk as Jk,I as ju,Ia as ED,Ib as wo,Ic as Vn,Id as w0,Ie as ac,If as Q0,Ig as yR,Ih as WR,Ii as lk,Ij as Gg,Ik as im,J as Gl,Ja as $u,Jb as $D,Jc as Ua,Jd as y0,Je as Ho,Jf as _g,Jg as yg,Jh as BR,Ji as ck,Jj as $g,Jk as fn,K as Pa,Ka as qb,Kb as Qb,Kc as a0,Kd as zn,Ke as Xa,Kf as Ce,Kg as ad,Kh as ld,Ki as hk,Kj as Io,Kk as e1,L as Ku,La as Zu,Lb as ZD,Lc as B,Ld as x0,Le as P0,Lf as K,Lg as xg,Lh as ce,Li as Fi,Lj as Rk,Lk as WC,M as bo,Ma as Ss,Mb as Jb,Mc as se,Md as ig,Me as O0,Mf as an,Mg as pC,Mh as yC,Mi as As,Mj as go,Mk as t1,N as Oa,Na as Yu,Nb as _i,Nc as Ae,Nd as og,Ne as hg,Nf as lt,Ng as fC,Nh as Dr,Ni as uk,Nj as kk,Nk as i1,O as ut,Oa as ue,Ob as za,Oc as ve,Od as ng,Oe as Rs,Of as vg,Og as Ig,Oh as VR,Oi as vc,Oj as Si,Ok as om,P as Bb,Pa as gt,Pb as _t,Pc as M,Pd as Ls,Pe as A0,Pf as Ct,Pg as xR,Ph as zR,Pi as fd,Pj as Tk,Pk as o1,Q as pe,Qa as DD,Qb as qt,Qc as d0,Qd as xr,Qe as dc,Qf as cc,Qg as Lg,Qh as ho,Qi as bc,Qj as Mk,Qk as n1,R as T,Ra as RD,Rb as ne,Rc as ee,Rd as qa,Re as ug,Rf as J0,Rg as IR,Rh as UR,Ri as $i,Rj as Lo,Rk as r1,S as E,Sa as Wa,Sb as ki,Sc as Q,Sd as oc,Se as rC,Sf as Gi,Sh as jR,Si as gk,Sj as kC,Sk as s1,T as Re,Ta as Xu,Tb as YD,Tc as si,Td as I0,Te as Qa,Tf as dn,Tg as Eg,Th as cd,Ti as mk,Tj as Nk,Tk as a1,U as fD,Ua as Kt,Ub as Ju,Uc as $t,Ud as L0,Ue as F0,Uf as eR,Ug as jn,Uh as KR,Ui as qe,Uj as Pk,Uk as nm,V as qu,Va as Xl,Vb as XD,Vc as l0,Vd as Ga,Ve as sC,Vf as od,Vg as Dg,Vh as qR,Vi as zg,Vj as TC,Vk as wc,W as xt,Wa as kD,Wb as eg,Wc as q,Wd as Ni,We as H0,Wf as Ms,Wg as Rg,Wh as GR,Wi as pk,Wj as Ok,Wk as d1,X as xe,Xa as TD,Xb as eC,Xc as Ki,Xd as nc,Xe as gg,Xf as nd,Xg as Kn,Xh as $R,Xi as Fs,Xj as Ak,Xk as bd,Y as z,Ya as Gb,Yb as QD,Yc as ai,Yd as rn,Ye as W0,Yf as bg,Yg as _C,Yi as Tr,Yj as Fk,Yk as l1,Z as Vb,Za as pi,Zb as tn,Zc as c0,Zd as E0,Ze as B0,Zf as tR,Zg as LR,Zh as ZR,Zi as Mr,Zj as Zg,Zk as c1,_ as oe,_a as MD,_b as Te,_c as yo,_d as rc,_e as V0,_f as iR,_h as YR,_i as Nr,_j as pn,_k as yc,a as p,aa as zb,ab as ND,ac as e0,ad as ge,ae as iC,af as Xe,ag as nR,ah as kg,ai as QR,aj as Pr,ak as Yg,al as BC,b as x,ba as je,bb as PD,bc as tt,bd as vi,be as rg,bf as Oi,bg as hc,bh as qn,bi as JR,bj as gn,bk as wt,bl as rm,c as Ra,ca as Oo,cb as Qu,cc as Ti,cd as lo,ce as ae,cf as U0,cg as rR,ch as DR,ci as hd,cj as LC,ck as MC,cl as u1,d as Hb,da as _D,db as Co,dc as Sr,dd as nn,de as ei,df as j0,dg as sR,dh as Tg,di as xC,dj as oi,dk as Ws,dl as sm,e as de,ea as vD,eb as So,ec as t0,ed as h0,ee as ti,ef as Ja,eg as hC,eh as Mg,ei as ud,ej as Ie,ek as Wk,el as Bo,f as De,fa as Ei,fb as OD,fc as i0,fd as u0,fe as Zt,ff as Ai,fg as aR,fh as dd,fi as J,fj as EC,fk as Et,fl as g1,g as Xt,ga as br,gb as $b,gc as wr,gd as tC,ge as D0,gf as Ve,gg as dR,gh as RR,gi as Fg,gj as $n,gk as Eo,gl as m1,h as ka,ha as Di,hb as AD,hc as ys,hd as qi,he as $a,hf as mg,hg as lR,hh as vC,hi as gd,hj as fk,hk as Xg,hl as p1,i as zi,ia as $l,ib as FD,ic as o0,id as g0,ie as sg,if as aC,ig as cR,ih as kR,ii as he,ij as Lt,ik as Bk,il as f1,j as Ze,ja as Jo,jb as Ba,jc as xs,jd as Qt,je as Be,jf as co,jg as Cg,jh as Ng,ji as md,jj as _d,jk as Vk,k as Ta,ka as Oe,kb as HD,kc as so,kd as m0,ke as Za,kf as Yt,kg as hR,kh as bC,ki as pd,kj as Ug,kk as zk,l as aD,la as Aa,lb as Zb,lc as n0,ld as ja,le as Me,lf as dC,lg as uc,lh as Pg,li as Rr,lj as DC,lk as Uk,m as dD,ma as bD,mb as WD,mc as ke,md as p0,me as xo,mf as K0,mg as rd,mh as TR,mi as IC,mj as RC,mk as Qg,n as zu,na as gi,nb as Ql,nc as ao,nd as f0,ne as R0,nf as Wo,ng as sd,nh as MR,ni as ek,nj as _k,nk as jk,o as Uu,oa as CD,ob as BD,oc as ji,od as ec,oe as Ir,of as ed,og as uR,oh as NR,oi as tk,oj as vk,ok as Kk,p as lD,pa as Fa,pb as VD,pc as j,pd as dt,pe as k0,pf as me,pg as gR,ph as PR,pi as uo,pj as jg,pk as qk,q as Ma,qa as SD,qb as Yb,qc as Is,qd as _0,qe as ag,qf as q0,qg as mR,qh as pc,qi as hn,qj as Kg,qk as Gk,r as Wb,ra as Ha,rb as ws,rc as W,rd as v0,re as Un,rf as V,rg as pR,rh as Og,ri as un,rj as bk,rk as $k,s as bs,sa as Bn,sb as zD,sc as r0,sd as b0,se as Es,sf as G0,sg as fR,sh as Ke,si as Hg,sj as vd,sk as Ge,t as ro,ta as wD,tb as UD,tc as ri,td as C0,te as dg,tf as $0,tg as _R,th as it,ti as ik,tj as Ck,tk as NC,u as fe,ua as mi,ub as D,uc as Gt,ud as tg,ue as oC,uf as pg,ug as Ns,uh as ln,ui as ok,uj as Sk,uk as Jg,v as vr,va as Zl,vb as Ri,vc as s0,vd as nt,ve as T0,vf as Z0,vg as Lr,vh as OR,vi as nk,vj as wk,vk as em,w as cD,wa as mt,wb as Xb,wc as yr,wd as O,we as w,wf as td,wg as gc,wh as AR,wi as rk,wj as yk,wk as PC,x as Na,xa as Cr,xb as Va,xc as $,xd as tc,xe as Ya,xf as id,xg as vR,xh as Ag,xi as sk,xj as St,xk as Zk,y as Ui,ya as Ub,yb as re,yd as Jt,ye as bi,yf as Y0,yg as bR,yh as fc,yi as Ps,yj as xk,yk as Sc,z as hD,za as yD,zb as en,zc as bt,zd as At,ze as nC,zf as ks,zg as Sg,zh as CC,zi as Gn,zj as Ik,zk as OC}from"./NE365JK4.js";var am=class extends at{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:x(101,"Toggle Collapse Unchanged Regions"),icon:B.map,toggled:M.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:M.has("isInDiffEditor"),menu:{when:M.has("isInDiffEditor"),id:q.EditorTitle,order:22,group:"navigation"}})}run(e,...t){let i=e.get(ae),o=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}},xc=class extends at{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:x(102,"Toggle Show Moved Code Blocks"),precondition:M.has("isInDiffEditor")})}run(e,...t){let i=e.get(ae),o=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",o)}},Ic=class extends at{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:x(103,"Toggle Use Inline View When Space Is Limited"),precondition:M.has("isInDiffEditor")})}run(e,...t){let i=e.get(ae),o=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}},Ec=x(104,"Diff Editor"),dm=class extends Jt{constructor(){super({id:"diffEditor.switchSide",title:x(105,"Switch Side"),icon:B.arrowSwap,precondition:M.has("isInDiffEditor"),f1:!0,category:Ec})}runEditorCommand(e,t,i){let o=Bs(e);if(o instanceof Hs){if(i&&i.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}},lm=class extends Jt{constructor(){super({id:"diffEditor.exitCompareMove",title:x(106,"Exit Compare Move"),icon:B.close,precondition:w.comparingMovedCode,f1:!1,category:Ec,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){let o=Bs(e);o instanceof Hs&&o.exitCompareMove()}},cm=class extends Jt{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:x(107,"Collapse All Unchanged Regions"),icon:B.fold,precondition:M.has("isInDiffEditor"),f1:!0,category:Ec})}runEditorCommand(e,t,...i){let o=Bs(e);o instanceof Hs&&o.collapseAllUnchangedRegions()}},hm=class extends Jt{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:x(108,"Show All Unchanged Regions"),icon:B.unfold,precondition:M.has("isInDiffEditor"),f1:!0,category:Ec})}runEditorCommand(e,t,...i){let o=Bs(e);o instanceof Hs&&o.showAllUnchangedRegions()}},Cd=class extends at{constructor(){super({id:"diffEditor.revert",title:x(109,"Revert"),f1:!0,category:Ec,precondition:M.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){let t=Bs(e);t instanceof Hs&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){let i=wP(e,t.originalUri,t.modifiedUri);i instanceof Hs&&i.revertRangeMappings(t.mapping.innerChanges??[])}},_1=x(110,"Accessible Diff Viewer"),Sd=class r extends at{static{this.id="editor.action.accessibleDiffViewer.next"}constructor(){super({id:r.id,title:x(111,"Go to Next Difference"),category:_1,precondition:M.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){Bs(e)?.accessibleDiffViewerNext()}},Lc=class r extends at{static{this.id="editor.action.accessibleDiffViewer.prev"}constructor(){super({id:r.id,title:x(112,"Go to Previous Difference"),category:_1,precondition:M.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){Bs(e)?.accessibleDiffViewerPrev()}};function wP(r,e,t){return r.get(Le).listDiffEditors().find(n=>{let s=n.getModifiedEditor(),a=n.getOriginalEditor();return s&&s.getModel()?.uri.toString()===t.toString()&&a&&a.getModel()?.uri.toString()===e.toString()})||null}function Bs(r){let t=r.get(Le).listDiffEditors(),i=wr();if(i){for(let o of t)if(o.getContainerDomNode().contains(i))return o}return null}ge(am);ge(xc);ge(Ic);ai.appendMenuItem(q.EditorTitle,{command:{id:new Ic().desc.id,title:p(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(w.diffEditorRenderSideBySideInlineBreakpointReached,M.has("isInDiffEditor"))});ai.appendMenuItem(q.EditorTitle,{command:{id:new xc().desc.id,title:p(136,"Show Moved Code Blocks"),icon:B.move,toggled:d0.create("config.diffEditor.experimental.showMoves",!0),precondition:M.has("isInDiffEditor")},order:10,group:"1_diff",when:M.has("isInDiffEditor")});ge(Cd);for(let r of[{icon:B.arrowRight,key:w.diffEditorInlineMode.toNegated()},{icon:B.discard,key:w.diffEditorInlineMode}])ai.appendMenuItem(q.DiffEditorHunkToolbar,{command:{id:new Cd().desc.id,title:p(137,"Revert Block"),icon:r.icon},when:M.and(w.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),ai.appendMenuItem(q.DiffEditorSelectionToolbar,{command:{id:new Cd().desc.id,title:p(138,"Revert Selection"),icon:r.icon},when:M.and(w.diffEditorModifiedWritable,r.key),order:5,group:"primary"});ge(dm);ge(lm);ge(cm);ge(hm);ai.appendMenuItem(q.EditorTitle,{command:{id:Sd.id,title:p(139,"Open Accessible Diff Viewer"),precondition:M.has("isInDiffEditor")},order:10,group:"2_diff",when:M.and(w.accessibleDiffViewerVisible.negate(),M.has("isInDiffEditor"))});ve.registerCommandAlias("editor.action.diffReview.next",Sd.id);ge(Sd);ve.registerCommandAlias("editor.action.diffReview.prev",Lc.id);ge(Lc);var yP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},xP=function(r,e){return function(t,i){e(t,i,r)}},VC,um=new ee("selectionAnchorSet",!1),Or=class{static{VC=this}static{this.ID="editor.contrib.selectionAnchorController"}static get(e){return e.getContribution(VC.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=um.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(X.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new ct().appendText(p(834,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),bt(p(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(X.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()}};Or=VC=yP([xP(1,Q)],Or);var zC=class extends O{constructor(){super({id:"editor.action.setSelectionAnchor",label:x(836,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:w.editorTextFocus,primary:Ye(2089,2080),weight:100}})}async run(e,t){Or.get(t)?.setSelectionAnchor()}},UC=class extends O{constructor(){super({id:"editor.action.goToSelectionAnchor",label:x(837,"Go to Selection Anchor"),precondition:um})}async run(e,t){Or.get(t)?.goToSelectionAnchor()}},jC=class extends O{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:x(838,"Select from Anchor to Cursor"),precondition:um,kbOpts:{kbExpr:w.editorTextFocus,primary:Ye(2089,2089),weight:100}})}async run(e,t){Or.get(t)?.selectFromAnchorToCursor()}},KC=class extends O{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:x(839,"Cancel Selection Anchor"),precondition:um,kbOpts:{kbExpr:w.editorTextFocus,primary:9,weight:100}})}async run(e,t){Or.get(t)?.cancelSelectionAnchor()}};Z(Or.ID,Or,4);R(zC);R(UC);R(jC);R(KC);var IP=K("editorOverviewRuler.bracketMatchForeground","#A0A0A0",p(840,"Overview ruler marker color for matching brackets.")),qC=class extends O{constructor(){super({id:"editor.action.jumpToBracket",label:x(842,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:w.editorTextFocus,primary:3165,weight:100}})}run(e,t){Vs.get(t)?.jumpToBracket()}},GC=class extends O{constructor(){super({id:"editor.action.selectToBracket",label:x(843,"Select to Bracket"),precondition:void 0,metadata:{description:x(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,i){let o=!0;i&&i.selectBrackets===!1&&(o=!1),Vs.get(t)?.selectToBracket(o)}},$C=class extends O{constructor(){super({id:"editor.action.removeBrackets",label:x(845,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:w.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Vs.get(t)?.removeBrackets(this.id)}},ZC=class{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}},Vs=class r extends E{static{this.ID="editor.contrib.bracketMatchingController"}static get(e){return e.getContribution(r.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Oe(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.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(i=>{let o=i.getStartPosition(),n=e.bracketPairs.matchBracket(o),s=null;if(n)n[0].containsPosition(o)&&!n[1].containsPosition(o)?s=n[1].getStartPosition():n[1].containsPosition(o)&&(s=n[0].getStartPosition());else{let a=e.bracketPairs.findEnclosingBrackets(o);if(a)s=a[1].getStartPosition();else{let d=e.bracketPairs.findNextBracket(o);d&&d.range&&(s=d.range.getStartPosition())}}return s?new X(s.lineNumber,s.column,s.lineNumber,s.column):new X(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(o=>{let n=o.getStartPosition(),s=t.bracketPairs.matchBracket(n);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(n),!s)){let l=t.bracketPairs.findNextBracket(n);l&&l.range&&(s=t.bracketPairs.matchBracket(l.range.getStartPosition()))}let a=null,d=null;if(s){s.sort(S.compareRangesUsingStarts);let[l,c]=s;if(a=e?l.getStartPosition():l.getEndPosition(),d=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(n)){let h=a;a=d,d=h}}a&&d&&i.push(new X(a.lineNumber,a.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(i=>{let o=i.getPosition(),n=t.bracketPairs.matchBracket(o);n||(n=t.bracketPairs.findEnclosingBrackets(o)),n&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:n[0],text:""},{range:n[1],text:""}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=J.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",inlineClassName:"bracket-match-inline",overviewRuler:{color:it(IP),position:Ni.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=J.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 i of this._lastBracketsData){let o=i.brackets;o&&(e[t++]={range:o[0],options:i.options},e[t++]={range:o[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getModel(),i=t.getVersionId(),o=[];this._lastVersionId===i&&(o=this._lastBracketsData);let n=[],s=0;for(let h=0,u=e.length;h<u;h++){let g=e[h];g.isEmpty()&&(n[s++]=g.getStartPosition())}n.length>1&&n.sort(H.compare);let a=[],d=0,l=0,c=o.length;for(let h=0,u=n.length;h<u;h++){let g=n[h];for(;l<c&&o[l].position.isBefore(g);)l++;if(l<c&&o[l].position.equals(g))a[d++]=o[l];else{let m=t.bracketPairs.matchBracket(g,20),f=r._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(g,20),f=r._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[d++]=new ZC(g,m,f)}}this._lastBracketsData=a,this._lastVersionId=i}};Z(Vs.ID,Vs,1);R(GC);R(qC);R($C);ai.appendMenuItem(q.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:p(841,"Go to &&Bracket")},order:2});ln((r,e)=>{let t=r.getColor(OR);t&&e.addRule(`.monaco-editor .bracket-match-inline { color: ${t} !important; }`)});var gm=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 i=this._selection.startLineNumber,o=this._selection.startColumn,n=this._selection.endColumn;if(!(this._isMovingLeft&&o===1)&&!(!this._isMovingLeft&&n===e.getLineMaxColumn(i)))if(this._isMovingLeft){let s=new S(i,o-1,i,o),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new S(i,n,i,n),a)}else{let s=new S(i,n,i,n+1),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new S(i,o,i,o),a)}}computeCursorState(e,t){return this._isMovingLeft?new X(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new X(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}};var mm=class extends O{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let i=[],o=t.getSelections();for(let n of o)i.push(new gm(n,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}},YC=class extends mm{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:x(846,"Move Selected Text Left"),precondition:w.writable})}},XC=class extends mm{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:x(847,"Move Selected Text Right"),precondition:w.writable})}};R(YC);R(XC);var QC=class extends O{constructor(){super({id:"editor.action.transposeLetters",label:x(848,"Transpose Letters"),precondition:w.writable,kbOpts:{kbExpr:w.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let i=t.getModel(),o=[],n=t.getSelections();for(let s of n){if(!s.isEmpty())continue;let a=s.startLineNumber,d=s.startColumn,l=i.getLineMaxColumn(a);if(a===1&&(d===1||d===2&&l===2))continue;let c=d===l?s.getPosition():og.rightPosition(i,s.getPosition().lineNumber,s.getPosition().column),h=og.leftPosition(i,c),u=og.leftPosition(i,h),g=i.getValueInRange(S.fromPositions(u,h)),m=i.getValueInRange(S.fromPositions(h,c)),f=S.fromPositions(u,c);o.push(new zn(f,m+g))}o.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}};R(QC);var LP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},EP=function(r,e){return function(t,i){e(t,i,r)}},DP=J.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:$u,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),JC=class r extends E{static{this.baseId="editor.widget.inlineProgressWidget"}constructor(e,t,i,o,n){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=n,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(o),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=W(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;let t=W("span.icon");this.domNode.append(t),t.classList.add(...se.asClassNameArray(B.loading),"codicon-modifier-spin");let i=()=>{let o=this.editor.getOption(75);this.domNode.style.height=`${o}px`,this.domNode.style.width=`${Math.ceil(.8*o)}px`};i(),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(61)||o.hasChanged(75))&&i()})),this._register(ne(this.domNode,ke.CLICK,o=>{this.delegate.cancel()}))}getId(){return r.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 E{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Re),this._currentWidget=this._register(new Re),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,o,n){let s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=Di(()=>{let a=S.fromPositions(e);this._currentDecorations.set([{range:a,options:DP}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(JC,this.id,this._editor,a,t,o))},n??this._showDelay);try{return await i}finally{this._currentOperation===s&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};wd=LP([EP(2,U)],wd);var We=class r{static{this.sep="."}static{this.None=new r("@@none@@")}static{this.Empty=new r("")}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+r.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new r((this.value?[this.value,...e]:e).join(r.sep))}};var RP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},v1=function(r,e){return function(t,i){e(t,i,r)}},pm,Wt=class{static{pm=this}static{this.ID="editor.contrib.messageController"}static{this.MESSAGE_VISIBLE=new ee("messageVisible",!1,p(1333,"Whether the editor is currently showing an inline message"))}static get(e){return e.getContribution(pm.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Re,this._messageListeners=new T,this._mouseOverMessage=!1,this._editor=e,this._visible=pm.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(bt(Os(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Os(e)){let o=this._messageListeners.add(As(e,{actionHandler:(n,s)=>{this.closeMessage(),Tk(this._openerService,n,s.isTrusted)}}));this._messageWidget.value=new Dc(this._editor,t,o.element)}else this._messageWidget.value=new Dc(this._editor,t,e);this._messageListeners.add(xe.debounce(this._editor.onDidBlurEditorText,(o,n)=>n,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&t0(wr(),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(ne(this._messageWidget.value.getDomNode(),ke.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ne(this._messageWidget.value.getDomNode(),ke.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(o=>{o.target.position&&(i?i.containsPosition(o.target.position)||this.closeMessage():i=new S(t.lineNumber-3,1,o.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Dc.fadeOut(this._messageWidget.value))}};Wt=pm=RP([v1(1,Q),v1(2,go)],Wt);var kP=nt.bindToContribution(Wt.get);Y(new kP({id:"leaveEditorMessage",precondition:Wt.MESSAGE_VISIBLE,handler:r=>r.closeMessage(),kbOpts:{weight:130,primary:9}}));var Dc=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},o){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";let n=document.createElement("div");n.classList.add("anchor","top"),this._domNode.appendChild(n);let s=document.createElement("div");typeof o=="string"?(s.classList.add("message"),s.textContent=o):(o.classList.add("message"),s.appendChild(o)),this._domNode.appendChild(s);let a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),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)}};Z(Wt.ID,Wt,4);var tS=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Rc=function(r,e){return function(t,i){e(t,i,r)}},kc=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,o,n){let s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,o){let n=await this.getEdit(i,o);if(n)return{edits:[{insertText:n.insertText,title:n.title,kind:n.kind,handledMimeType:n.handledMimeType,yieldTo:n.yieldTo}],dispose(){}}}},Zn=class r extends kc{static{this.id="text"}constructor(){super(We.Empty.append("text","plain")),this.id=r.id,this.dropMimeTypes=[Zt.text],this.pasteMimeTypes=[Zt.text]}async getEdit(e,t){let i=e.get(Zt.text);if(!i||e.has(Zt.uriList))return;let o=await i.asString();return{handledMimeType:Zt.text,title:p(965,"Insert Plain Text"),insertText:o,kind:this.kind}}},fm=class extends kc{constructor(){super(We.Empty.append("uri","path","absolute")),this.dropMimeTypes=[Zt.uriList],this.pasteMimeTypes=[Zt.uriList]}async getEdit(e,t){let i=await b1(e);if(!i.length||t.isCancellationRequested)return;let o=0,n=i.map(({uri:a,originalText:d})=>a.scheme===gt.file?a.fsPath:(o++,d)).join(" "),s;return o>0?s=i.length>1?p(966,"Insert Uris"):p(967,"Insert Uri"):s=i.length>1?p(968,"Insert Paths"):p(969,"Insert Path"),{handledMimeType:Zt.uriList,insertText:n,title:s,kind:this.kind}}},_m=class extends kc{constructor(e){super(We.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[Zt.uriList],this.pasteMimeTypes=[Zt.uriList]}async getEdit(e,t){let i=await b1(e);if(!i.length||t.isCancellationRequested)return;let o=pi(i.map(({uri:n})=>{let s=this._workspaceContextService.getWorkspaceFolder(n);return s?f0(s.uri,n):void 0}));if(o.length)return{handledMimeType:Zt.uriList,insertText:o.join(" "),title:i.length>1?p(970,"Insert Relative Paths"):p(971,"Insert Relative Path"),kind:this.kind}}};_m=tS([Rc(0,Lo)],_m);var eS=class{constructor(){this.kind=new We("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Zt.text}]}async provideDocumentPasteEdits(e,t,i,o,n){if(o.triggerKind!==ac.PasteAs&&!o.only?.contains(this.kind))return;let a=await i.get("text/html")?.asString();if(!(!a||n.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:p(972,"Insert HTML"),kind:this.kind}]}}};async function b1(r){let e=r.get(Zt.uriList);if(!e)return[];let t=await e.asString(),i=[];for(let o of Pg.parse(t))try{i.push({uri:ue.parse(o),originalText:o})}catch{}return i}var zs={scheme:"*",hasAccessToAllModels:!0},vm=class extends E{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(zs,new Zn)),this._register(e.documentDropEditProvider.register(zs,new fm)),this._register(e.documentDropEditProvider.register(zs,new _m(t)))}};vm=tS([Rc(0,V),Rc(1,Lo)],vm);var bm=class extends E{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(zs,new Zn)),this._register(e.documentPasteEditProvider.register(zs,new fm)),this._register(e.documentPasteEditProvider.register(zs,new _m(t))),this._register(e.documentPasteEditProvider.register(zs,new eS))}};bm=tS([Rc(0,V),Rc(1,Lo)],bm);var iS=class r{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 e=this.pos,t=0,i=this.value.charCodeAt(e),o;if(o=r._table[i],typeof o=="number")return this.pos+=1,{type:o,pos:e,len:1};if(r.isDigitCharacter(i)){o=8;do t+=1,i=this.value.charCodeAt(e+t);while(r.isDigitCharacter(i));return this.pos+=t,{type:o,pos:e,len:t}}if(r.isVariableCharacter(i)){o=9;do i=this.value.charCodeAt(e+ ++t);while(r.isVariableCharacter(i)||r.isDigitCharacter(i));return this.pos+=t,{type:o,pos:e,len:t}}o=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof r._table[i]>"u"&&!r.isDigitCharacter(i)&&!r.isVariableCharacter(i));return this.pos+=t,{type:o,pos:e,len:t}}},Ar=class{constructor(){this._children=[]}appendChild(e){return e instanceof Bt&&this._children[this._children.length-1]instanceof Bt?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:i}=e,o=i.children.indexOf(e),n=i.children.slice(0);n.splice(o,1,...t),i._children=n,(function s(a,d){for(let l of a)l.parent=d,s(l.children,l)})(t,i)}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 yd)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}},Bt=class r extends Ar{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new r(this.value)}},Cm=class extends Ar{},Zi=class r extends Cm{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Us?this._children[0]:void 0}clone(){let e=new r(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}},Us=class r extends Ar{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Bt&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let e=new r;return this.options.forEach(e.appendChild,e),e}},oS=class r extends Ar{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){let t=this,i=!1,o=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(n=>n instanceof Vo&&!!n.elseValue)&&(o=this._replace([])),o}_replace(e){let t="";for(let i of this._children)if(i instanceof Vo){let o=e[i.index]||"";o=i.resolve(o),t+=o}else t+=i.toString();return t}toString(){return""}clone(){let e=new r;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}},Vo=class r extends Ar{constructor(e,t,i,o){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=o}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 i=e.trim().replace(/^_+|_+$/g,""),o=i.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 o?o.map(n=>n.toLowerCase()).join("-"):i.split(/[\s_-]+/).filter(n=>n.length>0).map(n=>n.toLowerCase()).join("-")}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((i,o)=>o===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,"$1_$2").replace(/[\s\-]+/g,"_").toLowerCase()}clone(){return new r(this.index,this.shorthandName,this.ifValue,this.elseValue)}},Fr=class r extends Cm{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Bt(t)],!0):!1}clone(){let e=new r(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}};function C1(r,e){let t=[...r];for(;t.length>0;){let i=t.shift();if(!e(i))break;t.unshift(...i.children)}}var yd=class r extends Ar{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(i){return i instanceof Zi&&(e.push(i),t=!t||t.index<i.index?i: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,i=!1;return this.walk(o=>o===e?(i=!0,!1):(t+=o.len(),!0)),i?t:-1}fullLen(e){let t=0;return C1([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof Zi&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Fr&&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 e=new r;return e._children=this.children.map(t=>t.clone()),e}walk(e){C1(this.children,e)}},Hi=class{constructor(){this._scanner=new iS,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,i){let o=new yd;return this.parseFragment(e,o),this.ensureFinalTabstop(o,i??!1,t??!1),o}parseFragment(e,t){let i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let o=new Map,n=[];t.walk(d=>(d instanceof Zi&&(d.isFinalTabstop?o.set(0,void 0):!o.has(d.index)&&d.children.length>0?o.set(d.index,d.children):n.push(d)),!0));let s=(d,l)=>{let c=o.get(d.index);if(!c)return;let h=new Zi(d.index);h.transform=d.transform;for(let u of c){let g=u.clone();h.appendChild(g),g instanceof Zi&&o.has(g.index)&&!l.has(g.index)&&(l.add(g.index),s(g,l),l.delete(g.index))}t.replace(d,[h])},a=new Set;for(let d of n)s(d,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(n=>n.index===0)||e.appendChild(new Zi(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}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 o=this._scanner.next();if(o.type!==0&&o.type!==4&&o.type!==5)return!1}this._token=this._scanner.next()}let i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_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 Bt(t)),!0):!1}_parseTabstopOrVariableName(e){let t,i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Zi(Number(t)):new Fr(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t,i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);let n=new Zi(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new Bt("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else if(n.index>0&&this._accept(7)){let s=new Us;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(s),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i)}_parseChoiceElement(e){let t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let o;if((o=this._accept(5,!0))?o=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||o:o=this._accept(void 0,!0),!o)return this._backTo(t),!1;i.push(o)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Bt(i.join(""))),!0)}_parseComplexVariable(e){let t,i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);let n=new Fr(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new Bt("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i)}_parseTransform(e){let t=new oS,i="",o="";for(;!this._accept(6);){let n;if(n=this._accept(5,!0)){n=this._accept(6,!0)||n,i+=n;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let n;if(n=this._accept(5,!0)){n=this._accept(5,!0)||this._accept(6,!0)||n,t.appendChild(new Bt(n));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){o+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,o)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let o=this._accept(8,!0);if(o)if(i){if(this._accept(4))return e.appendChild(new Vo(Number(o))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Vo(Number(o))),!0;else 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 Vo(Number(o),n)),!0)}else if(this._accept(11)){let n=this._until(4);if(n)return e.appendChild(new Vo(Number(o),void 0,n,void 0)),!0}else if(this._accept(12)){let n=this._until(4);if(n)return e.appendChild(new Vo(Number(o),void 0,void 0,n)),!0}else if(this._accept(13)){let n=this._until(1);if(n){let s=this._until(4);if(s)return e.appendChild(new Vo(Number(o),void 0,n,s)),!0}}else{let n=this._until(4);if(n)return e.appendChild(new Vo(Number(o),void 0,void 0,n)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Bt(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}};function Sm(r,e,t){return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:t.additionalEdit?.edits??[]}:{edits:[...e.map(i=>new Gg(r,{range:i,text:typeof t.insertText=="string"?Hi.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...t.additionalEdit?.edits??[]]}}function wm(r){function e(s,a){return"mimeType"in s?s.mimeType===a.handledMimeType:!!a.kind&&s.kind.contains(a.kind)}let t=new Map;for(let s of r)for(let a of s.yieldTo??[])for(let d of r)if(d!==s&&e(a,d)){let l=t.get(s);l||(l=[],t.set(s,l)),l.push(d)}if(!t.size)return Array.from(r);let i=new Set,o=[];function n(s){if(!s.length)return[];let a=s[0];if(o.includes(a))return console.warn("Yield to cycle detected",a),s;if(i.has(a))return n(s.slice(1));let d=[],l=t.get(a);return l&&(o.push(a),d=n(l),o.pop()),i.add(a),[...d,a,...n(s.slice(1))]}return n(Array.from(r))}function nS(r,e){return e&&(r.stack||r.stacktrace)?p(33,"{0}: {1}",w1(r),S1(r.stack)||S1(r.stacktrace)):w1(r)}function S1(r){return Array.isArray(r)?r.join(`
|
|
3
3
|
`):r}function w1(r){return r.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${r.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?p(34,"A system error occurred ({0})",r.message):r.message||p(35,"An unknown error occurred. Please consult the log for more details.")}function xd(r=null,e=!1){if(!r)return p(36,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(r)){let t=pi(r),i=xd(t[0],e);return t.length>1?p(37,"{0} ({1} errors in total)",i,t.length):i}if(Uu(r))return r;if(r.detail){let t=r.detail;if(t.error)return nS(t.error,e);if(t.exception)return nS(t.exception,e)}return r.stack?nS(r,e):r.message?r.message:p(38,"An unknown error occurred. Please consult the log for more details.")}var hS=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Hr=function(r,e){return function(t,i){e(t,i,r)}},rS,uS="acceptSelectedCodeAction",gS="previewSelectedCodeAction",sS=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,i){i.text.textContent=e.group?.title??e.label??""}disposeTemplate(e){}},aS=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,i){i.text.textContent=e.label??""}disposeTemplate(e){}},dS=class{get templateId(){return"action"}constructor(e,t,i,o,n,s,a,d,l){this._supportsPreview=e,this._onRemoveItem=t,this._onShowSubmenu=i,this._hasAnySubmenuActions=o,this._groupTitleByIndex=n,this._linkHandler=s,this._hideDefaultKeybindingTooltip=a,this._keybindingService=d,this._openerService=l}renderTemplate(e){e.classList.add(this.templateId);let t=document.createElement("div");t.className="icon",e.append(t);let i=document.createElement("span");i.className="title",e.append(i);let o=document.createElement("span");o.className="action-item-badge",e.append(o);let n=document.createElement("span");n.className="description",e.append(n);let s=document.createElement("span");s.className="group-title",e.append(s);let a=document.createElement("span");a.className="detail",e.append(a);let d=new pn(e,Qo),l=document.createElement("div");l.className="action-list-item-toolbar",e.append(l);let c=document.createElement("div");c.className="action-list-submenu-indicator",e.append(c);let h=new T;return{container:e,icon:t,text:i,detail:a,badge:o,description:n,groupTitle:s,keybinding:d,toolbar:l,submenuIndicator:c,elementDisposables:h}}renderElement(e,t,i){if(i.elementDisposables.clear(),e.group?.icon?(i.icon.className=se.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Ce(e.group.icon.color.id))):(i.icon.className=se.asClassName(B.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;if(r0(!e.hideIcon,i.icon),e.isSectionToggle){let d=e.group?.icon===B.chevronDown;i.container.setAttribute("aria-expanded",String(d))}else i.container.removeAttribute("aria-expanded");if(i.previousClassName&&i.container.classList.remove(i.previousClassName),i.container.classList.toggle("action-list-custom",!!e.className),e.className&&i.container.classList.add(e.className),i.previousClassName=e.className,i.text.textContent=_n(e.label),e.badge?(i.badge.textContent=e.badge,i.badge.style.display=""):(i.badge.textContent="",i.badge.style.display="none"),e.keybinding)i.description.textContent=e.keybinding.getLabel(),i.description.style.display="inline",i.description.style.letterSpacing="0.5px";else if(e.description){if(qt(i.description),typeof e.description=="string")i.description.textContent=_n(e.description);else{let d=As(e.description,{actionHandler:l=>{let c=ue.parse(l);this._linkHandler?this._linkHandler(c,e):this._openerService.open(c,{allowCommands:!0})}});i.elementDisposables.add(d),i.description.appendChild(d.element)}i.description.style.display="inline"}else i.description.textContent="",i.description.style.display="none";let o=this._groupTitleByIndex.get(t);o?(i.groupTitle.textContent=o,i.groupTitle.style.display=""):(i.groupTitle.textContent="",i.groupTitle.style.display="none"),e.detail?(i.detail.textContent=_n(e.detail),i.detail.style.display=""):(i.detail.textContent="",i.detail.style.display="none");let n=this._keybindingService.lookupKeybinding(uS)?.getLabel(),s=this._keybindingService.lookupKeybinding(gS)?.getLabel();i.container.classList.toggle("option-disabled",!!e.disabled),e.hover!==void 0?i.container.title="":e.tooltip?i.container.title=e.tooltip:e.disabled?i.container.title=e.label:this._hideDefaultKeybindingTooltip?i.container.title="":n&&s?this._supportsPreview&&e.canPreview?i.container.title=p(1705,"{0} to Apply, {1} to Preview",n,s):i.container.title=p(1706,"{0} to Apply",n):i.container.title="",qt(i.toolbar);let a=[...e.toolbarActions??[]];if(e.onRemove&&a.push(a0({id:"actionList.remove",label:p(1707,"Remove"),class:se.asClassName(B.close),run:async()=>{await e.onRemove(),this._onRemoveItem?.(e)}})),i.container.classList.toggle("has-toolbar",a.length>0),a.length>0){let d=new $i(i.toolbar);i.elementDisposables.add(d),d.push(a,{icon:!0,label:!1})}e.submenuActions?.length&&!e.hover?.content?(i.submenuIndicator.className="action-list-submenu-indicator has-submenu "+se.asClassName(B.chevronRight),i.submenuIndicator.style.display="",i.submenuIndicator.style.visibility="",i.elementDisposables.add(ne(i.submenuIndicator,ke.CLICK,d=>{d.stopPropagation(),this._onShowSubmenu?.(e)}))):this._hasAnySubmenuActions?(i.submenuIndicator.className="action-list-submenu-indicator",i.submenuIndicator.style.display="",i.submenuIndicator.style.visibility="hidden"):(i.submenuIndicator.className="action-list-submenu-indicator",i.submenuIndicator.style.display="none")}disposeTemplate(e){e.keybinding.dispose(),e.elementDisposables.dispose()}};dS=hS([Hr(7,ce),Hr(8,go)],dS);var lS=class extends UIEvent{constructor(){super("acceptSelectedAction")}},ym=class extends UIEvent{constructor(){super("previewSelectedAction")}};function TP(r){if(r.kind==="action")return r.label}var cS=rS=class extends E{constructor(e,t,i,o,n,s,a,d,l){if(super(),this._supportsPreview=t,this._delegate=o,this._options=s,this._keybindingService=a,this._openerService=d,this._instantiationService=l,this._headerLineHeight=24,this._separatorLineHeight=8,this.cts=this._register(new Pe),this._submenuDisposables=this._register(new T),this._collapsedSections=new Set,this._filterText="",this._suppressHover=!1,this._hasLaidOut=!1,this._filterCts=this._register(new Re),this._groupTitleByIndex=new Map,this._onDidRequestLayout=this._register(new z),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 g=this._options.className.split(/\s+/).filter(m=>m.length>0);g.length>0&&this.domNode.classList.add(...g)}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(ne(this._submenuContainer,"mouseenter",()=>{this._cancelSubmenuHide()})),this._register(ne(this._submenuContainer,"mouseleave",()=>{this._scheduleSubmenuHide()})),this._register(pe(()=>{this._cancelSubmenuHide(),this._cancelSubmenuShow()})),this._options?.collapsedByDefault)for(let g of this._options.collapsedByDefault)this._collapsedSections.add(g);let c={getHeight:g=>this._getItemHeight(g),getTemplateId:g=>g.kind},u=(this._options?.reserveSubmenuSpace??!0)&&i.some(g=>!!g.submenuActions?.length&&!g.hover?.content);if(this._list=this._register(new fd(e,this.domNode,c,[new dS(this._supportsPreview,g=>this._removeItem(g),g=>this._showSubmenuForItem(g),u,this._groupTitleByIndex,this._options?.linkHandler,this._options?.hideDefaultKeybindingTooltip??!1,this._keybindingService,this._openerService),new sS,new aS],{keyboardSupport:!1,typeNavigationEnabled:!this._options?.showFilter,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:TP},accessibilityProvider:{getAriaLabel:g=>{if(g.kind==="action"){let m=g.label?_n(g?.label):"";if(g.detail&&(m=m+", "+_n(g.detail)),g.ariaDescription)m=m+", "+_n(g.ariaDescription);else if(g.description){let f=typeof g.description=="string"?g.description:g.description.value;m=m+", "+_n(f)}if(g.hover?.content&&!g.ariaDescription&&!g.description){let f=g.hover.content,_=typeof f=="string"?f:Os(f)?f.value:so(f)?f.textContent??void 0:void 0;_&&(!g.detail||_n(g.detail)!==_n(_))&&(m=m+", "+_n(_))}return g.group?.title&&(m=m+", "+g.group.title),g.disabled&&(m=p(1708,"{0}, Disabled Reason: {1}",m,g.disabled)),g.submenuActions?.length&&(m=p(1709,"{0}, use right arrow to access options",m)),m}return null},getWidgetAriaLabel:()=>p(1710,"Action Widget"),getRole:g=>{switch(g.kind){case"action":return"option";case"separator":return"separator";default:return"separator"}},getWidgetRole:()=>"listbox",...n}})),this._list.style(vk),this._register(this._list.onMouseClick(g=>this.onListClick(g))),this._register(this._list.onMouseOver(g=>this.onListHover(g))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(g=>this.onListSelection(g))),this._allMenuItems=[...i],this._options?.showFilter||this._options?.secondaryHeading){this._filterContainer=document.createElement("div"),this._filterContainer.className="action-list-filter";let g=j(this._filterContainer,W(".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??p(1711,"Search..."),this._filterInput.setAttribute("aria-label",p(1712,"Filter items")),g.appendChild(this._filterInput);let m=this._options?.filterActions??[];if(m.length>0){let f=j(g,W(".action-list-filter-actions"));this._register(new $i(f)).push(m,{icon:!0,label:!1})}this._register(ne(this._filterInput,"input",()=>{this._filterText=this._filterInput.value,this._applyOrUpdateFilter()}))}if(this._options?.secondaryHeading){let m=j(g,W(".action-list-filter-label"));m.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 m=j(this._headerContainer,W("span.action-list-header-icon"));m.classList.add(...se.asClassNameArray(this._options.headerIcon)),m.setAttribute("aria-hidden","true")}let g=j(this._headerContainer,W("span.action-list-header-text"));g.textContent=this._options.headerText}this._applyFilter(),this._list.length&&this._focusCheckedOrFirst(),this._register(ne(this.domNode,"keydown",g=>{if(g.key==="ArrowRight"){let m=this._list.getFocus();if(m.length>0){let f=this._list.element(m[0]);if(f?.submenuActions?.length){ao.stop(g,!0);let _=this._getRowElement(m[0]);_&&(this._showSubmenuForElement(f,_),this._currentSubmenuWidget?.focus())}}}})),this._filterInput&&this._register(ne(this.domNode,"keydown",g=>{this._filterInput&&!ys(this._filterInput)&&g.key.length===1&&g.key!==" "&&!g.ctrlKey&&!g.metaKey&&!g.altKey&&(this._filterInput.focus(),this._filterInput.value=g.key,this._filterText=g.key,this._applyOrUpdateFilter(),g.preventDefault(),g.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 Pe;this._filterCts.value=t,this._delegate.onFilter(e,t.token).then(i=>{t.token.isCancellationRequested||(this._allMenuItems=[...i],this._applyFilter(!0))}).catch(()=>{})}_applyFilter(e=!1,t=!0){let i=e?"":this._filterText.toLowerCase(),o=!e&&i.length>0,n=[],s=this._list.getFocus(),a;if(s.length>0&&(a=this._list.element(s[0])),o){let g,m=[],f=!1,_=()=>{g&&f&&n.push(g),n.push(...m),g=void 0,m=[],f=!1},v=C=>{let I=(C.label??"").toLowerCase(),L=typeof C.description=="string"?C.description:C.description?.value??"";return I.includes(i)||L.toLowerCase().includes(i)};for(let C of this._allMenuItems)if(C.kind!=="header"){if(C.kind==="separator"){_(),g=C.label?C:void 0;continue}if(C.showAlways){m.push(C);continue}C.isSectionToggle||v(C)&&(f=!0,m.push(C))}_()}else for(let g of this._allMenuItems){if(g.kind==="header"){n.push(g);continue}if(g.kind==="separator"){if(g.section&&this._collapsedSections.has(g.section))continue;n.push(g);continue}if(g.isSectionToggle&&g.section){let m=this._collapsedSections.has(g.section);n.push({...g,group:{...g.group,icon:m?B.chevronRight:B.chevronDown}});continue}g.section&&this._collapsedSections.has(g.section)||n.push(g)}let d=[],l=!1;for(let g=0;g<n.length;g++)d[g]=l,n[g].kind==="action"&&(l=!0);let c=[],h=!1;for(let g=n.length-1;g>=0;g--){if(n[g].kind==="action"){h=!0;continue}n[g].kind==="separator"&&(c[g]=h,h=!1)}for(let g=n.length-1;g>=0;g--){let m=n[g];if(m.kind!=="separator")continue;let f=c[g],_=!m.label&&!d[g];(!f||_)&&n.splice(g,1)}this._options?.showGroupTitleOnFirstItem&&this._recomputeGroupTitles(n);let u=this._filterInput&&ys(this._filterInput);if(this._list.splice(0,this._list.length,n),t&&this._onDidRequestLayout.fire(),u)this._filterInput?.focus(),this._focusCheckedOrFirst();else if(this._hasLaidOut&&a){let g=a.item?.id;if(g){for(let m=0;m<this._list.length;m++)if(this._list.element(m).item?.id===g){this._list.setFocus([m]),this._list.reveal(m),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 t=0;t<this._list.length;t++){let i=this._list.element(t);if(i.kind==="action"&&i.item?.checked){this._list.setFocus([t]),this._list.reveal(t);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 i=0;i<e;i++){let o=this._list.element(i);t+=this._getItemHeight(o)}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,i=Math.max(e,this._options?.minWidth??0),o=this._options?.maxWidth??Number.POSITIVE_INFINITY,n=Math.max(o,i),s=c=>Math.min(Math.max(c,i),n),a=i,d=this._allMenuItems.length;if(d>=50)return s(380);if(d>t){let c=[];for(let m=0;m<t;m++)c.push(this._list.element(m));let h=[...this._allMenuItems];this._list.splice(0,t,h);let u=0;for(let m of h)u+=this._getItemHeight(m);this._list.layout(u);let g=[];for(let m=0;m<h.length;m++){let f=this._getRowElement(m);if(f){f.style.width="auto";let _=f.getBoundingClientRect().width;f.style.width="",g.push(_+this._computeToolbarWidth(h[m]))}}return a=s(Math.max(...g)),this._list.splice(0,h.length,c),a}let l=[];for(let c=0;c<t;c++){let h=this._getRowElement(c);if(h){h.style.width="auto";let u=h.getBoundingClientRect().width;h.style.width="",l.push(u+this._computeToolbarWidth(this._list.element(c)))}}return s(Math.max(...l))}focusPrevious(){if(this._filterInput&&ys(this._filterInput)){this._list.domFocus();let i=this._list.getFocus();if(i.length>0){this._list.focusPrevious(1,!1,void 0,this.focusCondition);let o=this._list.getFocus();o.length>0&&o[0]>=i[0]?this._filterInput.focus():o.length>0&&this._list.reveal(o[0])}else{this._list.focusLast(void 0,this.focusCondition);let o=this._list.getFocus();o.length>0&&this._list.reveal(o[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&&ys(this._filterInput)){if(this._list.domFocus(),this._list.getFocus().length>0){this._list.focusNext(1,!1,void 0,this.focusCondition);let o=this._list.getFocus();o.length>0&&this._list.reveal(o[0])}else{this._list.focusFirst(void 0,this.focusCondition);let o=this._list.getFocus();o.length>0&&this._list.reveal(o[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 i=t[0],o=this._list.element(i);if(!this.focusCondition(o))return;let n=e?new ym:new lS;this._list.setSelection([i],n)}onListSelection(e){if(!e.elements.length)return;let t=e.elements[0];if(t.isSectionToggle&&t.section){this._list.setSelection([]);let i=t.section;queueMicrotask(()=>{this._toggleSection(i)});return}if(n0(e.browserEvent)){let i=e.browserEvent.target;if(so(i)&&(i.closest(".action-list-item-toolbar")||i.closest(".action-list-submenu-indicator"))){this._list.setSelection([]);return}}if(t.item&&this.focusCondition(t)){let i=e.browserEvent instanceof ym;this._delegate.onSelect(t.item,i&&this._supportsPreview)}else this._list.setSelection([])}onFocus(){let e=this._list.getFocus();if(e.length===0)return;let t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item),this._suppressHover||this._showHoverForElement(i,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 i=0;i<e.length;i++){let o=e[i];o.kind==="action"&&o.group?.title&&!t.has(o.group.title)&&(t.add(o.group.title),this._groupTitleByIndex.set(i,o.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 i=!!e.hover?.content,o=!!e.submenuActions?.length;if(i||o){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 i=this._getRowElement(t);i&&this._showSubmenuForElement(e,i)}}_showSubmenuForElement(e,t){if(this._currentSubmenuElement===e)return;this._submenuDisposables.clear(),this._currentSubmenuElement=e,this._clearSubmenuContainer();let i,o=e.hover?.content;if(o){if(so(o))i=o,e.hover?.disposable&&this._register(e.hover.disposable);else{let y=typeof o=="string"?new ct(o):o,k=this._options?.linkHandler,P=As(y,{actionHandler:N=>{let F=ue.parse(N);k?k(F,e):this._openerService.open(F,{allowCommands:!0})}});this._submenuDisposables.add(P),i=P.element}i.classList.add("action-list-submenu-hover-header"),e.submenuActions?.length&&i.classList.add("has-submenu"),this._submenuContainer.appendChild(i)}let n=!!e.submenuActions?.length;this._submenuContainer.style.display="",this._submenuContainer.style.position="absolute",this._submenuContainer.removeAttribute("role");let s=t.getBoundingClientRect(),a=this.domNode.getBoundingClientRect(),d=_t(this.domNode),l=0,c=i?i.offsetWidth:0;if(n){let y=[],P=e.submenuActions.filter(G=>G instanceof Ua).filter(G=>G.actions.length>0);for(let G=0;G<P.length;G++){let ie=P[G];ie.label&&y.push({kind:"header",group:{title:ie.label},label:ie.label});for(let Se=0;Se<ie.actions.length;Se++){let Fe=ie.actions[Se],we=Fe,He=we.icon??se.fromId(Fe.checked?B.check.id:B.blank.id),le=we.hoverContent;y.push({item:Fe,kind:"action",label:Fe.label,description:Fe.tooltip||void 0,group:{title:"",icon:He},hideIcon:!1,hover:le?{content:le}:{},onRemove:we.onRemove})}G<P.length-1&&y.push({kind:"separator",label:""})}for(let G of e.submenuActions)if(!(G instanceof Ua)){let ie=G;y.push({item:G,kind:"action",label:G.label,description:G.tooltip||void 0,group:{title:""},hideIcon:!1,hover:{},onRemove:ie.onRemove})}let N={onHide:()=>{},onSelect:G=>{G.run();let ie=this._currentSubmenuElement?.item;this._hideSubmenu(),ie&&this._delegate.onSelect(ie),this.hide()}},F=this._submenuDisposables.add(this._instantiationService.createInstance(rS,"submenu",!1,y,N,void 0,void 0));this._submenuContainer.appendChild(F.domNode),this._currentSubmenuWidget=F,F.clearFocus(),l=F.computeListHeight(),F.layout(l);let A=F.computeMaxWidth(0);c=Math.max(c,A),F.layout(l,c),F.domNode.style.width=`${c}px`,this._submenuDisposables.add(ne(F.domNode,"keydown",G=>{if(G.key==="ArrowLeft"||G.key==="Escape")ao.stop(G,!0),this._hideSubmenu(),this._list.domFocus();else if(G.key==="Enter"){ao.stop(G,!0);let ie=F.getFocusedElement();if(ie?.item){ie.item.run();let Se=this._currentSubmenuElement?.item;this._hideSubmenu(),Se&&this._delegate.onSelect(Se),this.hide()}}else G.key==="ArrowDown"?(ao.stop(G,!0),F.focusNext()):G.key==="ArrowUp"&&(ao.stop(G,!0),F.focusPrevious())}))}let u=d.innerWidth-s.right,g=a.left,m=c+10,f=4;u>=m||u>=g?this._submenuContainer.style.left=`${a.right-a.left+f}px`:this._submenuContainer.style.left=`${-m-f}px`;let _=i?i.offsetHeight:0,v=l+_,C=d.innerHeight,I=s.height,L=s.top-a.top+(I-v)/2,b=a.top+L+v;b>C&&(L-=b-C+8),a.top+L<0&&(L=-a.top),this._submenuContainer.style.top=`${L}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(wr())&&this._list.domFocus(),qt(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 i=typeof t=="number"?this._getRowElement(t):null;i&&this._showSubmenuForElement(e,i)},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(so(e.browserEvent.target)&&e.browserEvent.target.closest(".action-list-item-toolbar")!==null){t.submenuActions?.length||this._cancelSubmenuShow(),this._list.setFocus([]);return}let o=!!(t.submenuActions?.length||t.hover?.content);if(o&&(this._suppressHover=!0),this._list.setFocus(typeof e.index=="number"?[e.index]:[]),o&&(this._suppressHover=!1),o){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),s=n?n.canPreview:void 0;s!==t.canPreview&&(t.canPreview=s,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([])}};cS=rS=hS([Hr(6,ce),Hr(7,go),Hr(8,U)],cS);var xm=class extends E{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?1:0}constructor(e,t,i,o,n,s,a,d,l,c){super(),this._contextViewService=d,this._layoutService=l,this._lastMinWidth=0,this._hasLaidOut=!1,this._anchor=a,this._widget=this._register(c.createInstance(cS,e,t,i,o,n,s)),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=_t(e).getComputedStyle(e),i=o=>Number.parseFloat(o)||0;return i(t.paddingTop)+i(t.paddingBottom)+i(t.borderTopWidth)+i(t.borderBottomWidth)}computeHeight(){let e=this._widget.computeListHeight(),t=this._widget.filterContainer?36:0,i=this._widget.footerContainer?32:0,o=this._widget.headerContainer?this._widget.headerContainer.offsetHeight||36:0,n=t+i+o,s=_t(this.domNode),a;if(this.hasDynamicHeight()){let u=s.innerHeight,g=Fk(this._anchor),m=g.top-s.pageYOffset,_=u-m-g.height-30,v=m;if(this._showAbove===void 0){let C=n+this._widget.computeFullHeight();this._showAbove=C>_&&v>_}a=Math.max(0,(this._showAbove?v:_)-this.computeActionWidgetVerticalChromeHeight())}else{let g=this._layoutService.getContainer(s).clientHeight,m=this.domNode.getBoundingClientRect().top;a=m>0?g-m-10:g*.7}let d=Math.floor(s.innerHeight*.6),l=this._widget.lineHeight,c=Math.min(Math.max(a,l*3+n),d);return Math.min(e+n,c)-n}layout(e){this._hasLaidOut=!0,this._lastMinWidth=e;let t=this.computeHeight();this._widget.layout(t);let i=this._widget.computeMaxWidth(e);return this._cachedMaxWidth=i,this._widget.layout(t,this._cachedMaxWidth),this._cachedMaxWidth}};xm=hS([Hr(7,Pr),Hr(8,Hk),Hr(9,U)],xm);function _n(r){return r.replace(/\r\n|\r|\n/g," ")}var MP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},mS=function(r,e){return function(t,i){e(t,i,r)}};K("actionBar.toggledBackground",ad,p(1713,"Background color for toggled action items in action bar."));var wi={Visible:new ee("codeActionMenuVisible",!1,p(1714,"Whether the action widget list is visible")),FilterFocused:new ee("codeActionMenuFilterFocused",!1,p(1715,"Whether the action widget filter input is focused"))},Yi=Ht("actionWidgetService"),zo=class extends E{get isVisible(){return wi.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Re)}show(e,t,i,o,n,s,a,d,l){let c=wi.Visible.bindTo(this._contextKeyService),h=this._instantiationService.createInstance(xm,e,t,i,o,d,l,n);this._contextViewService.showContextView({getAnchor:()=>n,render:u=>(c.set(!0),this._renderWidget(u,h,a??[])),onHide:u=>{c.reset(),this._onWidgetClosed(u)},get anchorPosition(){return h.anchorPosition}},s,!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,i){let o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)this._list.value.headerContainer&&o.appendChild(this._list.value.headerContainer),this._list.value.filterContainer&&o.appendChild(this._list.value.filterContainer),o.appendChild(this._list.value.domNode),this._list.value.footerContainer&&o.appendChild(this._list.value.footerContainer);else throw new Error("List has no value");let n=new T,s=this._list.value.headerContainer;s&&n.add(Ju(s,f=>f.preventDefault()));let a=document.createElement("div"),d=e.appendChild(a);d.classList.add("context-view-block"),n.add(Ju(d,f=>f.stopPropagation()));let l=document.createElement("div"),c=e.appendChild(l);c.classList.add("context-view-pointerBlock"),n.add(ne(c,ke.POINTER_MOVE,()=>c.remove())),n.add(Ju(c,()=>c.remove()));let h=0;if(i.length){let f=this._createActionBar(".action-widget-action-bar",i);f&&(o.appendChild(f.getContainer().parentElement),n.add(f),h=f.getContainer().offsetWidth)}let u=this._list.value?.layout(h);o.style.width=`${u}px`,this._list.value?.focus();let g=wi.FilterFocused.bindTo(this._contextKeyService);if(n.add({dispose:()=>g.reset()}),this._list.value?.filterInput){let f=this._list.value.filterInput;n.add(ne(f,"focus",()=>g.set(!0))),n.add(ne(f,"blur",()=>g.set(!1)))}let m=n.add(ji(e));return n.add(m.onDidBlur(()=>{let f=wr();f?.closest(".action-widget-hover")||f?.closest(".action-list-submenu-panel")||this.hide(!0)})),n}_createActionBar(e,t){if(!t.length)return;let i=W(e),o=new $i(i);return o.push(t,{icon:!1,label:!0}),o}_onWidgetClosed(e){this._list.value?.hide(e)}};zo=MP([mS(0,Pr),mS(1,Q),mS(2,U)],zo);ti(Yi,zo,1);var Yn=1100;ge(class extends at{constructor(){super({id:"hideCodeActionWidget",title:x(1716,"Hide action widget"),precondition:wi.Visible,keybinding:{weight:Yn,primary:9,secondary:[1033]}})}run(r){r.get(Yi).hide(!0)}});ge(class extends at{constructor(){super({id:"clearFilterCodeActionWidget",title:x(1717,"Clear action widget filter"),precondition:M.and(wi.Visible,wi.FilterFocused),keybinding:{weight:Yn+1,primary:9}})}run(r){let e=r.get(Yi);e instanceof zo&&(e.clearFilter()||e.hide(!0))}});ge(class extends at{constructor(){super({id:"selectPrevCodeAction",title:x(1718,"Select previous action"),precondition:wi.Visible,keybinding:{weight:Yn,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(r){let e=r.get(Yi);e instanceof zo&&e.focusPrevious()}});ge(class extends at{constructor(){super({id:"selectNextCodeAction",title:x(1719,"Select next action"),precondition:wi.Visible,keybinding:{weight:Yn,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(r){let e=r.get(Yi);e instanceof zo&&e.focusNext()}});ge(class extends at{constructor(){super({id:"collapseSectionCodeAction",title:x(1720,"Collapse section"),precondition:M.and(wi.Visible,wi.FilterFocused.negate()),keybinding:{weight:Yn,primary:15}})}run(r){let e=r.get(Yi);e instanceof zo&&e.collapseSection()}});ge(class extends at{constructor(){super({id:"expandSectionCodeAction",title:x(1721,"Expand section"),precondition:M.and(wi.Visible,wi.FilterFocused.negate()),keybinding:{weight:Yn,primary:17}})}run(r){let e=r.get(Yi);e instanceof zo&&e.expandSection()}});ge(class extends at{constructor(){super({id:"toggleSectionCodeAction",title:x(1722,"Toggle section"),precondition:M.and(wi.Visible,wi.FilterFocused.negate()),keybinding:{weight:Yn,primary:10}})}run(r){let e=r.get(Yi);e instanceof zo&&(e.toggleSection()||e.acceptSelected())}});ge(class extends at{constructor(){super({id:uS,title:x(1723,"Accept selected action"),precondition:wi.Visible,keybinding:{weight:Yn,primary:3,secondary:[2137]}})}run(r){let e=r.get(Yi);e instanceof zo&&e.acceptSelected()}});ge(class extends at{constructor(){super({id:gS,title:x(1724,"Preview selected action"),precondition:wi.Visible,keybinding:{weight:Yn,primary:2051}})}run(r){let e=r.get(Yi);e instanceof zo&&e.acceptSelected(!0)}});var y1=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Id=function(r,e){return function(t,i){e(t,i,r)}},pS,fS=class extends E{static{pS=this}static{this.baseId="editor.widget.postEditWidget"}constructor(e,t,i,o,n,s,a,d,l,c,h){super(),this.typeId=e,this.editor=t,this.showCommand=o,this.range=n,this.edits=s,this.onSelectNewEdit=a,this.additionalActions=d,this._keybindingService=c,this._actionWidgetService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(pe(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(pe((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(u=>{this.dispose()})),this._register(xe.runAndSubscribe(c.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){this.button.element.title=this._keybindingService.appendKeybinding(this.showCommand.label,this.showCommand.id)}create(){this.domNode=W(".post-edit-widget"),this.button=this._register(new Ak(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ne(this.domNode,ke.CLICK,()=>this.showSelector()))}getId(){return pS.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){let e=tt(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show("postEditWidget",!1,this.edits.allEdits.map((i,o)=>({kind:"action",item:i,label:i.title,disabled:!1,canPreview:!1,group:{title:"",icon:se.fromId(o===this.edits.activeEditIndex?B.check.id:B.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:i=>{this._actionWidgetService.hide(!1);let o=this.edits.allEdits.findIndex(n=>n===i);if(o!==this.edits.activeEditIndex)return this.onSelectNewEdit(o)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}};fS=pS=y1([Id(8,Q),Id(9,ce),Id(10,Yi)],fS);var Ld=class extends E{constructor(e,t,i,o,n,s,a,d){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=o,this._getAdditionalActions=n,this._instantiationService=s,this._bulkEditService=a,this._notificationService=d,this._currentWidget=this._register(new Re),this._register(xe.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,o,n){if(!e.length||!this._editor.hasModel())return;let s=this._editor.getModel(),a=t.allEdits.at(t.activeEditIndex);if(!a)return;let d=async v=>{let C=this._editor.getModel();C&&(await C.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:v,allEdits:t.allEdits},i,o,n))},l=(v,C)=>{Xt(v)||(this._notificationService.error(C),i&&this.show(e[0],t,d))},c=new Io(this._editor,3,void 0,n),h;try{h=await _D(o(a,c.token),c.token)}catch(v){return l(v,p(976,`Error resolving edit '{0}':
|
|
4
4
|
{1}`,a.title,xd(v)))}finally{c.dispose()}if(n.isCancellationRequested)return;let u=Sm(s.uri,e,h),g=e[0],m=s.deltaDecorations([],[{range:g,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let f,_;try{f=await this._bulkEditService.apply(u,{editor:this._editor,token:n}),_=s.getDecorationRange(m[0])}catch(v){return l(v,p(977,`Error applying edit '{0}':
|
|
5
5
|
{1}`,a.title,xd(v)))}finally{s.deltaDecorations(m,[])}n.isCancellationRequested||i&&f.isApplied&&t.allEdits.length>1&&this.show(_??g,t,d)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(fS,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};Ld=y1([Id(5,U),Id(6,mn),Id(7,Qe)],Ld);var NP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Xn=function(r,e){return function(t,i){e(t,i,r)}},Do,vS="editor.changePasteType",PP="editor.pasteAs.preferences",Im=new ee("pasteWidgetVisible",!1,p(956,"Whether the paste widget is showing")),_S="application/vnd.code.copymetadata",Uo=class extends E{static{Do=this}static{this.ID="editor.contrib.copyPasteActionController"}static get(e){return e.getContribution(Do.ID)}constructor(e,t,i,o,n,s,a,d,l,c){super(),this._logService=i,this._bulkEditService=o,this._clipboardService=n,this._commandService=s,this._configService=a,this._languageFeaturesService=d,this._quickInputService=l,this._progressService=c,this._editor=e,this._register(e.onWillCopy(h=>this.handleCopy(h))),this._register(e.onWillCut(h=>this.handleCopy(h))),this._register(e.onWillPaste(h=>this.handlePaste(h))),this._pasteProgressManager=this._register(new wd("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(Ld,"pasteIntoEditor",e,Im,{id:vS,label:p(957,"Show paste options...")},()=>Do._configureDefaultAction?[Do._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(),i=this._editor._getViewModel(),o=this._editor.getSelections();if(!t||!i||!o?.length)return;let n={multicursorText:e.dataToCopy.multicursorText??null,pasteOnNewLine:e.dataToCopy.isFromEmptySelection,mode:null},s=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(h=>!!h.prepareDocumentPaste);if(!s.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:n});return}let a=new Ng,d=s.flatMap(h=>h.copyMimeTypes??[]),l=dd();this.setCopyMetadata(e.clipboardData,{id:l,providerCopyMimeTypes:d,defaultPastePayload:n});let c=s.map(h=>({providerMimeTypes:h.copyMimeTypes,operation:je(u=>h.prepareDocumentPaste(t,e.dataToCopy.sourceRanges,a,u).catch(g=>{console.error(g)}))}));Do._currentCopyOperation?.operations.forEach(h=>h.operation.cancel()),Do._currentCopyOperation={handle:l,operations:c}}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(_S),Wt.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;let i=this._editor.getModel(),o=this._editor.getSelections();if(!o?.length||!i||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;let n=this.fetchCopyMetadata(e);this._logService.trace("CopyPasteController#handlePaste with metadata : ",n?.id," and text.length : ",e.clipboardData.getData("text/plain").length);let s=Array.from(e.clipboardData.files).map(l=>l.type),a=[...e.clipboardData.types,...s,...n?.providerCopyMimeTypes??[],Zt.uriList],d=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter(l=>{let c=this._pasteAsActionContext?.preferred;return c&&!this.providerMatchesPreference(l,c)?!1:l.pasteMimeTypes?.some(h=>bC(h,a))});if(!d.length){this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(o,this._pasteAsActionContext.preferred),e.setHandled());return}e.setHandled(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,d,o,t,n):this.doPasteInline(d,o,t,n,e.browserEvent)}showPasteAsNoEditMessage(e,t){let i="only"in t?t.only.value:"preferences"in t?t.preferences.length?t.preferences.map(o=>o.value).join(", "):p(958,"empty"):t.providerId;Wt.get(this._editor)?.showMessage(p(959,"No paste edits for '{0}' found",i),e[0].getStartPosition())}doPasteInline(e,t,i,o,n){this._logService.trace("CopyPasteController#doPasteInline");let s=this._editor;if(!s.hasModel())return;let a=new Io(s,3,void 0),d=je(async l=>{let c=this._editor;if(!c.hasModel())return;let h=c.getModel(),u=new T,g=u.add(new Pe(l));u.add(a.token.onCancellationRequested(()=>g.cancel()));let m=g.token;try{if(await this.mergeInDataFromCopy(e,i,o,m),m.isCancellationRequested)return;let f=e.filter(C=>this.isSupportedPasteProvider(C,i));if(!f.length||f.length===1&&f[0]instanceof Zn)return this.applyDefaultPasteHandler(i,o,m,n);let _={triggerKind:ac.Automatic},v=await this.getPasteEdits(f,i,h,t,_,m);if(u.add(v),m.isCancellationRequested)return;if(v.edits.length===1&&v.edits[0].provider instanceof Zn)return this.applyDefaultPasteHandler(i,o,m,n);if(v.edits.length){let C=c.getOption(97).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(h,v.edits),allEdits:v.edits},C,async(I,L)=>{if(!I.provider.resolveDocumentPasteEdit)return I;let b=I.provider.resolveDocumentPasteEdit(I,L),y=new Aa,k=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),p(960,"Resolving paste edit for '{0}'. Click to cancel",I.title),Oo(Promise.race([y.p,b]),L),{cancel:()=>y.cancel()},0);return k&&(I.insertText=k.insertText,I.additionalEdit=k.additionalEdit),I},m)}await this.applyDefaultPasteHandler(i,o,m,n)}finally{u.dispose(),this._currentPasteOperation===d&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),p(961,"Running paste handlers. Click to cancel and do basic paste"),d,{cancel:async()=>{d.cancel(),!a.token.isCancellationRequested&&await this.applyDefaultPasteHandler(i,o,a.token,n)}}).finally(()=>{a.dispose()}),this._currentPasteOperation=d}showPasteAsPick(e,t,i,o,n){this._logService.trace("CopyPasteController#showPasteAsPick");let s=je(async a=>{let d=this._editor;if(!d.hasModel())return;let l=d.getModel(),c=new T,h=c.add(new Io(d,3,void 0,a));try{if(await this.mergeInDataFromCopy(t,o,n,h.token),h.token.isCancellationRequested)return;let u=t.filter(v=>this.isSupportedPasteProvider(v,o,e));e&&(u=u.filter(v=>this.providerMatchesPreference(v,e)));let g={triggerKind:ac.PasteAs,only:e&&"only"in e?e.only:void 0},m=c.add(await this.getPasteEdits(u,o,l,i,g,h.token));if(h.token.isCancellationRequested)return;if(e&&(m={edits:m.edits.filter(v=>"only"in e?e.only.contains(v.kind):"preferences"in e?e.preferences.some(C=>C.contains(v.kind)):e.providerId===v.provider.id),dispose:m.dispose}),!m.edits.length){e&&this.showPasteAsNoEditMessage(i,e);return}let f;if(e)f=m.edits.at(0);else{let v={id:"editor.pasteAs.default",label:p(962,"Configure default paste action"),edit:void 0},C=await this._quickInputService.pick([...m.edits.map(I=>({label:I.title,description:I.kind?.value,edit:I})),...Do._configureDefaultAction?[{type:"separator"},{label:Do._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:p(963,"Select Paste Action")});if(C===v){Do._configureDefaultAction?.run();return}f=C?.edit}if(!f)return;let _=Sm(l.uri,i,f);await this._bulkEditService.apply(_,{editor:this._editor})}finally{c.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:p(964,"Running paste handlers")},()=>s)}setCopyMetadata(e,t){this._logService.trace("CopyPasteController#setCopyMetadata new id : ",t.id),e.setData(_S,JSON.stringify(t))}fetchCopyMetadata(e){this._logService.trace("CopyPasteController#fetchCopyMetadata");let t=e.clipboardData.getData(_S);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,i,o){if(this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ",i?.id),i?.id&&Do._currentCopyOperation?.handle===i.id){let n=Do._currentCopyOperation.operations.filter(a=>e.some(d=>d.pasteMimeTypes.some(l=>bC(l,a.providerMimeTypes)))).map(a=>a.operation),s=await Promise.all(n);if(o.isCancellationRequested)return;for(let a of s.reverse())if(a)for(let[d,l]of a)t.replace(d,l)}if(!t.has(Zt.uriList)){let n=await this._clipboardService.readResources();if(o.isCancellationRequested)return;n.length&&t.append(Zt.uriList,kR(Pg.create(n)))}}async getPasteEdits(e,t,i,o,n,s){let a=new T,d=await Oo(Promise.all(e.map(async c=>{try{let h=await c.provideDocumentPasteEdits?.(i,o,t,n,s);return h&&a.add(h),h?.edits?.map(u=>({...u,provider:c}))}catch(h){Xt(h)||console.error(h);return}})),s),l=pi(d??[]).flat().filter(c=>!n.only||n.only.contains(c.kind));return{edits:wm(l),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,o){let s=await(e.get(Zt.text)??e.get("text"))?.asString()??"";if(i.isCancellationRequested)return;let a={clipboardEvent:o,text:s,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,i){return e.pasteMimeTypes?.some(o=>t.matches(o))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return"only"in t?e.providedPasteEditKinds.some(i=>t.only.contains(i)):"preferences"in t?e.providedPasteEditKinds.some(i=>t.preferences.some(o=>o.contains(i))):e.id===t.providerId}getInitialActiveEditIndex(e,t){let i=this._configService.getValue(PP,{resource:e.uri});for(let o of Array.isArray(i)?i:[]){let n=new We(o),s=t.findIndex(a=>n.contains(a.kind));if(s>=0)return s}return 0}};Uo=Do=NP([Xn(1,U),Xn(2,dt),Xn(3,mn),Xn(4,It),Xn(5,Ae),Xn(6,ae),Xn(7,V),Xn(8,Mt),Xn(9,tk)],Uo);var js="9_cutcopypaste",OP=Cs||document.queryCommandSupported("cut"),I1=Cs||document.queryCommandSupported("copy"),AP=typeof navigator.clipboard>"u"||Hb?document.queryCommandSupported("paste"):!0;function wS(r){return r.register(),r}var FP=OP?wS(new tg({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Cs?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:q.MenubarEditMenu,group:"2_ccp",title:p(849,"Cu&&t"),order:1},{menuId:q.EditorContext,group:js,title:p(850,"Cut"),when:w.writable,order:1},{menuId:q.CommandPalette,group:"",title:p(851,"Cut"),order:1},{menuId:q.SimpleEditorContext,group:js,title:p(852,"Cut"),when:w.writable,order:1}]})):void 0,HP=I1?wS(new tg({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Cs?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:q.MenubarEditMenu,group:"2_ccp",title:p(853,"&&Copy"),order:2},{menuId:q.EditorContext,group:js,title:p(854,"Copy"),order:2},{menuId:q.CommandPalette,group:"",title:p(855,"Copy"),order:1},{menuId:q.SimpleEditorContext,group:js,title:p(856,"Copy"),order:2}]})):void 0;ai.appendMenuItem(q.MenubarEditMenu,{submenu:q.MenubarCopy,title:x(861,"Copy As"),group:"2_ccp",order:3});ai.appendMenuItem(q.EditorContext,{submenu:q.EditorContextCopy,title:x(862,"Copy As"),group:js,order:3});ai.appendMenuItem(q.EditorContext,{submenu:q.EditorContextShare,title:x(863,"Share"),group:"11_share",order:-1,when:M.and(M.notEquals("resourceScheme","output"),w.editorTextFocus)});ai.appendMenuItem(q.ExplorerContext,{submenu:q.ExplorerContextShare,title:x(864,"Share"),group:"11_share",order:-1});var bS=AP?wS(new tg({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Cs?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:q.MenubarEditMenu,group:"2_ccp",title:p(857,"&&Paste"),order:4},{menuId:q.EditorContext,group:js,title:p(858,"Paste"),when:w.writable,order:4},{menuId:q.CommandPalette,group:"",title:p(859,"Paste"),order:1},{menuId:q.SimpleEditorContext,group:js,title:p(860,"Paste"),when:w.writable,order:4}]})):void 0,CS=class extends O{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:x(865,"Copy with Syntax Highlighting"),precondition:void 0,kbOpts:{kbExpr:w.textInputFocus,primary:0,weight:100}})}run(e,t){let i=e.get(dt),o=e.get(It);i.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"),!(!t.hasModel()||!t.getOption(45)&&t.getSelection().isEmpty())&&(pc.forceCopyWithSyntaxHighlighting=!0,t.focus(),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),SS(t,o),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),pc.forceCopyWithSyntaxHighlighting=!1)}};function SS(r,e){if(pc.electronBugWorkaroundCopyEventHasFired=!1,r.getContainerDomNode().ownerDocument.execCommand("copy"),Cs&&pc.electronBugWorkaroundCopyEventHasFired===!1){let{dataToCopy:t}=NR(r._getViewModel(),void 0,Hb);e.writeText(t.text)}}function L1(r,e){r&&(r.addImplementation(1e4,"code-editor",(t,i)=>{let o=t.get(dt),n=t.get(It);o.trace("registerExecCommandImpl (addImplementation code-editor for : ",e,")");let s=t.get(Le).getFocusedCodeEditor();if(s&&s.hasTextFocus()&&s.hasModel()){let a=s.getOption(45),d=s.getSelection();return d&&d.isEmpty()&&!a||(s.getOption(170)&&e==="cut"?(x1(s),o.trace("registerExecCommandImpl (before execCommand copy)"),SS(s,n),s.trigger(void 0,"cut",void 0),o.trace("registerExecCommandImpl (after execCommand copy)")):(x1(s),o.trace("registerExecCommandImpl (before execCommand "+e+")"),e==="copy"?SS(s,n):s.getContainerDomNode().ownerDocument.execCommand(e),o.trace("registerExecCommandImpl (after execCommand "+e+")"))),!0}return!1}),r.addImplementation(0,"generic-dom",(t,i)=>{let o=t.get(dt);return o.trace("registerExecCommandImpl (addImplementation generic-dom for : ",e,")"),o.trace("registerExecCommandImpl (before execCommand "+e+")"),o0().execCommand(e),o.trace("registerExecCommandImpl (after execCommand "+e+")"),!0}))}function x1(r){if(r.getOption(170)){let t=yC.get(r.getId());t&&t.handleWillCopy()}}L1(FP,"cut");L1(HP,"copy");bS&&(bS.addImplementation(1e4,"code-editor",(r,e)=>{let t=r.get(dt);t.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");let i=r.get(Le),o=r.get(It),n=i.getFocusedCodeEditor();if(n&&n.hasModel()&&n.hasTextFocus()){if(n.getOption(170)){let d=yC.get(n.getId());d&&d.handleWillPaste()}t.trace("registerExecCommandImpl (before triggerPaste)");let a=o.triggerPaste(xs().vscodeWindowId);return a?(t.trace("registerExecCommandImpl (triggerPaste defined)"),a.then(async()=>(t.trace("registerExecCommandImpl (after triggerPaste)"),Uo.get(n)?.finishedPaste()??Promise.resolve()))):(t.trace("registerExecCommandImpl (triggerPaste undefined)"),uD?(t.trace("registerExecCommandImpl (Paste handling on web)"),(async()=>{let d=await o.readText();if(d!==""){let l=PR.INSTANCE.get(d),c=!1,h=null,u=null;l&&(c=n.getOption(45)&&!!l.isFromEmptySelection,h=typeof l.multicursorText<"u"?l.multicursorText:null,u=l.mode),t.trace("registerExecCommandImpl (clipboardText.length : ",d.length," id : ",l?.id,")"),n.trigger("keyboard","paste",{text:d,pasteOnNewLine:c,multicursorText:h,mode:u})}})()):!0)}return!1}),bS.addImplementation(0,"generic-dom",(r,e)=>(r.get(dt).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"),r.get(It).triggerPaste(xs().vscodeWindowId)??!1)));I1&&R(CS);var ze=new class{constructor(){this.QuickFix=new We("quickfix"),this.Refactor=new We("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 We("notebook"),this.Source=new We("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}},Vt;(function(r){r.Refactor="refactor",r.RefactorPreview="refactor preview",r.Lightbulb="lightbulb",r.Default="other (default)",r.SourceAction="source action",r.QuickFix="quick fix action",r.FixAll="fix all",r.OrganizeImports="organize imports",r.AutoFix="auto fix",r.QuickFixHover="quick fix hover window",r.OnSave="save participants",r.ProblemsView="problems view"})(Vt||(Vt={}));function E1(r,e){return!(r.include&&!r.include.intersects(e)||r.excludes&&r.excludes.some(t=>R1(e,t,r.include))||!r.includeSourceActions&&ze.Source.contains(e))}function D1(r,e){let t=e.kind?new We(e.kind):void 0;return!(r.include&&(!t||!r.include.contains(t))||r.excludes&&t&&r.excludes.some(i=>R1(t,i,r.include))||!r.includeSourceActions&&t&&ze.Source.contains(t)||r.onlyIncludePreferredActions&&!e.isPreferred)}function R1(r,e,t){return!(!e.contains(r)||t&&e.contains(t))}var Wr=class r{static fromUser(e,t){return!e||typeof e!="object"?new r(t.kind,t.apply,!1):new r(r.getKindFromUser(e,t.kind),r.getApplyFromUser(e,t.apply),r.getPreferredUser(e))}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 We(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}},Lm=class{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(i){De(i)}t&&(this.action.edit=t.edit)}return this}};var Em="editor.action.codeAction",Br="editor.action.quickFix",Ed="editor.action.autoFix",Dm="editor.action.refactor",Rm="editor.action.sourceAction",Tc="editor.action.organizeImports",Mc="editor.action.fixAll",WP=1e3,yS=class r extends E{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:vt(e.diagnostics)?vt(t.diagnostics)?r.codeActionsPreferredComparator(e,t):-1:vt(t.diagnostics)?1:r.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(r.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&ze.QuickFix.contains(new We(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},k1={actions:[],documentation:void 0};async function Vr(r,e,t,i,o,n){let s=i.filter||{},a={...s,excludes:[...s.excludes||[],ze.Notebook]},d={only:s.include?.value,trigger:i.type},l=new Rk(e,n),c=i.type===2,h=BP(r,e,c?a:s),u=new T,g=h.map(async f=>{let _=setTimeout(()=>o.report(f),1250);try{let v=await f.provideCodeActions(e,t,d,l.token);if(l.token.isCancellationRequested)return v?.dispose(),k1;v&&u.add(v);let C=(v?.actions||[]).filter(L=>L&&D1(s,L)),I=zP(f,C,s.include);return{actions:C.map(L=>new Lm(L,f)),documentation:I}}catch(v){if(Xt(v))throw v;return De(v),k1}finally{clearTimeout(_)}}),m=r.onDidChange(()=>{let f=r.all(e);Kt(f,h)||l.cancel()});try{let f=await Promise.all(g),_=f.map(I=>I.actions).flat(),v=[...pi(f.map(I=>I.documentation)),...VP(r,e,i,_)],C=new yS(_,v,u);return u.add(C),C}catch(f){throw u.dispose(),f}finally{m.dispose(),l.dispose()}}function BP(r,e,t){return r.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(o=>E1(t,new We(o))):!0)}function*VP(r,e,t,i){if(e&&i.length)for(let o of r.all(e))o._getAdditionalMenuItems&&(yield*o._getAdditionalMenuItems?.({trigger:t.type,only:t.filter?.include?.value},i.map(n=>n.action)))}function zP(r,e,t){if(!r.documentation)return;let i=r.documentation.map(o=>({kind:new We(o.kind),command:o.command}));if(t){let o;for(let n of i)n.kind.contains(t)&&(o?o.kind.contains(n.kind)&&(o=n):o=n);if(o)return o?.command}for(let o of e)if(o.kind){for(let n of i)if(n.kind.contains(new We(o.kind)))return n.command}}var vn;(function(r){r.OnSave="onSave",r.FromProblemsView="fromProblemsView",r.FromCodeActions="fromCodeActions",r.FromAILightbulb="fromAILightbulb",r.FromProblemsHover="fromProblemsHover"})(vn||(vn={}));async function T1(r,e,t,i,o=oe.None){let n=r.get(mn),s=r.get(Ae),a=r.get(vi),d=r.get(Qe),l=r.get(pd);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),l.playSignal(Rr.codeActionTriggered),await e.resolve(o),!o.isCancellationRequested&&!(e.action.edit?.edits.length&&!(await n.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==vn.OnSave,showPreview:i?.preview,reason:ho.codeAction({kind:e.action.kind,providerId:cg.fromExtensionId(e.provider?.extensionId)})})).isApplied)){if(e.action.command)try{await s.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){let h=UP(c);d.error(typeof h=="string"?h:p(866,"An unknown error occurred while applying the code action"))}setTimeout(()=>l.playSignal(Rr.codeActionApplied),WP)}}function UP(r){return typeof r=="string"?r:r instanceof Error&&typeof r.message=="string"?r.message:void 0}ve.registerCommand("_executeCodeActionProvider",async function(r,e,t,i,o){if(!(e instanceof ue))throw zi();let{codeActionProvider:n}=r.get(V),s=r.get(pt).getModel(e);if(!s)throw zi();let a=X.isISelection(t)?X.liftSelection(t):S.isIRange(t)?s.validateRange(t):void 0;if(!a)throw zi();let d=typeof i=="string"?new We(i):void 0,l=await Vr(n,s,a,{type:1,triggerAction:Vt.Default,filter:{includeSourceActions:!0,include:d}},uo.None,oe.None),c=[],h=Math.min(l.validActions.length,typeof o=="number"?o:0);for(let u=0;u<h;u++)c.push(l.validActions[u].resolve(oe.None));try{return await Promise.all(c),l.validActions.map(u=>u.action)}finally{setTimeout(()=>l.dispose(),100)}});var jP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},KP=function(r,e){return function(t,i){e(t,i,r)}},xS,km=class{static{xS=this}static{this.codeActionCommands=[Dm,Em,Rm,Tc,Mc]}constructor(e){this.keybindingService=e}getResolver(){let e=new Fa(()=>this.keybindingService.getKeybindings().filter(t=>xS.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Tc?i={kind:ze.SourceOrganizeImports.value}:t.command===Mc&&(i={kind:ze.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Wr.fromUser(i,{kind:We.None,apply:"never"})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;let i=new We(e.kind);return t.filter(o=>o.kind.contains(i)).filter(o=>o.preferred?e.isPreferred:!0).reduceRight((o,n)=>o?o.kind.contains(n.kind)?n:o:n,void 0)}};km=xS=jP([KP(0,ce)],km);K("symbolIcon.arrayForeground",Ct,p(1547,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.booleanForeground",Ct,p(1548,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p(1549,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.colorForeground",Ct,p(1550,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.constantForeground",Ct,p(1551,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p(1552,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p(1553,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p(1554,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},p(1555,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p(1556,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.fileForeground",Ct,p(1557,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.folderForeground",Ct,p(1558,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p(1559,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p(1560,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.keyForeground",Ct,p(1561,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.keywordForeground",Ct,p(1562,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},p(1563,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.moduleForeground",Ct,p(1564,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.namespaceForeground",Ct,p(1565,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.nullForeground",Ct,p(1566,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.numberForeground",Ct,p(1567,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.objectForeground",Ct,p(1568,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.operatorForeground",Ct,p(1569,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.packageForeground",Ct,p(1570,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.propertyForeground",Ct,p(1571,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.referenceForeground",Ct,p(1572,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.snippetForeground",Ct,p(1573,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.stringForeground",Ct,p(1574,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.structForeground",Ct,p(1575,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.textForeground",Ct,p(1576,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.typeParameterForeground",Ct,p(1577,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.unitForeground",Ct,p(1578,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));K("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},p(1579,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));var M1=Object.freeze({kind:We.Empty,title:p(902,"More Actions...")}),qP=Object.freeze([{kind:ze.QuickFix,title:p(903,"Quick Fix")},{kind:ze.RefactorExtract,title:p(904,"Extract"),icon:B.wrench},{kind:ze.RefactorInline,title:p(905,"Inline"),icon:B.wrench},{kind:ze.RefactorRewrite,title:p(906,"Rewrite"),icon:B.wrench},{kind:ze.RefactorMove,title:p(907,"Move"),icon:B.wrench},{kind:ze.SurroundWith,title:p(908,"Surround With"),icon:B.surroundWith},{kind:ze.Source,title:p(909,"Source Action"),icon:B.symbolFile},M1]);function N1(r,e,t){if(!e)return r.map(n=>({kind:"action",item:n,group:M1,disabled:!!n.action.disabled,label:n.action.disabled||n.action.title,canPreview:!!n.action.edit?.edits.length}));let i=qP.map(n=>({group:n,actions:[]}));for(let n of r){let s=n.action.kind?new We(n.action.kind):We.None;for(let a of i)if(a.group.kind.contains(s)){a.actions.push(n);break}}let o=[];for(let n of i)if(n.actions.length){o.push({kind:"header",group:n.group});for(let s of n.actions){let a=n.group;o.push({kind:"action",item:s,group:s.action.isAI?{title:a.title,kind:a.kind,icon:B.sparkle}:a,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}}return o}var ES=new ee("supportedCodeAction",""),P1="_typescript.applyFixAllCodeAction",IS=class extends E{constructor(e,t,i,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=o,this._autoTriggerTimer=this._register(new Jo),this.ignoreLightbulbOff=!1,this._register(this._markerService.onMarkerChanged(n=>this._onMarkerChanges(n))),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(i=>qi(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Vt.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;let t=this._editor.getSelection();if(e.type===1)return t;let i=this._editor.getOption(73).enabled;if(!(i===ks.Off&&!this.ignoreLightbulbOff)){{if(i===ks.Off||i===ks.On)return t;if(i===ks.OnCode){if(!t.isEmpty())return t;let n=this._editor.getModel(),{lineNumber:s,column:a}=t.getPosition(),d=n.getLineContent(s);if(d.length===0)return;if(a===1){if(/\s/.test(d[0]))return}else if(a===n.getLineMaxColumn(s)){if(/\s/.test(d[d.length-1]))return}else if(/\s/.test(d[a-2])&&/\s/.test(d[a-1]))return}}return t}}},Ks;(function(r){r.Empty={type:0};class e{constructor(i,o,n){this.trigger=i,this.position=o,this._cancellablePromise=n,this.type=1,this.actions=n.catch(s=>{if(Xt(s))return LS;throw s})}cancel(){this._cancellablePromise.cancel()}}r.Triggered=e})(Ks||(Ks={}));var LS=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),Tm=class extends E{constructor(e,t,i,o,n,s){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=n,this._configurationService=s,this._codeActionOracle=this._register(new Re),this._state=Ks.Empty,this._onDidChangeState=this._register(new z),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new Re),this._disposed=!1,this._ignoreLightbulbOff=!1,this._supportedCodeActions=ES.bindTo(o),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(a=>{a.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Ks.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(Ks.Empty);let e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){let t=this._registry.all(e).flatMap(o=>o.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" "));let i=new IS(this._editor,this._markerService,o=>{if(!o){this.setState(Ks.Empty);return}let n=o.selection.getStartPosition(),s=je(async l=>{if(this._settingEnabledNearbyQuickfixes()&&o.trigger.type===1&&(o.trigger.triggerAction===Vt.QuickFix||o.trigger.filter?.include?.contains(ze.QuickFix))){let h=await Vr(this._registry,e,o.selection,o.trigger,uo.None,l);this.codeActionsDisposable.value=h;let u=[...h.allActions];if(l.isCancellationRequested)return h.dispose(),LS;let g=h.validActions?.some(f=>f.action.kind&&ze.QuickFix.contains(new We(f.action.kind))&&!f.action.isAI),m=this._markerService.read({resource:e.uri});if(g){for(let f of h.validActions)f.action.command?.arguments?.some(_=>typeof _=="string"&&_.includes(P1))&&(f.action.diagnostics=[...m.filter(_=>_.relatedInformation)]);return{validActions:h.validActions,allActions:u,documentation:h.documentation,hasAutoFix:h.hasAutoFix,hasAIFix:h.hasAIFix,allAIFixes:h.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=h}}}else if(!g&&m.length>0){let f=o.selection.getPosition(),_=f,v=Number.MAX_VALUE,C=[...h.validActions];for(let L of m){let b=L.endColumn,y=L.endLineNumber,k=L.startLineNumber;if(y===f.lineNumber||k===f.lineNumber){_=new H(y,b);let P={type:o.trigger.type,triggerAction:o.trigger.triggerAction,filter:{include:o.trigger.filter?.include?o.trigger.filter?.include:ze.QuickFix},autoApply:o.trigger.autoApply,context:{notAvailableMessage:o.trigger.context?.notAvailableMessage||"",position:_}},N=new X(_.lineNumber,_.column,_.lineNumber,_.column),F=await Vr(this._registry,e,N,P,uo.None,l);if(l.isCancellationRequested)return F.dispose(),LS;if(F.validActions.length!==0){for(let A of F.validActions)A.action.command?.arguments?.some(G=>typeof G=="string"&&G.includes(P1))&&(A.action.diagnostics=[...m.filter(G=>G.relatedInformation)]);h.allActions.length===0&&u.push(...F.allActions),Math.abs(f.column-b)<v?C.unshift(...F.validActions):C.push(...F.validActions)}v=Math.abs(f.column-b)}}let I=C.filter((L,b,y)=>y.findIndex(k=>k.action.title===L.action.title)===b);return I.sort((L,b)=>L.action.isPreferred&&!b.action.isPreferred?-1:!L.action.isPreferred&&b.action.isPreferred||L.action.isAI&&!b.action.isAI?1:!L.action.isAI&&b.action.isAI?-1:0),{validActions:I,allActions:u,documentation:h.documentation,hasAutoFix:h.hasAutoFix,hasAIFix:h.hasAIFix,allAIFixes:h.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=h}}}}if(o.trigger.type===1){let h=await Vr(this._registry,e,o.selection,o.trigger,uo.None,l);return this.codeActionsDisposable.value=h,h}let c=await Vr(this._registry,e,o.selection,o.trigger,uo.None,l);return this.codeActionsDisposable.value=c,c});o.trigger.type===1&&this._progressService?.showWhile(s,250);let a=new Ks.Triggered(o.trigger,n,s),d=!1;this._state.type===1&&(d=this._state.trigger.type===1&&a.type===1&&a.trigger.type===2&&this._state.position!==a.position),d?setTimeout(()=>{this.setState(a)},500):this.setState(a)},void 0);i.ignoreLightbulbOff=this._ignoreLightbulbOff,this._codeActionOracle.value=i,this._codeActionOracle.value.trigger({type:2,triggerAction:Vt.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))}};var GP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},$P=function(r,e){return function(t,i){e(t,i,r)}},zr,O1=qe("gutter-lightbulb",B.lightBulb,p(910,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),A1=qe("gutter-lightbulb-auto-fix",B.lightbulbAutofix,p(911,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),F1=qe("gutter-lightbulb-sparkle",B.lightbulbSparkle,p(912,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),H1=qe("gutter-lightbulb-aifix-auto-fix",B.lightbulbSparkleAutofix,p(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.")),W1=qe("gutter-lightbulb-sparkle-filled",B.sparkleFilled,p(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.")),jo;(function(r){r.Hidden={type:0};class e{constructor(i,o,n,s){this.actions=i,this.trigger=o,this.editorPosition=n,this.widgetPosition=s,this.type=1}}r.Showing=e})(jo||(jo={}));function DS(r,e,t,i,o=!1){if(r.validActions.length<=0)return;let n,s=!1;r.allAIFixes?(n=o?W1:B.sparkleFilled,r.validActions.length===1&&(s=!0)):r.hasAutoFix?r.hasAIFix?n=o?H1:B.lightbulbSparkleAutofix:n=o?A1:B.lightbulbAutofix:r.hasAIFix?n=o?F1:B.lightbulbSparkle:n=o?O1:B.lightBulb;let a;return s?a=p(915,"Run: {0}",r.validActions[0].action.title):r.hasAutoFix&&t?a=p(916,"Show Code Actions. Preferred Quick Fix Available ({0})",t):!r.hasAutoFix&&i?a=p(917,"Show Code Actions ({0})",i):a=p(918,"Show Code Actions"),{actions:r,trigger:e,icon:n,autoRun:s,title:a,isGutter:o}}var qs=class extends E{static{zr=this}static{this.GUTTER_DECORATION=J.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:se.asClassName(B.lightBulb),glyphMargin:{position:nc.Left},stickiness:1})}static{this.ID="editor.contrib.lightbulbWidget"}static{this._posPref=[0]}static _computeLightBulbInfo(e,t,i,o){if(e.type===1)return DS(e.actions,e.trigger,i,o,t)}constructor(e,t){super(),this._editor=e,this._keybindingService=t,this.onlyWithEmptySelection=!1,this._onClick=this._register(new z),this.onClick=this._onClick.event,this._state=_e(this,jo.Hidden),this._gutterState=_e(this,jo.Hidden),this._combinedInfo=D(this,i=>{let o=this._gutterState.read(i);if(o.type===1)return zr._computeLightBulbInfo(o,!0,this._preferredKbLabel.read(i),this._quickFixKbLabel.read(i));let n=this._state.read(i);if(n.type===1)return zr._computeLightBulbInfo(n,!1,this._preferredKbLabel.read(i),this._quickFixKbLabel.read(i))}),this._iconClasses=[],this.lightbulbClasses=["codicon-"+O1.id,"codicon-"+H1.id,"codicon-"+A1.id,"codicon-"+F1.id,"codicon-"+W1.id],this._preferredKbLabel=_e(this,void 0),this._quickFixKbLabel=_e(this,void 0),this.gutterDecoration=zr.GUTTER_DECORATION,this._domNode=W("div.lightBulbWidget"),this._domNode.role="listbox",this._register(kg.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{let o=this._editor.getModel(),n=this._state.get();(n.type!==1||!o||n.editorPosition.lineNumber>=o.getLineCount())&&this.hide();let s=this._gutterState.get();(s.type!==1||!o||s.editorPosition.lineNumber>=o.getLineCount())&&this.gutterHide()})),this._register(YD(this._domNode,i=>{let o=this._state.get();if(o.type!==1)return;this._editor.focus(),i.preventDefault();let{top:n,height:s}=tt(this._domNode),a=this._editor.getOption(75),d=Math.floor(a/3);o.widgetPosition.position!==null&&o.widgetPosition.position.lineNumber<o.editorPosition.lineNumber&&(d+=a),this._onClick.fire({x:i.posx,y:n+s+d,actions:o.actions,trigger:o.trigger})})),this._register(ne(this._domNode,"mouseenter",i=>{(i.buttons&1)===1&&this.hide()})),this._register(xe.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(Ed)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(Br)?.getLabel()??void 0,void 0)})),this._register(re(i=>{let o=this._combinedInfo.read(i);this._updateLightBulbTitleAndIcon(o),this._updateGutterDecorationOptions(o)})),this._register(this._editor.onMouseDown(async i=>{if(!i.target.element||!this.lightbulbClasses.some(l=>i.target.element&&i.target.element.classList.contains(l)))return;let o=this._gutterState.get();if(o.type!==1)return;this._editor.focus();let{top:n,height:s}=tt(i.target.element),a=this._editor.getOption(75),d=Math.floor(a/3);o.widgetPosition.position!==null&&o.widgetPosition.position.lineNumber<o.editorPosition.lineNumber&&(d+=a),this._onClick.fire({x:i.event.posx,y:n+s+d,actions:o.actions,trigger:o.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,i){if(e.validActions.length<=0)return this.gutterHide(),this.hide();if(this.onlyWithEmptySelection&&!this._editor.getSelection()?.isEmpty())return this.gutterHide(),this.hide();if(!this._editor.hasTextFocus())return this.gutterHide(),this.hide();if(this._editor.getOptions().get(73).enabled===ks.Off)return this.gutterHide(),this.hide();let s=this._editor.getModel();if(!s)return this.gutterHide(),this.hide();let{lineNumber:a,column:d}=s.validatePosition(i),l=s.getOptions().tabSize,c=this._editor.getOptions().get(59),h=s.getLineContent(a),u=fc(h,l),g=c.spaceWidth*u>22,m=b=>b>2&&this._editor.getTopForLineNumber(b)===this._editor.getTopForLineNumber(b-1),f=this._editor.getLineDecorations(a),_=!1;if(f)for(let b of f){let y=b.options.glyphMarginClassName;if(y&&!this.lightbulbClasses.some(k=>y.includes(k))){_=!0;break}}let v=a,C=1;if(!g){let b=y=>{let k=s.getLineContent(y);return/^\s*$|^\s+/.test(k)||k.length<=C};if(a>1&&!m(a-1)){let y=s.getLineCount(),k=a===y,P=a>1&&b(a-1),N=!k&&b(a+1),F=b(a),A=!N&&!P;if(!N&&!P&&!_)return this._gutterState.set(new jo.Showing(e,t,i,{position:{lineNumber:v,column:C},preference:zr._posPref}),void 0),this.renderGutterLightbub(),this.hide();P||k||P&&!F?v-=1:(N||A&&F)&&(v+=1)}else if(a===1&&(a===s.getLineCount()||!b(a+1)&&!b(a)))if(this._gutterState.set(new jo.Showing(e,t,i,{position:{lineNumber:v,column:C},preference:zr._posPref}),void 0),_)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(a<s.getLineCount()&&!m(a+1))v+=1;else if(d*c.spaceWidth<22)return this.hide();C=/^\S\s*$/.test(s.getLineContent(v))?2:1}this._state.set(new jo.Showing(e,t,i,{position:{lineNumber:v,column:C},preference:zr._posPref}),void 0),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());let I=e.validActions,L=e.validActions[0].action.kind;if(I.length!==1||!L){this._editor.layoutContentWidget(this);return}this._editor.layoutContentWidget(this)}hide(){this._state.get()!==jo.Hidden&&(this._state.set(jo.Hidden,void 0),this._editor.layoutContentWidget(this))}gutterHide(){this._gutterState.get()!==jo.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this._gutterState.set(jo.Hidden,void 0))}_updateLightBulbTitleAndIcon(e){this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],!(!e||e.isGutter)&&(this._domNode.title=e.title,this._iconClasses=se.asClassNameArray(e.icon),this._domNode.classList.add(...this._iconClasses))}_updateGutterDecorationOptions(e){!e||!e.isGutter||(this.gutterDecoration=J.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:se.asClassName(e.icon),glyphMargin:{position:nc.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 S(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(i=>{i.changeDecoration(e,new S(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}};qs=zr=GP([$P(1,ce)],qs);var ZP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Ko=function(r,e){return function(t,i){e(t,i,r)}},Dd,YP="quickfix-edit-highlight",bn=class extends E{static{Dd=this}static{this.ID="editor.contrib.codeActionController"}static get(e){return e.getContribution(Dd.ID)}constructor(e,t,i,o,n,s,a,d,l,c,h,u){super(),this._commandService=a,this._configurationService=d,this._actionWidgetService=l,this._instantiationService=c,this._progressService=h,this._keybindingService=u,this._activeCodeActions=this._register(new Re),this._showDisabled=!1,this._disposed=!1,this._onlyLightBulbWithEmptySelection=!1,this._lightBulbInfoObs=_e(this,void 0),this._preferredKbLabel=_e(this,void 0),this._quickFixKbLabel=_e(this,void 0),this._editor=e,this._model=this._register(new Tm(this._editor,n.codeActionProvider,t,i,s,d)),this._register(this._model.onDidChangeState(g=>this.update(g))),this._register(xe.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(Ed)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(Br)?.getLabel()??void 0,void 0)})),this._lightBulbWidget=new Fa(()=>{let g=this._editor.getContribution(qs.ID);return g&&(this._register(g.onClick(m=>this.showCodeActionsFromLightbulb(m.actions,m))),g.onlyWithEmptySelection=this._onlyLightBulbWithEmptySelection),g}),this._resolver=o.createInstance(km),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 i=e.validActions[0],o=i.action.command;o&&o.id==="inlineChat.start"&&o.arguments&&o.arguments.length>=1&&o.arguments[0]&&(o.arguments[0]={...o.arguments[0],autoSend:!1}),await this.applyCodeAction(i,!1,!1,vn.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,o){if(!this._editor.hasModel())return;Wt.get(this._editor)?.closeMessage();let n=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:o,context:{notAvailableMessage:e,position:n}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,i,o){let n=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(T1,e,o,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Vt.QuickFix,filter:{}}),n.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(o){de(o);return}if(!(this._disposed||this._editor.getSelection()?.startLineNumber!==e.position.lineNumber))if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),this._lightBulbInfoObs.set(DS(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,vn.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){let s=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(s&&s.action.disabled){Wt.get(this._editor)?.showMessage(s.action.disabled,e.trigger.context.position),t.dispose();return}}}let o=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!o&&!t.validActions.length)){Wt.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:o,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:i})=>i.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=J.register({description:"quickfix-highlight",className:YP})}async showCodeActionList(e,t,i){let o=this._editor.createDecorationsCollection(),n=this._editor.getDomNode();if(!n)return;let s=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;let a=H.isIPosition(t)?this.toCoords(t):t,d={onSelect:async(l,c)=>{this.applyCodeAction(l,!0,!!c,i.fromLightbulb?vn.FromAILightbulb:vn.FromCodeActions),this._actionWidgetService.hide(!1),o.clear()},onHide:l=>{this._editor?.focus(),o.clear()},onHover:async(l,c)=>{if(c.isCancellationRequested)return;let h=!1,u=l.action.kind;if(u){let g=new We(u);h=[ze.RefactorExtract,ze.RefactorInline,ze.RefactorRewrite,ze.RefactorMove,ze.Source].some(f=>f.contains(g))}return{canPreview:h||!!l.action.edit?.edits.length}},onFocus:l=>{if(l&&l.action){let c=l.action.ranges,h=l.action.diagnostics;if(o.clear(),c&&c.length>0){let u=h&&h?.length>1?h.map(g=>({range:g,options:Dd.DECORATION})):c.map(g=>({range:g,options:Dd.DECORATION}));o.set(u)}else if(h&&h.length>0){let u=h.map(m=>({range:m,options:Dd.DECORATION}));o.set(u);let g=h[0];if(g.startLineNumber&&g.startColumn){let m=this._editor.getModel()?.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn})?.word;Mi(p(899,"Context: {0} at line {1} and column {2}.",m,g.startLineNumber,g.startColumn))}}}else o.clear()}};this._actionWidgetService.show("codeActionWidget",!0,N1(s,this._shouldShowHeaders(),this._resolver.getResolver()),d,a,n,this._getActionBarActions(e,t,i))}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),i=tt(this._editor.getDomNode()),o=i.left+t.left,n=i.top+t.top+t.height;return{x:o,y:n}}_shouldShowHeaders(){let e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];let o=e.documentation.map(n=>({id:n.id,label:n.title,tooltip:n.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(n.id,...n.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&o.push(this._showDisabled?{id:"hideMoreActions",label:p(900,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:p(901,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),o}};bn=Dd=ZP([Ko(1,Ws),Ko(2,Q),Ko(3,U),Ko(4,V),Ko(5,hn),Ko(6,Ae),Ko(7,ae),Ko(8,Yi),Ko(9,U),Ko(10,hn),Ko(11,ce)],bn);ln((r,e)=>{((o,n)=>{n&&e.addRule(`.monaco-editor ${o} { background-color: ${n}; }`)})(".quickfix-edit-highlight",r.getColor(lR));let i=r.getColor(Cg);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Kn(r.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function Nc(r){return M.regex(ES.keys()[0],new RegExp("(\\s|^)"+Bn(r.value)+"\\b"))}var RS={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:p(867,"Kind of the code action to run.")},apply:{type:"string",description:p(868,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[p(869,"Always apply the first returned code action."),p(870,"Apply the first returned code action if it is the only one."),p(871,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:p(872,"Controls if only preferred code actions should be returned.")}}};function Gs(r,e,t,i,o=Vt.Default){r.hasModel()&&bn.get(r)?.manualTriggerAtCurrentPosition(e,o,t,i)}var Mm=class extends Jt{constructor(){super({id:Br,title:x(889,"Quick Fix..."),precondition:M.and(w.writable,w.hasCodeActionsProvider),icon:B.lightBulb,f1:!0,keybinding:{when:w.textInputFocus,primary:2137,weight:100},menu:{id:q.InlineChatEditorAffordance,group:"1_quickfix",order:0,when:M.and(w.writable,w.hasCodeActionsProvider)}})}runEditorCommand(e,t){return Gs(t,p(873,"No code actions available"),void 0,void 0,Vt.QuickFix)}},Nm=class extends nt{constructor(){super({id:Em,precondition:M.and(w.writable,w.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:RS}]}})}runEditorCommand(e,t,i){let o=Wr.fromUser(i,{kind:We.Empty,apply:"ifSingle"});return Gs(t,typeof i?.kind=="string"?o.preferred?p(874,"No preferred code actions for '{0}' available",i.kind):p(875,"No code actions for '{0}' available",i.kind):o.preferred?p(876,"No preferred code actions available"):p(877,"No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}},Pm=class extends O{constructor(){super({id:Dm,label:x(890,"Refactor..."),precondition:M.and(w.writable,w.hasCodeActionsProvider),kbOpts:{kbExpr:w.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:M.and(w.writable,Nc(ze.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:RS}]}})}run(e,t,i){let o=Wr.fromUser(i,{kind:ze.Refactor,apply:"never"});return Gs(t,typeof i?.kind=="string"?o.preferred?p(878,"No preferred refactorings for '{0}' available",i.kind):p(879,"No refactorings for '{0}' available",i.kind):o.preferred?p(880,"No preferred refactorings available"):p(881,"No refactorings available"),{include:ze.Refactor.contains(o.kind)?o.kind:We.None,onlyIncludePreferredActions:o.preferred},o.apply,Vt.Refactor)}},Om=class extends O{constructor(){super({id:Rm,label:x(891,"Source Action..."),precondition:M.and(w.writable,w.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:M.and(w.writable,Nc(ze.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:RS}]}})}run(e,t,i){let o=Wr.fromUser(i,{kind:ze.Source,apply:"never"});return Gs(t,typeof i?.kind=="string"?o.preferred?p(882,"No preferred source actions for '{0}' available",i.kind):p(883,"No source actions for '{0}' available",i.kind):o.preferred?p(884,"No preferred source actions available"):p(885,"No source actions available"),{include:ze.Source.contains(o.kind)?o.kind:We.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,Vt.SourceAction)}},Am=class extends O{constructor(){super({id:Tc,label:x(892,"Organize Imports"),precondition:M.and(w.writable,Nc(ze.SourceOrganizeImports)),kbOpts:{kbExpr:w.textInputFocus,primary:1581,weight:100},metadata:{description:x(893,"Organize imports in the current file. Also called 'Optimize Imports' by some tools")}})}run(e,t){return Gs(t,p(886,"No organize imports action available"),{include:ze.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Vt.OrganizeImports)}},Fm=class extends O{constructor(){super({id:Mc,label:x(894,"Fix All"),precondition:M.and(w.writable,Nc(ze.SourceFixAll))})}run(e,t){return Gs(t,p(887,"No fix all action available"),{include:ze.SourceFixAll,includeSourceActions:!0},"ifSingle",Vt.FixAll)}},Hm=class extends O{constructor(){super({id:Ed,label:x(895,"Auto Fix..."),precondition:M.and(w.writable,Nc(ze.QuickFix)),kbOpts:{kbExpr:w.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Gs(t,p(888,"No auto fixes available"),{include:ze.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Vt.AutoFix)}};Z(bn.ID,bn,3);Z(qs.ID,qs,4);ge(Mm);R(Pm);R(Om);R(Am);R(Hm);R(Fm);Y(new Nm);si.as($a.Configuration).registerConfiguration({...Yg,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:6,description:p(896,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});si.as($a.Configuration).registerConfiguration({...Yg,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:6,description:p(897,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});si.as($a.Configuration).registerConfiguration({...Yg,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:6,markdownDescription:p(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 $s=class r{constructor(){this.lenses=[]}static{this.Empty=new r}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){Oa(e)&&(this._store??=new T,this._store.add(e));for(let i of e.lenses)this.lenses.push({symbol:i,provider:t})}};async function kS(r,e,t){let i=r.ordered(e),o=new Map,n=new $s,s=i.map(async(a,d)=>{o.set(a,d);try{let l=await Promise.resolve(a.provideCodeLenses(e,t));l&&n.add(l,a)}catch(l){De(l)}});return await Promise.all(s),t.isCancellationRequested?(n.dispose(),$s.Empty):(n.lenses=n.lenses.sort((a,d)=>a.symbol.range.startLineNumber<d.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>d.symbol.range.startLineNumber?1:o.get(a.provider)<o.get(d.provider)?-1:o.get(a.provider)>o.get(d.provider)?1:a.symbol.range.startColumn<d.symbol.range.startColumn?-1:a.symbol.range.startColumn>d.symbol.range.startColumn?1:0),n)}ve.registerCommand("_executeCodeLensProvider",function(r,...e){let[t,i]=e;fe(ue.isUri(t)),fe(typeof i=="number"||!i);let{codeLensProvider:o}=r.get(V),n=r.get(pt).getModel(t);if(!n)throw zi();let s=[],a=new T;return kS(o,n,oe.None).then(d=>{a.add(d);let l=[];for(let c of d.lenses)i==null||c.symbol.command?s.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&l.push(Promise.resolve(c.provider.resolveCodeLens(n,c.symbol,oe.None)).then(h=>s.push(h||c.symbol)));return Promise.all(l)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var XP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},QP=function(r,e){return function(t,i){e(t,i,r)}},MS=Ht("ICodeLensCache"),Wm=class{constructor(e,t){this.lineCount=e,this.data=t}},TS=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new nn(20,.75);let t="codelens/cache";XD(Ra,()=>e.remove(t,1));let i="codelens/cache2",o=e.get(i,1,"{}");this._deserialize(o);let n=xe.filter(e.onWillSaveState,s=>s.reason===_d.SHUTDOWN);xe.once(n)(s=>{e.store(i,this._serialize(),1,1)})}put(e,t){let i=t.lenses.map(s=>({range:s.symbol.range,command:s.symbol.command&&{id:"",title:s.symbol.command?.title}})),o=new $s;o.add({lenses:i},this._fakeProvider);let n=new Wm(e.getLineCount(),o);this._cache.set(e.uri.toString(),n)}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,i]of this._cache){let o=new Set;for(let n of i.data.lenses)o.add(n.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...o.values()]}}return JSON.stringify(e)}_deserialize(e){try{let t=JSON.parse(e);for(let i in t){let o=t[i],n=[];for(let a of o.lines)n.push({range:new S(a,1,a,11)});let s=new $s;s.add({lenses:n},this._fakeProvider),this._cache.set(i,new Wm(o.lineCount,s))}}catch{}}};TS=XP([QP(0,Lt)],TS);ti(MS,TS,1);var NS=class{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,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")}},PS=class r{static{this._idPool=0}constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${r._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();let i=[],o=!1;for(let n=0;n<e.length;n++){let s=e[n];if(s&&(o=!0,s.command)){let a=hk(s.command.title.trim());if(s.command.id){let d=`c${r._idPool++}`;i.push(W("a",{id:d,title:s.command.tooltip,role:"button"},...a)),this._commands.set(d,s.command)}else i.push(W("span",{title:s.command.tooltip},...a));n+1<e.length&&i.push(W("span",void 0,"\xA0|\xA0"))}}o?(Is(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Is(this._domNode,W("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}},Rd=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 i=0,o=t.length;i<o;i++)this._addDecorationsCallbacks[i](t[i])}},B1=J.register({collapseOnReplaceEdit:!0,description:"codelens"}),Pc=class{constructor(e,t,i,o,n,s){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a,d=[];this._data.forEach((l,c)=>{l.symbol.command&&d.push(l.symbol),i.addDecoration({range:l.symbol.range,options:B1},h=>this._decorationIds[c]=h),a?a=S.plusRange(a,l.symbol.range):a=S.lift(l.symbol.range)}),this._viewZone=new NS(a.startLineNumber-1,n,s),this._viewZoneId=o.addZone(this._viewZone),d.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(d,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new PS(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),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{let i=this._editor.getModel().getDecorationRange(e),o=this._data[t].symbol;return!!(i&&S.isEmpty(o.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,o)=>{t.addDecoration({range:i.symbol.range,options:B1},n=>this._decorationIds[o]=n)})}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 i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){let i=e[t];if(i){let{symbol:o}=this._data[t];o.command=i.command||o.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)))}}};var JP=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Oc=function(r,e){return function(t,i){e(t,i,r)}},Ac=class{static{this.ID="css.editor.codeLens"}constructor(e,t,i,o,n,s){this._editor=e,this._languageFeaturesService=t,this._commandService=o,this._notificationService=n,this._codeLensCache=s,this._disposables=new T,this._localToDispose=new T,this._lenses=[],this._oldCodeLensModels=new T,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new Oe(()=>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(a=>{(a.hasChanged(59)||a.hasChanged(25)||a.hasChanged(24))&&this._updateLensStyle(),a.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(),i=this._editor.getOption(24),o=this._editor.getOption(59),{style:n}=this._editor.getContainerDomNode();n.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),n.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),n.setProperty("--vscode-editorCodeLens-fontFeatureSettings",o.fontFeatureSettings),i&&(n.setProperty("--vscode-editorCodeLens-fontFamily",i),n.setProperty("--vscode-editorCodeLens-fontFamilyDefault",id.fontFamily)),this._editor.changeViewZones(s=>{for(let a of this._lenses)a.updateHeight(e,s)})}_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&&Di(()=>{let o=this._codeLensCache.get(e);t===o&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(let o of this._languageFeaturesService.codeLensProvider.all(e))if(typeof o.onDidChange=="function"){let n=o.onDidChange(()=>i.schedule());this._localToDispose.add(n)}let i=new Oe(()=>{let o=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=je(n=>kS(this._languageFeaturesService.codeLensProvider,e,n)),this._getCodeLensModelPromise.then(n=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=n,this._codeLensCache.put(e,n);let s=this._provideCodeLensDebounce.update(e,Date.now()-o);i.delay=s,this._renderCodeLensSymbols(n),this._resolveCodeLensesInViewportSoon()},de)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(pe(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(o=>{this._editor.changeViewZones(n=>{let s=[],a=-1;this._lenses.forEach(l=>{!l.isValid()||a===l.getLineNumber()?s.push(l):(l.update(n),a=l.getLineNumber())});let d=new Rd;s.forEach(l=>{l.dispose(d,n),this._lenses.splice(this._lenses.indexOf(l),1)}),d.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(o=>{o.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(pe(()=>{if(this._editor.getModel()){let o=un.capture(this._editor);this._editor.changeDecorations(n=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(n,s)})}),o.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(o=>{if(o.target.type!==9)return;let n=o.target.element;if(n?.tagName==="SPAN"&&(n=n.parentElement),n?.tagName==="A")for(let s of this._lenses){let a=s.getCommand(n);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(d=>this._notificationService.error(d));break}}})),i.schedule()}_disposeAllLenses(e,t){let i=new Rd;for(let o of this._lenses)o.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t=this._editor.getModel().getLineCount(),i=[],o;for(let a of e.lenses){let d=a.symbol.range.startLineNumber;d<1||d>t||(o&&o[o.length-1].symbol.range.startLineNumber===d?o.push(a):(o=[a],i.push(o)))}if(!i.length&&!this._lenses.length)return;let n=un.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(d=>{let l=new Rd,c=0,h=0;for(;h<i.length&&c<this._lenses.length;){let u=i[h][0].symbol.range.startLineNumber,g=this._lenses[c].getLineNumber();g<u?(this._lenses[c].dispose(l,d),this._lenses.splice(c,1)):g===u?(this._lenses[c].updateCodeLensSymbols(i[h],l),h++,c++):(this._lenses.splice(c,0,new Pc(i[h],this._editor,l,d,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++,h++)}for(;c<this._lenses.length;)this._lenses[c].dispose(l,d),this._lenses.splice(c,1);for(;h<i.length;)this._lenses.push(new Pc(i[h],this._editor,l,d,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),h++;l.commit(a)})}),n.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=[],i=[];if(this._lenses.forEach(s=>{let a=s.computeIfNecessary(e);a&&(t.push(a),i.push(s))}),t.length===0){this._oldCodeLensModels.clear();return}let o=Date.now(),n=je(s=>{let a=t.map((d,l)=>{let c=new Array(d.length),h=d.map((u,g)=>!u.symbol.command&&typeof u.provider.resolveCodeLens=="function"?Promise.resolve(u.provider.resolveCodeLens(e,u.symbol,s)).then(m=>{c[g]=m},De):(c[g]=u.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!s.isCancellationRequested&&!i[l].isDisposed()&&i[l].updateCommands(c)})});return Promise.all(a)});this._resolveCodeLensesPromise=n,this._resolveCodeLensesPromise.then(()=>{let s=this._resolveCodeLensesDebounce.update(e,Date.now()-o);this._resolveCodeLensesScheduler.delay=s,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),n===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},s=>{de(s),n===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}};Ac=JP([Oc(1,V),Oc(2,Et),Oc(3,Ae),Oc(4,Qe),Oc(5,MS)],Ac);Z(Ac.ID,Ac,1);R(class extends O{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:w.hasCodeLensProvider,label:x(920,"Show CodeLens Commands for Current Line")})}async run(e,t){if(!t.hasModel())return;let i=e.get(Mt),o=e.get(Ae),n=e.get(Qe),s=t.getSelection().positionLineNumber,a=t.getContribution(Ac.ID);if(!a)return;let d=await a.getModel();if(!d)return;let l=[];for(let u of d.lenses)u.symbol.command&&u.symbol.range.startLineNumber===s&&l.push({label:u.symbol.command.title,command:u.symbol.command});if(l.length===0)return;let c=await i.pick(l,{canPickMany:!1,placeHolder:p(919,"Select a command")});if(!c)return;let h=c.command;if(d.isDisposed){let g=(await a.getModel())?.lenses.find(m=>m.symbol.range.startLineNumber===s&&m.symbol.command?.title===h.title);if(!g||!g.symbol.command)return;h=g.symbol.command}try{await o.executeCommand(h.id,...h.arguments||[])}catch(u){n.error(u)}}});var eO=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Cn=function(r,e){return function(t,i){e(t,i,r)}},di=class extends gd{constructor(e,t,i,o,n,s,a,d,l,c,h,u,g,m){super(e,{...o.getRawOptions(),overflowWidgetsDomNode:o.getOverflowWidgetsDomNode()},i,n,s,a,d,l,c,h,u,g,m),this._parentEditor=o,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(o.onDidChangeConfiguration(f=>this._onParentConfigurationChanged(f)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){Ga(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};di=eO([Cn(4,U),Cn(5,Le),Cn(6,Ae),Cn(7,Q),Cn(8,Ke),Cn(9,Qe),Cn(10,Ci),Cn(11,Be),Cn(12,V),Cn(13,Dr)],di);function Bm(r){let e=r.get(Le).getFocusedCodeEditor();return e instanceof di?e.getParentEditor():e}var V1=new me(new Wo(0,122,204)),tO={showArrow:!0,showFrame:!0,className:"",frameColor:V1,arrowColor:V1,keepEditorSelection:!1},iO="vs.editor.contrib.zoneWidget",OS=class{constructor(e,t,i,o,n,s,a,d){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=o,this.showInHiddenAreas=a,this.ordinal=d,this._onDomNodeTop=n,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}},AS=class{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}},FS=class r{static{this._IdGenerator=new lk(".arrow-decoration-")}constructor(e){this._editor=e,this._ruleName=r._IdGenerator.nextId(),this._color=null,this._height=-1,this._decorations=this._editor.createDecorationsCollection()}dispose(){this.hide(),cC(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){cC(this._ruleName),X0(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:S.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}},Vm=class{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._isSashResizeHeight=!1,this._viewZone=null,this._disposables=new T,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=I0(t),Ga(this.options,tO,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{let o=this._getWidth(i);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(o)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new FS(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){let t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;let i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash?.layout()}get position(){let e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){let i=S.isIRange(e)?S.lift(e):S.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:J.EMPTY}])}hide(){this._viewZone&&(this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._arrow?.hide(),this._positionMarkerId.clear(),this._isSashResizeHeight=!1}_decoratingElementsHeight(){let e=this.editor.getOption(75),t=0;if(this.options.showArrow){let i=Math.round(e/3);t+=2*i}if(this.options.showFrame){let i=this.options.frameWidth??Math.round(e/9);t+=2*i}return t}_getMaximumHeightInLines(){return Math.max(12,this.editor.getLayoutInfo().height/this.editor.getOption(75)*.8)}_showImpl(e,t){let i=e.getStartPosition(),o=this.editor.getLayoutInfo(),n=this._getWidth(o);this.domNode.style.width=`${n}px`,this.domNode.style.left=this._getLeft(o)+"px";let s=document.createElement("div");s.style.overflow="hidden";let a=this.editor.getOption(75),d=this._getMaximumHeightInLines();d!==void 0&&(t=Math.min(t,d));let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(g=>{this._viewZone&&g.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new OS(s,i.lineNumber,i.column,t,m=>this._onViewZoneTop(m),m=>this._onViewZoneHeight(m),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=g.addZone(this._viewZone),this._overlayWidget=new AS(iO+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this._updateSashEnablement(),this.container&&this.options.showFrame){let g=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=g+"px",this.container.style.borderBottomWidth=g+"px"}let h=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,n),this.options.keepEditorSelection||this.editor.setSelection(e);let u=this.editor.getModel();if(u){let g=u.validateRange(new S(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(g,g.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e,t){let i=this._getMaximumHeightInLines(),o=t&&i!==void 0?Math.min(i,e):e;this._viewZone&&this._viewZone.heightInLines!==o&&(this.editor.changeViewZones(n=>{this._viewZone&&(this._viewZone.heightInLines=o,n.layoutZone(this._viewZone.id))}),this._updateSashEnablement())}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new $n(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines,...this._getResizeBounds()})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){let i=(t.currentY-e.startY)/this.editor.getOption(75),o=i<0?Math.ceil(i):Math.floor(i),n=e.heightInLines+o;n>e.minLines&&n<e.maxLines&&(this._isSashResizeHeight=!0,this._relayout(n))}}))}_updateSashEnablement(){if(this._resizeSash){let{minLines:e,maxLines:t}=this._getResizeBounds();this._resizeSash.state=e===t?0:3}}_getResizeBounds(){return{minLines:5,maxLines:35}}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){let e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}};var z1=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},U1=function(r,e){return function(t,i){e(t,i,r)}},HS=Ht("IPeekViewService");ti(HS,class{constructor(){this._widgets=new Map}addExclusiveWidget(r,e){let t=this._widgets.get(r);t&&(t.listener.dispose(),t.widget.dispose());let i=()=>{let o=this._widgets.get(r);o&&o.widget===e&&(o.listener.dispose(),this._widgets.delete(r))};this._widgets.set(r,{widget:e,listener:e.onDidClose(i)})}},1);var zt;(function(r){r.inPeekEditor=new ee("inReferenceSearchEditor",!0,p(1362,"Whether the current code editor is embedded inside peek")),r.notInPeekEditor=r.inPeekEditor.toNegated()})(zt||(zt={}));var zm=class{static{this.ID="editor.contrib.referenceController"}constructor(e,t){e instanceof di&&zt.inPeekEditor.bindTo(t)}dispose(){}};zm=z1([U1(1,Q)],zm);Z(zm.ID,zm,0);var oO={headerBackgroundColor:me.white,primaryHeadingColor:me.fromHex("#333333"),secondaryHeadingColor:me.fromHex("#6c6c6cb3")},kd=class extends Vm{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new z,this.onDidClose=this._onDidClose.event,Ga(this.options,oO,!1);let o=Ie(this.editor);o.openedPeekWidgets.set(o.openedPeekWidgets.get()+1,void 0)}dispose(){if(!this.disposed){this.disposed=!0,super.dispose(),this._onDidClose.fire(this),this._onDidClose.dispose();let e=Ie(this.editor);e.openedPeekWidgets.set(e.openedPeekWidgets.get()-1,void 0)}}style(e){let t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=W(".head"),this._bodyElement=W(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=W(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),ki(this._titleElement,"click",n=>this._onTitleClick(n))),j(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=W("span.filename"),this._secondaryHeading=W("span.dirname"),this._metaHeading=W("span.meta"),j(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);let i=W(".peekview-actions");j(this._headElement,i);let o=this._getActionBarOptions();this._actionbarWidget=new $i(i,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(this._disposables.add(new on("peekview.close",p(1363,"Close"),se.asClassName(B.close),!0,()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Sk.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:qt(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,ri(this._metaHeading)):Gt(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}let i=Math.ceil(this.editor.getOption(75)*1.2),o=Math.round(e-(i+1));this._doLayoutHead(i,t),this._doLayoutBody(o,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};kd=z1([U1(2,U)],kd);var j1=K("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},p(1364,"Background color of the peek view title area.")),Um=K("peekViewTitleLabel.foreground",{dark:me.white,light:me.black,hcDark:me.white,hcLight:Ms},p(1365,"Color of the peek view title.")),jm=K("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},p(1366,"Color of the peek view title info.")),K1=K("peekView.border",{dark:hc,light:hc,hcDark:Gi,hcLight:Gi},p(1367,"Color of the peek view borders and arrow.")),q1=K("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},p(1368,"Background color of the peek view result list."));K("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:me.white,hcLight:Ms},p(1369,"Foreground color for line nodes in the peek view result list."));K("peekViewResult.fileForeground",{dark:me.white,light:"#1E1E1E",hcDark:me.white,hcLight:Ms},p(1370,"Foreground color for file nodes in the peek view result list."));K("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},p(1371,"Background color of the selected entry in the peek view result list."));K("peekViewResult.selectionForeground",{dark:me.white,light:"#6C6C6C",hcDark:me.white,hcLight:Ms},p(1372,"Foreground color of the selected entry in the peek view result list."));var WS=K("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:me.black,hcLight:me.white},p(1373,"Background color of the peek view editor."));K("peekViewEditorGutter.background",WS,p(1374,"Background color of the gutter in the peek view editor."));K("peekViewEditorStickyScroll.background",WS,p(1375,"Background color of sticky scroll in the peek view editor."));K("peekViewEditorStickyScrollGutter.background",WS,p(1376,"Background color of the gutter part of sticky scroll in the peek view editor."));K("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},p(1377,"Match highlight color in the peek view result list."));K("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},p(1378,"Match highlight color in the peek view editor."));K("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:dn,hcLight:dn},p(1379,"Match highlight border in the peek view editor."));var Xi=class{constructor(e,t,i,o){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=o,this.id=ck.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){let e=this.parent.getPreview(this)?.preview(this.range);return e?p(1131,"{0} in {1} on line {2} at column {3}",e.value,Qt(this.uri),this.range.startLineNumber,this.range.startColumn):p(1130,"in {0} on line {1} at column {2}",Qt(this.uri),this.range.startLineNumber,this.range.startColumn)}},BS=class{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){let i=this._modelReference.object.textEditorModel;if(!i)return;let{startLineNumber:o,startColumn:n,endLineNumber:s,endColumn:a}=e,d=i.getWordUntilPosition({lineNumber:o,column:n-t}),l=new S(o,d.startColumn,o,n),c=new S(s,a,s,1073741824),h=i.getValueInRange(l).replace(/^\s+/,""),u=i.getValueInRange(e),g=i.getValueInRange(c).replace(/\s+$/,"");return{value:h+u+g,highlight:{start:h.length,end:h.length+u.length}}}},Sn=class{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new lo}dispose(){ut(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){let e=this.children.length;return e===1?p(1132,"1 symbol in {0}, full path {1}",Qt(this.uri),this.uri.fsPath):p(1133,"{0} symbols in {1}, full path {2}",e,Qt(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(let t of this.children)if(!this._previews.has(t.uri))try{let i=await e.createModelReference(t.uri);this._previews.set(t.uri,new BS(i))}catch(i){de(i)}return this}},yi=class r{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new z,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;let[i]=e;e.sort(r._compareReferences);let o;for(let n of e)if((!o||!tC.isEqual(o.uri,n.uri,!0))&&(o=new Sn(this,n.uri),this.groups.push(o)),o.children.length===0||r._compareReferences(n,o.children[o.children.length-1])!==0){let s=new Xi(i===n,o,n,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),o.children.push(s)}}dispose(){ut(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new r(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?p(1134,"No results found"):this.references.length===1?p(1135,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?p(1136,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):p(1137,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,o=i.children.indexOf(e),n=i.children.length,s=i.parent.groups.length;return s===1||t&&o+1<n||!t&&o>0?(t?o=(o+1)%n:o=(o+n-1)%n,i.children[o]):(o=i.parent.groups.indexOf(i),t?(o=(o+1)%s,i.parent.groups[o].children[0]):(o=(o+s-1)%s,i.parent.groups[o].children[i.parent.groups[o].children.length-1]))}nearestReference(e,t){let i=this.references.map((o,n)=>({idx:n,prefixLen:Ao(o.uri.toString(),e.toString()),offsetDist:Math.abs(o.range.startLineNumber-t.lineNumber)*100+Math.abs(o.range.startColumn-t.column)})).sort((o,n)=>o.prefixLen>n.prefixLen?-1:o.prefixLen<n.prefixLen?1:o.offsetDist<n.offsetDist?-1:o.offsetDist>n.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(let i of this.references)if(i.uri.toString()===e.toString()&&S.containsPosition(i.range,t))return i}firstReference(){for(let e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return tC.compare(e.uri,t.uri)||S.compareRangesUsingStarts(e.range,t.range)}};var Ym=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Xm=function(r,e){return function(t,i){e(t,i,r)}},VS,Km=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof yi||e instanceof Sn}getChildren(e){if(e instanceof yi)return e.groups;if(e instanceof Sn)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};Km=Ym([Xm(0,ft)],Km);var qm=class{getHeight(){return 23}getTemplateId(e){return e instanceof Sn?Fc.id:Hc.id}},Gm=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof Xi){let t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return Qt(e.uri)}};Gm=Ym([Xm(0,ce)],Gm);var $m=class{getId(e){return e instanceof Xi?e.id:e.uri}},zS=class extends E{constructor(e,t){super(),this._labelService=t;let i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new im(i,{supportHighlights:!0})),this.badge=this._register(new Qk(j(i,W(".count")),{},_k)),e.appendChild(i)}set(e,t){let i=ja(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});let o=e.children.length;this.badge.setCount(o),o>1?this.badge.setTitleFormat(p(1124,"{0} references",o)):this.badge.setTitleFormat(p(1125,"{0} reference",o))}};zS=Ym([Xm(1,fn)],zS);var Fc=class{static{VS=this}static{this.id="FileReferencesRenderer"}constructor(e){this._instantiationService=e,this.templateId=VS.id}renderTemplate(e){return this._instantiationService.createInstance(zS,e)}renderElement(e,t,i){i.set(e.element,Ps(e.filterData))}disposeTemplate(e){e.dispose()}};Fc=VS=Ym([Xm(0,U)],Fc);var US=class extends E{constructor(e){super(),this.label=this._register(new Jk(e))}set(e,t){let i=e.parent.getPreview(e)?.preview(e.range);if(!i||!i.value)this.label.set(`${Qt(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{let{value:o,highlight:n}=i;t&&!Gn.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,Ps(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[n]))}}},Hc=class r{constructor(){this.templateId=r.id}static{this.id="OneReferenceRenderer"}renderTemplate(e){return new US(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}},Zm=class{getWidgetAriaLabel(){return p(1126,"References")}getAriaLabel(e){return e.ariaMessage}};var G1=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Zs=function(r,e){return function(t,i){e(t,i,r)}},jS=class r{static{this.DecorationOptions=J.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"})}constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new T,this._callOnModelChange=new T,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();let e=this._editor.getModel();if(e){for(let t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));let t=[],i=[];for(let o=0,n=e.children.length;o<n;o++){let s=e.children[o];this._decorationIgnoreSet.has(s.id)||s.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:s.range,options:r.DecorationOptions}),i.push(o))}this._editor.changeDecorations(o=>{let n=o.deltaDecorations([],t);for(let s=0;s<n.length;s++)this._decorations.set(n[s],e.children[i[s]])})}_onDecorationChanged(){let e=[],t=this._editor.getModel();if(t){for(let[i,o]of this._decorations){let n=t.getDecorationRange(i);if(!n)continue;let s=!1;if(!S.equalsRange(n,o.range)){if(S.spansMultipleLines(n))s=!0;else{let a=o.range.endColumn-o.range.startColumn,d=n.endColumn-n.startColumn;a!==d&&(s=!0)}s?(this._decorationIgnoreSet.add(o.id),e.push(i)):o.range=n}}for(let i=0,o=e.length;i<o;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}},Qm=class{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{let o=JSON.parse(e);t=o.ratio,i=o.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}},KS=class extends Xk{},qS=class{constructor(e){this.labelService=e,this.disposables=new T}getDragURI(e){return e instanceof Sn?e.uri.toString():e instanceof Xi?kk(e.uri,e.range).toString():null}getDragLabel(e){return e.length===0?void 0:e.map(i=>this.labelService.getUriBasenameLabel(i.uri)).join(", ")}onDragStart(e,t){if(!t.dataTransfer)return;let o=e.elements.map(n=>this.getDragURI(n)).filter(Boolean);o.length&&(t.dataTransfer.setData(vC.RESOURCES,JSON.stringify(o)),t.dataTransfer.setData(vC.TEXT,o.join(`
|