tmagic-editor/playground/assets/editor.api2-legacy-a29CXms_.js
2026-03-19 03:41:09 +00:00

2 lines
3.6 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

System.register(["./chunk-legacy-B9MfnjDG.js","./index-legacy-C1hLlhAy.js"],function(e,t){var i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,b,v,w,C,y,S,x,k,L,D,I,N,E,M,T,R,O,A,P,F,W,B,V,H,z,U,K,q,j,$,G,Z,Y,Q,X,J,ee,te,ie,ne,oe,se,re,ae,le,de,ce,he,ue,ge,pe,me,fe,_e,be,ve,we,Ce,ye,Se,xe,ke,Le,De,Ie,Ne,Ee,Me,Te,Re,Oe,Ae,Pe,Fe,We,Be,Ve,He,ze,Ue,Ke,qe,je,$e,Ge,Ze,Ye,Qe,Xe,Je,et,tt,it,nt,ot,st,rt,at,lt,dt,ct,ht,ut,gt,pt,mt,ft,_t,bt,vt,wt,Ct,yt,St,xt,kt,Lt,Dt,It,Nt,Et,Mt,Tt,Rt,Ot,At,Pt,Ft,Wt,Bt,Vt,Ht,zt,Ut,Kt,qt,jt,$t,Gt,Zt,Yt,Qt,Xt,Jt,ei,ti,ii,ni,oi,si,ri,ai,li,di,ci,hi,ui,gi,pi,mi,fi,_i,bi,vi,wi,Ci,yi,Si,xi,ki,Li,Di,Ii,Ni,Ei,Mi,Ti,Ri,Oi,Ai,Pi,Fi,Wi,Bi,Vi,Hi,zi,Ui,Ki,qi,ji,$i,Gi,Zi,Yi,Qi,Xi,Ji,en,tn,nn,on,sn,rn,an,ln,dn,cn,hn,un,gn,pn,mn,fn,_n,bn,vn,wn,Cn,yn,Sn,xn,kn,Ln,Dn,In,Nn,En,Mn,Tn,Rn,On,An,Pn,Fn,Wn,Bn,Vn,Hn,zn,Un,Kn,qn,jn,$n,Gn,Zn,Yn,Qn,Xn,Jn,eo,to,io,no,oo,so,ro,ao,lo,co,ho,uo,go,po,mo,fo,_o,bo,vo,wo,Co,yo,So,xo,ko,Lo,Do,Io,No,Eo,Mo,To,Ro,Oo,Ao,Po,Fo,Wo,Bo,Vo,Ho,zo,Uo,Ko,qo,jo,$o,Go,Zo,Yo,Qo,Xo,Jo,es,ts,is,ns,os,ss,rs,as,ls,ds,cs,hs,us,gs,ps,ms,fs,_s,bs,vs,ws,Cs,ys,Ss,xs,ks,Ls,Ds,Is,Ns,Es,Ms,Ts,Rs,Os,As,Ps,Fs,Ws,Bs,Vs,Hs,zs,Us,Ks,qs,js,$s,Gs,Zs,Ys,Qs,Xs,Js,er,tr,ir,nr,or,sr,rr,ar,lr,dr,cr,hr,ur,gr,pr,mr,fr,_r,br,vr,wr,Cr,yr,Sr,xr,kr,Lr,Dr,Ir,Nr,Er,Mr,Tr,Rr,Or,Ar,Pr,Fr,Wr,Br,Vr,Hr,zr,Ur,Kr,qr,jr,$r,Gr,Zr,Yr,Qr,Xr,Jr,ea,ta,ia,na,oa,sa,ra,aa,la,da,ca,ha,ua,ga,pa,ma,fa,_a,ba,va,wa,Ca,ya,Sa,xa,ka,La,Da,Ia,Na,Ea,Ma,Ta,Ra,Oa,Aa,Pa,Fa,Wa,Ba,Va,Ha,za,Ua,Ka,qa,ja,$a,Ga,Za,Ya,Qa,Xa,Ja,el,tl,il,nl,ol,sl,rl,al,ll,dl,cl,hl,ul,gl,pl,ml,fl,_l,bl,vl,wl,Cl,yl,Sl,xl,kl,Ll,Dl,Il,Nl,El,Ml,Tl,Rl,Ol,Al,Pl,Fl,Wl,Bl,Vl,Hl,zl,Ul,Kl,ql,jl,$l,Gl,Zl,Yl,Ql,Xl,Jl,ed,td,id,nd,od,sd,rd,ad,ld,dd,cd,hd,ud,gd,pd,md,fd,_d,bd,vd,wd,Cd,yd,Sd,xd,kd,Ld,Dd,Id,Nd,Ed,Md,Td,Rd,Od,Ad,Pd,Fd,Wd,Bd,Vd,Hd,zd,Ud,Kd,qd,jd,$d,Gd,Zd,Yd,Qd,Xd,Jd,ec,tc,ic,nc,oc,sc,rc,ac,lc,dc,cc,hc,uc,gc,pc,mc,fc,_c,bc,vc,wc,Cc,yc,Sc,xc,kc,Lc,Dc,Ic,Nc,Ec,Mc,Tc,Rc,Oc,Ac,Pc,Fc,Wc,Bc,Vc,Hc,zc,Uc,Kc,qc,jc,$c,Gc,Zc,Yc,Qc,Xc,Jc,eh,th,ih,nh,oh,sh,rh,ah,lh,dh,ch,hh,uh,gh,ph,mh,fh,_h,bh,vh,wh,Ch,yh,Sh,xh,kh,Lh,Dh,Ih,Nh,Eh,Mh,Th,Rh,Oh,Ah,Ph,Fh,Wh,Bh,Vh,Hh,zh,Uh,Kh,qh,jh,$h,Gh,Zh,Yh,Qh,Xh,Jh,eu,tu,iu,nu,ou,su,ru,au,lu,du,cu,hu,uu,gu,pu,mu,fu,_u,bu,vu,wu,Cu,yu,Su,xu,ku,Lu,Du,Iu,Nu,Eu,Mu,Tu,Ru,Ou,Au,Pu,Fu,Wu,Bu,Vu,Hu,zu,Uu,Ku,qu,ju,$u,Gu,Zu,Yu,Qu,Xu,Ju,eg,tg,ig,ng,og,sg,rg,ag,lg,dg,cg,hg,ug,gg,pg,mg,fg,_g,bg,vg,wg,Cg,yg,Sg,xg,kg,Lg,Dg,Ig,Ng,Eg,Mg,Tg,Rg,Og,Ag,Pg,Fg,Wg,Bg,Vg,Hg,zg,Ug,Kg,qg,jg,$g,Gg,Zg,Yg,Qg,Xg,Jg,ep,tp,ip,np,op,sp,rp,ap,lp,dp,cp,hp,up,gp,pp,mp,fp,_p,bp,vp,wp,Cp,yp,Sp,xp,kp,Lp,Dp,Ip,Np,Ep,Mp,Tp,Rp,Op,Ap,Pp,Fp,Wp,Bp,Vp,Hp,zp,Up,Kp,qp,jp,$p,Gp,Zp,Yp,Qp,Xp,Jp,em,tm,im,nm,om,sm,rm,am,lm,dm,cm,hm,um,gm,pm,mm,fm,_m,bm,vm,wm,Cm,ym,Sm,xm,km,Lm,Dm,Im,Nm,Em,Mm,Tm,Rm,Om,Am,Pm,Fm,Wm,Bm,Vm,Hm,zm,Um,Km,qm,jm,$m,Gm,Zm,Ym,Qm,Xm,Jm,ef,tf,nf,of,sf,rf,af,lf,df,cf,hf,uf,gf,pf,mf,ff,_f,bf,vf,wf,Cf,yf,Sf,xf,kf,Lf,Df,If,Nf,Ef,Mf,Tf,Rf,Of,Af,Pf,Ff,Wf,Bf,Vf,Hf,zf,Uf,Kf,qf,jf,$f,Gf,Zf,Yf,Qf,Xf,Jf,e_,t_,i_,n_,o_,s_,r_,a_,l_,d_,c_,h_,u_,g_,p_,m_,f_,__,b_,v_,w_,C_,y_,S_,x_,k_,L_,D_,I_,N_,E_,M_,T_,R_,O_,A_,P_,F_,W_,B_,V_,H_,z_,U_,K_,q_,j_,$_,G_,Z_,Y_,Q_,X_,J_,eb,tb,ib,nb,ob,sb,rb,ab,lb,db,cb,hb,ub,gb,pb,mb,fb,_b,bb,vb,wb,Cb,yb,Sb,xb,kb,Lb,Db,Ib,Nb,Eb,Mb,Tb,Rb,Ob,Ab,Pb,Fb,Wb,Bb,Vb,Hb,zb,Ub,Kb,qb,jb,$b,Gb,Zb,Yb,Qb,Xb,Jb,ev,tv,iv,nv,ov,sv,rv,av,lv,dv,cv,hv,uv,gv,pv,mv,fv,_v,bv,vv,wv,Cv,yv,Sv,xv,kv,Lv,Dv,Iv,Nv,Ev,Mv,Tv,Rv,Ov,Av,Pv,Fv,Wv,Bv,Vv,Hv,zv,Uv,Kv,qv,jv,$v,Gv,Zv,Yv,Qv,Xv,Jv,ew,tw,iw,nw,ow,sw,rw,aw,lw,dw,cw,hw,uw,gw,pw,mw,fw,_w,bw,vw,ww,Cw,yw,Sw,xw,kw,Lw,Dw,Iw,Nw,Ew,Mw,Tw,Rw,Ow,Aw,Pw,Fw,Ww,Bw,Vw,Hw,zw,Uw,Kw,qw,jw,$w,Gw,Zw,Yw,Qw,Xw,Jw,eC,tC,iC,nC,oC,sC,rC,aC,lC,dC,cC,hC,uC,gC,pC,mC,fC,_C,bC,vC,wC,CC,yC,SC,xC,kC,LC,DC,IC,NC,EC,MC,TC,RC,OC,AC,PC,FC,WC,BC,VC,HC,zC,UC,KC,qC,jC,$C,GC,ZC,YC,QC,XC,JC,ey,ty,iy,ny,oy,sy,ry,ay,ly,dy,cy,hy,uy,gy,py,my,fy,_y,by,vy,wy,Cy,yy,Sy,xy,ky,Ly,Dy,Iy,Ny,Ey,My,Ty,Ry,Oy,Ay,Py,Fy,Wy,By,Vy,Hy,zy,Uy,Ky,qy,jy,$y,Gy,Zy,Yy,Qy,Xy,Jy,eS,tS,iS,nS,oS,sS,rS,aS,lS,dS,cS,hS,uS,gS,pS,mS,fS,_S,bS,vS,wS,CS,yS,SS,xS,kS,LS,DS,IS,NS,ES,MS,TS,RS,OS,AS,PS,FS,WS,BS,VS,HS,zS,US,KS,qS,jS,$S,GS,ZS,YS,QS,XS,JS,ex,tx,ix,nx,ox,sx,rx,ax,lx,dx,cx,hx,ux,gx,px,mx,fx,_x,bx,vx,wx,Cx,yx,Sx,xx,kx,Lx,Dx,Ix,Nx,Ex,Mx,Tx,Rx,Ox,Ax,Px,Fx,Wx,Bx,Vx,Hx,zx,Ux,Kx,qx,jx,$x,Gx,Zx,Yx,Qx,Xx,Jx,ek,tk,ik,nk,ok,sk,rk,ak,lk,dk,ck,hk,uk,gk,pk,mk,fk,_k,bk,vk,wk,Ck,yk,Sk,xk,kk,Lk,Dk,Ik,Nk,Ek,Mk,Tk,Rk,Ok,Ak,Pk,Fk,Wk,Bk,Vk,Hk,zk,Uk,Kk,qk,jk,$k,Gk,Zk,Yk,Qk,Xk,Jk,eL,tL,iL,nL,oL,sL,rL,aL,lL,dL,cL,hL,uL,gL,pL,mL,fL,_L,bL,vL,wL,CL,yL,SL,xL,kL,LL,DL,IL,NL,EL,ML,TL,RL,OL,AL,PL,FL,WL,BL,VL,HL,zL,UL,KL,qL,jL,$L,GL,ZL,YL,QL,XL,JL,eD,tD,iD,nD,oD,sD,rD,aD,lD,dD,cD,hD,uD,gD,pD,mD,fD,_D,bD,vD,wD,CD,yD,SD,xD,kD,LD,DD,ID,ND,ED,MD,TD,RD,OD,AD,PD,FD,WD,BD,VD,HD,zD,UD,KD,qD,jD,$D,GD,ZD,YD,QD,XD,JD,eI,tI,iI,nI,oI,sI,rI,aI,lI,dI,cI,hI,uI,gI,pI,mI,fI,_I,bI,vI,wI,CI,yI,SI,xI,kI,LI,DI,II,NI,EI,MI,TI,RI,OI,AI,PI,FI,WI,BI,VI,HI,zI,UI,KI,qI,jI,$I,GI,ZI,YI,QI,XI,JI,eN,tN,iN,nN,oN,sN,rN,aN,lN,dN,cN,hN,uN,gN,pN,mN,fN,_N,bN,vN,wN,CN,yN,SN,xN,kN,LN,DN,IN,NN,EN,MN,TN,RN,ON,AN,PN,FN,WN,BN,VN,HN,zN,UN,KN,qN,jN,$N,GN,ZN,YN,QN,XN,JN,eE,tE,iE,nE,oE,sE,rE,aE,lE,dE,cE,hE,uE,gE,pE,mE,fE,_E,bE,vE,wE,CE,yE,SE,xE,kE,LE,DE,IE,NE,EE,ME,TE,RE,OE,AE,PE,FE,WE,BE,VE,HE,zE,UE,KE,qE,jE,$E,GE,ZE,YE,QE,XE,JE,eM,tM,iM,nM,oM,sM,rM,aM,lM,dM,cM,hM,uM,gM,pM,mM,fM,_M,bM,vM,wM,CM,yM,SM,xM,kM,LM,DM,IM,NM,EM,MM,TM,RM,OM,AM,PM,FM,WM,BM,VM,HM,zM,UM,KM,qM,jM,$M,GM,ZM,YM,QM,XM,JM,eT,tT,iT,nT,oT,sT,rT,aT,lT,dT,cT,hT,uT,gT,pT,mT,fT,_T,bT,vT,wT,CT,yT,ST,xT,kT,LT,DT,IT,NT,ET,MT,TT,RT,OT,AT,PT,FT,WT,BT,VT,HT,zT,UT,KT,qT,jT,$T,GT,ZT,YT,QT,XT,JT,eR,tR,iR,nR,oR,sR,rR,aR,lR,dR,cR,hR,uR,gR,pR,mR,fR,_R,bR,vR,wR,CR,yR,SR,xR,kR,LR,DR,IR,NR,ER,MR,TR,RR,OR,AR,PR,FR,WR,BR,VR,HR,zR,UR,KR,qR,jR,$R,GR,ZR,YR,QR,XR,JR,eO,tO,iO,nO,oO,sO,rO,aO,lO,dO,cO,hO,uO,gO,pO,mO,fO,_O,bO,vO,wO,CO,yO,SO,xO,kO,LO,DO,IO,NO,EO,MO,TO,RO,OO,AO,PO,FO,WO,BO,VO,HO,zO,UO,KO,qO,jO,$O,GO,ZO,YO,QO,XO,JO,eA,tA,iA,nA,oA,sA,rA,aA,lA,dA,cA,hA,uA,gA,pA,mA,fA,_A,bA,vA,wA,CA,yA,SA,xA,kA,LA,DA,IA,NA,EA,MA,TA,RA,OA,AA,PA,FA,WA,BA,VA,HA,zA,UA,KA,qA,jA,$A,GA,ZA,YA,QA,XA,JA,eP,tP,iP,nP,oP,sP,rP,aP,lP,dP,cP,hP,uP,gP,pP,mP,fP,_P,bP,vP,wP,CP,yP,SP,xP,kP,LP,DP,IP,NP,EP,MP,TP,RP,OP,AP,PP,FP,WP,BP,VP,HP,zP,UP,KP,qP,jP,$P,GP,ZP,YP,QP,XP,JP,eF,tF,iF,nF,oF,sF,rF,aF,lF,dF,cF,hF,uF,gF,pF,mF,fF,_F,bF,vF,wF,CF,yF,SF,xF,kF,LF,DF,IF,NF,EF,MF,TF,RF,OF,AF,PF,FF,WF,BF,VF,HF,zF,UF,KF,qF,jF,$F,GF,ZF,YF,QF,XF,JF,eW,tW,iW,nW,oW,sW,rW,aW,lW,dW,cW,hW,uW,gW,pW,mW,fW,_W,bW,vW,wW,CW,yW,SW,xW,kW,LW,DW,IW,NW,EW,MW,TW,RW,OW,AW,PW,FW,WW,BW,VW,HW,zW,UW,KW,qW,jW,$W,GW,ZW,YW,QW,XW,JW,eB,tB,iB,nB,oB,sB,rB,aB,lB,dB,cB,hB,uB,gB,pB,mB,fB,_B,bB,vB,wB,CB,yB,SB,xB,kB,LB,DB,IB,NB,EB,MB,TB,RB,OB,AB,PB,FB,WB,BB,VB,HB,zB,UB,KB,qB,jB,$B,GB,ZB,YB,QB,XB,JB,eV,tV,iV,nV,oV,sV,rV,aV,lV,dV,cV,hV,uV,gV,pV,mV,fV,_V,bV,vV,wV,CV,yV,SV,xV,kV,LV,DV,IV,NV,EV,MV,TV,RV,OV,AV,PV,FV,WV,BV,VV,HV,zV,UV,KV,qV,jV,$V,GV,ZV,YV,QV,XV,JV,eH,tH,iH,nH,oH,sH,rH,aH,lH,dH,cH,hH,uH,gH,pH,mH,fH,_H,bH,vH,wH,CH,yH,SH,xH,kH,LH,DH,IH,NH,EH,MH,TH,RH,OH,AH,PH,FH,WH,BH,VH,HH,zH,UH,KH,qH,jH,$H,GH,ZH,YH,QH,XH,JH,ez,tz,iz,nz,oz,sz,rz,az,lz,dz,cz,hz,uz,gz,pz,mz,fz,_z,bz,vz,wz,Cz,yz,Sz,xz,kz,Lz,Dz,Iz,Nz,Ez,Mz,Tz,Rz,Oz,Az,Pz,Fz,Wz,Bz,Vz,Hz,zz,Uz,Kz,qz,jz,$z,Gz,Zz,Yz,Qz,Xz,Jz,eU,tU,iU,nU,oU,sU,rU,aU,lU,dU,cU,hU,uU,gU,pU,mU,fU,_U,bU,vU,wU,CU,yU,SU,xU,kU,LU,DU,IU,NU,EU,MU,TU,RU,OU,AU,PU,FU,WU,BU,VU,HU,zU,UU,KU,qU,jU,$U,GU,ZU,YU,QU,XU,JU,eK,tK,iK,nK,oK,sK,rK,aK,lK,dK,cK,hK,uK,gK,pK,mK,fK,_K,bK,vK,wK,CK,yK,SK,xK,kK,LK,DK,IK,NK,EK,MK,TK,RK,OK,AK,PK,FK,WK,BK,VK,HK,zK,UK,KK,qK,jK,$K,GK,ZK,YK,QK,XK,JK,eq,tq,iq,nq,oq,sq,rq,aq,lq,dq,cq,hq,uq,gq,pq,mq,fq,_q,bq,vq,wq,Cq,yq,Sq,xq,kq,Lq,Dq,Iq,Nq,Eq,Mq,Tq,Rq,Oq,Aq,Pq,Fq,Wq,Bq,Vq,Hq,zq,Uq,Kq,qq,jq,$q,Gq,Zq,Yq,Qq,Xq,Jq,ej,tj,ij,nj,oj,sj,rj,aj,lj,dj,cj,hj,uj,gj,pj,mj,fj,_j,bj,vj,wj,Cj,yj,Sj,xj,kj,Lj,Dj,Ij,Nj,Ej,Mj,Tj,Rj,Oj,Aj,Pj,Fj,Wj,Bj,Vj,Hj,zj,Uj,Kj,qj,jj,$j,Gj,Zj,Yj,Qj,Xj,Jj,e$,t$,i$,n$,o$,s$,r$,a$,l$,d$,c$,h$,u$,g$,p$,m$,f$,_$,b$,v$,w$,C$,y$,S$,x$,k$,L$,D$,I$,N$,E$,M$,T$,R$,O$,A$,P$,F$,W$,B$,V$,H$,z$,U$,K$,q$,j$,$$,G$,Z$,Y$,Q$,X$,J$,eG,tG,iG,nG,oG,sG,rG,aG,lG,dG,cG,hG,uG,gG,pG,mG,fG,_G,bG,vG,wG,CG,yG,SG,xG,kG,LG,DG,IG,NG,EG,MG,TG,RG,OG,AG,PG,FG,WG,BG,VG,HG,zG,UG,KG,qG,jG,$G,GG,ZG,YG,QG,XG,JG,eZ,tZ,iZ,nZ,oZ,sZ,rZ,aZ,lZ,dZ,cZ,hZ,uZ,gZ,pZ,mZ,fZ,_Z,bZ,vZ,wZ,CZ,yZ,SZ,xZ,kZ,LZ,DZ,IZ,NZ,EZ,MZ,TZ,RZ,OZ,AZ,PZ,FZ,WZ,BZ,VZ,HZ,zZ,UZ,KZ,qZ,jZ,$Z,GZ,ZZ,YZ,QZ,XZ,JZ,eY,tY,iY,nY,oY,sY,rY,aY,lY,dY,cY,hY,uY,gY,pY,mY,fY,_Y,bY,vY,wY,CY,yY,SY,xY,kY,LY,DY,IY,NY,EY,MY,TY,RY,OY,AY,PY,FY,WY,BY,VY,HY,zY,UY,KY,qY,jY,$Y,GY,ZY,YY,QY,XY,JY,eQ,tQ,iQ,nQ,oQ,sQ,rQ,aQ,lQ,dQ,cQ,hQ,uQ,gQ,pQ,mQ,fQ,_Q,bQ,vQ,wQ,CQ,yQ,SQ,xQ,kQ,LQ,DQ,IQ,NQ,EQ,MQ,TQ,RQ,OQ,AQ,PQ,FQ,WQ,BQ,VQ,HQ,zQ,UQ,KQ,qQ,jQ,$Q,GQ,ZQ,YQ,QQ,XQ,JQ,eX,tX,iX,nX,oX,sX,rX,aX,lX,dX,cX,hX,uX,gX,pX,mX,fX,_X,bX,vX,wX,CX,yX,SX,xX,kX,LX,DX,IX,NX,EX,MX,TX,RX,OX,AX,PX,FX,WX,BX,VX,HX,zX,UX,KX,qX,jX,$X,GX,ZX,YX,QX,XX,JX,eJ,tJ,iJ,nJ,oJ,sJ,rJ,aJ,lJ,dJ,cJ,hJ,uJ,gJ,pJ,mJ,fJ,_J,bJ,vJ,wJ,CJ,yJ,SJ,xJ,kJ,LJ,DJ,IJ,NJ,EJ,MJ,TJ,RJ,OJ,AJ,PJ,FJ,WJ,BJ,VJ,HJ,zJ,UJ,KJ,qJ,jJ,$J,GJ,ZJ,YJ,QJ,XJ,JJ,e1,t1,i1,n1,o1,s1,r1,a1,l1,d1,c1,h1,u1,g1,p1,m1,f1,_1,b1,v1,w1,C1,y1,S1,x1,k1,L1,D1,I1,N1,E1,M1,T1,R1,O1,A1,P1,F1,W1,B1,V1,H1,z1,U1,K1,q1,j1,$1,G1,Z1,Y1,Q1,X1,J1,e0,t0,i0,n0,o0,s0,r0,a0,l0,d0,c0,h0,u0,g0,p0,m0,f0,_0,b0,v0,w0,C0,y0,S0,x0,k0,L0,D0,I0,N0,E0,M0,T0,R0,O0,A0,P0,F0,W0,B0,V0,H0,z0,U0,K0,q0,j0,$0,G0,Z0,Y0,Q0,X0,J0,e2,t2,i2,n2,o2,s2,r2,a2,l2,d2,c2,h2,u2,g2,p2,m2,f2,_2,b2,v2,w2,C2,y2,S2,x2,k2,L2,D2,I2,N2,E2,M2,T2,R2,O2,A2,P2,F2,W2,B2,V2,H2,z2,U2,K2,q2,j2,$2,G2,Z2,Y2,Q2,X2,J2,e4,t4,i4,n4,o4,s4,r4,a4,l4,d4,c4,h4,u4,g4,p4,m4,f4,_4,b4,v4,w4,C4,y4,S4,x4,k4,L4,D4,I4,N4,E4,M4,T4,R4,O4,A4,P4,F4,W4,B4,V4,H4,z4,U4,K4,q4,j4,$4,G4,Z4,Y4,Q4,X4,J4,e5,t5,i5,n5,o5,s5,r5,a5,l5,d5,c5,h5,u5,g5,p5,m5,f5,_5,b5,v5,w5,C5,y5,S5,x5,k5,L5,D5,I5,N5,E5,M5,T5,R5,O5,A5,P5,F5,W5,B5,V5,H5,z5,U5,K5,q5,j5,$5,G5,Z5,Y5,Q5,X5,J5,e3,t3,i3,n3,o3,s3,r3,a3,l3,d3,c3,h3,u3,g3,p3,m3,f3,_3,b3,v3,w3,C3,y3,S3,x3,k3,L3,D3,I3,N3,E3,M3,T3,R3,O3,A3,P3,F3,W3,B3,V3,H3,z3,U3,K3,q3,j3,$3,G3,Z3,Y3,Q3,X3,J3,e6,t6,i6,n6,o6,s6,r6,a6,l6,d6,c6,h6,u6,g6,p6,m6,f6,_6,b6,v6,w6,C6,y6,S6,x6,k6,L6,D6,I6,N6,E6,M6,T6,R6,O6,A6,P6,F6,W6,B6,V6,H6,z6,U6,K6,q6,j6,$6,G6,Z6,Y6,Q6,X6,J6,e9,t9,i9,n9,o9,s9,r9,a9,l9,d9,c9,h9,u9,g9,p9,m9,f9,_9,b9,v9,w9,C9,y9,S9,x9,k9,L9,D9,I9,N9,E9,M9,T9,R9,O9,A9,P9,F9,W9,B9,V9,H9,z9,U9,K9,q9,j9,$9,G9,Z9,Y9,Q9,X9,J9,e7,t7,i7,n7,o7,s7,r7,a7,l7,d7,c7,h7,u7,g7,p7,m7,f7,_7,b7,v7,w7,C7,y7,S7,x7,k7,L7,D7,I7,N7,E7,M7,T7,R7,O7,A7,P7,F7,W7,B7,V7,H7,z7,U7,K7,q7,j7,$7,G7,Z7,Y7,Q7,X7,J7,e8,t8,i8,n8,o8,s8,r8,a8,l8,d8,c8,h8,u8,g8,p8,m8,f8,_8,b8,v8,w8,C8,y8,S8,x8,k8,L8,D8,I8,N8,E8,M8,T8,R8,O8,A8,P8,F8,W8,B8,V8,H8,z8,U8,K8,q8,j8,$8,G8,Z8,Y8,Q8,X8,J8,eee,tee,iee,nee,oee,see,ree,aee,lee,dee,cee,hee,uee,gee,pee,mee,fee,_ee,bee,vee,wee,Cee,yee,See,xee,kee,Lee,Dee,Iee,Nee,Eee,Mee,Tee,Ree,Oee,Aee,Pee,Fee,Wee,Bee,Vee,Hee,zee,Uee,Kee,qee,jee,$ee,Gee,Zee,Yee,Qee,Xee,Jee,ete,tte,ite,nte,ote,ste,rte,ate,lte,dte,cte,hte,ute,gte,pte,mte,fte,_te,bte,vte,wte,Cte,yte,Ste,xte,kte,Lte,Dte,Ite,Nte,Ete,Mte,Tte,Rte,Ote,Ate,Pte,Fte,Wte,Bte,Vte,Hte,zte,Ute,Kte,qte,jte,$te,Gte,Zte,Yte,Qte,Xte,Jte,eie,tie,iie,nie,oie,sie,rie,aie,lie,die,cie,hie,uie,gie,pie,mie,fie,_ie,bie,vie,wie,Cie,yie,Sie,xie,kie,Lie,Die,Iie,Nie,Eie,Mie,Tie,Rie,Oie,Aie,Pie,Fie,Wie,Bie,Vie,Hie,zie,Uie,Kie,qie,jie,$ie,Gie,Zie,Yie,Qie,Xie,Jie,ene,tne,ine,nne,one,sne,rne,ane,lne,dne,cne,hne,une,gne,pne,mne,fne,_ne,bne,vne,wne,Cne,yne,Sne,xne,kne,Lne,Dne,Ine,Nne,Ene,Mne,Tne,Rne,One,Ane,Pne,Fne,Wne,Bne,Vne,Hne,zne,Une,Kne,qne,jne,$ne,Gne,Zne,Yne,Qne,Xne,Jne,eoe,toe,ioe,noe,ooe,soe,roe,aoe,loe,doe,coe,hoe,uoe,goe,poe,moe,foe,_oe,boe,voe,woe,Coe,yoe,Soe,xoe,koe,Loe,Doe,Ioe,Noe,Eoe,Moe,Toe,Roe,Ooe,Aoe,Poe,Foe,Woe,Boe,Voe,Hoe,zoe,Uoe,Koe,qoe,joe,$oe,Goe,Zoe,Yoe,Qoe,Xoe,Joe,ese,tse,ise,nse,ose,sse,rse,ase,lse,dse,cse,hse,use,gse,pse,mse,fse,_se,bse,vse,wse,Cse,yse,Sse,xse,kse,Lse,Dse,Ise,Nse,Ese,Mse,Tse,Rse,Ose,Ase,Pse,Fse,Wse,Bse,Vse,Hse,zse,Use,Kse,qse,jse,$se,Gse,Zse,Yse,Qse,Xse,Jse,ere,tre,ire,nre,ore,sre,rre,are,lre,dre,cre,hre,ure,gre,pre,mre,fre,_re,bre,vre,wre,Cre,yre,Sre,xre,kre,Lre,Dre,Ire,Nre,Ere,Mre,Tre,Rre,Ore,Are,Pre,Fre,Wre,Bre,Vre,Hre,zre,Ure,Kre,qre,jre,$re,Gre,Zre,Yre,Qre,Xre,Jre,eae,tae,iae,nae,oae,sae,rae,aae,lae,dae,cae,hae,uae,gae,pae,mae,fae,_ae,bae,vae,wae,Cae,yae,Sae,xae,kae,Lae,Dae,Iae,Nae,Eae,Mae,Tae,Rae,Oae,Aae,Pae;function Fae(){return globalThis._VSCODE_NLS_MESSAGES}function Wae(){return globalThis._VSCODE_NLS_LANGUAGE}function Bae(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,(e,i)=>{const n=t[i[0]];let o=e;return"string"==typeof n?o=n:"number"!=typeof n&&"boolean"!=typeof n&&null!=n||(o=String(n)),o}),s&&(i=""+i.replace(/[aouei]/g,"$&$&")+""),i}function Vae(e,t,...i){return Bae("number"==typeof e?Hae(e,t):t,i)}function Hae(e,t){const i=Fae()?.[e];if("string"!=typeof i){if("string"==typeof t)return t;throw new Error(`!!! NLS MISSING: ${e} !!!`)}return i}function zae(e,t,...i){let n;n="number"==typeof e?Hae(e,t):t;const o=Bae(n,i);return{value:o,original:t===n?o:Bae(t,i)}}function Uae(e,t,i){"string"==typeof t&&(t=e.matchMedia(t)),t.addEventListener("change",i)}function Kae(e){return l.INSTANCE.getZoomFactor(e)}function qae(){return globalThis.MonacoEnvironment}function jae(e){_.onUnexpectedError(e)}function $ae(e){Yae(e)||_.onUnexpectedError(e)}function Gae(e){Yae(e)||_.onUnexpectedExternalError(e)}function Zae(e){if(e instanceof Error){const{name:t,message:i,cause:n}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack,noTelemetry:C.isErrorNoTelemetry(e),cause:n?Zae(n):void 0,code:e.code}}return e}function Yae(e){return e instanceof v||e instanceof Error&&"Canceled"===e.name&&"Canceled"===e.message}function Qae(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function Xae(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}function Jae(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function ele(e,t="Unreachable"){throw new Error(t)}function tle(e,t="unexpected state"){if(!e)throw"string"==typeof t?new y(`Assertion Failed: ${t}`):t}function ile(e,t="Soft Assertion Failed"){e||$ae(new y(t))}function nle(e){e()||(e(),$ae(new y("Assertion Failed")))}function ole(e,t){let i=0;for(;i<e.length-1;){if(!t(e[i],e[i+1]))return!1;i++}return!0}function sle(e){return"string"==typeof e}function rle(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function ale(e){const t=Object.getPrototypeOf(Uint8Array);return"object"==typeof e&&e instanceof t}function lle(e){return"number"==typeof e&&!isNaN(e)}function dle(e){return!!e&&"function"==typeof e[Symbol.iterator]}function cle(e){return!0===e||!1===e}function hle(e){return void 0===e}function ule(e){return!gle(e)}function gle(e){return hle(e)||null===e}function ple(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function mle(e){return tle(null!=e,"Argument is `undefined` or `null`."),e}function fle(e){return"function"==typeof e}function _le(e,t){if(sle(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(fle(t)){try{if(e instanceof t)return}catch{}if(!gle(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function ble(){if(!X){X=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2,Q=513===new Uint16Array(e.buffer)[0]}return Q}function vle(e,t){return(e|(65535&t)<<16>>>0)>>>0}function wle(e,t){if("number"==typeof e){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new me(0!==n?[Cle(i,t),Cle(n,t)]:[Cle(i,t)])}{const i=[];for(let n=0;n<e.length;n++)i.push(Cle(e[n],t));return new me(i)}}function Cle(e,t){const i=!!(2048&e),n=!!(256&e);return new pe(2===t?n:i,!!(1024&e),!!(512&e),2===t?i:n,255&e)}function yle(e){if(!e.parent||e.parent===e)return null;try{const t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return null}catch(t){return null}return e.parent}function Sle(e,t){const i=this;let n,o=!1;return function(){return o||(o=!0,n=e.apply(i,arguments)),n}}function xle(e){return"object"==typeof e&&null!==e&&"function"==typeof e.dispose&&0===e.dispose.length}function kle(e){if(ke.is(e)){const i=[];for(const n of e)if(n)try{n.dispose()}catch(t){i.push(t)}if(1===i.length)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function Lle(...e){return Dle(()=>kle(e))}function Dle(e){return new Le(e)}function Ile(e){const t=new ot;return e.add({dispose(){t.cancel()}}),t.token}function Nle(e){return!!e&&"function"==typeof e.then}function Ele(e){const t=new ot,i=e(t.token);let n=!1;const o=new Promise((e,o)=>{const s=t.token.onCancellationRequested(()=>{n=!0,s.dispose(),o(new v)});Promise.resolve(i).then(i=>{s.dispose(),t.dispose(),n?xle(i)&&i.dispose():e(i)},e=>{s.dispose(),t.dispose(),o(e)})});return new class{cancel(){t.cancel(),t.dispose()}then(e,t){return o.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return o.finally(e)}}}function Mle(e,t,i){return new Promise((n,o)=>{const s=t.onCancellationRequested(()=>{s.dispose(),n(i)});e.then(n,o).finally(()=>s.dispose())})}function Tle(e,t){return t?new Promise((i,n)=>{const o=setTimeout(()=>{s.dispose(),i()},e),s=t.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new v)})}):Ele(t=>Tle(e,t))}function Rle(e,t=0,i){const n=setTimeout(()=>{e(),i&&o.dispose()},t),o=Dle(()=>{clearTimeout(n),i?.delete(o)});return i?.add(o),o}function Ole(e,t=e=>!!e,i=null){let n=0;const o=e.length,s=()=>{if(n>=o)return Promise.resolve(i);const r=e[n++];return Promise.resolve(r()).then(e=>t(e)?Promise.resolve(e):s())};return s()}function Ale(e){return e}function Ple(e){return!e||"string"!=typeof e||0===e.trim().length}function Fle(e,...t){return 0===t.length?e:e.replace(Mt,function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]})}function Wle(e){return e.replace(/[<>&]/g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}})}function Ble(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Vle(e,t=" "){return zle(Hle(e,t),t)}function Hle(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function zle(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let o=n,s=-1;for(;s=e.lastIndexOf(t,o-1),-1!==s&&s+i===o;){if(0===s)return"";o=s}return e.substring(0,o)}function Ule(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=Ble(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function Kle(e){return"^"!==e.source&&"^$"!==e.source&&"$"!==e.source&&"^\\s*$"!==e.source&&!(!e.exec("")||0!==e.lastIndex)}function qle(e){return e.split(/\r\n|\r|\n/)}function jle(e){for(let t=0,i=e.length;t<i;t++){const i=e.charCodeAt(t);if(32!==i&&9!==i)return t}return-1}function $le(e,t=0,i=e.length){for(let n=t;n<i;n++){const i=e.charCodeAt(n);if(32!==i&&9!==i)return e.substring(t,n)}return e.substring(t,i)}function Gle(e,t=e.length-1){for(let i=t;i>=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1}function Zle(e,t){return e<t?-1:e>t?1:0}function Yle(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){const n=e.charCodeAt(i),s=t.charCodeAt(o);if(n<s)return-1;if(n>s)return 1}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function Qle(e,t){return Xle(e,t,0,e.length,0,t.length)}function Xle(e,t,i=0,n=e.length,o=0,s=t.length){for(;i<n&&o<s;i++,o++){let r=e.charCodeAt(i),a=t.charCodeAt(o);if(r===a)continue;if(r>=128||a>=128)return Yle(e.toLowerCase(),t.toLowerCase(),i,n,o,s);ede(r)&&(r-=32),ede(a)&&(a-=32);const l=r-a;if(0!==l)return l}const r=n-i,a=s-o;return r<a?-1:r>a?1:0}function Jle(e){return e>=48&&e<=57}function ede(e){return e>=97&&e<=122}function tde(e){return e>=65&&e<=90}function ide(e,t){return e.length===t.length&&0===Xle(e,t)}function nde(e,t){const i=t.length;return i<=e.length&&0===Xle(e,t,0,i)}function ode(e,t){const i=e.length,n=i-t.length;return n>=0&&0===Xle(e,t,n,i)}function sde(e,t){const i=Math.min(e.length,t.length);let n;for(n=0;n<i;n++)if(e.charCodeAt(n)!==t.charCodeAt(n))return n;return i}function rde(e,t){const i=Math.min(e.length,t.length);let n;const o=e.length-1,s=t.length-1;for(n=0;n<i;n++)if(e.charCodeAt(o-n)!==t.charCodeAt(s-n))return n;return i}function ade(e){return 55296<=e&&e<=56319}function lde(e){return 56320<=e&&e<=57343}function dde(e,t){return t-56320+(e-55296<<10)+65536}function cde(e,t,i){const n=e.charCodeAt(i);if(ade(n)&&i+1<t){const t=e.charCodeAt(i+1);if(lde(t))return dde(n,t)}return n}function hde(e,t){return new Rt(e,t).nextGraphemeLength()}function ude(e,t){return new Rt(e,t).prevGraphemeLength()}function gde(e){return Ot||(Ot=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/),Ot.test(e)}function pde(e){return At.test(e)}function mde(e){return Pt.test(e)}function fde(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function _de(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}function bde(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function vde(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function wde(e,t){return 0===e?5!==t&&7!==t:!(2===e&&3===t||4!==e&&2!==e&&3!==e&&4!==t&&2!==t&&3!==t&&(8===e&&(8===t||9===t||11===t||12===t)||!(11!==e&&9!==e||9!==t&&10!==t)||(12===e||10===e)&&10===t||5===t||13===t||7===t||1===e||13===e&&14===t||6===e&&6===t))}function Cde(e,t){if(0===e)return 0;const i=function(e,t){const i=new Tt(t,e);let n=i.prevCodePoint();for(;yde(n)||65039===n||8419===n;){if(0===i.offset)return;n=i.prevCodePoint()}if(!_de(n))return;let o=i.offset;return o>0&&8205===i.prevCodePoint()&&(o=i.offset),o}(e,t);if(void 0!==i)return i;const n=new Tt(t,e);return n.prevCodePoint(),n.offset}function yde(e){return 127995<=e&&e<=127999}function Sde(e,t){if("string"!=typeof e)throw new Jt(t,"string",e)}function xde(e){return e===Yt||e===Qt}function kde(e){return e===Yt}function Lde(e){return e>=qt&&e<=$t||e>=jt&&e<=Gt}function Dde(e,t,i,n){let o="",s=0,r=-1,a=0,l=0;for(let d=0;d<=e.length;++d){if(d<e.length)l=e.charCodeAt(d);else{if(n(l))break;l=Yt}if(n(l)){if(r===d-1||1===a);else if(2===a){if(o.length<2||2!==s||o.charCodeAt(o.length-1)!==Zt||o.charCodeAt(o.length-2)!==Zt){if(o.length>2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(i)),r=d,a=0;continue}if(0!==o.length){o="",s=0,r=d,a=0;continue}}t&&(o+=o.length>0?`${i}..`:"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,d)}`:o=e.slice(r+1,d),s=d-r-1;r=d,a=0}else l===Zt&&-1!==a?++a:a=-1}return o}function Ide(e,t){!function(e,t){if(null===e||"object"!=typeof e)throw new Jt(t,"Object",e)}(t,"pathObject");const i=t.dir||t.root,n=t.base||`${t.name||""}${o=t.ext,o?`${"."===o[0]?"":"."}${o}`:""}`;var o;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}function Nde(e,t,i){let n,o=-1;for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);if(r>=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r||i&&91===r||i&&93===r||i&&58===r)-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),void 0!==n&&(n+=e.charAt(s));else{void 0===n&&(n=e.substr(0,s));const t=wi[r];void 0!==t?(-1!==o&&(n+=encodeURIComponent(e.substring(o,s)),o=-1),n+=t):-1===o&&(o=s)}}return-1!==o&&(n+=encodeURIComponent(e.substring(o))),void 0!==n?n:e}function Ede(e){let t;for(let i=0;i<e.length;i++){const n=e.charCodeAt(i);35===n||63===n?(void 0===t&&(t=e.substr(0,i)),t+=wi[n]):void 0!==t&&(t+=e[i])}return void 0!==t?t:e}function Mde(e,t){let i;return i=e.authority&&e.path.length>1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,P&&(i=i.replace(/\//g,"\\")),i}function Tde(e,t){const i=t?Ede:Nde;let n="",{scheme:o,authority:s,path:r,query:a,fragment:l}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=mi,n+=mi),s){let e=s.indexOf("@");if(-1!==e){const t=s.substr(0,e);s=s.substr(e+1),e=t.lastIndexOf(":"),-1===e?n+=i(t,!1,!1):(n+=i(t.substr(0,e),!1,!1),n+=":",n+=i(t.substr(e+1),!1,!0)),n+="@"}s=s.toLowerCase(),e=s.lastIndexOf(":"),-1===e?n+=i(s,!1,!0):(n+=i(s.substr(0,e),!1,!0),n+=s.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0);e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0,!1)}return a&&(n+="?",n+=i(a,!1,!1)),l&&(n+="#",n+=t?l:Nde(l,!1,!1)),n}function Rde(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+Rde(e.substr(3)):e}}function Ode(e){return e.match(Ci)?e.replace(Ci,e=>Rde(e)):e}function Ade(e,t){return _i.isUri(e)?ide(e.scheme,t):nde(e,t+":")}function Pde(e,...t){return t.some(t=>Ade(e,t))}function Fde(e,t){return(0|e[t+0])>>>0|e[t+1]<<8>>>0}function Wde(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function Bde(e,t){return e[t]*2**24+65536*e[t+1]+256*e[t+2]+e[t+3]}function Vde(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function Hde(e,t){return e[t]}function zde(e,t,i){e[i]=t}function Ude(e){return Kde(e,0)}function Kde(e,t){switch(typeof e){case"object":return null===e?qde(349,t):Array.isArray(e)?(i=e,n=qde(104579,n=t),i.reduce((e,t)=>Kde(t,e),n)):function(e,t){return t=qde(181387,t),Object.keys(e).sort().reduce((t,i)=>(t=jde(i,t),Kde(e[i],t)),t)}(e,t);case"string":return jde(e,t);case"boolean":return function(e,t){return qde(e?433:863,t)}(e,t);case"number":return qde(e,t);case"undefined":return qde(937,t);default:return qde(617,t)}var i,n}function qde(e,t){return(t<<5)-t+e|0}function jde(e,t){t=qde(149417,t);for(let i=0,n=e.length;i<n;i++)t=qde(e.charCodeAt(i),t);return t}function $de(e,t,i=32){const n=i-t;return(e<<t|(~((1<<n)-1)&e)>>>n)>>>0}function Gde(e,t=32){return e instanceof ArrayBuffer?function({buffer:e}){let t="";for(let i=0;i<e.length;i++){const n=e[i];t+=Ei[n>>>4],t+=Ei[15&n]}return t}(Ni.wrap(new Uint8Array(e))):(e>>>0).toString(16).padStart(t/4,"0")}function Zde(e,t,i=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let n=0,o=e.length;n<o;n++)if(!i(e[n],t[n]))return!1;return!0}function Yde(e,t,i){return Qde(e.length,n=>i(e[n],t))}function Qde(e,t){let i=0,n=e-1;for(;i<=n;){const e=(i+n)/2|0,o=t(e);if(o<0)i=e+1;else{if(!(o>0))return e;n=e-1}}return-(i+1)}function Xde(e,t,i){if((e|=0)>=t.length)throw new TypeError("invalid index");const n=t[Math.floor(t.length*Math.random())],o=[],s=[],r=[];for(const a of t){const e=i(a,n);e<0?o.push(a):e>0?s.push(a):r.push(a)}return e<o.length?Xde(e,o,i):e<o.length+r.length?r[0]:Xde(e-(o.length+r.length),s,i)}function Jde(e,t){const i=[];let n;for(const o of e.slice(0).sort(t))n&&0===t(n[0],o)?n.push(o):(n=[o],i.push(n));return i}function*ece(e,t){let i,n;for(const o of e)void 0!==n&&t(n,o)?i.push(o):(i&&(yield i),i=[o]),n=o;i&&(yield i)}function tce(e,t){for(let i=0;i<=e.length;i++)t(0===i?void 0:e[i-1],i===e.length?void 0:e[i])}function ice(e){return e.filter(e=>!!e)}function nce(e){let t=0;for(let i=0;i<e.length;i++)e[i]&&(e[t]=e[i],t+=1);e.length=t}function oce(e){return!Array.isArray(e)||0===e.length}function sce(e){return Array.isArray(e)&&e.length>0}function rce(e,t=e=>e){const i=new Set;return e.filter(e=>{const n=t(e);return!i.has(n)&&(i.add(n),!0)})}function ace(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const n=[];if(i<=t)for(let o=i;o<t;o++)n.push(o);else for(let o=i;o>t;o--)n.push(o);return n}function lce(e,t,i){const n=e.slice(0,t),o=e.slice(t);return n.concat(i,o)}function dce(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function cce(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function hce(e,t){for(const i of t)e.push(i)}function uce(e,t){const i=[];for(const n of e){const e=t(n);void 0!==e&&i.push(e)}return i}function gce(e){return Array.isArray(e)?e:[e]}function pce(e,t,i,n){const o=mce(e,t);let s=e.splice(o,i);return void 0===s&&(s=[]),function(e,t,i){const n=mce(e,t),o=e.length,s=i.length;e.length=o+s;for(let r=o-1;r>=n;r--)e[r+s]=e[r];for(let r=0;r<s;r++)e[r+n]=i[r]}(e,o,n),s}function mce(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}function fce(e,t){return(i,n)=>t(e(i),e(n))}function _ce(e){return(t,i)=>-e(t,i)}function bce(e){return e.reduce((e,t)=>e+t,0)}function vce(){return Bi}function wce(e=Ui){return(t,i)=>Zde(t,i,e)}function Cce(e,t,i){if(void 0!==i){const n=e;return null==n||null==t?t===n:i(n,t)}{const t=e;return(e,i)=>null==e||null==i?i===e:t(e,i)}}function yce(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!yce(e[i],t[i]))return!1;return!0}if(e&&"object"==typeof e&&t&&"object"==typeof t&&Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){const i=e,n=t,o=Object.keys(i),s=Object.keys(n),r=new Set(s);if(o.length!==s.length)return!1;for(const e of o){if(!r.has(e))return!1;if(!yce(i[e],n[e]))return!1}return!0}return!1}function Sce(e,t){const i=ji.get(e);if(i)return i;const n=function(e,t){const i=ji.get(e);if(i)return i;const n=t.owner?function(e){const t=Gi.get(e);if(t)return t;const i=xce(e)??"Object";let n=$i.get(i)??0;n++,$i.set(i,n);const o=1===n?i:`${i}#${n}`;return Gi.set(e,o),o}(t.owner)+".":"";let o;const s=t.debugNameSource;if(void 0!==s){if("function"!=typeof s)return n+s;if(o=s(),void 0!==o)return n+o}const r=t.referenceFn;if(void 0!==r&&(o=kce(r),void 0!==o))return n+o;if(void 0!==t.owner){const i=function(e,t){for(const i in e)if(e[i]===t)return i}(t.owner,e);if(void 0!==i)return n+i}}(e,t);if(n){let t=qi.get(n)??0;t++,qi.set(n,t);const i=1===t?n:`${n}#${t}`;return ji.set(e,i),i}}function xce(e){const t=e.constructor;if(t){if("Object"===t.name)return;return t.name}}function kce(e){const t=e.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t);return(i?i[1]:void 0)?.trim()}function Lce(e){switch(e){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}function Dce(e,t,i=Hi.ofCaller()){return void 0!==t?new Ji(new Ki(e,void 0,t),t,void 0,void 0,Ui,i):new Ji(new Ki(void 0,void 0,e),e,void 0,void 0,Ui,i)}function Ice(e,t,i,n=Hi.ofCaller()){return new en(new Ki(e,void 0,t),t,void 0,void 0,Ui,i,n)}function Nce(e,t,i=Hi.ofCaller()){return new Ji(new Ki(e.owner,e.debugName,e.debugReferenceFn),t,void 0,e.onLastObserverRemoved,e.equalsFn??Ui,i)}function Ece(e,t,i=Hi.ofCaller()){return new Ji(new Ki(e.owner,e.debugName,void 0),t,e.changeTracker,void 0,e.equalityComparer??Ui,i)}function Mce(e,t,i=Hi.ofCaller()){let n,o,s;return void 0===t?(n=e,o=void 0):(o=e,n=t),new Ji(new Ki(o,void 0,n),e=>{s?s.clear():s=new De;const t=n(e);return t&&s.add(t),t},void 0,()=>{s&&(s.dispose(),s=void 0)},Ui,i)}function Tce(e){switch(e){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}function Rce(e,t=Hi.ofCaller()){return new tn(new Ki(void 0,void 0,e),e,void 0,t)}function Oce(e,t,i=Hi.ofCaller()){return new tn(new Ki(e.owner,e.debugName,e.debugReferenceFn??t),t,void 0,i)}function Ace(e,t,i=Hi.ofCaller()){return new tn(new Ki(e.owner,e.debugName,e.debugReferenceFn??t),t,e.changeTracker,i)}function Pce(e){const t=new De,i=Oce({owner:void 0,debugName:void 0,debugReferenceFn:e},i=>{t.clear(),e(i,t)});return Dle(()=>{i.dispose(),t.dispose()})}function Fce(e){const t=new Error("BugIndicatingErrorRecovery: "+e);$ae(t),console.error("recovered from an error that indicates a bug",t)}function Wce(e,t){const i=new on(e,t);try{e(i)}finally{i.finish()}}function Bce(e){if(nn)e(nn);else{const t=new on(e,void 0);nn=t;try{e(t)}finally{t.finish(),nn=void 0}}}function Vce(e,t,i){e?t(e):Wce(t,i)}function Hce(...e){let t,i,n,o;return 2===e.length?[i,n]=e:[t,i,n,o]=e,new sn(new Ki(t,void 0,n),i,n,()=>sn.globalTransaction,Ui,o??Hi.ofCaller())}function zce(e,t,i,n=Hi.ofCaller()){return new sn(new Ki(e.owner,e.debugName,e.debugReferenceFn??i),t,i,()=>sn.globalTransaction,e.equalsFn??Ui,n)}function Uce(e,t){let i,n,o=!1;return Hce(s=>{const r=Rce(r=>{const a=e.read(r);o?(n&&clearTimeout(n),n=setTimeout(()=>{i=a,s()},t)):(o=!0,i=a)});return{dispose(){r.dispose(),o=!1,i=void 0}}},()=>o?i:e.get())}function Kce(e,t){const i=new rn(!0,t);e.addObserver(i);try{i.beginUpdate(e)}finally{i.endUpdate(e)}return Dle(()=>{e.removeObserver(i)})}function qce(e,t){let i;return Nce({owner:e,debugReferenceFn:t},e=>(i=t(e,i),i))}function jce(e,t,i,n){let o=new an(i,n);return Nce({debugReferenceFn:i,owner:e,onLastObserverRemoved:()=>{o.dispose(),o=new an(i)}},e=>(o.setItems(t.read(e)),o.getItems()))}function $ce(e,t){switch(typeof e){case"number":default:return""+e;case"string":return e.length+2<=t?`"${e}"`:`"${e.substr(0,t-7)}"+...`;case"boolean":return e?"true":"false";case"undefined":return"undefined";case"object":return null===e?"null":Array.isArray(e)?function(e,t){let i="[ ",n=!0;for(const o of e){if(n||(i+=", "),i.length-5>t){i+="...";break}n=!1,i+=`${$ce(o,t-i.length)}`}return i+=" ]",i}(e,t):function(e,t){if("function"==typeof e.toString&&e.toString!==Object.prototype.toString){const i=e.toString();return i.length<=t?i:i.substring(0,t-3)+"..."}const i=xce(e);let n=i?i+"(":"{ ",o=!0;for(const[s,r]of Object.entries(e)){if(o||(n+=", "),n.length-5>t){n+="...";break}o=!1,n+=`${s}: ${$ce(r,t-n.length)}`}return n+=i?")":" }",n}(e,t);case"symbol":return e.toString();case"function":return`[[Function${e.name?" "+e.name:""}]]`}}function Gce(e,t){const i=globalThis;let n,o=[];const{channel:s,handler:r}=function(e){let t;const i=i=>(t=i,{sendNotification:t=>{e.sendNotification(t)},sendRequest:e=>{throw new Error("not supported")}});return{channel:i,handler:{handleRequest:e=>"notification"===e.type?t?.handleNotification(e.data):t?.handleRequest(e.data)}}}({sendNotification:e=>{n?n.sendNotification(e):o.push(e)}});let a;return(i.$$debugValueEditor_debugChannels??(i.$$debugValueEditor_debugChannels={}))[e]=e=>{a=t(),n=e;for(const t of o)e.sendNotification(t);return o=[],r},ln.createClient(s,()=>{if(!a)throw new Error("Not supported");return a})}function Zce(e,t){for(const i in t)e[i]&&"object"==typeof e[i]&&t[i]&&"object"==typeof t[i]?Zce(e[i],t[i]):e[i]=t[i]}function Yce(e,t){for(const i in t)null===t[i]?delete e[i]:e[i]&&"object"==typeof e[i]&&t[i]&&"object"==typeof t[i]?Yce(e[i],t[i]):e[i]=t[i]}function Qce(e,t,i=Hi.ofCaller()){let n;return n="string"==typeof e?new Ki(void 0,e,void 0):new Ki(e,void 0,void 0),new cn(n,t,Ui,i)}function Xce(e,t,i=Hi.ofCaller()){let n;return n="string"==typeof e?new Ki(void 0,e,void 0):new Ki(e,void 0,void 0),new hn(n,t,Ui,i)}function Jce(e){for(;e.firstChild;)e.firstChild.remove()}function ehe(e,t,i,n){return new Sn(e,t,i,n)}function the(e,t){return function(i){return t(new Se(e,i))}}function ihe(e,t,i){return ehe(e,U&&oe.pointerEvents?On.POINTER_DOWN:On.MOUSE_DOWN,t,i)}function nhe(e,t,i){return ehe(e,U&&oe.pointerEvents?On.POINTER_UP:On.MOUSE_UP,t,i)}function ohe(e,t,i){return bt(e,t,i)}function she(e){return pn(e).getComputedStyle(e,null)}function rhe(e,t,i){const n=pn(e),o=n.document;if(e!==o.body)return new Tn(e.clientWidth,e.clientHeight);if(U&&n?.visualViewport)return new Tn(n.visualViewport.width,n.visualViewport.height);if(n?.innerWidth&&n.innerHeight)return new Tn(n.innerWidth,n.innerHeight);if(o.body&&o.body.clientWidth&&o.body.clientHeight)return new Tn(o.body.clientWidth,o.body.clientHeight);if(o.documentElement&&o.documentElement.clientWidth&&o.documentElement.clientHeight)return new Tn(o.documentElement.clientWidth,o.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}function ahe(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement;){i-=e.scrollTop;const o=fhe(e)?null:she(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=Mn.getBorderLeftWidth(e),i+=Mn.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function lhe(e){const t=e.getBoundingClientRect(),i=pn(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}function dhe(e){let t=e,i=1;do{const e=she(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==t.ownerDocument.documentElement);return i}function che(e){const t=Mn.getMarginLeft(e)+Mn.getMarginRight(e);return e.offsetWidth+t}function hhe(e){const t=Mn.getBorderLeftWidth(e)+Mn.getBorderRightWidth(e),i=Mn.getPaddingLeft(e)+Mn.getPaddingRight(e);return e.offsetWidth-t-i}function uhe(e){const t=Mn.getBorderTopWidth(e)+Mn.getBorderBottomWidth(e),i=Mn.getPaddingTop(e)+Mn.getPaddingBottom(e);return e.offsetHeight-t-i}function ghe(e){const t=Mn.getMarginTop(e)+Mn.getMarginBottom(e);return e.offsetHeight+t}function phe(e,t){return Boolean(t?.contains(e))}function mhe(e,t,i){return!!function(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}(e,t,i)}function fhe(e){return e&&!!e.host&&!!e.mode}function _he(e){return!!bhe(e)}function bhe(e){for(;e.parentNode;){if(e===e.ownerDocument?.body)return null;e=e.parentNode}return fhe(e)?e:null}function vhe(){let e=yhe().activeElement;for(;e?.shadowRoot;)e=e.shadowRoot.activeElement;return e}function whe(e){return vhe()===e}function Che(e){return phe(vhe(),e)}function yhe(){return _n()<=1?r.document:Array.from(fn()).map(({window:e})=>e.document).find(e=>e.hasFocus())??r.document}function She(){return yhe().defaultView?.window??r}function xhe(e){return e instanceof HTMLElement||e instanceof pn(e).HTMLElement}function khe(e){return e instanceof HTMLAnchorElement||e instanceof pn(e).HTMLAnchorElement}function Lhe(e){return e instanceof SVGElement||e instanceof pn(e).SVGElement}function Dhe(e){return e instanceof MouseEvent||e instanceof pn(e).MouseEvent}function Ihe(e){return e instanceof KeyboardEvent||e instanceof pn(e).KeyboardEvent}function Nhe(e){const t=e;return!(!t||"function"!=typeof t.preventDefault||"function"!=typeof t.stopPropagation)}function Ehe(e){return new Pn(e)}function Mhe(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function The(e,t){return e.insertBefore(t,e.firstChild),t}function Rhe(e,...t){e.textContent="",Mhe(e,...t)}function Ohe(e,t,i,...n){const o=Fn.exec(t);if(!o)throw new Error("Bad use of emmet");const s=o[1]||"div";let r;return r=e!==Wn.HTML?document.createElementNS(e,s):document.createElement(s),o[3]&&(r.id=o[3]),o[4]&&(r.className=o[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?r[e]=t:"selected"===e?t&&r.setAttribute(e,"true"):r.setAttribute(e,t))}),r.append(...n),r}function Ahe(e,t,...i){return Ohe(Wn.HTML,e,t,...i)}function Phe(...e){for(const t of e)t.style.display="",t.removeAttribute("aria-hidden")}function Fhe(...e){for(const t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function Whe(e,t){const i=e.devicePixelRatio*t;return Math.max(1,Math.floor(i))/e.devicePixelRatio}function Bhe(e){r.open(e,"_blank","noopener")}function Vhe(e,...t){let i,n;Array.isArray(t[0])?(i={},n=t[0]):(i=t[0]||{},n=t[1]);const o=Hn.exec(e);if(!o||!o.groups)throw new Error("Bad use of h");const s=o.groups.tag||"div",r=document.createElement(s);o.groups.id&&(r.id=o.groups.id);const a=[];if(o.groups.class)for(const d of o.groups.class.split("."))""!==d&&a.push(d);if(void 0!==i.className)for(const d of i.className.split("."))""!==d&&a.push(d);a.length>0&&(r.className=a.join(" "));const l={};if(o.groups.name&&(l[o.groups.name]=r),n)for(const d of n)xhe(d)?r.appendChild(d):"string"==typeof d?r.append(d):"root"in d&&(Object.assign(l,d),r.appendChild(d.root));for(const[d,c]of Object.entries(i))if("className"!==d)if("style"===d)for(const[e,t]of Object.entries(c))r.style.setProperty(Hhe(e),"number"==typeof t?t+"px":""+t);else"tabIndex"===d?r.tabIndex=c:r.setAttribute(Hhe(d),c.toString());return l.root=r,l}function Hhe(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function zhe(e){return"input"===e.tagName.toLowerCase()||"textarea"===e.tagName.toLowerCase()||xhe(e)&&!!e.editContext}function Uhe(e,t){Lhe(e)?e.setAttribute("class",t):e.className=t}function Khe(e,t,i){if(Yhe(e))i(e.read(t));else if(Array.isArray(e))for(const n of e)Khe(n,t,i);else i(e)}function qhe(e,t){let i="";return Khe(e,t,e=>{e&&(0===i.length?i=e:i+=" "+e)}),i}function jhe(e){return!!Yhe(e)||!!Array.isArray(e)&&e.some(e=>jhe(e))}function $he(e){return"number"==typeof e?e+"px":e}function Ghe(e){return!!Yhe(e)||!!Array.isArray(e)&&e.some(e=>Ghe(e))}function Zhe(e,t,i){null==i?e.removeAttribute(Hhe(t)):e.setAttribute(Hhe(t),String(i))}function Yhe(e){return!!e&&void 0!==e.read&&void 0!==e.reportChanges}function Qhe(e){$n&&(Gn.textContent!==e?(Jce(Zn),Jhe(Gn,e)):(Jce(Gn),Jhe(Zn,e)))}function Xhe(e){$n&&(Yn.textContent!==e?(Jce(Qn),Jhe(Yn,e)):(Jce(Yn),Jhe(Qn,e)))}function Jhe(e,t){Jce(e),t.length>jn&&(t=t.substr(0,jn)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}function eue(e){if(Xn.serviceIds.has(e))return Xn.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t[Xn.DI_TARGET]===t?t[Xn.DI_DEPENDENCIES].push({id:e,index:i}):(t[Xn.DI_DEPENDENCIES]=[{id:e,index:i}],t[Xn.DI_TARGET]=t)}(t,e,n)};return t.toString=()=>e,Xn.serviceIds.set(e,t),t}function tue(e){return{id:e.id,label:e.label,tooltip:e.tooltip??e.label,class:e.class,enabled:e.enabled??!0,checked:e.checked,run:async(...t)=>e.run(...t)}}function iue(e,t){if(sle(t)){const i=co[t];if(void 0===i)throw new Error(`${e} references an unknown codicon: ${t}`);t=i}return co[e]=t,{id:e}}function nue(){return co}function oue(...e){switch(e.length){case 1:return Vae(1693,"Did you mean {0}?",e[0]);case 2:return Vae(1694,"Did you mean {0} or {1}?",e[0],e[1]);case 3:return Vae(1695,"Did you mean {0}, {1} or {2}?",e[0],e[1],e[2]);default:return}}function sue(e,t){return e.cmp(t)}function rue(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):Fo.INSTANCE}function aue(e){let t=null;for(let i=0,n=e.length;i<n;i++){const n=e[i].substituteConstants();if(e[i]!==n&&null===t){t=[];for(let n=0;n<i;n++)t[n]=e[n]}null!==t&&(t[i]=n)}return null===t?e:t}function lue(e,t){return e<t?-1:e>t?1:0}function due(e,t,i,n){return e<i?-1:e>i?1:t<n?-1:t>n?1:0}function cue(e,t){if(0===e.type||1===t.type)return!0;if(9===e.type)return 9===t.type&&hue(e.expr,t.expr);if(9===t.type){for(const i of t.expr)if(cue(e,i))return!0;return!1}if(6===e.type){if(6===t.type)return hue(t.expr,e.expr);for(const i of e.expr)if(cue(i,t))return!0;return!1}return e.equals(t)}function hue(e,t){let i=0,n=0;for(;i<e.length&&n<t.length;){const o=e[i].cmp(t[n]);if(o<0)return!1;0===o?(i++,n++):n++}return i===e.length}function uue(e){return 9===e.type?e.expr:[e]}function gue(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.command<t.command)return-1;if(e.command>t.command)return 1}return e.weight2-t.weight2}function pue(e){return void 0!==e.command}function mue(e){const t=[],i=new e,{f1:n,menu:o,keybinding:s,...r}=i.desc;if(_o.getCommand(r.id))throw new Error(`Cannot register two commands with the same id: ${r.id}`);if(t.push(_o.registerCommand({id:r.id,handler:(e,...t)=>i.run(e,...t),metadata:r.metadata??{description:i.desc.title}})),Array.isArray(o))for(const a of o)t.push(us.appendMenuItem(a.id,{command:{...r,precondition:null===a.precondition?void 0:r.precondition},...a}));else o&&t.push(us.appendMenuItem(o.id,{command:{...r,precondition:null===o.precondition?void 0:r.precondition},...o}));if(n&&(t.push(us.appendMenuItem(ds.CommandPalette,{command:r,when:r.precondition})),t.push(us.addCommand(r))),Array.isArray(s))for(const a of s)t.push(ns.registerKeybindingRule({...a,id:r.id,when:r.precondition?Po.and(r.precondition,a.when):a.when}));else s&&t.push(ns.registerKeybindingRule({...s,id:r.id,when:r.precondition?Po.and(r.precondition,s.when):s.when}));return{dispose(){kle(t)}}}function fue(e){return 47===e||92===e}function _ue(e){return e.replace(/[\\/]/g,ni.sep)}function bue(e,t=ni.sep){if(!e)return"";const i=e.length,n=e.charCodeAt(0);if(fue(n)){if(fue(e.charCodeAt(1))&&!fue(e.charCodeAt(2))){let n=3;const o=n;for(;n<i&&!fue(e.charCodeAt(n));n++);if(o!==n&&!fue(e.charCodeAt(n+1)))for(n+=1;n<i;n++)if(fue(e.charCodeAt(n)))return e.slice(0,n+1).replace(/[\\/]/g,t)}return t}if(wue(n)&&58===e.charCodeAt(1))return fue(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);let o=e.indexOf("://");if(-1!==o)for(o+=3;o<i;o++)if(fue(e.charCodeAt(o)))return e.slice(0,o+1);return""}function vue(e,t,i,n=ci){if(e===t)return!0;if(!e||!t)return!1;if(t.length>e.length)return!1;if(i){if(!nde(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function wue(e){return e>=65&&e<=90||e>=97&&e<=122}function Cue(e){return Mde(e,!0)}function yue(e,t){return e!==js.Off&&e<=t}function Sue(e,t){_o.registerCommand(e,function(e,...i){const n=e.get(Jn),[o,s]=i;ple(_i.isUri(o)),ple(to.isIPosition(s));const r=e.get(io).getModel(o);if(r){const e=to.lift(s);return n.invokeFunction(t,r,e,...i.slice(2))}return e.get(no).createModelReference(o).then(e=>new Promise((o,r)=>{try{o(n.invokeFunction(t,e.object.textEditorModel,to.lift(s),i.slice(2)))}catch(a){r(a)}}).finally(()=>{e.dispose()}))})}function xue(e){return hr.INSTANCE.registerEditorCommand(e),e}function kue(e){const t=new e;return hr.INSTANCE.registerEditorAction(t),t}function Lue(e){return hr.INSTANCE.registerEditorAction(e),e}function Due(e){hr.INSTANCE.registerEditorAction(e)}function Iue(e,t,i){hr.INSTANCE.registerEditorContribution(e,t,i)}function Nue(e){return e.register(),e}function Eue(e,t){const i=e.getCount(),n=e.findTokenIndexAtOffset(t),o=e.getLanguageId(n);let s=n;for(;s+1<i&&e.getLanguageId(s+1)===o;)s++;let r=n;for(;r>0&&e.getLanguageId(r-1)===o;)r--;return new _r(e,o,r,s+1,e.getStartOffset(r),e.getEndOffset(s))}function Mue(e){return!!(3&e)}function Tue(e,t,i){let n=jle(e);return-1===n&&(n=e.length),function(e,t,i){let n=0;for(let s=0;s<e.length;s++)"\t"===e.charAt(s)?n=br.nextIndentTabStop(n,t):n++;let o="";if(!i){const e=Math.floor(n/t);n%=t;for(let t=0;t<e;t++)o+="\t"}for(let s=0;s<n;s++)o+=" ";return o}(e.substring(0,n),t,i)+e.substring(n)}function Rue(e){return"'"===e||'"'===e||"`"===e}function Oue(e,t,i){if(i<0)throw new Error("Unexpected negative delta");const n=e.getLineCount();let o=new to(n,e.getLineMaxColumn(n));for(let s=t.lineNumber;s<=n;s++)if(s===t.lineNumber){const n=i-e.getLineMaxColumn(t.lineNumber)+t.column;if(n<=0){o=new to(t.lineNumber,t.column+i);break}i=n}else{const t=i-e.getLineMaxColumn(s);if(t<=0){o=new to(s,i);break}i=t}return o}function Aue(e){return e<0?0:e>255?255:0|e}function Pue(e){return e<0?0:e>4294967295?4294967295:0|e}function Fue(e,t){const i=`${e}/${t.join(",")}`;let n=qr.get(i);return n||(n=new Kr(e,t),qr.set(i,n)),n}function Wue(e){return e.filter(e=>Boolean(e))}function Bue(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.entries(e).forEach(([e,i])=>{t[e]=i&&"object"==typeof i?Bue(i):i}),t}function Vue(e,t){return Hue(e,t,new Set)}function Hue(e,t,i){if(gle(e))return e;const n=t(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];for(const o of e)n.push(Hue(o,t,i));return n}if(rle(e)){if(i.has(e))throw new Error("Cannot clone recursive data-structure");i.add(e);const n={};for(const o in e)Gr.call(e,o)&&(n[o]=Hue(e[o],t,i));return i.delete(e),n}return e}function zue(e,t,i=!0){return rle(e)?(rle(t)&&Object.keys(t).forEach(n=>{n in e?i&&(rle(e[n])&&rle(t[n])?zue(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]}),e):t}function Uue(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let i,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(!Uue(e[i],t[i]))return!1}else{const o=[];for(n in e)o.push(n);o.sort();const s=[];for(n in t)s.push(n);if(s.sort(),!Uue(o,s))return!1;for(i=0;i<o.length;i++)if(!Uue(e[o[i]],t[o[i]]))return!1}return!0}function Kue(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}function que(e,t,i){e.has(t)?e.get(t).push(i):e.set(t,[i])}function jue(e){let t=ca;if(e&&e instanceof RegExp)if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}return t.lastIndex=0,t}function $ue(e,t,i,n,o){if(t=jue(t),o||(o=ke.first(ha)),i.length>o.maxLen){let s=e-o.maxLen/2;return s<0?s=0:n+=s,$ue(e,t,i=i.substring(s,e+o.maxLen/2),n,o)}const s=Date.now(),r=e-1-n;let a=-1,l=null;for(let d=1;!(Date.now()-s>=o.timeBudget);d++){const e=r-o.windowSize*d;t.lastIndex=Math.max(0,e);const n=Gue(t,i,r,a);if(!n&&l)break;if(l=n,e<=0)break;a=e}if(l){const e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function Gue(e,t,i,n){let o;for(;o=e.exec(t);){const t=o.index||0;if(t<=i&&e.lastIndex>=i)return o;if(n>0&&t>n)return null}return null}function Zue(){return pa||(pa=new TextDecoder("UTF-16LE")),pa}function Yue(){return fa||(fa=ble()?Zue():(ma||(ma=new TextDecoder("UTF-16BE")),ma)),fa}function Que(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?function(e,t,i){const n=[];let o=0;for(let s=0;s<i;s++){const i=Fde(e,t);t+=2,n[o++]=String.fromCharCode(i)}return n.join("")}(e,t,i):Zue().decode(n)}function Xue(e,t,i,n){for(let o=0,s=t.length;o<s;o++){if(o===i)continue;const s=t[o];for(const t of s.open)t.indexOf(e)>=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function Jue(e,t){return e.length-t.length}function ege(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function tge(e){const t=/^[\w ]+$/.test(e);return e=Ble(e),t?`\\b${e}\\b`:e}function ige(e,t){return Ule(`(${e.map(tge).join(")|(")})`,!0,t)}function nge(e){return e.global&&(e.lastIndex=0),!0}function oge(e,t){const i=Object.create(null);for(const n in e)sge(i,n,e[n],t);return i}function sge(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let l=0;l<o.length;l++){const e=o[l];let i=r[e];switch(typeof i){case"undefined":i=r[e]=Object.create(null);break;case"object":if(null===i)return void n(`Ignoring ${t} as ${o.slice(0,l+1).join(".")} is null`);break;default:return void n(`Ignoring ${t} as ${o.slice(0,l+1).join(".")} is ${JSON.stringify(i)}`)}r=i}if("object"==typeof r&&null!==r)try{r[s]=i}catch(a){n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}else n(`Ignoring ${t} as ${o.join(".")} is ${JSON.stringify(r)}`)}function rge(e,t){age(e,t.split("."))}function age(e,t){if(!e)return;const i=t.shift();if(0!==t.length){if(-1!==Object.keys(e).indexOf(i)){const n=e[i];"object"!=typeof n||Array.isArray(n)||(age(n,t),0===Object.keys(n).length&&delete e[i])}}else delete e[i]}function lge(e,t,i){const n=function(e,t){let i=e;for(const n of t){if("object"!=typeof i||null===i)return;i=i[n]}return i}(e,t.split("."));return void 0===n?i:n}function dge(e,t,i){t instanceof Da||(t=new Da(t,[],Boolean(i))),Ia.push([e,t])}function cge(){return Ia}function hge(e){const t=[];if(za.test(e)){let i=Ha.exec(e);for(;i?.length;){const n=i[1].trim();n&&t.push(n),i=Ha.exec(e)}}return rce(t)}function uge(e,t,i){return e.trim()?za.test(e)?Vae(1671,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0===Ua.getConfigurationProperties()[e]||i&&Ka.has(i.toLowerCase())?t.policy?.name&&void 0!==Ua.getPolicyConfigurations().get(t.policy?.name)?Vae(1673,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",e,t.policy?.name,Ua.getPolicyConfigurations().get(t.policy?.name)):null:Vae(1672,"Cannot register '{0}'. This property is already registered.",e):Vae(1670,"Cannot register an empty property")}function gge(e){return e.filter(([e,t])=>""!==e&&""!==t)}function pge(e,t,i,n){let o=t.getLanguageConfiguration(e);if(!o){if(!n.isRegisteredLanguageId(e))return new dl(e,{});o=new dl(e,{})}const s=function(e,t){const i=t.getValue(ol.brackets,{overrideIdentifier:e}),n=t.getValue(ol.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:mge(i),colorizedBracketPairs:mge(n)}}(o.languageId,i),r=_ge([o.underlyingConfig,s]);return new dl(o.languageId,r)}function mge(e){if(Array.isArray(e))return e.map(e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]}).filter(e=>!!e)}function fge(e,t,i){let n=$le(e.getLineContent(t));return n.length>i-1&&(n=n.substring(0,i-1)),n}function _ge(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}function bge(e,t){e.tokenization.forceTokenization(t.lineNumber);const i=e.tokenization.getLineTokens(t.lineNumber),n=Eue(i,t.column-1),o=0===n.firstCharOffset,s=i.getLanguageId(0)===n.languageId;return!o&&!s}function vge(e,t,i,n){t.tokenization.forceTokenization(i.startLineNumber);const o=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),s=n.getLanguageConfiguration(o);if(!s)return null;const r=new vl(t,n).getProcessedTokenContextAroundRange(i),a=r.previousLineProcessedTokens.getLineContent(),l=r.beforeRangeProcessedTokens.getLineContent(),d=r.afterRangeProcessedTokens.getLineContent(),c=s.onEnter(e,a,l,d);if(!c)return null;const h=c.indentAction;let u=c.appendText;const g=c.removeText||0;u?h===ra.Indent&&(u="\t"+u):u=h===ra.Indent||h===ra.IndentOutdent?"\t":"";let p=fge(t,i.startLineNumber,i.startColumn);return g&&(p=p.substring(0,p.length-g)),{indentAction:h,appendText:u,removeText:g,indentation:p}}function wge(e,t){if(t<=0)return"";xl[e]||(xl[e]=["",e]);const i=xl[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}function Cge(e,t,i,n=!0,o){if(e<4)return null;const s=o.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!s)return null;const r=new bl(t,s,o);if(i<=1)return{indentation:"",action:null};for(let l=i-1;l>0&&""===t.getLineContent(l);l--)if(1===l)return{indentation:"",action:null};const a=function(e,t,i){const n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let o,s=-1;for(o=t-1;o>=1;o--){if(e.tokenization.getLanguageIdAtPosition(o,0)!==n)return s;const t=e.getLineContent(o);if(!i.shouldIgnore(o)&&!/^\s+$/.test(t)&&""!==t)return o;s=o}}return-1}(t,i,r);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(r.shouldIncrease(a)||r.shouldIndentNextLine(a))return{indentation:$le(t.getLineContent(a)),action:ra.Indent,line:a};if(r.shouldDecrease(a))return{indentation:$le(t.getLineContent(a)),action:null,line:a};{if(1===a)return{indentation:$le(t.getLineContent(a)),action:null,line:a};const e=a-1,i=s.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let t=e-1;t>0;t--)if(!r.shouldIndentNextLine(t)){i=t;break}return{indentation:$le(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:$le(t.getLineContent(a)),action:null,line:a};for(let n=a;n>0;n--){if(r.shouldIncrease(n))return{indentation:$le(t.getLineContent(n)),action:ra.Indent,line:n};if(r.shouldIndentNextLine(n)){let e=0;for(let t=n-1;t>0;t--)if(!r.shouldIndentNextLine(n)){e=t;break}return{indentation:$le(t.getLineContent(e+1)),action:null,line:e+1}}if(r.shouldDecrease(n))return{indentation:$le(t.getLineContent(n)),action:null,line:n}}return{indentation:$le(t.getLineContent(1)),action:null,line:1}}}function yge(e,t,i,n,o,s){if(e<4)return null;const r=s.getLanguageConfiguration(i);if(!r)return null;const a=s.getLanguageConfiguration(i).indentRulesSupport;if(!a)return null;const l=new bl(t,a,s),d=Cge(e,t,n,void 0,s);if(d){const i=d.line;if(void 0!==i){let s=!0;for(let e=i;e<n-1;e++)if(!/^\s*$/.test(t.getLineContent(e))){s=!1;break}if(s){const s=r.onEnter(e,"",t.getLineContent(i),"");if(s){let e=$le(t.getLineContent(i));return s.removeText&&(e=e.substring(0,e.length-s.removeText)),s.indentAction===ra.Indent||s.indentAction===ra.IndentOutdent?e=o.shiftIndent(e):s.indentAction===ra.Outdent&&(e=o.unshiftIndent(e)),l.shouldDecrease(n)&&(e=o.unshiftIndent(e)),s.appendText&&(e+=s.appendText),$le(e)}}}return l.shouldDecrease(n)?d.action===ra.Indent?d.indentation:o.unshiftIndent(d.indentation):d.action===ra.Indent?o.shiftIndent(d.indentation):d.indentation}return null}function Sge(e,t,i){const n=i.getLanguageConfiguration(e.getLanguageId()).indentRulesSupport;return n?t<1||t>e.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null}function xge(e,t){return" "===e?5===t||6===t?6:5:4}function kge(e,t){return!(!Dge(e)||Dge(t))||5!==e&&Lge(e)!==Lge(t)}function Lge(e){return 6===e||5===e?"space":e}function Dge(e){return 4===e||5===e||6===e}function Ige(e,t,i,n,o){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,r=i.length;s<r;s++){const r=i[s];if(!r.isEmpty())return!1;const a=r.getPosition(),l=t.getLineContent(a.lineNumber);if(l.charAt(a.column-1)!==o)return!1;const d=Rue(o);if(92===(a.column>2?l.charCodeAt(a.column-2):0)&&d)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t<i;t++){const i=n[t];if(a.lineNumber===i.startLineNumber&&a.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}function Nge(e,t,i){return i?new Rr(e,t,!0):new Er(e,t,!0)}function Ege(e,t,i){return i=i||1,kl.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}function Mge(e,t,i){return i=i||1,kl.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}function Tge(e,t){return Rue(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}function Rge(e,t){ns.registerKeybindingRule({id:e,primary:t,when:Jl,weight:$l+1})}function Oge(e){return e.register(),e}function Age(e,t){Oge(new td("default:"+e,e)),Oge(new td(e,e,t))}function Pge(e){return"number"==typeof e?`${e}px`:e}function Fge(e){return new ad(e)}function Wge(e,t){e instanceof ad?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}function Bge(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new Dd(t,e!==t);if(Array.isArray(e)||Array.isArray(t))return new Dd(t,!(Array.isArray(e)&&Array.isArray(t)&&Zde(e,t)));let i=!1;for(const n in t)if(t.hasOwnProperty(n)){const o=Bge(e[n],t[n]);o.didChange&&(e[n]=o.newValue,i=!0)}return new Dd(e,i)}function Vge(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}function Hge(e,t,i,n){if("string"==typeof e&&(e=parseInt(e,10)),"number"!=typeof e||isNaN(e))return t;let o=e;return o=Math.max(i,o),o=Math.min(n,o),0|o}function zge(e,t,i,n){if(void 0===e)return t;const o=Td.float(e,t);return Td.clamp(o,i,n)}function Uge(e,t,i,n){return"string"!=typeof e?t:n&&e in n?n[e]:-1===i.indexOf(e)?t:e}function Kge(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}function qge(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}function jge(e){switch(e){case"line":return Wd.Line;case"block":return Wd.Block;case"underline":return Wd.Underline;case"line-thin":return Wd.LineThin;case"block-outline":return Wd.BlockOutline;case"underline-thin":return Wd.UnderlineThin}}function $ge(e){return"ctrlCmd"===e?F?"metaKey":"ctrlKey":"altKey"}function Gge(e){const t=e.get(112);return"editable"===t?e.get(104):"on"!==t}function Zge(e){return!e.get(172)}function Yge(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}function Qge(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}function Xge(e){return Nc[e.id]=e,e}function Jge(e,t){Oc.items.push(new Oc(e,t))}function epe(e,t){Jge(e,(i,n,o)=>{if(void 0!==i)for(const[s,r]of t)if(i===s)return void o(e,r)})}function tpe(){let e="";return g||p?(e+="no-minimap-shadow ",e+="enable-user-select "):e+="no-user-select ",F&&(e+="mac "),e}function ipe(e){const t=Bue(e);return function(e){Oc.items.forEach(t=>t.apply(e))}(t),t}function npe(e=r.document.head,t,i){const n=document.createElement("style");if(n.type="text/css",n.media="screen",t?.(n),e.appendChild(n),i&&i.add(Dle(()=>n.remove())),e===r.document.head){const e=new Set;jc.set(n,e),i&&i.add(Dle(()=>jc.delete(n)));for(const{window:t,disposables:o}of fn()){if(t===r)continue;const s=o.add(ope(n,e,t));i?.add(s)}}return n}function ope(e,t,i){const n=new De,o=e.cloneNode(!0);i.document.head.appendChild(o),n.add(Dle(()=>o.remove()));for(const s of rpe(e))o.sheet?.insertRule(s.cssText,o.sheet?.cssRules.length);return n.add(Rn.observe(e,n,{childList:!0,subtree:c,characterData:c})(()=>{o.textContent=e.textContent})),t.add(o),n.add(Dle(()=>t.delete(o))),n}function spe(){return Gc||(Gc=npe()),Gc}function rpe(e){return e?.sheet?.rules?e.sheet.rules:e?.sheet?.cssRules?e.sheet.cssRules:[]}function ape(e,t,i=spe()){if(i&&t){i.sheet?.insertRule(`${e} {${t}}`,0);for(const n of jc.get(i)??[])ape(e,t,n)}}function lpe(e,t=spe()){if(!t)return;const i=rpe(t),n=[];for(let o=0;o<i.length;o++){const t=i[o];dpe(t)&&-1!==t.selectorText.indexOf(e)&&n.push(o)}for(let o=n.length-1;o>=0;o--)t.sheet?.deleteRule(n[o]);for(const o of jc.get(t)??[])lpe(e,o)}function dpe(e){return"string"==typeof e.selectorText}function cpe(e){const t=new De,i=t.add(new $c);return t.add(Rce(t=>{i.setStyle(e.read(t))})),t}function hpe(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}function upe(e){return`--vscode-${e.replace(/\./g,"-")}`}function gpe(e){return`var(${upe(e)})`}function ppe(e,t){return`var(${upe(e)}, ${t})`}function mpe(e,t,i,n,o){return ih.registerColor(e,t,i,n,o)}function fpe(e,t){return{op:0,value:e,factor:t}}function _pe(e,t){return{op:1,value:e,factor:t}}function bpe(e,t){return{op:2,value:e,factor:t}}function vpe(...e){return{op:4,values:e}}function wpe(e,t,i,n){return{op:5,value:e,background:t,factor:i,transparency:n}}function Cpe(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?eh.fromHex(e):t.getColor(e):e instanceof eh?e:"object"==typeof e?function(e,t){switch(e.op){case 0:return Cpe(e.value,t)?.darken(e.factor);case 1:return Cpe(e.value,t)?.lighten(e.factor);case 2:return Cpe(e.value,t)?.transparent(e.factor);case 7:{const i=Cpe(e.color,t)||eh.transparent,n=Cpe(e.with,t)||eh.transparent;return i.mix(n,e.ratio)}case 3:{const i=Cpe(e.background,t);return i?Cpe(e.value,t)?.makeOpaque(i):Cpe(e.value,t)}case 4:for(const i of e.values){const e=Cpe(i,t);if(e)return e}return;case 6:return Cpe(t.defines(e.if)?e.then:e.else,t);case 5:{const i=Cpe(e.value,t);if(!i)return;const n=Cpe(e.background,t);return n?i.isDarkerThan(n)?eh.getLighterColor(i,n,e.factor).transparent(e.transparency):eh.getDarkerColor(i,n,e.factor).transparent(e.transparency):i.transparent(e.factor*e.transparency)}default:throw ele()}}(e,t):void 0}function ype(e){const t=lhe(e);return new pp(t.left,t.top,t.width,t.height)}function Spe(e,t,i){const n=t.width/e.offsetWidth,o=t.height/e.offsetHeight;return new mp((i.x-t.x)/n,(i.y-t.y)/o)}function xpe(e){return e.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}function kpe(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("<span>");let i=0,n=0,o=0;for(const r of e.lineDecorations)1!==r.type&&2!==r.type||(t.appendString('<span class="'),t.appendString(r.className),t.appendString('"></span>'),1===r.type&&(o|=1,i++),2===r.type&&(o|=2,n++));t.appendString("</span>");const s=new Vp(1,i+n);return s.setColumnInfo(1,i,0,0),new Hp(s,o)}return e.renderNewLineWhenEmpty?t.appendString("<span><span>\n</span></span>"):t.appendString("<span><span></span></span>"),new Hp(new Vp(0,0),0)}return function(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,o=e.containsForeignElements,s=e.lineContent,r=e.len,a=e.isOverflowing,l=e.overflowingCharCount,d=e.parts,c=e.fauxIndentLength,h=e.tabSize,u=e.startVisibleColumn,g=e.spaceWidth,p=e.renderSpaceCharCode,m=e.renderWhitespace,f=e.renderControlCharacters,_=new Vp(r+1,d.length);let b=!1,v=0,w=u,C=0,y=0,S=0;t.appendString("<span>");for(let x=0,k=d.length;x<k;x++){const e=d[x],a=e.endIndex,l=e.type,u=e.containsRTL,k=0!==m&&e.isWhitespace(),L=k&&!i&&("mtkw"===l||!o),D=v===a&&e.isPseudoAfter();if(C=0,t.appendString("<span "),u&&t.appendString('dir="rtl" style="unicode-bidi:isolate" '),t.appendString('class="'),t.appendString(L?"mtkz":l),t.appendASCIICharCode(34),k){let e=0;{let t=v,i=w;for(;t<a;t++){const n=0|(9===s.charCodeAt(t)?h-i%h:1);e+=n,t>=c&&(i+=n)}}for(L&&(t.appendString(' style="width:'),t.appendString(String(g*e)),t.appendString('px"')),t.appendASCIICharCode(62);v<a;v++){let e,i;if(_.setColumnInfo(v+1,x-S,C,y),S=0,9===s.charCodeAt(v)){e=h-w%h|0,i=e,!n||i>1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=i;e++)t.appendCharCode(160)}else e=2,i=1,t.appendCharCode(p),t.appendCharCode(8204);C+=e,y+=i,v>=c&&(w+=i)}}else for(t.appendASCIICharCode(62);v<a;v++){_.setColumnInfo(v+1,x-S,C,y),S=0;const e=s.charCodeAt(v);let i=1,n=1;switch(e){case 9:i=h-w%h,n=i;for(let e=1;e<=i;e++)t.appendCharCode(160);break;case 32:t.appendCharCode(160);break;case 60:t.appendString("&lt;");break;case 62:t.appendString("&gt;");break;case 38:t.appendString("&amp;");break;case 0:f?t.appendCharCode(9216):t.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:t.appendCharCode(65533);break;default:fde(e)&&n++,f&&e<32?t.appendCharCode(9216+e):f&&127===e?t.appendCharCode(9249):f&&Dpe(e)?(t.appendString("[U+"),t.appendString(Ipe(e)),t.appendString("]"),i=8,n=i):t.appendCharCode(e)}C+=i,y+=n,v>=c&&(w+=n)}D?S++:S=0,v>=r&&!b&&e.isPseudoAfter()&&(b=!0,_.setColumnInfo(v+1,x,C,y)),t.appendString("</span>")}return b||_.setColumnInfo(r+1,d.length-1,C,y),a&&(t.appendString('<span class="mtkoverflow">'),t.appendString(Vae(796,"Show more ({0})",function(e){return e<1024?Vae(797,"{0} chars",e):e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}(l))),t.appendString("</span>")),t.appendString("</span>"),new Hp(_,o)}(function(e){const t=e.lineContent;let i,n,o;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<t.length?(i=!0,n=t.length-e.stopRenderingLineAfter,o=e.stopRenderingLineAfter):(i=!1,n=0,o=t.length);let s=function(e,t,i,n,o){const s=[];let r=0;n>0&&(s[r++]=new Fp(n,"",0,!1));let a=n;for(let l=0,d=i.getCount();l<d;l++){const d=i.getEndOffset(l);if(d<=n)continue;const c=i.getClassName(l);if(d>=o){const i=!!t&&gde(e.substring(a,o));s[r++]=new Fp(o,c,0,i);break}const h=!!t&&gde(e.substring(a,d));s[r++]=new Fp(d,c,0,h),a=d}return s}(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,o);e.renderControlCharacters&&!e.isBasicASCII&&(s=function(e,t){const i=[];let n=new Fp(0,"",0,!1),o=0;for(const s of t){const t=s.endIndex;for(;o<t;o++)Dpe(e.charCodeAt(o))&&(o>n.endIndex&&(n=new Fp(o,s.type,s.metadata,s.containsRTL),i.push(n)),n=new Fp(o+1,"mtkcontrol",s.metadata,!1),i.push(n));o>n.endIndex&&(n=new Fp(t,s.type,s.metadata,s.containsRTL),i.push(n))}return i}(t,s)),(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace&&!e.continuesWithWrappedLine)&&(s=function(e,t,i,n){const o=e.continuesWithWrappedLine,s=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,d=e.selectionsOnLine,c=1===e.renderWhitespace,h=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth,g=[];let p=0,m=0,f=n[m].type,_=n[m].containsRTL,b=n[m].endIndex;const v=n.length;let w,C=!1,y=jle(t);-1===y?(C=!0,y=i,w=i):w=Gle(t);let S=!1,x=0,k=d&&d[x],L=a%r;for(let I=s;I<i;I++){const e=t.charCodeAt(I);let o;if(k&&k.endExclusive<=I&&(x++,k=d&&d[x]),I<y||I>w)o=!0;else if(9===e)o=!0;else if(32===e)if(c)if(S)o=!0;else{const e=I+1<i?t.charCodeAt(I+1):0;o=32===e||9===e}else o=!0;else o=!1;if(o&&d&&(o=!!k&&k.start<=I&&I<k.endExclusive),o&&h&&(o=C||I>w),o&&_&&I>=y&&I<=w&&(o=!1),S){if(!o||!l&&L>=r){if(u)for(let e=(p>0?g[p-1].endIndex:s)+1;e<=I;e++)g[p++]=new Fp(e,"mtkw",1,!1);else g[p++]=new Fp(I,"mtkw",1,!1);L%=r}}else(I===b||o&&I>s)&&(g[p++]=new Fp(I,f,0,_),L%=r);for(9===e?L=r:fde(e)?L+=2:L++,S=o;I===b&&(m++,m<v);)f=n[m].type,_=n[m].containsRTL,b=n[m].endIndex}let D=!1;if(S)if(o&&c){const e=i>0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(D=!0)}else D=!0;if(D)if(u)for(let I=(p>0?g[p-1].endIndex:s)+1;I<=i;I++)g[p++]=new Fp(I,"mtkw",1,!1);else g[p++]=new Fp(i,"mtkw",1,!1);else g[p++]=new Fp(i,f,0,_);return g}(e,t,o,s));let r=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;t<i;t++){const i=e.lineDecorations[t];3===i.type||1===i.type?r|=1:2===i.type&&(r|=2)}s=function(e,t,i,n){n.sort(Rp.compare);const o=Pp.normalize(e,n),s=o.length;let r=0;const a=[];let l=0,d=0;for(let h=0,u=i.length;h<u;h++){const e=i[h],t=e.endIndex,n=e.type,c=e.metadata,u=e.containsRTL;for(;r<s&&o[r].startOffset<t;){const e=o[r];if(e.startOffset>d&&(d=e.startOffset,a[l++]=new Fp(d,n,c,u)),!(e.endOffset+1<=t)){d=t,a[l++]=new Fp(d,n+" "+e.className,c|e.metadata,u);break}d=e.endOffset+1,a[l++]=new Fp(d,n+" "+e.className,c|e.metadata,u),r++}t>d&&(d=t,a[l++]=new Fp(d,n,c,u))}const c=i[i.length-1].endIndex;if(r<s&&o[r].startOffset===c)for(;r<s&&o[r].startOffset===c;){const e=o[r];a[l++]=new Fp(d,e.className,e.metadata,!1),r++}return a}(t,0,s,e.lineDecorations)}return s=e.containsRTL?function(e,t){if(0===t.length)return t;const i=t[0];if(!i.containsRTL)return t;const n=i.endIndex;let o=0;for(let r=0;r<n;r++){const t=e.charCodeAt(r);if(32!==t&&9!==t){o=r;break}}if(0===o)return t;const s=[];s.push(new Fp(o,i.type,i.metadata,!1)),s.push(new Fp(n,i.type,i.metadata,i.containsRTL));for(let r=1;r<t.length;r++)s.push(t[r]);return s}(t,s):function(e,t,i){let n=0;const o=[];let s=0;if(i)for(let r=0,a=t.length;r<a;r++){const i=t[r],a=i.endIndex;if(n+50<a){const t=i.type,r=i.metadata,l=i.containsRTL;let d=-1,c=n;for(let i=n;i<a;i++)32===e.charCodeAt(i)&&(d=i),-1!==d&&i-c>=50&&(o[s++]=new Fp(d+1,t,r,l),c=d+1,d=-1);c!==a&&(o[s++]=new Fp(a,t,r,l))}else o[s++]=i;n=a}else for(let r=0,a=t.length;r<a;r++){const e=t[r],i=e.endIndex,a=i-n;if(a>50){const t=e.type,r=e.metadata,l=e.containsRTL,d=Math.ceil(a/50);for(let e=1;e<d;e++){const i=n+50*e;o[s++]=new Fp(i,t,r,l)}o[s++]=new Fp(i,t,r,l)}else o[s++]=e;n=i}return o}(t,s,!e.isBasicASCII||e.fontLigatures),new Up(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,t,o,i,n,s,r,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.spaceWidth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}(e),t)}function Lpe(e){const t=new _a(1e4),i=kpe(e,t);return new zp(i.characterMapping,t.build(),i.containsForeignElements)}function Dpe(e){return e<32?9!==e:127===e||e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e}function Ipe(e){return e.toString(16).toUpperCase().padStart(4,"0")}function Npe(e){return e===Kp.HIGH_CONTRAST_DARK||e===Kp.HIGH_CONTRAST_LIGHT}function Epe(e){return e===Kp.DARK||e===Kp.HIGH_CONTRAST_DARK}function Mpe(e,t,i,n){return new Qp(e,t,i,n)}function Tpe(e,t,i,n){return new Yp(e,t,i,n)}function Rpe(e,t,i){const n=t.textContent.length;let o=-1;for(;t;)t=t.previousSibling,o++;return e.getColumn(new Bp(o,i),n)}function Ope(e){return{isAfterLines:!1,horizontalDistanceToText:e}}function Ape(e,t,i){let n=null,o=null;if("function"==typeof i.value?(n="value",o=i.value,0!==o.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(n="get",o=i.get),!o)throw new Error("not supported");const s=`$memoize$${t}`;i[n]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,e)}),this[s]}}function Ppe(e,t){const i=t-e;return function(t){return e+i*(1-function(e){return Math.pow(e,3)}(1-t))}}function Fpe(e,t,i,n){const o=e.getPlainTextToCopy(t,i,P),s=e.model.getEOL(),r=i&&1===t.length&&t[0].isEmpty(),a=Array.isArray(o)?o:null,l=Array.isArray(o)?o.join(s):o;let d,c=null;if(qm.forceCopyWithSyntaxHighlighting||n&&l.length<65536){const n=e.getRichTextToCopy(t,i);n&&(d=n.html,c=n.mode)}return{isFromEmptySelection:r,multicursorText:a,text:l,html:d,mode:c}}function Wpe(e){return`${e}-${Zm()}`}function Bpe(e,t){const i=qae();if(i?.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(e,t)}catch(n){return void $ae(n)}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(n){return void $ae(n)}}function Vpe(e,t,...i){try{return e.call(t,...i)}catch{return null}}function Hpe(e){return{id:e}}function zpe(e){switch(e){case Kp.DARK:return qp.VS_DARK;case Kp.HIGH_CONTRAST_DARK:return qp.HC_BLACK;case Kp.HIGH_CONTRAST_LIGHT:return qp.HC_LIGHT;default:return qp.VS}}function Upe(e){return kf.onColorThemeChange(e)}function Kpe(e,t,i=e.length-1){const n=function(e,t,i=e.length-1){for(let n=i;n>=0;n--)if(t(e[n],n))return n;return-1}(e,t,i);if(-1!==n)return e[n]}function qpe(e,t){const i=jpe(e,t);return-1===i?void 0:e[i]}function jpe(e,t,i=0,n=e.length){let o=i,s=n;for(;o<s;){const i=Math.floor((o+s)/2);t(e[i])?o=i+1:s=i}return o-1}function $pe(e,t,i=0,n=e.length){let o=i,s=n;for(;o<s;){const i=Math.floor((o+s)/2);t(e[i])?s=i:o=i+1}return o}function Gpe(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>0&&(i=o)}return i}function Zpe(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){const o=e[n];t(o,i)>=0&&(i=o)}return i}function Ype(e,t){return Gpe(e,(e,i)=>-t(e,i))}function Qpe(e,t){if(0===e.length)return-1;let i=0;for(let n=1;n<e.length;n++)t(e[n],e[i])>0&&(i=n);return i}function Xpe(e,t){let i=0,n=0;const o=e.length;for(;n<o;){const o=e.charCodeAt(n);if(32===o)i++;else{if(9!==o)break;i=i-i%t+t}n++}return n===o?-1:i}function Jpe(e){if(!e||!e.isTransparent())return e}function eme(e,t){return Vae(783,"{0} ({1})",e,Sb[t])}function tme(e,t){return!(t.options.hideInCommentTokens&&ime(e,t)||t.options.hideInStringTokens&&nme(e,t))}function ime(e,t){return ome(e,t.range,e=>1===e)}function nme(e,t){return ome(e,t.range,e=>2===e)}function ome(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const o=e.tokenization.getLineTokens(n),s=n===t.startLineNumber,r=n===t.endLineNumber;let a=s?o.findTokenIndexAtOffset(t.startColumn-1):0;for(;a<o.getCount()&&!(r&&o.getStartOffset(a)>t.endColumn-1);){if(!i(o.getStandardTokenType(a)))return!1;a++}}return!0}function sme(e){return new gv(e)}function rme(e){return new pv(e.lineNumber,e.ranges.map(sme))}function ame(e){return e<0?-e:e}function lme(e){if(!e)throw new Error(`Value "${e}" cannot be null`);return e}function dme(e,t,i){let n=new t.ResizeObserver(t=>{const o=t.find(t=>t.target===e);if(!o)return;if(!("devicePixelContentBoxSize"in o))return n?.disconnect(),void(n=void 0);const s=o.devicePixelContentBoxSize[0].inlineSize,r=o.devicePixelContentBoxSize[0].blockSize;s>0&&r>0&&i(s,r)});try{n.observe(e,{box:["device-pixel-content-box"]})}catch{throw n.disconnect(),n=void 0,new y("Could not observe device pixel dimensions")}return Dle(()=>n?.disconnect())}function cme(e,t,i){let n=e.get(t);n||(n=[],e.set(t,n)),n.push(i)}function hme(e){return{object:e,dispose:()=>e.destroy()}}function ume(e,t){let i,n=!0;return function(e,t){const i=new De,n=Ace({owner:e.owner,debugName:e.debugName,debugReferenceFn:e.debugReferenceFn??t,changeTracker:e.changeTracker},(e,n)=>{i.clear(),t(e,n,i)});return Dle(()=>{n.dispose(),i.dispose()})}({changeTracker:{createChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(e)){const e=t.change;void 0!==e&&i.deltas.push(e),i.didChange=!0}return!0}}},(o,s)=>{const r=e.read(o),a=i;s.didChange&&(i=r,t(r,a,s.deltas)),n&&(n=!1,i=r)})}function gme(e,t){const i=new De,n=ume(e,(e,n,o)=>{i.clear(),t(e,n,o,i)});return{dispose(){n.dispose(),i.dispose()}}}function pme(e,t){return!!uw.includes(e)}function mme(e,t){return e.isBasicASCII&&t.useMonospaceOptimizations?new gw(e):new pw(e)}function fme(e){switch(e){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(e)}function _me(e){return e.endsWith("%")?parseFloat(e.substring(0,e.length-1))/100:e.match(/^\d+(?:\.\d*)/)?parseFloat(e):1}function bme(e){switch(e){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(e)}function vme(e){return e.endsWith("%")?parseFloat(e.substring(0,e.length-1))/100:e.match(/^\d+(?:\.\d*)/)?parseFloat(e):1}function wme(e,t){if(1===e.get(2)){const e=t.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),i=t.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),n=t.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),o=Vae(61,"The editor is not accessible at this time.");return e?Vae(62,"{0} To enable screen reader optimized mode, use {1}",o,e):i?Vae(63,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",o,i):n?Vae(64,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",o,n):o}return e.get(8)}function Cme(e){let t=0,i=-1;for(;i=e.indexOf("\n",i+1),-1!==i;)t++;return t}function yme(e,t,i,n){if(0===t.length)return 0;const o=e.createElement("div");o.style.position="absolute",o.style.top="-50000px",o.style.width="50000px";const s=e.createElement("span");Wge(s,i),s.style.whiteSpace="pre",s.style.tabSize=n*i.spaceWidth+"px",s.append(t),o.appendChild(s),e.body.appendChild(o);const r=s.offsetWidth;return o.remove(),r}function Sme(e,t,i,n){return e.addEventListener(t,i,n),{dispose(){e.removeEventListener(t,i)}}}function xme(e,t){e=e.slice();const i=[];let n=0;for(const o of t.replacements){for(;;){const t=e[0];if(!t||t.endExclusive>=o.replaceRange.start)break;e.shift(),i.push(t.delta(n))}const t=[];for(;;){const i=e[0];if(!i||!i.intersectsOrTouches(o.replaceRange))break;e.shift(),t.push(i)}for(let i=t.length-1;i>=0;i--){let n=t[i];const s=n.intersect(o.replaceRange).length;n=n.deltaEnd(-s+(0===i?o.newText.length:0));const r=n.start-o.replaceRange.start;r>0&&(n=n.delta(-r)),0!==i&&(n=n.delta(o.newText.length)),n=n.delta(-(o.newText.length-o.replaceRange.length)),e.unshift(n)}n+=o.newText.length-o.replaceRange.length}for(;;){const t=e[0];if(!t)break;e.shift(),i.push(t.delta(n))}return i}function kme(e,t){if(e.lineNumber===t.lineNumber&&e.column===Number.MAX_SAFE_INTEGER)return mr.fromPositions(t,t);if(!e.isBeforeOrEqual(t))throw new y("start must be before end");return new mr(e.lineNumber,e.column,t.lineNumber,t.column)}function Lme(e){try{return e()}catch(t){return $ae(t),null}}function Dme(e){return null==e||e===Xr.Right||e===Xr.Both}function Ime(e){return null==e||e===Xr.Left||e===Xr.Both}function Nme(e,t,i,n,o,s){if(0!==s){const e=String(s);o.appendString('<div style="text-indent: -'),o.appendString(e),o.appendString("px; padding-left: "),o.appendString(e),o.appendString("px; box-sizing: border-box; width:")}else o.appendString('<div style="width:');o.appendString(String(n)),o.appendString('px;">');const r=e.length;let a=t,l=0;const d=[],c=[];let h=0<r?e.charCodeAt(0):0;o.appendString("<span>");for(let u=0;u<r;u++){0!==u&&u%16384==0&&o.appendString("</span><span>"),d[u]=l,c[u]=a;const t=h;h=u+1<r?e.charCodeAt(u+1):0;let n=1,s=1;switch(t){case 9:n=i-a%i,s=n;for(let e=1;e<=n;e++)e<n?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 32:32===h?o.appendCharCode(160):o.appendASCIICharCode(32);break;case 60:o.appendString("&lt;");break;case 62:o.appendString("&gt;");break;case 38:o.appendString("&amp;");break;case 0:o.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:o.appendCharCode(65533);break;default:fde(t)&&s++,t<32?o.appendCharCode(9216+t):o.appendCharCode(t)}l+=n,a+=s}return o.appendString("</span>"),d[e.length]=l,c[e.length]=a,o.appendString("</div>"),[d,c]}function Eme(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{Mme(e,o,n,0,null,i.length-1,null,s)}catch(r){return console.log(r),null}return 0===s.length?null:(s.push(i.length),s)}function Mme(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||Tme(e,t,i[n],i[n+1]),r=r||Tme(e,t,i[s],i[s+1]),Math.abs(o[0].top-r[0].top)<=.1)return;if(n+1===s)return void a.push(s);const l=n+(s-n)/2|0,d=Tme(e,t,i[l],i[l+1]);Mme(e,t,i,n,o,l,d,a),Mme(e,t,i,l,d,s,r,a)}function Tme(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}function Rme(e){let t=0,i=0,n=0,o=0;for(let s=0,r=e.length;s<r;s++){const a=e.charCodeAt(s);13===a?(0===t&&(i=s),t++,s+1<r&&10===e.charCodeAt(s+1)?(o|=2,s++):o|=3,n=s+1):10===a&&(o|=1,0===t&&(i=s),t++,n=s+1)}return 0===t&&(i=e.length),[t,i,e.length-n,o]}function Ome(e){return 0===e}function Ame(e,t){return e*JC+t}function Pme(e){const t=e,i=Math.floor(t/JC);return new eC(i,t-i*JC)}function Fme(e){return e}function Wme(e,t){let i=e+t;return t>=JC&&(i-=e%JC),i}function Bme(e,t){return e.reduce((e,i)=>Wme(e,t(i)),0)}function Vme(e,t){return e===t}function Hme(e,t){const i=e,n=t;if(n-i<=0)return 0;const o=Math.floor(i/JC),s=Math.floor(n/JC),r=n-s*JC;return o===s?Ame(0,r-(i-o*JC)):Ame(s-o,r)}function zme(e,t){return e<t}function Ume(e,t){return e<=t}function Kme(e,t){return e>=t}function qme(e){return Ame(e.lineNumber-1,e.column-1)}function jme(e,t){const i=e,n=Math.floor(i/JC),o=i-n*JC,s=t,r=Math.floor(s/JC);return new mr(n+1,o+1,r+1,s-r*JC+1)}function $me(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){const n=i>>1;for(let o=0;o<n;o++){const n=o<<1;e[o]=cy.create23(e[n],e[n+1],n+3===i?e[n+2]:null,t)}i=n}return cy.create23(e[0],e[1],i>=3?e[2]:null,t)}function Gme(e,t){return Math.abs(e.listHeight-t.listHeight)}function Zme(e,t){return e.listHeight===t.listHeight?cy.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i=e=e.toMutable();const n=[];let o;for(;;){if(t.listHeight===i.listHeight){o=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let s=n.length-1;s>=0;s--){const e=n[s];o?e.childrenLength>=3?o=cy.create23(e.unappendChild(),o,null,!1):(e.appendChildOfSameHeight(o),o=void 0):e.handleChildrenChanged()}return o?cy.create23(e,o,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable();const n=[];for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let o=t;for(let s=n.length-1;s>=0;s--){const e=n[s];o?e.childrenLength>=3?o=cy.create23(o,e.unprependChild(),null,!1):(e.prependChildOfSameHeight(o),o=void 0):e.handleChildrenChanged()}return o?cy.create23(o,e,null,!1):e}(t,e)}function Yme(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function Qme(e){return e.length>0?e[e.length-1]:void 0}function Xme(e,t,i,n){return new Dy(e,t,i,n).parseDocument()}function Jme(e,t){if(0===e.length)return t;if(0===t.length)return e;const i=new Pi(efe(e)),n=efe(t);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=i.dequeue();function s(e){if(void 0===e){const e=i.takeWhile(e=>!0)||[];return o&&e.unshift(o),e}const t=[];for(;o&&!Ome(e);){const[n,s]=o.splitAt(e);t.push(n),e=Hme(n.lengthAfter,e),o=s??i.dequeue()}return Ome(e)||t.push(new Iy(!1,e,e)),t}const r=[];function a(e,t,i){if(r.length>0&&Vme(r[r.length-1].endOffset,e)){const e=r[r.length-1];r[r.length-1]=new ey(e.startOffset,t,Wme(e.newLength,i))}else r.push({startOffset:e,endOffset:t,newLength:i})}let l=0;for(const d of n){const e=s(d.lengthBefore);if(d.modified){const t=Wme(l,Bme(e,e=>e.lengthBefore));a(l,t,d.lengthAfter),l=t}else for(const t of e){const e=l;l=Wme(l,t.lengthBefore),t.modified&&a(e,l,t.lengthAfter)}}return r}function efe(e){const t=[];let i=0;for(const n of e){const e=Hme(i,n.startOffset);Ome(e)||t.push(new Iy(!1,e,e));const o=Hme(n.startOffset,n.endOffset);t.push(new Iy(!0,o,n.newLength)),i=n.endOffset}return t}function tfe(e,t,i,n){if(4===e.kind||2===e.kind){const o=[];for(const n of e.children)i=Wme(t,n.length),o.push({nodeOffsetStart:t,nodeOffsetEnd:i}),t=i;for(let t=o.length-1;t>=0;t--){const{nodeOffsetStart:i,nodeOffsetEnd:s}=o[t];if(zme(i,n)){const o=tfe(e.children[t],i,s,n);if(o)return o}}return null}if(3===e.kind)return null;if(1===e.kind){const n=jme(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function ife(e,t,i,n){if(4===e.kind||2===e.kind){for(const o of e.children){if(zme(n,i=Wme(t,o.length))){const e=ife(o,t,i,n);if(e)return e}t=i}return null}if(3===e.kind)return null;if(1===e.kind){const n=jme(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function nfe(e,t,i,n,o,s,r,a,l,d,c=!1){if(r>200)return!0;e:for(;;)switch(e.kind){case 4:{const a=e.childrenLength;for(let c=0;c<a;c++){const a=e.getChild(c);if(a){if(i=Wme(t,a.length),Ume(t,o)&&Kme(i,n)){if(Kme(i,o)){e=a;continue e}if(!nfe(a,t,i,n,o,s,r,0,l,d))return!1}t=i}}return!0}case 2:{const c=!d||!e.closingBracket||e.closingBracket.bracketInfo.closesColorized(e.openingBracket.bracketInfo);let h=0;if(l){let t=l.get(e.openingBracket.text);void 0===t&&(t=0),h=t,c&&(t++,l.set(e.openingBracket.text,t))}const u=e.childrenLength;for(let g=0;g<u;g++){const u=e.getChild(g);if(u){if(i=Wme(t,u.length),Ume(t,o)&&Kme(i,n)){if(Kme(i,o)&&1!==u.kind){e=u,c?(r++,a=h+1):a=h;continue e}if((c||1!==u.kind||!e.closingBracket)&&!nfe(u,t,i,n,o,s,c?r+1:r,c?h+1:h,l,d,!e.closingBracket))return!1}t=i}}return l?.set(e.openingBracket.text,h),!0}case 3:return s(new YC(jme(t,i),r-1,0,!0));case 1:return s(new YC(jme(t,i),r-1,a-1,c));case 0:return!0}}function ofe(e,t,i,n,o,s,r,a){if(r>200)return!0;let l=!0;if(2===e.kind){let d=0;if(a){let t=a.get(e.openingBracket.text);void 0===t&&(t=0),d=t,t++,a.set(e.openingBracket.text,t)}const c=Wme(t,e.openingBracket.length);let h=-1;if(s.includeMinIndentation&&(h=e.computeMinIndentation(t,s.textModel)),l=s.push(new XC(jme(t,i),jme(t,c),e.closingBracket?jme(Wme(c,e.child?.length||0),i):void 0,r,d,e,h)),t=c,l&&e.child){const d=e.child;if(i=Wme(t,d.length),Ume(t,o)&&Kme(i,n)&&(l=ofe(d,t,i,n,o,s,r+1,a),!l))return!1}a?.set(e.openingBracket.text,d)}else{let i=t;for(const t of e.children){const e=i;if(i=Wme(i,t.length),Ume(e,o)&&Ume(n,i)&&(l=ofe(t,e,i,n,o,s,r,a),!l))return!1}}return l}function sfe(e){if(void 0===e)return()=>!0;{const t=Date.now();return()=>Date.now()-t<=e}}function rfe(e){return e instanceof Ry?null:e}function afe(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}function lfe(e){return new By(e,Wy)}function dfe(e){return e?{$extensionId:e.extensionId,$extensionVersion:e.extensionVersion,$providerId:e.providerId}:{}}function cfe(e){if(void 0!==e)return e.replaceAll("/","|")}function hfe(e){return e.toString()}function ufe(e){return"\n"===e.getEOL()?0:1}function gfe(e){return!!e&&(e instanceof Ky||e instanceof qy)}function pfe(e,t,i,n,o){let s;for(o.spacesDiff=0,o.looksLikeAlignment=!1,s=0;s<t&&s<n&&e.charCodeAt(s)===i.charCodeAt(s);s++);let r=0,a=0;for(let u=s;u<t;u++)32===e.charCodeAt(u)?r++:a++;let l=0,d=0;for(let u=s;u<n;u++)32===i.charCodeAt(u)?l++:d++;if(r>0&&a>0)return;if(l>0&&d>0)return;const c=Math.abs(a-d),h=Math.abs(r-l);if(0===c)return o.spacesDiff=h,void(h>0&&0<=l-1&&l-1<e.length&&l<i.length&&32!==i.charCodeAt(l)&&32===e.charCodeAt(l-1)&&44===e.charCodeAt(e.length-1)&&(o.looksLikeAlignment=!0));h%c!==0||(o.spacesDiff=h/c)}function mfe(e,t,i){const n=Math.min(e.getLineCount(),1e4);let o=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],d=[0,0,0,0,0,0,0,0,0],c=new $y;for(let g=1;g<=n;g++){const n=e.getLineLength(g),l=e.getLineContent(g),h=n<=65536;let u=!1,p=0,m=0,f=0;for(let t=0,i=n;t<i;t++){const i=h?l.charCodeAt(t):e.getLineCharCode(g,t);if(9===i)f++;else{if(32!==i){u=!0,p=t;break}m++}}if(!u)continue;if(f>0?o++:m>1&&s++,pfe(r,a,l,p,c),c.looksLikeAlignment&&(!i||t!==c.spacesDiff))continue;const _=c.spacesDiff;_<=8&&d[_]++,r=l,a=p}let h=i;o!==s&&(h=o<s);let u=t;if(h){let e=h?0:.1*n;l.forEach(t=>{const i=d[t];i>e&&(e=i,u=t)}),4===u&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(u=2)}return{insertSpaces:h,tabSize:u}}function ffe(e){return(1&e.metadata)>>>0}function _fe(e,t){e.metadata=254&e.metadata|t}function bfe(e){return(2&e.metadata)>>>1==1}function vfe(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function wfe(e){return(4&e.metadata)>>>2==1}function Cfe(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function yfe(e){return(64&e.metadata)>>>6==1}function Sfe(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}function xfe(e){return(128&e.metadata)>>>7==1}function kfe(e,t){e.metadata=127&e.metadata|(t?1:0)<<7}function Lfe(e,t){e.metadata=231&e.metadata|t<<3}function Dfe(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}function Ife(e,t,i,n){return e<i||!(e>i)&&1!==n&&(2===n||t)}function Nfe(e,t,i,n,o){const s=function(e){return(24&e.metadata)>>>3}(e),r=0===s||2===s,a=1===s||2===s,l=i-t,d=n,c=Math.min(l,d),h=e.start;let u=!1;const g=e.end;let p=!1;t<=h&&g<=i&&function(e){return(32&e.metadata)>>>5==1}(e)&&(e.start=t,u=!0,e.end=t,p=!0);{const e=o?1:l>0?2:0;!u&&Ife(h,r,t,e)&&(u=!0),!p&&Ife(g,a,t,e)&&(p=!0)}if(c>0&&!o){const e=l>d?2:0;!u&&Ife(h,r,t+c,e)&&(u=!0),!p&&Ife(g,a,t+c,e)&&(p=!0)}{const n=o?1:0;!u&&Ife(h,r,i,n)&&(e.start=t+d,u=!0),!p&&Ife(g,a,i,n)&&(e.end=t+d,p=!0)}const m=d-l;u||(e.start=Math.max(0,h+m)),p||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function Efe(e,t){if(e.root===Zy)return t.parent=Zy,t.left=Zy,t.right=Zy,_fe(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const o=t.start,s=t.end;for(;;)if(Wfe(o,s,n.start+i,n.end+i)<0){if(n.left===Zy){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===Zy){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}t.parent=n,t.left=Zy,t.right=Zy,_fe(t,1)}(e,t),Ffe(t.parent);let i=t;for(;i!==e.root&&1===ffe(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===ffe(t)?(_fe(i.parent,0),_fe(t,0),_fe(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,Rfe(e,i)),_fe(i.parent,0),_fe(i.parent.parent,1),Ofe(e,i.parent.parent))}else{const t=i.parent.parent.left;1===ffe(t)?(_fe(i.parent,0),_fe(t,0),_fe(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,Ofe(e,i)),_fe(i.parent,0),_fe(i.parent.parent,1),Rfe(e,i.parent.parent))}return _fe(e.root,0),t}function Mfe(e,t){let i,n;if(t.left===Zy?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===Zy?(i=t.left,n=t):(n=function(e){for(;e.left!==Zy;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,_fe(i,0),t.detach(),Tfe(),Pfe(i),void(e.root.parent=Zy);const o=1===ffe(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,_fe(n,ffe(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==Zy&&(n.left.parent=n),n.right!==Zy&&(n.right.parent=n)),t.detach(),o)return Ffe(i.parent),n!==t&&(Ffe(n),Ffe(n.parent)),void Tfe();let s;for(Ffe(i),Ffe(i.parent),n!==t&&(Ffe(n),Ffe(n.parent));i!==e.root&&0===ffe(i);)i===i.parent.left?(s=i.parent.right,1===ffe(s)&&(_fe(s,0),_fe(i.parent,1),Rfe(e,i.parent),s=i.parent.right),0===ffe(s.left)&&0===ffe(s.right)?(_fe(s,1),i=i.parent):(0===ffe(s.right)&&(_fe(s.left,0),_fe(s,1),Ofe(e,s),s=i.parent.right),_fe(s,ffe(i.parent)),_fe(i.parent,0),_fe(s.right,0),Rfe(e,i.parent),i=e.root)):(s=i.parent.left,1===ffe(s)&&(_fe(s,0),_fe(i.parent,1),Ofe(e,i.parent),s=i.parent.left),0===ffe(s.left)&&0===ffe(s.right)?(_fe(s,1),i=i.parent):(0===ffe(s.left)&&(_fe(s.right,0),_fe(s,1),Rfe(e,s),s=i.parent.left),_fe(s,ffe(i.parent)),_fe(i.parent,0),_fe(s.left,0),Ofe(e,i.parent),i=e.root));_fe(i,0),Tfe()}function Tfe(){Zy.parent=Zy,Zy.delta=0,Zy.start=0,Zy.end=0}function Rfe(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==Zy&&(i.left.parent=t),i.parent=t.parent,t.parent===Zy?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,Pfe(t),Pfe(i)}function Ofe(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==Zy&&(i.right.parent=t),i.parent=t.parent,t.parent===Zy?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,Pfe(t),Pfe(i)}function Afe(e){let t=e.end;if(e.left!==Zy){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==Zy){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function Pfe(e){e.maxEnd=Afe(e)}function Ffe(e){for(;e!==Zy;){const t=Afe(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function Wfe(e,t,i,n){return e===i?t-n:e-i}function Bfe(e){for(;e.left!==Xy;)e=e.left;return e}function Vfe(e){for(;e.right!==Xy;)e=e.right;return e}function Hfe(e){return e===Xy?0:e.size_left+e.piece.length+Hfe(e.right)}function zfe(e){return e===Xy?0:e.lf_left+e.piece.lineFeedCnt+zfe(e.right)}function Ufe(){Xy.parent=Xy}function Kfe(e,t){const i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==Xy&&(i.left.parent=t),i.parent=t.parent,t.parent===Xy?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function qfe(e,t){const i=t.left;t.left=i.right,i.right!==Xy&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===Xy?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function jfe(e,t){let i,n;if(t.left===Xy?(n=t,i=n.right):t.right===Xy?(n=t,i=n.left):(n=Bfe(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),Ufe(),void(e.root.parent=Xy);const o=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,Zfe(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,Zfe(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==Xy&&(n.left.parent=n),n.right!==Xy&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,Zfe(e,n)),t.detach(),i.parent.left===i){const t=Hfe(i),n=zfe(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){const o=t-i.parent.size_left,s=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,Gfe(e,i.parent,o,s)}}if(Zfe(e,i.parent),o)return void Ufe();let s;for(;i!==e.root&&0===i.color;)i===i.parent.left?(s=i.parent.right,1===s.color&&(s.color=0,i.parent.color=1,Kfe(e,i.parent),s=i.parent.right),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.right.color&&(s.left.color=0,s.color=1,qfe(e,s),s=i.parent.right),s.color=i.parent.color,i.parent.color=0,s.right.color=0,Kfe(e,i.parent),i=e.root)):(s=i.parent.left,1===s.color&&(s.color=0,i.parent.color=1,qfe(e,i.parent),s=i.parent.left),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.left.color&&(s.right.color=0,s.color=1,Kfe(e,s),s=i.parent.left),s.color=i.parent.color,i.parent.color=0,s.left.color=0,qfe(e,i.parent),i=e.root));i.color=0,Ufe()}function $fe(e,t){for(Zfe(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&Kfe(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,qfe(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&qfe(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,Kfe(e,t.parent.parent))}e.root.color=0}function Gfe(e,t,i,n){for(;t!==e.root&&t!==Xy;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function Zfe(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=Hfe((t=t.parent).left)-t.size_left,n=zfe(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}function Yfe(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t<i;t++){const n=e.charCodeAt(t);if(10===n)return!0;if(92===n){if(t++,t>=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}function Qfe(e,t,i){if(!i)return new ea(e,null);const n=[];for(let o=0,s=t.length;o<s;o++)n[o]=t[o];return new ea(e,n)}function Xfe(e,t,i,n,o){return function(e,t,i,n,o){if(0===n)return!0;const s=t.charCodeAt(n-1);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,o)&&function(e,t,i,n,o){if(n+o===i)return!0;const s=t.charCodeAt(n+o);if(0!==e.get(s))return!0;if(13===s||10===s)return!0;if(o>0){const i=t.charCodeAt(n+o-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,o)}function Jfe(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}function e_e(e,t=!0){const i=[0];let n=1;for(let o=0,s=e.length;o<s;o++){const t=e.charCodeAt(o);13===t?o+1<s&&10===e.charCodeAt(o+1)?(i[n++]=o+2,o++):i[n++]=o+1:10===t&&(i[n++]=o+1)}return t?Jfe(i):i}function t_e(e,t=Hi.ofCaller()){return"string"==typeof e?new gS(e,void 0,t):new gS(void 0,e,t)}function i_e(e,t,i=Hi.ofCaller()){return e.lazy?new pS(new Ki(e.owner,e.debugName,void 0),t,e.equalsFn??Ui,i):new cn(new Ki(e.owner,e.debugName,void 0),t,e.equalsFn??Ui,i)}function n_e(e,t){const i=e.gotoNextSibling(),n=t.gotoNextSibling();if(i!==n)throw new Error("Trees are out of sync");return i&&n}function o_e(e,t){const i=e.gotoParent(),n=t.gotoParent();if(i!==n)throw new Error("Trees are out of sync");return i&&n}function s_e(e,t,i){const n=e.gotoFirstChild(),o=t.gotoFirstChild();if(n!==o)throw new Error("Trees are out of sync");if(0===i)return n&&o;for(let s=1;s<=i;s++){const i=e.gotoNextSibling(),n=t.gotoNextSibling();if(i!==n)throw new Error("Trees are out of sync");if(!i||!n)return!1}return n&&o}function r_e(e,t){do{if(e.currentNode.nextSibling)return n_e(e,t);e.currentNode.parent&&o_e(e,t)}while(e.currentNode.nextSibling||e.currentNode.parent);return!1}function a_e(e,t){const i=t.walk();i.resetTo(e);const n=e.currentNode;do{if(i.currentNode.previousSibling&&i.currentNode.endIndex-i.currentNode.startIndex!==0)i.gotoPreviousSibling();else{for(;!i.currentNode.previousSibling&&i.currentNode.parent;)i.gotoParent();i.gotoPreviousSibling()}}while(i.currentNode.endIndex>n.startIndex&&(i.currentNode.parent||i.currentNode.previousSibling)&&i.currentNode.id!==n.id);return i.currentNode.id!==n.id&&i.currentNode.endIndex<=n.startIndex?i.currentNode:void 0}function l_e(e,t){return e.startPosition.row===t.startPosition.row&&e.startPosition.column===t.startPosition.column&&e.endPosition.row===t.endPosition.row&&e.endPosition.column===t.endPosition.column&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex}function d_e(e,t){return e.startIndex<=t.startIndex&&e.endIndex>=t.startIndex||t.startIndex<=e.startIndex&&t.endIndex>=e.startIndex}function c_e(e,t){return new hb([new cb(0,"",e)],t)}function h_e(e,t){const i=new Uint32Array(2);return i[0]=0,i[1]=(33587200|e)>>>0,new ub(i,null===t?SS:t)}function u_e(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);const o=[];let s=null;for(let r=t-1;n>1&&r>=1;r--){const t=e.getLineFirstNonWhitespaceColumn(r);if(0!==t&&t<n&&(o.push(e.getLineContent(r)),n=t,s=i?.getStartState(r),s))break}return o.reverse(),{likelyRelevantLines:o,initialState:s??void 0}}function g_e(e,t,i,n,o,s){let r=null;if(i)try{r=i.tokenizeEncoded(n,o,s.clone())}catch(a){$ae(a)}return r||(r=h_e(e.encodeLanguageId(t),s)),gl.convertToEndOffset(r.tokens,n.length),r}function p_e(e){return void 0!==e.token}function m_e(e,t){let i=e;const n=[];let o;for(;;){if(t.height===i.height){o=t;break}if(p_e(i))throw new Error("unexpected");n.push(i),i=i.lastChild()}for(let s=n.length-1;s>=0;s--){const e=n[s];o&&(e.children.length>=3?o=RS.create(e.unappendChild(),o):(e.appendChild(o),o=void 0))}if(o){const t=new RS(o.height+1);return t.appendChild(e),t.appendChild(o),t}return e}function f_e(e,t){return e.height===t.height?RS.create(e,t):e.height>t.height?m_e(e,t):function(e,t){let i=e;const n=[];for(;t.height!==i.height;){if(p_e(i))throw new Error("unexpected");n.push(i),i=i.children[0]}let o=t;for(let s=n.length-1;s>=0;s--){const e=n[s];o&&(e.children.length>=3?o=RS.create(o,e.unprependChild()):(e.prependChild(o),o=void 0))}return o?RS.create(o,e):e}(t,e)}function __e(e){let t;return{createChangeSummary:e=>({changes:[]}),handleChange(i,n){t||(t=e());for(const e in t)i.didChange(t[e])&&n.changes.push({key:e,change:i.change});return!0},beforeUpdate(i,n){t||(t=e());for(const e in t){if("changes"===e)throw new y('property name "changes" is reserved for change tracking');n[e]=t[e].read(i)}}}}function b_e(e){return e instanceof Uint32Array?e:new Uint32Array(e)}function v_e(e){return(33588224|e)>>>0}function w_e(e,t){const i=new Set;for(const n of t)e.has(n)&&i.add(n);return i}function C_e(e,t){let i;var n;return i="string"==typeof e?function(e){const t=new uS;return t.acceptChunk(e),t.finish()}(e):(n=e)&&"function"==typeof n.read?function(e){const t=new uS;let i;for(;"string"==typeof(i=e.read());)t.acceptChunk(i);return t.finish()}(e):e,i.create(t)}function y_e(e){let t=0;for(const i of e){if(" "!==i&&"\t"!==i)break;t++}return t}function S_e(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function x_e(e){return!!e.options.after||!!e.options.before}function k_e(e){return e.replace(/[^a-z0-9\-_]/gi," ")}function L_e(e){return e instanceof Lx?e:Lx.createDynamic(e)}function D_e(e,t,i,n,o,s,r,a){if(-1===o)return null;const l=i.length;if(l<=1)return null;const d="keepAll"===a,c=t.breakOffsets,h=t.breakOffsetsVisibleColumn,u=R_e(i,n,o,s,r),g=o-u,p=Ax,m=Px;let f=0,_=0,b=0,v=o;const w=c.length;let C=0;if(C>=0){let e=Math.abs(h[C]-v);for(;C+1<w;){const t=Math.abs(h[C+1]-v);if(t>=e)break;e=t,C++}}for(;C<w;){let t=C<0?0:c[C],o=C<0?0:h[C];_>t&&(t=_,o=b);let r=0,a=0,u=0,y=0;if(o<=v){let b=o,w=0===t?0:i.charCodeAt(t-1),C=0===t?0:e.get(w),S=!0;for(let o=t;o<l;o++){const t=o,l=i.charCodeAt(o);let c,h;if(ade(l)?(o++,c=0,h=2):(c=e.get(l),h=N_e(l,b,n,s)),t>_&&T_e(0,C,l,c,d)&&(r=t,a=b),b+=h,b>v){t>_?(u=t,y=b-h):(u=o+1,y=b),b-a>g&&(r=0),S=!1;break}w=l,C=c}if(S){f>0&&(p[f]=c[c.length-1],m[f]=h[c.length-1],f++);break}}if(0===r){let l=o,c=i.charCodeAt(t),h=e.get(c),p=!1;for(let n=t-1;n>=_;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){p=!0;break}let m,f;if(lde(o)?(n--,m=0,f=2):(m=e.get(o),f=fde(o)?s:1),l<=v){if(0===u&&(u=t,y=l),l<=v-g)break;if(T_e(0,m,c,h,d)){r=t,a=l;break}}l-=f,c=o,h=m}if(0!==r){const e=g-(y-a);if(e<=n){const t=i.charCodeAt(u);let o;o=ade(t)?2:N_e(t,y,n,s),e-o<0&&(r=0)}}if(p){C--;continue}}if(0===r&&(r=u,a=y),r<=_){const e=i.charCodeAt(_);ade(e)?(r=_+2,a=b+2):(r=_+1,a=b+N_e(e,b,n,s))}for(_=r,p[f]=r,b=a,m[f]=a,f++,v=a+g;C<0||C<w&&h[C]<a;)C++;let S=Math.abs(h[C]-v);for(;C+1<w;){const e=Math.abs(h[C+1]-v);if(e>=S)break;S=e,C++}}return 0===f?null:(p.length=f,m.length=f,Ax=t.breakOffsets,Px=t.breakOffsetsVisibleColumn,t.breakOffsets=p,t.breakOffsetsVisibleColumn=m,t.wrappedTextIndentLength=u,t)}function I_e(e,t,i,n,o,s,r,a,l){const d=RC.applyInjectedText(t,i);let c,h;if(i&&i.length>0?(c=i.map(e=>e.options),h=i.map(e=>e.column-1)):(c=null,h=null),-1===o)return c?new EC(h,c,[d.length],[],0):null;const u=d.length;if(u<=1)return c?new EC(h,c,[d.length],[],0):null;const g="keepAll"===a,p=R_e(d,n,o,s,r),m=o-p,f=[],_=[];let b=0,v=0,w=0,C=o,y=d.charCodeAt(0),S=e.get(y),x=N_e(y,0,n,s),k=1;ade(y)&&(x+=1,y=d.charCodeAt(1),S=e.get(y),k++);for(let L=k;L<u;L++){const t=L,i=d.charCodeAt(L);let o,r,a=!1;ade(i)?(L++,o=0,r=2):(o=e.get(i),r=N_e(i,x,n,s)),l&&M_e(d,L)?(v=t,w=x,a=!0):T_e(0,S,i,o,g)&&(v=t,w=x),x+=r,(x>C||a)&&((0===v||x-w>m)&&(v=t,w=x-r),f[b]=v,_[b]=w,b++,C=w+m,v=0),y=i,S=o}return 0!==b||i&&0!==i.length?(f[b]=u,_[b]=x,new EC(h,c,f,_,p)):null}function N_e(e,t,i,n){return 9===e?i-t%i:fde(e)||e<32?n:1}function E_e(e,t){return t-e%t}function M_e(e,t){if(t>=2&&"n"===e.charAt(t-1)){let i=0;for(let n=t-2;n>=0;n--){if("\\"!==e.charAt(n))return i%2==1;i++}}return!1}function T_e(e,t,i,n,o){return 32!==i&&(2===t&&2!==n||1!==t&&1===n||!o&&3===t&&2!==n||!o&&3===n&&1!==t)}function R_e(e,t,i,n,o){let s=0;if(0!==o){const r=jle(e);if(-1!==r){for(let i=0;i<r;i++)s+=9===e.charCodeAt(i)?E_e(s,t):1;const a=3===o?2:2===o?1:0;for(let e=0;e<a;e++)s+=E_e(s,t);s+n>i&&(s=0)}}return s}function O_e(e,t,i,n,o,s,r){let a="<div>",l=0,d=0,c=!0;for(let h=0,u=t.getCount();h<u;h++){const u=t.getEndOffset(h);let g="";for(;l<u&&l<o;l++){const t=e.charCodeAt(l),i=9===t;if(d+=fde(t)?2:i?0:1,l<n){if(i){const e=d%s;d+=0===e?s:s-e}}else switch(t){case 9:{const e=d%s,t=0===e?s:s-e;d+=t;let i=t;for(;i>0;)r&&c?(g+="&#160;",c=!1):(g+=" ",c=!0),i--;break}case 60:g+="&lt;",c=!1;break;case 62:g+="&gt;",c=!1;break;case 38:g+="&amp;",c=!1;break;case 0:g+="&#00;",c=!1;break;case 65279:case 8232:case 8233:case 133:g+="<22>",c=!1;break;case 13:g+="&#8203",c=!1;break;case 32:r&&c?(g+="&#160;",c=!1):(g+=" ",c=!0);break;default:g+=String.fromCharCode(t),c=!1}}if(!(u<=n)&&(a+=`<span style="${t.getInlineStyle(h,i)}">${g}</span>`,u>o||l>=o||n>=o))break}return a+="</div>",a}function A_e(e,t,i){let n='<div class="monaco-tokenized-source">';const o=qle(e);let s=i.getInitialState();for(let r=0,a=o.length;r<a;r++){const e=o[r];r>0&&(n+="<br/>");const a=i.tokenizeEncoded(e,!0,s);gl.convertToEndOffset(a.tokens,e.length);const l=new gl(a.tokens,e,t).inflate();let d=0;for(let t=0,i=l.getCount();t<i;t++){const i=l.getClassName(t),o=l.getEndOffset(t);n+=`<span class="${i}">${Wle(e.substring(d,o))}</span>`,d=o}s=a.endState}return n+="</div>",n}function P_e(e,t){return null===e?t?Kk.INSTANCE:qk.INSTANCE:new Uk(e,t)}function F_e(e){if(e>=jk.length)for(let t=1;t<=e;t++)jk[t]=W_e(t);return jk[e]}function W_e(e){return new Array(e+1).join(" ")}function B_e(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equalsRange(t[i]))return!1;return!0}function V_e(e){return yL+encodeURIComponent(e.toString())+SL}function H_e(e){return xL+encodeURIComponent(e.toString())+kL}function z_e(e){return new LL(e)}function U_e(e,t){return e}function K_e(e){return z_e(e)}function q_e(e,t,i,n=Hi.ofCaller()){return zce({debugName:()=>`Configuration Key "${e}"`},t=>i.onDidChangeConfiguration(i=>{i.affectsConfiguration(e)&&t(i)}),()=>i.getValue(e)??t,n)}function j_e(e,t,i,n=Hi.ofCaller()){const o=e.bindTo(t),s=new De;return Nce({debugName:()=>`Set Context Key "${e.key}"`},e=>{const t=i(e);return o.set(t),t},n).recomputeInitiallyAndOnChange(s),s}function $_e(e){return"element"===e?VL.value:BL.value}function G_e(){return WL("element",!0)}function Z_e(e,t){if(void 0!==e){const i=e.match(/^\s*var\((.+)\)$/);if(i){const e=i[1].split(",",2);return 2===e.length&&(t=Z_e(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}function Y_e(e){const t=e.replaceAll(/[^_\-a-z0-9]/gi,"");return t!==e&&console.warn(`CSS ident value ${e} modified to ${t} to be safe for CSS`),t}function Q_e(e){return`'${e.replaceAll(/'/g,"\\000027")}'`}function X_e(e){return e?ebe`url('${CSS.escape(ki.uriToBrowserUri(e).toString(!0))}')`:"url('')"}function J_e(e,t=!1){const i=CSS.escape(e);return t||i===e||console.warn(`CSS class name ${e} modified to ${i} to be safe for CSS`),i}function ebe(e,...t){return e.reduce((e,i,n)=>e+i+(t[n]||""),"")}function tbe(e){const t=function(e){if(zL=0,ibe(e,KL,4352),zL>0)return UL.subarray(0,zL);if(ibe(e,qL,4449),zL>0)return UL.subarray(0,zL);if(ibe(e,jL,4520),zL>0)return UL.subarray(0,zL);if(ibe(e,$L,12593),zL)return UL.subarray(0,zL);if(e>=44032&&e<=55203){const t=e-44032,i=t%588,n=Math.floor(t/588),o=Math.floor(i/28),s=i%28-1;if(n<KL.length?ibe(n,KL,0):4352+n-12593<$L.length&&ibe(4352+n,$L,12593),o<qL.length?ibe(o,qL,0):4449+o-12593<$L.length&&ibe(4449+o-12593,$L,12593),s>=0&&(s<jL.length?ibe(s,jL,0):4520+s-12593<$L.length&&ibe(4520+s-12593,$L,12593)),zL>0)return UL.subarray(0,zL)}}(e);if(t&&t.length>0)return new Uint32Array(t)}function ibe(e,t,i){var n;e>=i&&e<i+t.length&&(0!==(n=t[e-i])&&(UL[zL++]=255&n,n>>8&&(UL[zL++]=n>>8&255),n>>16&&(UL[zL++]=n>>16&255)))}function nbe(...e){return function(t,i){for(let n=0,o=e.length;n<o;n++){const o=e[n](t,i);if(o)return o}return null}}function obe(e,t,i){if(!i||i.length<t.length)return null;let n;return n=e?nde(i,t):0===i.indexOf(t),n?t.length>0?[{start:0,end:t.length}]:[]:null}function sbe(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function rbe(e,t){return abe(e.toLowerCase(),t.toLowerCase(),0,0)}function abe(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let o=null;return(o=abe(e,t,i+1,n+1))?fbe({start:n,end:n+1},o):null}return abe(e,t,i,n+1)}function lbe(e){return 97<=e&&e<=122}function dbe(e){return 65<=e&&e<=90}function cbe(e){return 48<=e&&e<=57}function hbe(e){return 32===e||9===e||10===e||13===e}function ube(e){return hbe(e)||ZL.has(e)}function gbe(e,t){return e===t||ube(e)&&ube(t)}function pbe(e){if(YL.has(e))return YL.get(e);let t;const i=tbe(e);return i&&(t=i),YL.set(e,t),t}function mbe(e){return lbe(e)||dbe(e)||cbe(e)}function fbe(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function _be(e,t){for(let i=t;i<e.length;i++){const t=e.charCodeAt(i);if(dbe(t)||cbe(t)||i>0&&!mbe(e.charCodeAt(i-1)))return i}return e.length}function bbe(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let o=null,s=n+1;for(o=bbe(e,t,i+1,n+1);!o&&(s=_be(t,s))<t.length;)o=bbe(e,t,i+1,s),s++;return null===o?null:fbe({start:n,end:n+1},o)}}function vbe(e,t){if(!t)return null;if(0===(t=t.trim()).length)return null;if(!function(e){let t=0,i=0,n=0,o=0;for(let s=0;s<e.length;s++)n=e.charCodeAt(s),dbe(n)&&t++,lbe(n)&&i++,hbe(n)&&o++;return 0!==t&&0!==i||0!==o?t<=5:e.length<=30}(e))return null;t.length>60&&(t=t.substring(0,60));const i=function(e){let t=0,i=0,n=0,o=0,s=0;for(let r=0;r<e.length;r++)s=e.charCodeAt(r),dbe(s)&&t++,lbe(s)&&i++,mbe(s)&&n++,cbe(s)&&o++;return{upperPercent:t/e.length,lowerPercent:i/e.length,alphaPercent:n/e.length,numericPercent:o/e.length}}(t);if(!function(e){const{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:o}=e;return i>.2&&t<.8&&n>.6&&o<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,o=0;for(e=e.toLowerCase();o<t.length&&null===(n=bbe(e,t,0,o));)o=_be(t,o+1);return n}function wbe(e,t,i=!1){if(!t||0===t.length)return null;let n=null,o=0;for(e=e.toLowerCase(),t=t.toLowerCase();o<t.length&&(n=Cbe(e,t,0,o,i),null===n);)o=ybe(t,o+1);return n}function Cbe(e,t,i,n,o){let s=0;if(i===e.length)return[];if(n===t.length)return null;if(!gbe(e.charCodeAt(i),t.charCodeAt(n))){const o=pbe(e.charCodeAt(i));if(!o)return null;for(let e=0;e<o.length;e++)if(!gbe(o[e],t.charCodeAt(n+e)))return null;s+=o.length-1}let r=null,a=n+s+1;if(r=Cbe(e,t,i+1,a,o),!o)for(;!r&&(a=ybe(t,a))<t.length;)r=Cbe(e,t,i+1,a,o),a++;if(!r)return null;if(e.charCodeAt(i)!==t.charCodeAt(n)){const o=pbe(e.charCodeAt(i));if(!o)return r;for(let e=0;e<o.length;e++)if(o[e]!==t.charCodeAt(n+e))return r}return fbe({start:n,end:n+s+1},r)}function ybe(e,t){for(let i=t;i<e.length;i++)if(ube(e.charCodeAt(i))||i>0&&ube(e.charCodeAt(i-1)))return i;return e.length}function Sbe(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=JL.get(e);n||(n=new RegExp(e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*"),"i"),JL.set(e,n));const o=n.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:i?XL(e,t):QL(e,t)}function xbe(e,t){const i=Tbe(e,e.toLowerCase(),0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?Lbe(i):null}function kbe(e,t,i,n,o,s){const r=Math.min(13,e.length);for(;i<r;i++){const r=Tbe(e,t,i,n,o,s,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(r)return r}return[0,s]}function Lbe(e){if(void 0===e)return[];const t=[],i=e[1];for(let n=e.length-1;n>1;n--){const o=e[n]+i,s=t[t.length-1];s&&s.end===o?s.end=o+1:t.push({start:o,end:o+1})}return t}function Dbe(){const e=[],t=[];for(let i=0;i<=eD;i++)t[i]=0;for(let i=0;i<=eD;i++)e.push(t.slice(0));return e}function Ibe(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}function Nbe(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!_de(i)}}function Ebe(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function Mbe(e,t,i){return t[e]!==i[e]}function Tbe(e,t,i,n,o,s,r=aD.default){const a=e.length>eD?eD:e.length,l=n.length>eD?eD:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!function(e,t,i,n,o,s,r=!1){for(;t<i&&o<s;)e[t]===n[o]&&(r&&(tD[t]=o),t+=1),o+=1;return t===i}(t,i,a,o,s,l,!0))return;!function(e,t,i,n,o,s){let r=e-1,a=t-1;for(;r>=i&&a>=n;)o[r]===s[a]&&(iD[r]=a,r--),a--}(a,l,i,s,t,o);let d=1,c=1,h=i,u=s;const g=[!1];for(d=1,h=i;h<a;d++,h++){const r=tD[h],p=iD[h],m=h+1<a?iD[h+1]:l;for(c=r-s+1,u=r;u<m;c++,u++){let a=Number.MIN_SAFE_INTEGER,m=!1;u<=p&&(a=Rbe(e,t,h,i,n,o,u,l,s,0===nD[d-1][c-1],g));let f=0;a!==Number.MIN_SAFE_INTEGER&&(m=!0,f=a+oD[d-1][c-1]);const _=u>r,b=_?oD[d][c-1]+(nD[d][c-1]>0?-5:0):0,v=u>r+1&&nD[d][c-1]>0,w=v?oD[d][c-2]+(nD[d][c-2]>0?-5:0):0;if(v&&(!_||w>=b)&&(!m||w>=f))oD[d][c]=w,sD[d][c]=3,nD[d][c]=0;else if(_&&(!m||b>=f))oD[d][c]=b,sD[d][c]=2,nD[d][c]=0;else{if(!m)throw new Error("not possible");oD[d][c]=f,sD[d][c]=1,nD[d][c]=nD[d-1][c-1]+1}}}if(!g[0]&&!r.firstMatchCanBeWeak)return;d--,c--;const p=[oD[d][c],s];let m=0,f=0;for(;d>=1;){let e=c;do{const t=sD[d][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+d-1]===o[s+c-1]&&!Mbe(e+s-1,n,o)&&m+1>nD[d][e]&&(e=c),e===c?m++:m=1,f||(f=e),d--,c=e-1,p.push(c)}l-s===a&&r.boostFullMatch&&(p[0]+=2);const _=f-a;return p[0]-=_,p}function Rbe(e,t,i,n,o,s,r,a,l,d,c){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===i-n?h=e[i]===o[r]?7:5:!Mbe(r,o,s)||0!==r&&Mbe(r-1,o,s)?!Nbe(s,r)||0!==r&&Nbe(s,r-1)?(Nbe(s,r-1)||Ebe(s,r-1))&&(h=5,u=!0):h=5:(h=e[i]===o[r]?7:5,u=!0),h>1&&i===n&&(c[0]=!0),u||(u=Mbe(r,o,s)||Nbe(s,r-1)||Ebe(s,r-1)),i===n?r>l&&(h-=u?3:5):h+=d?u?2:0:u?0:1,r+1===a&&(h-=u?3:5),h}function Obe(e,t,i,n,o,s,r){return function(e,t,i,n,o,s,r,a){let l=Tbe(e,t,i,n,o,s,a);if(e.length>=3){const t=Math.min(7,e.length-1);for(let r=i+1;r<t;r++){const t=Abe(e,r);if(t){const e=Tbe(t,t.toLowerCase(),i,n,o,s,a);e&&(e[0]-=3,(!l||e[0]>l[0])&&(l=e))}}}return l}(e,t,i,n,o,s,0,r)}function Abe(e,t){if(t+1>=e.length)return;const i=e[t],n=e[t+1];return i!==n?e.slice(0,t)+n+i+e.slice(t+2):void 0}function Pbe(e){return-1===e.indexOf(lD)?e:e.replace(uD,(e,t,i,n)=>i?e:t||n||"")}function Fbe(e){return e?e.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}function Wbe(e){gD.lastIndex=0;let t="";const i=[];let n=0;for(;;){const o=gD.lastIndex,s=gD.exec(e),r=e.substring(o,s?.index);if(r.length>0){t+=r;for(let e=0;e<r.length;e++)i.push(n)}if(!s)break;n+=s[0].length}return{text:t,iconOffsets:i}}function Bbe(e,t,i=!1){const{text:n,iconOffsets:o}=t;if(!o||0===o.length)return Sbe(e,n,i);const s=Hle(n," "),r=n.length-s.length,a=Sbe(e,s,i);if(a)for(const l of a){const e=o[l.start+r]+r;l.start+=e,l.end+=e}return a}function Vbe(e){return Hbe(e)?!e.value:!Array.isArray(e)||e.every(Vbe)}function Hbe(e){return e instanceof pD||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&"object"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons||"boolean"!=typeof e.supportAlertSyntax&&void 0!==e.supportAlertSyntax)}function zbe(e){return e.replace(/"/g,"&quot;")}function Ube(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1"):e}function Kbe(e,...t){return _i.from({scheme:yi.command,path:e,query:t.length?encodeURIComponent(JSON.stringify(t)):void 0})}function qbe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function jbe(e){_D=e}function $be(e,t){if(t){if(bD.test(e))return e.replace(vD,SD)}else if(wD.test(e))return e.replace(CD,SD);return e}function Gbe(e,t){let i="string"==typeof e?e:e.source;t=t||"";const n={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(xD,"$1"),i=i.replace(e,o),n},getRegex:()=>new RegExp(i,t)};return n}function Zbe(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}function Ybe(e,t){const i=e.replace(/\|/g,(e,t,i)=>{let n=!1,o=t;for(;--o>=0&&"\\"===i[o];)n=!n;return n?"|":" |"}).split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function Qbe(e,t,i){const n=e.length;if(0===n)return"";let o=0;for(;o<n&&e.charAt(n-o-1)===t;)o++;return e.slice(0,n-o)}function Xbe(e,t,i,n){const o=t.href,s=t.title?$be(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:i,href:o,title:s,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,e}return{type:"image",raw:i,href:o,title:s,text:$be(r)}}function Jbe(e,t){return SI.parse(e,t)}function eve(e){let t=JSON.parse(e);return t=ive(t),t}function tve(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}function ive(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return _i.revive(e);case 2:return new RegExp(e.source,e.flags);case 17:return new Date(e.source)}if(e instanceof Ni||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i<e.length;++i)e[i]=ive(e[i],t+1);else for(const i in e)Object.hasOwnProperty.call(e,i)&&(e[i]=ive(e[i],t+1))}return e}function nve(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return OI(e,t,n)}}function ove(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:HI;DI&&DI(e,null);let n=t.length;for(;n--;){let o=t[n];if("string"==typeof o){const e=i(o);e!==o&&(II(t)||(t[n]=e),o=e)}e[o]=!0}return e}function sve(e){for(let t=0;t<e.length;t++)$I(e,t)||(e[t]=null);return e}function rve(e){const t=RI(null);for(const[i,n]of LI(e))$I(e,i)&&(Array.isArray(n)?t[i]=sve(n):n&&"object"==typeof n&&n.constructor===Object?t[i]=rve(n):t[i]=n);return t}function ave(e,t){for(;null!==e;){const i=EI(e,t);if(i){if(i.get)return nve(i.get);if("function"==typeof i.value)return nve(i.value)}e=NI(e)}return function(){return null}}function lve(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vN();const t=e=>lve(e);if(t.version="3.2.7",t.removed=[],!e||!e.document||e.document.nodeType!==bN.document||!e.Element)return t.isSupported=!1,t;let{document:i}=e;const n=i,o=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:d,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:u,trustedTypes:g}=e,p=l.prototype,m=ave(p,"cloneNode"),f=ave(p,"remove"),_=ave(p,"nextSibling"),b=ave(p,"childNodes"),v=ave(p,"parentNode");if("function"==typeof r){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let w,C="";const{implementation:y,createNodeIterator:S,createDocumentFragment:x,getElementsByTagName:k}=i,{importNode:L}=n;let D=CN();t.isSupported="function"==typeof LI&&"function"==typeof v&&y&&void 0!==y.createHTMLDocument;const{MUSTACHE_EXPR:I,ERB_EXPR:N,TMPLIT_EXPR:E,DATA_ATTR:M,ARIA_ATTR:T,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:A}=_N;let{IS_ALLOWED_URI:P}=_N,F=null;const W=ove({},[...YI,...QI,...XI,...eN,...iN]);let B=null;const V=ove({},[...nN,...oN,...sN,...rN]);let H=Object.seal(RI(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,U=null,K=!0,q=!0,j=!1,$=!0,G=!1,Z=!0,Y=!1,Q=!1,X=!1,J=!1,ee=!1,te=!1,ie=!0,ne=!1,oe=!0,se=!1,re={},ae=null;const le=ove({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const ce=ove({},["audio","video","img","source","image","track"]);let he=null;const ue=ove({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",pe="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let fe=me,_e=!1,be=null;const ve=ove({},[ge,pe,me],zI);let we=ove({},["mi","mo","mn","ms","mtext"]),Ce=ove({},["annotation-xml"]);const ye=ove({},["title","style","font","a","script"]);let Se=null;const xe=["application/xhtml+xml","text/html"];let ke=null,Le=null;const De=i.createElement("form"),Ie=function(e){return e instanceof RegExp||e instanceof Function},Ne=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Le||Le!==e){if(e&&"object"==typeof e||(e={}),e=rve(e),Se=-1===xe.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ke="application/xhtml+xml"===Se?zI:HI,F=$I(e,"ALLOWED_TAGS")?ove({},e.ALLOWED_TAGS,ke):W,B=$I(e,"ALLOWED_ATTR")?ove({},e.ALLOWED_ATTR,ke):V,be=$I(e,"ALLOWED_NAMESPACES")?ove({},e.ALLOWED_NAMESPACES,zI):ve,he=$I(e,"ADD_URI_SAFE_ATTR")?ove(rve(ue),e.ADD_URI_SAFE_ATTR,ke):ue,de=$I(e,"ADD_DATA_URI_TAGS")?ove(rve(ce),e.ADD_DATA_URI_TAGS,ke):ce,ae=$I(e,"FORBID_CONTENTS")?ove({},e.FORBID_CONTENTS,ke):le,z=$I(e,"FORBID_TAGS")?ove({},e.FORBID_TAGS,ke):rve({}),U=$I(e,"FORBID_ATTR")?ove({},e.FORBID_ATTR,ke):rve({}),re=!!$I(e,"USE_PROFILES")&&e.USE_PROFILES,K=!1!==e.ALLOW_ARIA_ATTR,q=!1!==e.ALLOW_DATA_ATTR,j=e.ALLOW_UNKNOWN_PROTOCOLS||!1,$=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,G=e.SAFE_FOR_TEMPLATES||!1,Z=!1!==e.SAFE_FOR_XML,Y=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,X=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,ne=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||uN,fe=e.NAMESPACE||me,we=e.MATHML_TEXT_INTEGRATION_POINTS||we,Ce=e.HTML_INTEGRATION_POINTS||Ce,H=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(q=!1),ee&&(J=!0),re&&(F=ove({},iN),B=[],!0===re.html&&(ove(F,YI),ove(B,nN)),!0===re.svg&&(ove(F,QI),ove(B,oN),ove(B,rN)),!0===re.svgFilters&&(ove(F,XI),ove(B,oN),ove(B,rN)),!0===re.mathMl&&(ove(F,eN),ove(B,sN),ove(B,rN))),e.ADD_TAGS&&(F===W&&(F=rve(F)),ove(F,e.ADD_TAGS,ke)),e.ADD_ATTR&&(B===V&&(B=rve(B)),ove(B,e.ADD_ATTR,ke)),e.ADD_URI_SAFE_ATTR&&ove(he,e.ADD_URI_SAFE_ATTR,ke),e.FORBID_CONTENTS&&(ae===le&&(ae=rve(ae)),ove(ae,e.FORBID_CONTENTS,ke)),oe&&(F["#text"]=!0),Y&&ove(F,["html","head","body"]),F.table&&(ove(F,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw ZI('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw ZI('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,C=w.createHTML("")}else void 0===w&&(w=wN(g,o)),null!==w&&"string"==typeof C&&(C=w.createHTML(""));MI&&MI(e),Le=e}},Ee=ove({},[...QI,...XI,...JI]),Me=ove({},[...eN,...tN]),Te=function(e){BI(t.removed,{element:e});try{v(e).removeChild(e)}catch(i){f(e)}},Re=function(e,i){try{BI(t.removed,{attribute:i.getAttributeNode(e),from:i})}catch(n){BI(t.removed,{attribute:null,from:i})}if(i.removeAttribute(e),"is"===e)if(J||ee)try{Te(i)}catch(n){}else try{i.setAttribute(e,"")}catch(n){}},Oe=function(e){let t=null,n=null;if(X)e="<remove></remove>"+e;else{const t=UI(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&fe===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=w?w.createHTML(e):e;if(fe===me)try{t=(new u).parseFromString(o,Se)}catch(r){}if(!t||!t.documentElement){t=y.createDocument(fe,"template",null);try{t.documentElement.innerHTML=_e?C:o}catch(r){}}const s=t.body||t.documentElement;return e&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),fe===me?k.call(t,Y?"html":"body")[0]:Y?t.documentElement:s},Ae=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Pe=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof c)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Fe=function(e){return"function"==typeof a&&e instanceof a};function We(e,i,n){PI(e,e=>{e.call(t,i,n,Le)})}const Be=function(e){let i=null;if(We(D.beforeSanitizeElements,e,null),Pe(e))return Te(e),!0;const n=ke(e.nodeName);if(We(D.uponSanitizeElement,e,{tagName:n,allowedTags:F}),Z&&e.hasChildNodes()&&!Fe(e.firstElementChild)&&GI(/<[/\w!]/g,e.innerHTML)&&GI(/<[/\w!]/g,e.textContent))return Te(e),!0;if(e.nodeType===bN.progressingInstruction)return Te(e),!0;if(Z&&e.nodeType===bN.comment&&GI(/<[/\w]/g,e.data))return Te(e),!0;if(!F[n]||z[n]){if(!z[n]&&He(n)){if(H.tagNameCheck instanceof RegExp&&GI(H.tagNameCheck,n))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(n))return!1}if(oe&&!ae[n]){const t=v(e)||e.parentNode,i=b(e)||e.childNodes;if(i&&t)for(let n=i.length-1;n>=0;--n){const o=m(i[n],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,_(e))}}return Te(e),!0}return e instanceof l&&!function(e){let t=v(e);t&&t.tagName||(t={namespaceURI:fe,tagName:"template"});const i=HI(e.tagName),n=HI(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===pe?t.namespaceURI===me?"svg"===i:t.namespaceURI===ge?"svg"===i&&("annotation-xml"===n||we[n]):Boolean(Ee[i]):e.namespaceURI===ge?t.namespaceURI===me?"math"===i:t.namespaceURI===pe?"math"===i&&Ce[n]:Boolean(Me[i]):e.namespaceURI===me?!(t.namespaceURI===pe&&!Ce[n])&&!(t.namespaceURI===ge&&!we[n])&&!Me[i]&&(ye[i]||!Ee[i]):!("application/xhtml+xml"!==Se||!be[e.namespaceURI]))}(e)?(Te(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!GI(/<\/no(script|embed|frames)/i,e.innerHTML)?(G&&e.nodeType===bN.text&&(i=e.textContent,PI([I,N,E],e=>{i=KI(i,e," ")}),e.textContent!==i&&(BI(t.removed,{element:e.cloneNode()}),e.textContent=i)),We(D.afterSanitizeElements,e,null),!1):(Te(e),!0)},Ve=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in De))return!1;if(q&&!U[t]&&GI(M,t));else if(K&&GI(T,t));else if(!B[t]||U[t]){if(!(He(e)&&(H.tagNameCheck instanceof RegExp&&GI(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&GI(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t,e))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&GI(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(he[t]);else if(GI(P,KI(n,O,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==qI(n,"data:")||!de[e])if(j&&!GI(R,KI(n,O,"")));else if(n)return!1;return!0},He=function(e){return"annotation-xml"!==e&&UI(e,A)},ze=function(e){We(D.beforeSanitizeAttributes,e,null);const{attributes:i}=e;if(!i||Pe(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0};let o=i.length;for(;o--;){const{name:r,namespaceURI:a,value:l}=i[o],d=ke(r),c=l;let h="value"===r?c:jI(c);if(n.attrName=d,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,We(D.uponSanitizeAttribute,e,n),h=n.attrValue,!ne||"id"!==d&&"name"!==d||(Re(r,e),h="user-content-"+h),Z&&GI(/((--!?|])>)|<\/(style|title|textarea)/i,h)){Re(r,e);continue}if("attributename"===d&&UI(h,"href")){Re(r,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){Re(r,e);continue}if(!$&&GI(/\/>/i,h)){Re(r,e);continue}G&&PI([I,N,E],e=>{h=KI(h,e," ")});const u=ke(e.nodeName);if(Ve(u,d,h)){if(w&&"object"==typeof g&&"function"==typeof g.getAttributeType)if(a);else switch(g.getAttributeType(u,d)){case"TrustedHTML":h=w.createHTML(h);break;case"TrustedScriptURL":h=w.createScriptURL(h)}if(h!==c)try{a?e.setAttributeNS(a,r,h):e.setAttribute(r,h),Pe(e)?Te(e):WI(t.removed)}catch(s){Re(r,e)}}else Re(r,e)}We(D.afterSanitizeAttributes,e,null)},Ue=function e(t){let i=null;const n=Ae(t);for(We(D.beforeSanitizeShadowDOM,t,null);i=n.nextNode();)We(D.uponSanitizeShadowNode,i,null),Be(i),ze(i),i.content instanceof s&&e(i.content);We(D.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,r=null,l=null,d=null;if(_e=!e,_e&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Fe(e)){if("function"!=typeof e.toString)throw ZI("toString is not a function");if("string"!=typeof(e=e.toString()))throw ZI("dirty is not a string, aborting")}if(!t.isSupported)return e;if(Q||Ne(i),t.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=ke(e.nodeName);if(!F[t]||z[t])throw ZI("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof a)o=Oe("\x3c!----\x3e"),r=o.ownerDocument.importNode(e,!0),r.nodeType===bN.element&&"BODY"===r.nodeName||"HTML"===r.nodeName?o=r:o.appendChild(r);else{if(!J&&!G&&!Y&&-1===e.indexOf("<"))return w&&te?w.createHTML(e):e;if(o=Oe(e),!o)return J?null:te?C:""}o&&X&&Te(o.firstChild);const c=Ae(se?e:o);for(;l=c.nextNode();)Be(l),ze(l),l.content instanceof s&&Ue(l.content);if(se)return e;if(J){if(ee)for(d=x.call(o.ownerDocument);o.firstChild;)d.appendChild(o.firstChild);else d=o;return(B.shadowroot||B.shadowrootmode)&&(d=L.call(n,d,!0)),d}let h=Y?o.outerHTML:o.innerHTML;return Y&&F["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&GI(mN,o.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+h),G&&PI([I,N,E],e=>{h=KI(h,e," ")}),w&&te?w.createHTML(h):h},t.setConfig=function(){Ne(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},t.clearConfig=function(){Le=null,Q=!1},t.isValidAttribute=function(e,t,i){return Le||Ne({}),Ve(ke(e),ke(t),i)},t.addHook=function(e,t){"function"==typeof t&&BI(D[e],t)},t.removeHook=function(e,t){if(void 0!==t){const i=FI(D[e],t);return-1===i?void 0:VI(D[e],i,1)[0]}return WI(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=CN()},t}function dve(e,t){if("*"===t.override)return!0;try{const i=new URL(e,kN+"://");return!!t.override.includes(i.protocol.replace(/:$/,""))||!(!t.allowRelativePaths||i.protocol!==kN+":"||e.trim().toLowerCase().startsWith(kN))}catch(i){return!1}}function cve(e,t,i){try{const s={...LN};t?.allowedTags&&(t.allowedTags.override&&(s.ALLOWED_TAGS=[...t.allowedTags.override]),t.allowedTags.augment&&(s.ALLOWED_TAGS=[...s.ALLOWED_TAGS??[],...t.allowedTags.augment]));let r=[...xN];t?.allowedAttributes&&(t.allowedAttributes.override&&(r=[...t.allowedAttributes.override]),t.allowedAttributes.augment&&(r=[...r,...t.allowedAttributes.augment])),r=r.map(e=>"string"==typeof e?e.toLowerCase():{attributeName:e.attributeName.toLowerCase(),shouldKeep:e.shouldKeep});const a=new Set(r.map(e=>"string"==typeof e?e:e.attributeName)),l=new Map;for(const e of r)"string"==typeof e?l.delete(e):l.set(e.attributeName,e);return s.ALLOWED_ATTR=Array.from(a),n={override:t?.allowedLinkProtocols?.override??[yi.http,yi.https],allowRelativePaths:t?.allowRelativeLinkPaths??!1},o={override:t?.allowedMediaProtocols?.override??[yi.http,yi.https],allowRelativePaths:t?.allowRelativeMediaPaths??!1},yN.addHook("afterSanitizeAttributes",e=>{for(const t of["href","src"])if(e.hasAttribute(t)){const i=e.getAttribute(t);"href"===t?i.startsWith("#")||dve(i,n)||e.removeAttribute(t):dve(i,o)||e.removeAttribute(t)}}),t?.replaceWithPlaintext&&yN.addHook("uponSanitizeElement",IN),l.size&&yN.addHook("uponSanitizeAttribute",(e,t)=>{const i=l.get(t.attrName);if(i){const n=i.shouldKeep(e,t);"string"==typeof n?(t.keepAttr=!0,t.attrValue=n):t.keepAttr=n}else t.keepAttr=a.has(t.attrName)}),"dom"===i?yN.sanitize(e,{...s,RETURN_DOM_FRAGMENT:!0}):yN.sanitize(e,{...s,RETURN_TRUSTED_TYPE:!0})}finally{yN.removeAllHooks()}var n,o}function hve(e){if(!e.ownerDocument)return;let t,i;if(e.nodeType===Node.COMMENT_NODE)t=`\x3c!--${e.textContent}--\x3e`;else{if(!(e instanceof Element))return;{const n=e.tagName.toLowerCase(),o=DN.includes(n);t=`<${n}${e.attributes.length?" "+Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "):""}>`,o||(i=`</${n}>`)}}const n=document.createDocumentFragment(),o=e.ownerDocument.createTextNode(t);for(n.appendChild(o);e.firstChild;)n.appendChild(e.firstChild);const s=i?e.ownerDocument.createTextNode(i):void 0;return s&&n.appendChild(s),n}function uve(e,t,i){Rhe(e,cve(t,i,"dom"))}function gve(e){const t=new Array;let i,n=0,o=0;for(;null!==(i=NN.exec(e));){o=i.index||0,n<o&&t.push(e.substring(n,o)),n=(i.index||0)+i[0].length;const[,s,r]=i;t.push(s?`$(${r})`:pve({id:r}))}return n<e.length&&t.push(e.substring(n)),t}function pve(e){const t=Ahe("span");return t.classList.add(...mo.asClassNameArray(e)),t}function mve(e,t={},i){const n=new De;let o=!1;const s=new yI(...t.markedExtensions??[]),{renderer:r,codeBlocks:a,syncCodeBlocks:l}=function(e,t,i){const n=new e.Renderer(t.markedOptions);var o;n.image=EN.image,n.link=EN.link,n.paragraph=EN.paragraph,i.supportAlertSyntax&&(n.blockquote=(o=n.blockquote,function(e){const{tokens:t}=e,i=t[0];if("paragraph"!==i?.type)return o.call(this,e);const n=i.tokens;if(!n||0===n.length)return o.call(this,e);const s=n[0];if("text"!==s?.type)return o.call(this,e);const r=/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i,a=s.raw.match(r);if(!a)return o.call(this,e);s.raw=s.raw.replace(r,""),s.text=s.text.replace(r,"");const l=a[1],d=l.charAt(0).toUpperCase()+l.slice(1).toLowerCase(),c=l.toLowerCase();return`<blockquote data-severity="${c}"><p><span>${pve({id:{note:"info",tip:"light-bulb",important:"comment",warning:"alert",caution:"stop"}[c]}).outerHTML}${d}</span>${this.parser.parse(t).substring(3)}</blockquote>\n`}));const s=[],r=[];return t.codeBlockRendererSync?n.code=({text:e,lang:i,raw:n})=>{const o=fD.nextId(),s=t.codeBlockRendererSync(vve(i),e,n);return r.push([o,s]),`<div class="code" data-code="${o}">${Wle(e)}</div>`}:t.codeBlockRenderer&&(n.code=({text:e,lang:i})=>{const n=fD.nextId(),o=t.codeBlockRenderer(vve(i),e);return s.push(o.then(e=>[n,e])),`<div class="code" data-code="${n}">${Wle(e)}</div>`}),i.supportHtml||(n.html=({text:e})=>t.sanitizerConfig?.replaceWithPlaintext?Wle(e):(i.isTrusted?e.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?e:""),{renderer:n,codeBlocks:s,syncCodeBlocks:r}}(s,t,e),d=function(e){let t=e.value;return t.length>1e5&&(t=`${t.substr(0,1e5)}…`),e.supportThemeIcons&&(t=function(e){return e.replace(hD,e=>`\\${e}`)}(t)),t}(e);let c;if(t.fillInIncompleteTokens){const e={...s.defaults,...t.markedOptions,renderer:r},i=function(e){for(let t=0;t<AN;t++){const t=Ive(e);if(!t)break;e=t}return e}(s.lexer(d,e));c=s.parser(i,e)}else c=s.parse(d,{...t?.markedOptions,renderer:r,async:!1});e.supportThemeIcons&&(c=gve(c).map(e=>"string"==typeof e?e:e.outerHTML).join(""));const h=document.createElement("div");let u;if(uve(h,c,yve(e,t.sanitizerConfig??{})),function(e,t,i){for(const o of i.querySelectorAll("img, audio, video, source")){const i=o.getAttribute("src");if(i){let s=i;try{e.baseUri&&(s=wve(_i.from(e.baseUri),s))}catch(n){}if(o.setAttribute("src",bve(e,s,!0)),t.sanitizerConfig?.remoteImageIsAllowed){const e=_i.parse(s);e.scheme===yi.file||e.scheme===yi.data||t.sanitizerConfig.remoteImageIsAllowed(e)||o.replaceWith(Ahe("",void 0,o.outerHTML))}}}for(const o of i.querySelectorAll("a")){const t=o.getAttribute("href");if(o.setAttribute("href",""),!t||/^data:|javascript:/i.test(t)||/^command:/i.test(t)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(t))o.replaceWith(...o.childNodes);else{let i=bve(e,t,!1);e.baseUri&&(i=wve(_i.from(e.baseUri),t)),o.dataset.href=i}}}(e,t,h),i?(u=i,Rhe(i,...h.children)):u=h,a.length>0)Promise.all(a).then(e=>{if(o)return;const i=new Map(e),n=u.querySelectorAll("div[data-code]");for(const t of n){const e=i.get(t.dataset.code??"");e&&Rhe(t,e)}t.asyncRenderCallback?.()});else if(l.length>0){const e=new Map(l),t=u.querySelectorAll("div[data-code]");for(const i of t){const t=e.get(i.dataset.code??"");t&&Rhe(i,t)}}if(t.asyncRenderCallback)for(const g of u.getElementsByTagName("img")){const e=n.add(ehe(g,"load",()=>{e.dispose(),t.asyncRenderCallback()}))}if(t.actionHandler){const i=i=>{const n=new Se(pn(u),i);(n.leftButton||n.middleButton)&&fve(e,t,n)};n.add(ehe(u,"click",i)),n.add(ehe(u,"auxclick",i)),n.add(ehe(u,"keydown",i=>{const n=new we(i);(n.equals(10)||n.equals(3))&&fve(e,t,n)}))}for(const g of[...u.getElementsByTagName("input")])if("checkbox"===g.attributes.getNamedItem("type")?.value)g.setAttribute("disabled","");else if(t.sanitizerConfig?.replaceWithPlaintext){const e=hve(g);e?g.parentElement?.replaceChild(e,g):g.remove()}else g.remove();return{element:u,dispose:()=>{o=!0,n.dispose()}}}function fve(e,t,i){const n=i.target.closest("a[data-href]");if(xhe(n))try{let i=n.dataset.href;i&&(e.baseUri&&(i=wve(_i.from(e.baseUri),i)),t.actionHandler?.(i,e))}catch(o){$ae(o)}finally{i.preventDefault()}}function _ve(e,t){let i;try{i=eve(decodeURIComponent(t))}catch(n){}return i?(i=Vue(i,t=>e.uris&&e.uris[t]?_i.revive(e.uris[t]):void 0),encodeURIComponent(JSON.stringify(i))):t}function bve(e,t,i){const n=e.uris&&e.uris[t];let o=_i.revive(n);return i?t.startsWith(yi.data+":")?t:(o||(o=_i.parse(t)),ki.uriToBrowserUri(o).toString(!0)):o?_i.parse(t).toString()===o.toString()?t:(o.query&&(o=o.with({query:_ve(e,o.query)})),o.toString()):t}function vve(e){if(!e)return"";const t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}function wve(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?Vs(e,t).toString():Vs(Ps(e),t).toString()}function Cve(e,t,i={}){return n=e,o=yve(t,i),cve(n,o,"trusted");var n,o}function yve(e,t){const i=e.isTrusted??!1,n=[yi.http,yi.https,yi.mailto,yi.file,yi.vscodeFileResource,yi.vscodeRemote,yi.vscodeRemoteResource,yi.vscodeNotebookCell];return i&&n.push(yi.command),t.allowedLinkSchemes?.augment&&n.push(...t.allowedLinkSchemes.augment),{allowedTags:{override:t.allowedTags?.override??MN},allowedAttributes:{override:t.allowedAttributes?.override??TN},allowedLinkProtocols:{override:n},allowRelativeLinkPaths:!!e.baseUri,allowedMediaProtocols:{override:[yi.http,yi.https,yi.data,yi.file,yi.vscodeFileResource,yi.vscodeRemote,yi.vscodeRemoteResource]},allowRelativeMediaPaths:!!e.baseUri,replaceWithPlaintext:t.replaceWithPlaintext}}function Sve(){const e=new bI;return e.code=({text:e})=>Wle(e),e.blockquote=({text:e})=>e+"\n",e.html=e=>"",e.heading=function({tokens:e}){return this.parser.parseInline(e)+"\n"},e.hr=()=>"",e.list=function({items:e}){return e.map(e=>this.listitem(e)).join("\n")+"\n"},e.listitem=({text:e})=>e+"\n",e.paragraph=function({tokens:e}){return this.parser.parseInline(e)+"\n"},e.table=function({header:e,rows:t}){return e.map(e=>this.tablecell(e)).join(" ")+"\n"+t.map(e=>e.map(e=>this.tablecell(e)).join(" ")).join("\n")+"\n"},e.tablerow=({text:e})=>e,e.tablecell=function({tokens:e}){return this.parser.parseInline(e)},e.strong=({text:e})=>e,e.em=({text:e})=>e,e.codespan=({text:e})=>Wle(e),e.br=e=>"\n",e.del=({text:e})=>e,e.image=e=>"",e.text=({text:e})=>e,e.link=({text:e})=>e,e}function xve(e){let t="";return e.forEach(e=>{t+=e.raw}),t}function kve(e){if(e.tokens)for(let t=e.tokens.length-1;t>=0;t--){const i=e.tokens[t];if("text"===i.type){const n=i.raw.split("\n"),o=n[n.length-1];if(o.includes("`"))return Nve(e);if(o.includes("**"))return Ave(e);if(o.match(/\*\w/))return Eve(e);if(o.match(/(^|\s)__\w/))return Pve(e);if(o.match(/(^|\s)_\w/))return Mve(e);if(Lve(o)||Dve(o)&&e.tokens.slice(0,t).some(e=>"text"===e.type&&e.raw.match(/\[[^\]]*$/))){const i=e.tokens.slice(t+1);return"link"===i[0]?.type&&"text"===i[1]?.type&&i[1].raw.match(/^ *"[^"]*$/)||o.match(/^[^"]* +"[^"]*$/)?Rve(e):Tve(e)}if(o.match(/(^|\s)\[\w*[^\]]*$/))return Ove(e)}}}function Lve(e){return!!e.match(/(^|\s)\[.*\]\(\w*/)}function Dve(e){return!!e.match(/^[^\[]*\]\([^\)]*$/)}function Ive(e){let t,i;for(t=0;t<e.length;t++){const n=e[t];if("paragraph"===n.type&&n.raw.match(/(\n|^)\|/)){i=Wve(e.slice(t));break}}const n=e.at(-1);if(!i&&"list"===n?.type){const o=function(e){const t=e.items[e.items.length-1],i=t.tokens?t.tokens[t.tokens.length-1]:void 0,n=e=>{const t=e.items.at(-1)?.tokens.at(-1);return"heading"===t?.type||"list"===t?.type&&n(t)};let o;if("text"!==i?.type||"inRawBlock"in t){if(n(e)){const t=kI(e.raw.trim()+" &nbsp;")[0];if("list"!==t.type)return;return t}}else o=kve(i);if(!o||"paragraph"!==o.type)return;const s=xve(e.items.slice(0,-1)),r=t.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!r)return;const a=kI(s+(r+xve(t.tokens.slice(0,-1))+o.raw))[0];return"list"===a.type?a:void 0}(n);o&&(i=[o],t=e.length-1)}if(!i&&"paragraph"===n?.type){const o=kve(n);o&&(i=[o],t=e.length-1)}if(i){const n=[...e.slice(0,t),...i];return n.links=e.links,n}if("heading"===n?.type){const t=function(e,t){if(e.raw.match(/-\s*$/))return kI(t+" &nbsp;")}(n,xve(e));if(t)return t}return null}function Nve(e){return Fve(e,"`")}function Eve(e){return Fve(e,"*")}function Mve(e){return Fve(e,"_")}function Tve(e){return Fve(e,")",!1)}function Rve(e){return Fve(e,'")',!1)}function Ove(e){return Fve(e,"](https://microsoft.com)",!1)}function Ave(e){return Fve(e,"**")}function Pve(e){return Fve(e,"__")}function Fve(e,t,i=!0){const n=xve(Array.isArray(e)?e:[e]);return kI((i?n.trimEnd():n)+t)[0]}function Wve(e){const t=xve(e),i=t.split("\n");let n,o=!1;for(let s=0;s<i.length;s++){const e=i[s].trim();if(void 0===n&&e.match(/^\s*\|/)){const t=e.match(/(\|[^\|]+)(?=\||$)/g);t&&(n=t.length)}else if("number"==typeof n){if(!e.match(/^\s*\|/))return;if(s!==i.length-1)return;o=!0}}if("number"==typeof n&&n>0){const e=o?i.slice(0,-1).join("\n"):t;return kI(e+(e.match(/\|\s*$/)?"":"|")+`\n|${" --- |".repeat(n)}`)}}function Bve(){return PN}function Vve(e,t,i){return Math.min(Math.max(e,t),i)}function Hve(e,t){const i=[];for(const n of t){if(e.start>=n.range.end)continue;if(e.end<n.range.start)break;const t=HN.intersect(e,n.range);HN.isEmpty(t)||i.push({range:t,size:n.size})}return i}function zve({start:e,end:t},i){return{start:e+i,end:t+i}}function Uve(e,t){return!!e.classList.contains(t)||!e.classList.contains("monaco-list")&&!!e.parentElement&&Uve(e.parentElement,t)}function Kve(e){return Uve(e,"monaco-editor")}function qve(e){return Uve(e,"monaco-tree-sticky-row")}function jve(e){return e.classList.contains("monaco-tree-sticky-container")}function $ve(e){return!!("A"===e.tagName&&e.classList.contains("monaco-button")||"DIV"===e.tagName&&e.classList.contains("monaco-button-dropdown"))||!e.classList.contains("monaco-list")&&!!e.parentElement&&$ve(e.parentElement)}function Gve(e){return F?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function Zve(e){return e.browserEvent.shiftKey}function Yve(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){i.push(e[n]),n++,o++;continue}e[n]<t[o]?i.push(e[n++]):i.push(t[o++])}return i}function Qve(e,t){const i=new De,n=e.createDecorationsCollection();return i.add(Oce({debugName:()=>`Apply decorations from ${t.debugName}`},e=>{const i=t.read(e);n.set(i)})),i.add({dispose:()=>{n.clear()}}),i}function Xve(e,t){return e.appendChild(t),Dle(()=>{t.remove()})}function Jve(e,t,i){let n=t.get(),o=n,s=n;const r=Qce("animatedValue",n);let a,l=-1;function d(){const t=Date.now()-l;var i,c,h,u;s=Math.floor((c=o,h=n-o,(i=t)===(u=300)?c+h:h*(1-Math.pow(2,-10*i/u))+c)),t<300?a=e.requestAnimationFrame(d):s=n,r.set(s,void 0)}return i.add(Ace({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(e,i)=>(e.didChange(t)&&(i.animate=i.animate||e.change),!0)}},(i,r)=>{void 0!==a&&(e.cancelAnimationFrame(a),a=void 0),o=s,n=t.read(i),l=Date.now()-(r.animate?0:300),d()})),r}function ewe(e,t){return Rce(i=>{for(let[n,o]of Object.entries(t))o&&"object"==typeof o&&"read"in o&&(o=o.read(i)),"number"==typeof o&&(o=`${o}px`),n=n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),e.style[n]=o})}function twe(e,t,i,n){const o=new De,s=[];return o.add(Pce((o,r)=>{const a=t.read(o),l=new Map,d=new Map;i&&i(!0),e.changeViewZones(e=>{for(const t of s)e.removeZone(t),n?.delete(t);s.length=0;for(const t of a){const i=e.addZone(t);t.setZoneId&&t.setZoneId(i),s.push(i),n?.add(i),l.set(t,i)}}),i&&i(!1),r.add(Ace({changeTracker:{createChangeSummary:()=>({zoneIds:[]}),handleChange(e,t){const i=d.get(e.changedObservable);return void 0!==i&&t.zoneIds.push(i),!0}}},(t,n)=>{for(const e of a)e.onChange&&(d.set(e.onChange,l.get(e)),e.onChange.read(t));i&&i(!0),e.changeViewZones(e=>{for(const t of n.zoneIds)e.layoutZone(t)}),i&&i(!1)}))})),o.add({dispose(){i&&i(!0),e.changeViewZones(e=>{for(const t of s)e.removeZone(t)}),n?.clear(),i&&i(!1)}}),o}function iwe(e,t){const i=Kpe(t,t=>t.original.startLineNumber<=e.lineNumber);if(!i)return mr.fromPositions(e);if(i.original.endLineNumberExclusive<=e.lineNumber){const t=e.lineNumber-i.original.endLineNumberExclusive+i.modified.endLineNumberExclusive;return mr.fromPositions(new to(t,e.column))}if(!i.innerChanges)return mr.fromPositions(new to(i.modified.startLineNumber,1));const n=Kpe(i.innerChanges,t=>t.originalRange.getStartPosition().isBeforeOrEqual(e));if(!n){const t=e.lineNumber-i.original.startLineNumber+i.modified.startLineNumber;return mr.fromPositions(new to(t,e.column))}if(n.originalRange.containsPosition(e))return n.modifiedRange;{const t=(o=n.originalRange.getEndPosition(),s=e,o.lineNumber===s.lineNumber?new eC(0,s.column-o.column):new eC(s.lineNumber-o.lineNumber,s.column-1));return mr.fromPositions(t.addToPosition(n.modifiedRange.getEndPosition()))}var o,s}function nwe(e,t){if(e.lineNumber<1)return new to(1,1);if(e.lineNumber>t.length)return new to(t.length,t[t.length-1].length+1);const i=t[e.lineNumber-1];return e.column>i.length+1?new to(e.lineNumber,i.length+1):e}function owe(e,t){return e>=1&&e<=t.length}function swe(e,t,i,n=!1){const o=[];for(const s of ece(e.map(e=>function(e,t,i){let n=0,o=0;return 1===e.modifiedRange.endColumn&&1===e.originalRange.endColumn&&e.originalRange.startLineNumber+n<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+n<=e.modifiedRange.endLineNumber&&(o=-1),e.modifiedRange.startColumn-1>=i.getLineLength(e.modifiedRange.startLineNumber)&&e.originalRange.startColumn-1>=t.getLineLength(e.originalRange.startLineNumber)&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+o&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+o&&(n=1),new BE(new Qw(e.originalRange.startLineNumber+n,e.originalRange.endLineNumber+1+o),new Qw(e.modifiedRange.startLineNumber+n,e.modifiedRange.endLineNumber+1+o),[e])}(e,t,i)),(e,t)=>e.original.intersectsOrTouches(t.original)||e.modified.intersectsOrTouches(t.modified))){const e=s[0],t=s[s.length-1];o.push(new BE(e.original.join(t.original),e.modified.join(t.modified),s.map(e=>e.innerChanges[0])))}return nle(()=>{if(!n&&o.length>0){if(o[0].modified.startLineNumber!==o[0].original.startLineNumber)return!1;if(i.length.lineCount-o[o.length-1].modified.endLineNumberExclusive!==t.length.lineCount-o[o.length-1].original.endLineNumberExclusive)return!1}return ole(o,(e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive===t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)}),o}function rwe(e,t,i,n){return $E.registerIcon(e,t,i,n)}function awe(){return $E}function lwe(e){return 32===e||9===e}function dwe(e,t,i,n){return t||(t=e=>null!=e),new Promise((o,s)=>{let r=!0,a=!1;const l=e.map(e=>({isFinished:t(e),error:!!i&&i(e),state:e})),d=Rce(e=>{const{isFinished:t,error:i,state:n}=l.read(e);(t||i)&&(r?a=!0:d.dispose(),i?s(!0===i?n:i):o(n))});if(n){const e=n.onCancellationRequested(()=>{d.dispose(),e.dispose(),s(new v)});if(n.isCancellationRequested)return d.dispose(),e.dispose(),void s(new v)}r=!1,a&&d.dispose()})}function cwe(e,t,i=Hi.ofCaller()){return new KM("string"==typeof e?e:new Ki(e,void 0,void 0),t,i)}function hwe(e,t,i){return{changes:e.changes.map(e=>new BE(e.original,e.modified,e.innerChanges?e.innerChanges.map(e=>function(e,t,i){let n=e.originalRange,o=e.modifiedRange;return 1===n.startColumn&&1===o.startColumn&&(1!==n.endColumn||1!==o.endColumn)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&o.endColumn===i.getLineMaxColumn(o.endLineNumber)&&n.endLineNumber<t.getLineCount()&&o.endLineNumber<i.getLineCount()&&(n=n.setEndPosition(n.endLineNumber+1,1),o=o.setEndPosition(o.endLineNumber+1,1)),new VE(n,o)}(e,t,i)):void 0)),moves:e.moves,identical:e.identical,quitEarly:e.quitEarly}}function uwe(e,t,i,n,o=!1){Wge(n,t.fontInfo);const s=i.length>0,r=new _a(1e4);let a=0,l=0;const d=[],c=[];for(let g=0;g<e.lineTokens.length;g++){const n=g+1,h=e.lineTokens[g],u=e.lineBreakData[g],p=Rp.filter(i,n,1,Number.MAX_SAFE_INTEGER);if(u){let i=0;for(const n of u.breakOffsets){const d=gwe(l,h.sliceAndInflate(i,n,0),Rp.extractWrapped(p,i,n),s,e.mightContainNonBasicASCII,e.mightContainRTL,t,r,o);a=Math.max(a,d.maxCharWidth),c.push(new iT(d.output.characterMapping,d.output.containsForeignElements,i)),l++,i=n}d.push(u.breakOffsets.length)}else{d.push(1);const i=gwe(l,h,p,s,e.mightContainNonBasicASCII,e.mightContainRTL,t,r,o);a=Math.max(a,i.maxCharWidth),c.push(new iT(i.output.characterMapping,i.output.containsForeignElements,0)),l++}}a+=t.scrollBeyondLastColumn;const h=r.build();n.innerHTML=XM?XM.createHTML(h):h;const u=a*t.typicalHalfwidthCharacterWidth;return new tT(l,u,d,c,e)}function gwe(e,t,i,n,o,s,r,a,l){a.appendString('<div class="view-line'),l||n||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(e*r.lineHeight)),r.setWidth?a.appendString('px;width:1000000px;">'):a.appendString('px;">');const d=t.getLineContent(),c=iv.isBasicASCII(d,o),h=iv.containsRTL(d,c,s),u=kpe(new Wp(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,d,!1,c,h,0,t,i,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==zd.OFF,null,null,r.verticalScrollbarSize),a);return a.appendString("</div>"),{output:u,maxCharWidth:u.characterMapping.getHorizontalOffset(u.characterMapping.length)}}function pwe(e,t,i,n,o,s){const r=new Pi(mwe(e,n)),a=new Pi(mwe(t,o)),l=e.getOption(75),d=t.getOption(75),c=[];let h=0,u=0;function g(e,t){for(;;){let i=r.peek(),n=a.peek();if(i&&i.lineNumber>=e&&(i=void 0),n&&n.lineNumber>=t&&(n=void 0),!i&&!n)break;const o=i?i.lineNumber-h:Number.MAX_VALUE,s=n?n.lineNumber-u:Number.MAX_VALUE;o<s?(r.dequeue(),n={lineNumber:i.lineNumber-h+u,heightInPx:0}):o>s?(a.dequeue(),i={lineNumber:n.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),c.push({originalRange:Qw.ofLength(i.lineNumber,1),modifiedRange:Qw.ofLength(n.lineNumber,1),originalHeightInPx:l+i.heightInPx,modifiedHeightInPx:d+n.heightInPx,diff:void 0})}}for(const p of i){const m=p.lineRangeMapping;g(m.original.startLineNumber,m.modified.startLineNumber);let f=!0,_=m.modified.startLineNumber,b=m.original.startLineNumber;function v(e,t,i=!1){if(e<b||t<_)return;if(f)f=!1;else if(!i&&(e===b||t===_))return;const n=new Qw(b,e),o=new Qw(_,t);if(n.isEmpty&&o.isEmpty)return;const s=r.takeWhile(t=>t.lineNumber<e)?.reduce((e,t)=>e+t.heightInPx,0)??0,h=a.takeWhile(e=>e.lineNumber<t)?.reduce((e,t)=>e+t.heightInPx,0)??0;c.push({originalRange:n,modifiedRange:o,originalHeightInPx:n.length*l+s,modifiedHeightInPx:o.length*d+h,diff:p.lineRangeMapping}),b=e,_=t}if(s)for(const w of m.innerChanges||[]){w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&v(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber);const C=e.getModel(),y=w.originalRange.endLineNumber<=C.getLineCount()?C.getLineMaxColumn(w.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;w.originalRange.endColumn<y&&v(w.originalRange.endLineNumber,w.modifiedRange.endLineNumber)}v(m.original.endLineNumberExclusive,m.modified.endLineNumberExclusive,!0),h=m.original.endLineNumberExclusive,u=m.modified.endLineNumberExclusive}return g(Number.MAX_VALUE,Number.MAX_VALUE),c}function mwe(e,t){const i=[],n=[],o=-1!==e.getOption(166).wrappingColumn,s=e._getViewModel().coordinatesConverter,r=e.getOption(75);if(o)for(let a=1;a<=e.getModel().getLineCount();a++){const e=s.getModelLineViewLineCount(a);e>1&&n.push({lineNumber:a,heightInPx:r*(e-1)})}for(const a of e.getWhitespaces()){if(t.has(a.id))continue;const e=0===a.afterLineNumber?0:s.convertViewPositionToModelPosition(new to(a.afterLineNumber,1)).lineNumber;i.push({lineNumber:e,heightInPx:a.height})}return function(e,t,i,n){if(0===e.length)return t;if(0===t.length)return e;const o=[];let s=0,r=0;for(;s<e.length&&r<t.length;){const a=e[s],l=t[r],d=i(a),c=i(l);d<c?(o.push(a),s++):d>c?(o.push(l),r++):(o.push(n(a,l)),s++,r++)}for(;s<e.length;)o.push(e[s]),s++;for(;r<t.length;)o.push(t[r]),r++;return o}(i,n,e=>e.lineNumber,(e,t)=>({lineNumber:e.lineNumber,heightInPx:e.heightInPx+t.heightInPx}))}function fwe(e){return!!e.innerChanges&&e.innerChanges.every(e=>_we(e.modifiedRange)&&_we(e.originalRange)||e.originalRange.equalsRange(new mr(1,1,1,1)))}function _we(e){return e.startLineNumber===e.endLineNumber}function bwe(e){return pT.get(e)}function vwe(e,t){return{enableSplitViewResizing:Vge(e.enableSplitViewResizing,t.enableSplitViewResizing),splitViewDefaultRatio:zge(e.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Vge(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:Vge(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:Hge(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:Hge(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:Vge(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:Vge(e.renderIndicators,t.renderIndicators),originalEditable:Vge(e.originalEditable,t.originalEditable),diffCodeLens:Vge(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:Vge(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:Uge(e.diffWordWrap,t.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Uge(e.diffAlgorithm,t.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Vge(e.accessibilityVerbose,t.accessibilityVerbose),experimental:{showMoves:Vge(e.experimental?.showMoves,t.experimental.showMoves),showEmptyDecorations:Vge(e.experimental?.showEmptyDecorations,t.experimental.showEmptyDecorations),useTrueInlineView:Vge(e.experimental?.useTrueInlineView,t.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:Vge(e.hideUnchangedRegions?.enabled??e.experimental?.collapseUnchangedRegions,t.hideUnchangedRegions.enabled),contextLineCount:Hge(e.hideUnchangedRegions?.contextLineCount,t.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:Hge(e.hideUnchangedRegions?.minimumLineCount,t.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:Hge(e.hideUnchangedRegions?.revealLineCount,t.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Vge(e.isInEmbeddedEditor,t.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Vge(e.onlyShowAccessibleDiffViewer,t.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:Hge(e.renderSideBySideInlineBreakpoint,t.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Vge(e.useInlineViewWhenSpaceIsLimited,t.useInlineViewWhenSpaceIsLimited),renderGutterMenu:Vge(e.renderGutterMenu,t.renderGutterMenu),compactMode:Vge(e.compactMode,t.compactMode)}}function wwe(e,t,i){if(null===t)return"";const n=[];return e.ctrlKey&&n.push(i.ctrlKey),e.shiftKey&&n.push(i.shiftKey),e.altKey&&n.push(i.altKey),e.metaKey&&n.push(i.metaKey),""!==t&&n.push(t),n.join(i.separator)}function Cwe(e){return!!e&&"object"==typeof e&&"string"==typeof e.original&&"string"==typeof e.value}function ywe(e){return function(e,t){const i={...t};for(const n in e){const t=e[n];i[n]=void 0!==t?gpe(t):void 0}return i}(e,uR)}function Swe(e,t){if(V)return!1;const i=function(e,t){return t||(t=xwe(e)),"native"===t}(e,t),n=e.getValue("window");return"native"===n?.menuStyle?!(!F&&!i):"custom"!==n?.menuStyle&&i}function xwe(e){if(V)return"custom";const t=e.getValue("window");if(t){if(F&&!0===t.nativeTabs)return"native";if(F&&!1===t.nativeFullScreen)return"native";const e=t.titleBarStyle;if("native"===e||"custom"===e)return e}return"custom"}function kwe(e,t){const i=[];return function(e,t){const i=Bn.getInstance();Iwe(e,t,i.keyStatus.altKey||(P||W)&&i.keyStatus.shiftKey,e=>"navigation"===e)}(e,i),i}function Lwe(e,t,i,n){const o={primary:[],secondary:[]};return Dwe(e,o,t,i,n),o}function Dwe(e,t,i,n,o){Iwe(e,t,!1,"string"==typeof i?e=>e===i:i,n,o)}function Iwe(e,t,i,n=e=>"navigation"===e,o=()=>!1,s=!1){let r,a;Array.isArray(t)?(r=t,a=t):(r=t.primary,a=t.secondary);const l=new Set;for(const[d,c]of e){let e;n(d)?(e=r,e.length>0&&s&&e.push(new ro)):(e=a,e.length>0&&e.push(new ro));for(let t of c){i&&(t=t instanceof ps&&t.alt?t.alt:t);const n=e.push(t);t instanceof ao&&l.add({group:d,action:t,index:n-1})}}for(const{group:d,action:c,index:h}of l){const e=n(d)?r:a,t=c.actions;o(c,d,e.length)&&e.splice(h,1,...t)}}function Nwe(e,t,i){return t instanceof ps?e.createInstance(_R,t,i):t instanceof gs?t.item.isSelection?e.createInstance(CR,t):t.item.isSplitButton?e.createInstance(wR,t,{...i,togglePrimaryAction:"boolean"!=typeof t.item.isSplitButton&&t.item.isSplitButton.togglePrimaryAction}):e.createInstance(vR,t,i):void 0}function Ewe(e,t,i){const n=void 0!==t.submenu?t.submenu.id:t.id,o="string"==typeof t.title?t.title:t.title.value,s=tue({id:`hide/${e.id}/${n}`,label:Vae(1651,"Hide '{0}'",o),run(){i.updateHidden(e,n,!0)}}),r=tue({id:`toggle/${e.id}/${n}`,label:o,get checked(){return!i.isHidden(e,n)},run(){i.updateHidden(e,n,!!this.checked)}});return{hide:s,toggle:r,get isHidden(){return!r.checked}}}function Mwe(e,t,i,n=void 0,o=!0){return tue({id:`configureKeybinding/${i}`,label:Vae(1652,"Configure Keybinding"),enabled:o,run(){const o=!t.lookupKeybinding(i)&&n?n.serialize():void 0;e.executeCommand("workbench.action.openGlobalKeybindings",`@command:${i}`+(o?` +when:${o}`:""))}})}function Twe(e){const t=e.get(eo).listDiffEditors(),i=vhe();if(i)for(const n of t)if(n.getContainerDomNode().contains(i))return n;return null}function Rwe(e,t){return{id:t,asString:async()=>e,asFile:()=>{},value:"string"==typeof e?e:void 0}}function Owe(e){return e.toLowerCase()}function Awe(e,t){return Pwe(Owe(e),t.map(Owe))}function Pwe(e,t){if("*/*"===e)return t.length>0;if(t.includes(e))return!0;const i=e.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!i)return!1;const[n,o,s]=i;return"*"===s&&t.some(e=>e.startsWith(o+"/"))}function Fwe(e){if(B&&"function"==typeof globalThis.vscode?.webUtils?.getPathForFile)return globalThis.vscode?.webUtils?.getPathForFile(e)}function Wwe(e){const t=new jO;for(const i of e.items){const e=i.type;if("string"===i.kind){const n=new Promise(e=>i.getAsString(e));t.append(e,Rwe(n))}else if("file"===i.kind){const n=i.getAsFile();n&&t.append(e,Bwe(n))}}return t}function Bwe(e){const t=Fwe(e),i=t?_i.parse(t):void 0;return function(e,t,i,n){const o={id:Zm(),name:e,uri:t,data:i};return{id:n,asString:async()=>"",asFile:()=>o,value:void 0}}(e.name,i,async()=>new Uint8Array(await e.arrayBuffer()))}function Vwe(e,t=!1){const i=Wwe(e),n=i.get(FL.INTERNAL_URI_LIST);if(n)i.replace(Na.uriList,n);else if(t||!i.has(Na.uriList)){const t=[];for(const i of e.items){const e=i.getAsFile();if(e){const i=Fwe(e);try{i?t.push(_i.file(i).toString()):t.push(_i.parse(e.name,!0).toString())}catch{}}}t.length&&i.replace(Na.uriList,Rwe($O.create(t)))}for(const o of aA)i.delete(o);return i}async function Hwe(e,t,i,n){try{return await e.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:zwe(i),skipValidation:n})}catch(o){return $ae(o),!1}}function zwe(e){return!0===e||!(!e||!Array.isArray(e.enabledCommands))&&e.enabledCommands}function Uwe(e){const t=e;return"string"==typeof t?.id&&_i.isUri(t.uri)}function Kwe(e){return"string"==typeof e?.id&&!Uwe(e)&&!function(e){const t=e;return"string"==typeof t?.id&&_i.isUri(t.configPath)}(e)}async function qwe(e){const t=e.get(Na.uriList);if(!t)return[];const i=await t.asString(),n=[];for(const o of $O.parse(i))try{n.push({uri:_i.parse(o),originalText:o})}catch{}return n}function jwe(e,t){const i=[...e];for(;i.length>0;){const e=i.shift();if(!t(e))break;i.unshift(...e.children)}}function $we(e,t,i){return("string"==typeof i.insertText?""===i.insertText:""===i.insertText.snippet)?{edits:i.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new cA(e,{range:t,text:"string"==typeof i.insertText?hP.escape(i.insertText)+"$0":i.insertText.snippet,insertAsSnippet:!0})),...i.additionalEdit?.edits??[]]}}function Gwe(e){function t(e,t){return"mimeType"in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}const i=new Map;for(const s of e)for(const n of s.yieldTo??[])for(const o of e)if(o!==s&&t(n,o)){let e=i.get(s);e||(e=[],i.set(s,e)),e.push(o)}if(!i.size)return Array.from(e);const n=new Set,o=[];return function e(t){if(!t.length)return[];const s=t[0];if(o.includes(s))return console.warn("Yield to cycle detected",s),t;if(n.has(s))return e(t.slice(1));let r=[];const a=i.get(s);return a&&(o.push(s),r=e(a),o.pop()),n.add(s),[...r,s,...e(t.slice(1))]}(Array.from(e))}function Zwe(e,t){return t&&(e.stack||e.stacktrace)?Vae(29,"{0}: {1}",Qwe(e),Ywe(e.stack)||Ywe(e.stacktrace)):Qwe(e)}function Ywe(e){return Array.isArray(e)?e.join("\n"):e}function Qwe(e){return"ERR_UNC_HOST_NOT_ALLOWED"===e.code?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:"string"==typeof e.code&&"number"==typeof e.errno&&"string"==typeof e.syscall?Vae(30,"A system error occurred ({0})",e.message):e.message||Vae(31,"An unknown error occurred. Please consult the log for more details.")}function Xwe(e=null,t=!1){if(!e)return Vae(32,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(e)){const i=ice(e),n=Xwe(i[0],t);return i.length>1?Vae(33,"{0} ({1} errors in total)",n,i.length):n}if(sle(e))return e;if(e.detail){const i=e.detail;if(i.error)return Zwe(i.error,t);if(i.exception)return Zwe(i.exception,t)}return e.stack?Zwe(e,t):e.message?e.message:Vae(34,"An unknown error occurred. Please consult the log for more details.")}function Jwe(e){if("action"===e.kind)return e.label}function eCe(e){return e.replace(/\r\n|\r|\n/g," ")}function tCe(e){return e.register(),e}function iCe(e,t){e&&(e.addImplementation(1e4,"code-editor",(e,i)=>{const n=e.get(Ks);n.trace("registerExecCommandImpl (addImplementation code-editor for : ",t,")");const o=e.get(eo).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const e=o.getOption(45),i=o.getSelection();return i&&i.isEmpty()&&!e||(o.getOption(170)&&"cut"===t?(nCe(o),n.trace("registerExecCommandImpl (before execCommand copy)"),o.getContainerDomNode().ownerDocument.execCommand("copy"),o.trigger(void 0,"cut",void 0),n.trace("registerExecCommandImpl (after execCommand copy)")):(nCe(o),n.trace("registerExecCommandImpl (before execCommand "+t+")"),o.getContainerDomNode().ownerDocument.execCommand(t),n.trace("registerExecCommandImpl (after execCommand "+t+")"))),!0}return!1}),e.addImplementation(0,"generic-dom",(e,i)=>{const n=e.get(Ks);return n.trace("registerExecCommandImpl (addImplementation generic-dom for : ",t,")"),n.trace("registerExecCommandImpl (before execCommand "+t+")"),yhe().execCommand(t),n.trace("registerExecCommandImpl (after execCommand "+t+")"),!0}))}function nCe(e){if(e.getOption(170)){const t=_C.get(e.getId());t&&t.onWillCopy()}}function oCe(e){return void 0!==e.type||void 0!==e.anyOf}function sCe(){return null===oF&&(oF=Object.create(null),Object.keys(nF.properties).forEach(e=>{oF[e]=!0})),oF}function rCe(e,t,i){return!(!t.contains(e)||i&&t.contains(i))}async function aCe(e,t,i,n,o,s){const r=n.filter||{},a={...r,excludes:[...r.excludes||[],sF.Notebook]},l={only:r.include?.value,trigger:n.type},d=new _A(t,s),c=function(e,t,i){return e.all(t).filter(e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some(e=>function(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some(i=>rCe(t,i,e.include))||!e.includeSourceActions&&sF.Source.contains(t))}(i,new ZO(e))))}(e,t,2===n.type?a:r),h=new De,u=c.map(async e=>{const n=setTimeout(()=>o.report(e),1250);try{const n=await e.provideCodeActions(t,i,l,d.token);if(d.token.isCancellationRequested)return n?.dispose(),_F;n&&h.add(n);const o=(n?.actions||[]).filter(e=>e&&function(e,t){const i=t.kind?new ZO(t.kind):void 0;return!(!(!e.include||i&&e.include.contains(i))||e.excludes&&i&&e.excludes.some(t=>rCe(i,t,e.include))||!e.includeSourceActions&&i&&sF.Source.contains(i)||e.onlyIncludePreferredActions&&!t.isPreferred)}(r,e)),s=function(e,t,i){if(!e.documentation)return;const n=e.documentation.map(e=>({kind:new ZO(e.kind),command:e.command}));if(i){let e;for(const t of n)t.kind.contains(i)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return e?.command}for(const o of t)if(o.kind)for(const e of n)if(e.kind.contains(new ZO(o.kind)))return e.command}(e,o,r.include);return{actions:o.map(t=>new lF(t,e)),documentation:s}}catch(s){if(Yae(s))throw s;return Gae(s),_F}finally{clearTimeout(n)}}),g=e.onDidChange(()=>{Zde(e.all(t),c)||d.cancel()});try{const i=await Promise.all(u),o=i.map(e=>e.actions).flat(),s=new fF(o,[...ice(i.map(e=>e.documentation)),...lCe(e,t,n,o)],h);return h.add(s),s}catch(p){throw h.dispose(),p}finally{g.dispose(),d.dispose()}}function*lCe(e,t,i,n){if(t&&n.length)for(const o of e.all(t))o._getAdditionalMenuItems&&(yield*o._getAdditionalMenuItems?.({trigger:i.type,only:i.filter?.include?.value},n.map(e=>e.action)))}async function dCe(e,t,i,n,o=it.None){const s=e.get(lA),r=e.get(fo),a=e.get(fs),l=e.get(Xv),d=e.get(NL);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:i}),d.playSignal(TL.codeActionTriggered),await t.resolve(o),!o.isCancellationRequested&&(!t.action.edit?.edits.length||(await s.apply(t.action.edit,{editor:n?.editor,label:t.action.title,quotableLabel:t.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:i!==bF.OnSave,showPreview:n?.preview,reason:Vy.codeAction({kind:t.action.kind,providerId:bb.fromExtensionId(t.provider?.extensionId)})})).isApplied)){if(t.action.command)try{await r.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(c){const e=function(e){return"string"==typeof e?e:e instanceof Error&&"string"==typeof e.message?e.message:void 0}(c);l.error("string"==typeof e?e:Vae(830,"An unknown error occurred while applying the code action"))}setTimeout(()=>d.playSignal(TL.codeActionApplied),mF)}}function cCe(e){return Po.regex(NF.keys()[0],new RegExp("(\\s|^)"+Ble(e.value)+"\\b"))}function hCe(e,t,i,n,o=rF.Default){e.hasModel()&&ZF.get(e)?.manualTriggerAtCurrentPosition(t,o,i,n)}async function uCe(e,t,i){const n=e.ordered(t),o=new Map,s=new sW,r=n.map(async(e,n)=>{o.set(e,n);try{const n=await Promise.resolve(e.provideCodeLenses(t,i));n&&s.add(n,e)}catch(r){Gae(r)}});return await Promise.all(r),i.isCancellationRequested?(s.dispose(),sW.Empty):(s.lenses=s.lenses.sort((e,t)=>e.symbol.range.startLineNumber<t.symbol.range.startLineNumber?-1:e.symbol.range.startLineNumber>t.symbol.range.startLineNumber?1:o.get(e.provider)<o.get(t.provider)?-1:o.get(e.provider)>o.get(t.provider)?1:e.symbol.range.startColumn<t.symbol.range.startColumn?-1:e.symbol.range.startColumn>t.symbol.range.startColumn?1:0),s)}function gCe(e){IW.push(e)}function pCe(){return IW.slice(0)}async function mCe(e,t,i,n="auto"){return _Ce(new FW,e,t,i,n)}function fCe(e,t,i,n){return Promise.resolve(i.provideColorPresentations(e,t,n))}async function _Ce(e,t,i,n,o){let s,r=!1;const a=[],l=t.ordered(i);for(let c=l.length-1;c>=0;c--){const t=l[c];if("always"!==o&&t instanceof AW)s=t;else try{await e.compute(t,i,n,a)&&(r=!0)}catch(d){Gae(d)}}return r?a:s&&"never"!==o?(await e.compute(s,i,n,a),a):[]}function bCe(e,t){const{colorProvider:i}=e.get(Tx),n=e.get(io).getModel(t);if(!n)throw Qae();return{model:n,colorProviderRegistry:i,defaultColorDecoratorsEnablement:e.get(ka).getValue("editor.defaultColorDecorators",{resource:t})}}function vCe(e,t,i){const n=lhe(e);return!(t<n.left||t>n.left+n.width||i<n.top||i>n.top+n.height)}function wCe(e,t){return e&&t?Vae(7,"Inspect this in the accessible view with {0}.",t):e?Vae(8,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}function CCe(e,t,i,n,o,s){const r=i+o/2,a=n+s/2,l=Math.max(Math.abs(e-r)-o/2,0),d=Math.max(Math.abs(t-a)-s/2,0);return Math.sqrt(l*l+d*d)}function yCe(e,t){if(e&&""!==e[0]){const i=SCe(e,t,"-"),n=SCe(e,t,"_");return i&&!n?xCe(e,t,"-"):!i&&n?xCe(e,t,"_"):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():function(e,t=!1){return!!e&&(t&&(e=e.replace(/\\./g,"")),e.toLowerCase()!==e)}(e[0][0])&&t.length>0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}return t}function SCe(e,t,i){return-1!==e[0].indexOf(i)&&-1!==t.indexOf(i)&&e[0].split(i).length===t.split(i).length}function xCe(e,t,i){const n=t.split(i),o=e[0].split(i);let s="";return n.forEach((e,t)=>{s+=yCe([o[t]],e)+i}),s.slice(0,-1)}function kCe(e,t,i){const n=i??document.createElement("div");return n.textContent="",LCe(n,function(e){const t={type:1,children:[]};let i=0,n=t;const o=[],s=new cV(e);for(;!s.eos();){let e=s.next();const t="\\"===e&&0!==ICe(s.peek());if(t&&(e=s.next()),!t&&DCe(e)&&e===s.peek()){s.advance(),2===n.type&&(n=o.pop());const t=ICe(e);if(n.type===t||5===n.type&&6===t)n=o.pop();else{const e={type:t,children:[]};5===t&&(e.index=i,i++),n.children.push(e),o.push(n),n=e}}else if("\n"===e)2===n.type&&(n=o.pop()),n.children.push({type:8});else if(2!==n.type){const t={type:2,content:e};n.children.push(t),o.push(n),n=t}else n.content+=e}return 2===n.type&&(n=o.pop()),t}(e),t?.actionHandler,t?.renderCodeSegments),n}function LCe(e,t,i,n){let o;if(2===t.type)o=document.createTextNode(t.content||"");else if(3===t.type)o=document.createElement("b");else if(4===t.type)o=document.createElement("i");else if(7===t.type&&n)o=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");i.disposables.add(xn(e,"click",e=>{i.callback(String(t.index),e)})),o=e}else 8===t.type?o=document.createElement("br"):1===t.type&&(o=e);o&&e!==o&&e.appendChild(o),o&&Array.isArray(t.children)&&t.children.forEach(e=>{LCe(o,e,i,n)})}function DCe(e,t){return 0!==ICe(e)}function ICe(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;default:return 0}}function NCe(e,t){if(NV.includes(t))throw new Error("Cannot register the same widget multiple times");NV.push(t);const i=new De,n=new Jo(kV,!1).bindTo(e),o=new Jo(LV,!0).bindTo(e),s=new Jo(DV,!0).bindTo(e),r=()=>{n.set(!0),IV=t},a=()=>{n.set(!1),IV===t&&(IV=void 0)};return whe(t.element)&&r(),i.add(t.onDidFocus(()=>r())),i.add(t.onDidBlur(()=>a())),i.add(Dle(()=>{NV.splice(NV.indexOf(t),1),a()})),{historyNavigationForwardsEnablement:o,historyNavigationBackwardsEnablement:s,dispose(){i.dispose()}}}function ECe(e){return"Up"===e.lookupKeybinding("history.showPrevious")?.getElectronAccelerator()&&"Down"===e.lookupKeybinding("history.showNext")?.getElectronAccelerator()}function MCe(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionStart>0&&e.stopPropagation()}function TCe(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionEnd<i.value.length&&e.stopPropagation()}function RCe(e,t,i,n,o=!1){const s=e.ordered(t,o).map((e,o)=>async function(e,t,i,n,o){const s=await Promise.resolve(e.provideHover(i,n,o)).catch(Gae);if(s&&function(e){const t=void 0!==e.range,i=void 0!==e.contents&&e.contents&&e.contents.length>0;return t&&i}(s))return new dH(e,s,t)}(e,o,t,i,n));return xt.fromPromisesResolveOrder(s).coalesce()}async function OCe(e,t,i,n,o=!1){const s=[];for await(const r of RCe(e,t,i,n,o))s.push(r.hover);return s}function ACe(e,t,i,n){const o=new De,s=uH("div.hover-row"),r=uH("div.hover-row-contents");s.appendChild(r);const a=t.contents;for(const l of a){if(Vbe(l))continue;const t=uH("div.markdown-hover"),s=Mhe(t,uH("div.hover-contents")),a=o.add(i.render(l,{context:e,asyncRenderCallback:()=>{s.className="hover-contents code-hover-contents",n()}}));s.appendChild(a.element),r.appendChild(t)}return{hoverPart:t,hoverElement:s,dispose(){o.dispose()}}}async function PCe(e,t,i){const n=e.getValueInRange(t.range),{red:o,green:s,blue:r,alpha:a}=t.color,l=new eh(new Qc(Math.round(255*o),Math.round(255*s),Math.round(255*r),a)),d=await fCe(e,t,i,it.None),c=new AH(l,[],0);return c.colorPresentations=d||[],c.guessColorPresentation(l,n),{range:mr.lift(t.range),model:c,provider:i}}function FCe(e,t,i){const n=[],o=i.presentation.textEdit??{range:t,text:i.presentation.label,forceMoveMarkers:!1};n.push(o),i.presentation.additionalTextEdits&&n.push(...i.presentation.additionalTextEdits);const s=mr.lift(o.range),r=e.getModel()._setTrackedRange(null,s,3);return e.executeEdits("colorpicker",n),e.pushUndoStop(),e.getModel()._getTrackedRange(r)??s}async function WCe(e,t,i,n,o){t.colorPresentations=await fCe(e,{range:n,color:{red:i.rgba.r/255,green:i.rgba.g/255,blue:i.rgba.b/255,alpha:i.rgba.a}},o.provider,it.None)||[]}function BCe(e,t){return!!e[t]}function VCe(e,t){return"altKey"===e?F?new UH(57,"metaKey",6,"altKey",t):new UH(5,"ctrlKey",6,"altKey",t):F?new UH(6,"altKey",57,"metaKey",t):new UH(6,"altKey",5,"ctrlKey",t)}function HCe(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===ZC.ICodeEditor}function zCe(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===ZC.IDiffEditor}function UCe(e){return HCe(e)?e:zCe(e)?e.getModifiedEditor():function(e){return!!e&&"object"==typeof e&&"function"==typeof e.onDidChangeActiveEditor}(e)&&HCe(e.activeCodeEditor)?e.activeCodeEditor:null}function KCe(e){const t=e.get(eo).getFocusedCodeEditor();return t instanceof YH?t.getParentEditor():t}function qCe(e,t,i){return new Bz(new Az(e),new Az(t)).ComputeDiff(i).changes}function jCe(e){return!!e&&void 0!==e.visibility}function $Ce(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function GCe(e){return"collapsible"in e}function ZCe(e){return e instanceof $N?new Hz(e):e}function YCe(e,t){const i=t.toLowerCase().indexOf(e);let n;if(i>-1){n=[Number.MAX_SAFE_INTEGER,0];for(let t=e.length;t>0;t--)n.push(i+t-1)}return n}function QCe(e,t){return e.position===t.position&&XCe(e,t)}function XCe(e,t){return e.node.element===t.node.element&&e.startIndex===t.startIndex&&e.height===t.height&&e.endIndex===t.endIndex}function JCe(e){let t=Mz.Unknown;return mhe(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=Mz.Twistie:mhe(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=Mz.Element:mhe(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=Mz.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function eye(e){const t=jve(e.browserEvent.target);return{element:e.element?e.element.element:null,browserEvent:e.browserEvent,anchor:e.anchor,isStickyScroll:t}}function tye(e,t){t(e),e.children.forEach(e=>tye(e,t))}function iye(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:ke.map(ke.from(e.children),iye),collapsible:e.collapsible,collapsed:e.collapsed}}function nye(e){const t=[e.element],i=e.incompressible||!1;let n,o;for(;[o,n]=ke.consume(ke.from(e.children),2),1===o.length&&!o[0].incompressible;)e=o[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:ke.map(ke.concat(o,n),nye),collapsible:e.collapsible,collapsed:e.collapsed}}function oye(e,t=0){let i;return i=t<e.element.elements.length-1?[oye(e,t+1)]:ke.map(ke.from(e.children),e=>oye(e,0)),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function sye(e){return oye(e,0)}function rye(e,t,i){return e.element===t?{...e,children:i}:{...e,children:ke.map(ke.from(e.children),e=>rye(e,t,i))}}function aye(e,t){return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch{return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}}}function lye(e){return{...e,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function dye(e,t){return!!t.parent&&(t.parent===e||dye(e,t.parent))}function cye(e){return{browserEvent:e.browserEvent,elements:e.elements.map(e=>e.element)}}function hye(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}function uye(e){return e instanceof $N?new yU(e):e}function gye(e){return e&&{...e,collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new SU(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element}),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>!!e.accessibilityProvider?.isChecked(t.element):void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)},sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:"number"==typeof e.defaultFindVisibility?e.defaultFindVisibility:void 0===e.defaultFindVisibility?2:e.defaultFindVisibility(t.element),stickyScrollDelegate:e.stickyScrollDelegate}}function pye(e,t){t(e),e.children.forEach(e=>pye(e,t))}function mye(e,t){const i=e.createScoped(t.getHTMLElement());return VU.bindTo(i),i}function fye(e,t){const i=BU.bindTo(e),n=()=>{const e=0===t.scrollTop,n=t.scrollHeight-t.renderHeight-t.scrollTop<1;e&&n?i.set("both"):e?i.set("top"):n?i.set("bottom"):i.set("none")};return n(),t.onDidScroll(n)}function _ye(e){return"alt"===e.getValue(iK)}function bye(e,t){const i=e.get(ka),n=e.get(xw),o=new De;return[{...t,keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>n.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(i.getValue(uK)),mouseWheelScrollSensitivity:i.getValue(gK),fastScrollSensitivity:i.getValue(pK),multipleSelectionController:t.multipleSelectionController??o.add(new bK(i)),keyboardNavigationEventFilter:vye(n),scrollByPage:Boolean(i.getValue(lK))},o]}function vye(e){let t=!1;return i=>{if(i.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;const n=e.softDispatch(i,i.target);return 1===n.kind?(t=!0,!1):(t=!1,0===n.kind)}}function wye(e){const t=e.getValue(sK);if("highlight"===t)return Zz.Highlight;if("filter"===t)return Zz.Filter;const i=e.getValue(aK);return"simple"===i||"highlight"===i?Zz.Highlight:"filter"===i?Zz.Filter:void 0}function Cye(e){const t=e.getValue(dK);return"fuzzy"===t?Yz.Fuzzy:"contiguous"===t?Yz.Contiguous:void 0}function yye(e,t){const i=e.get(ka),n=e.get(oT),o=e.get(es),s=e.get(Jn),r=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(i.getValue(oK)),[a,l]=s.invokeFunction(bye,t),d=t.paddingBottom,c=void 0!==t.renderIndentGuides?t.renderIndentGuides:i.getValue(hK);return{getTypeNavigationMode:()=>{const e=o.getContextKeyValue(eK);if("automatic"===e)return oE.Automatic;if("trigger"===e)return oE.Trigger;if(!1===o.getContextKeyValue(tK))return oE.Trigger;const t=i.getValue(rK);return"automatic"===t?oE.Automatic:"trigger"===t?oE.Trigger:void 0},disposable:l,options:{keyboardSupport:!1,...a,indent:"number"==typeof i.getValue(cK)?i.getValue(cK):void 0,renderIndentGuides:c,smoothScrolling:Boolean(i.getValue(uK)),defaultFindMode:t.defaultFindMode??wye(i),defaultFindMatchType:t.defaultFindMatchType??Cye(i),horizontalScrolling:r,scrollByPage:Boolean(i.getValue(lK)),paddingBottom:d,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:t.expandOnlyOnTwistieClick??"doubleClick"===i.getValue(mK),contextViewProvider:n,findWidgetStyles:cR,enableStickyScroll:Boolean(i.getValue(fK)),stickyScrollMaxItemCount:Number(i.getValue(_K))}}}function Sye(e,t){const i=KCe(e);if(!i)return;const n=pq.get(i);n&&t(n)}function xye(e,t){return t.uri.scheme===e.uri.scheme||!Pde(t.uri,yi.walkThroughSnippet,yi.vscodeChatCodeBlock,yi.vscodeChatCodeCompareBlock)}async function kye(e,t,i,n,o){const s=i.ordered(e,n).map(i=>Promise.resolve(o(i,e,t)).then(void 0,e=>{Gae(e)}));return ice((await Promise.all(s)).flat()).filter(t=>xye(e,t))}function Lye(e,t,i,n,o){return kye(t,i,e,n,(e,t,i)=>e.provideDefinition(t,i,o))}function Dye(e,t,i,n,o){return kye(t,i,e,n,(e,t,i)=>e.provideDeclaration(t,i,o))}function Iye(e,t,i,n,o){return kye(t,i,e,n,(e,t,i)=>e.provideImplementation(t,i,o))}function Nye(e,t,i,n,o){return kye(t,i,e,n,(e,t,i)=>e.provideTypeDefinition(t,i,o))}function Eye(e,t,i,n,o,s){return kye(t,i,e,o,async(e,t,i)=>{const o=(await e.provideReferences(t,i,{includeDeclaration:!0},s))?.filter(e=>xye(t,e));if(!n||!o||2!==o.length)return o;const r=(await e.provideReferences(t,i,{includeDeclaration:!1},s))?.filter(e=>xye(t,e));return r&&1===r.length?r:o})}async function Mye(e){const t=new AK(await e(),""),i=t.references.map(e=>e.link);return t.dispose(),i}async function Tye(e,t,i,n){const o=e.get(no),s=e.get(sT),r=e.get(fo),a=e.get(Jn),l=e.get(Xv);if(await n.item.resolve(it.None),!n.part.location)return;const d=n.part.location,c=[],h=new Set(us.getMenuItems(ds.EditorContext).map(e=>pue(e)?e.command.id:Zm()));for(const g of Mq.all())h.has(g.desc.id)&&c.push(new oo(g.desc.id,ps.label(g.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const e=await o.createModelReference(d.uri);try{const i=new Eq(e.object.textEditorModel,mr.getStartPosition(d.range)),o=n.item.anchor.range;await a.invokeFunction(g.runEditorCommand.bind(g),t,i,o)}finally{e.dispose()}}));if(n.part.command){const{command:e}=n.part;c.push(new ro),c.push(new oo(e.id,e.title,void 0,!0,async()=>{try{await r.executeCommand(e.id,...e.arguments??[])}catch(t){l.notify({severity:Qv.Error,source:n.item.provider.displayName,message:t})}}))}const u=t.getOption(144);s.showContextMenu({domForShadowRoot:u?t.getDomNode()??void 0:void 0,getAnchor:()=>{const e=lhe(i);return{x:e.left,y:e.top+e.height+8}},getActions:()=>c,onHide:()=>{t.focus()},autoSelectFirstItem:!0})}async function Rye(e,t,i,n){const o=await e.get(no).createModelReference(n.uri);await i.invokeWithinContext(async e=>{const s=t.hasSideBySideModifier,r=e.get(es),a=az.inPeekEditor.getValue(r);return new Tq({openToSide:s,openInPeek:!s&&i.getOption(101)&&!a,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e,new Eq(o.object.textEditorModel,mr.getStartPosition(n.range)),mr.lift(n.range))}),o.dispose()}function Oye(e){return e.replace(/[ \t]/g," ")}function Aye(e){const t=e.target;return!!t&&6===t.type&&t.detail.injectedText?.options.attachedData===KW}function Pye(e){return F?e.altKey:e.ctrlKey}function Fye(e,t){return 1===e||2!==e&&t}function Wye(e,t="single",i=!1){if(!e.hasModel())return null;const n=e.getSelection();if("single"===t&&n.startLineNumber===n.endLineNumber||"multiple"===t)if(n.isEmpty()){const t=e.getConfiguredWordAtPosition(n.getStartPosition());if(t&&!1===i)return t.word}else if(e.getModel().getValueLengthInRange(n)<fG)return e.getModel().getValueInRange(n);return null}async function Bye(e,t){const i=_G.get(e);if(!i)return;const n=()=>!!(t?i.moveToNextMatch():i.moveToPrevMatch())&&(i.editor.pushUndoStop(),!0);n()||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===i.getState().searchString.length&&"never"!==e.getOption(50).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===e.getOption(50).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop}),n())}function Vye(e,t,i){const n=[];for(const o of i){const i=e.getRegionAtLine(o);if(i){const o=!i.isCollapsed;if(n.push(i),t>1){const s=e.getRegionsInside(i,(e,i)=>e.isCollapsed!==o&&i<t);n.push(...s)}}}e.toggleCollapseState(n)}function Hye(e,t,i=Number.MAX_VALUE,n){const o=[];if(n&&n.length>0)for(const s of n){const n=e.getRegionAtLine(s);if(n&&(n.isCollapsed!==t&&o.push(n),i>1)){const s=e.getRegionsInside(n,(e,n)=>e.isCollapsed!==t&&n<i);o.push(...s)}}else{const n=e.getRegionsInside(null,(e,n)=>e.isCollapsed!==t&&n<i);o.push(...n)}e.toggleCollapseState(o)}function zye(e,t,i,n){const o=[];for(const s of n){const n=e.getAllRegionsAtLine(s,(e,n)=>e.isCollapsed!==t&&n<=i);o.push(...n)}e.toggleCollapseState(o)}function Uye(e,t,i){const n=[];for(const s of i){const t=e.getAllRegionsAtLine(s,void 0);t.length>0&&n.push(t[0])}const o=e.getRegionsInside(null,e=>n.every(t=>!t.containedBy(e)&&!e.containedBy(t))&&e.isCollapsed!==t);e.toggleCollapseState(o)}function Kye(e,t,i){const n=e.textModel,o=e.regions,s=[];for(let r=o.length-1;r>=0;r--)if(i!==o.isCollapsed(r)){const e=o.getStartLineNumber(r);t.test(n.getLineContent(e))&&s.push(o.toRegion(r))}e.toggleCollapseState(s)}function qye(e,t,i){const n=e.regions,o=[];for(let s=n.length-1;s>=0;s--)i!==n.isCollapsed(s)&&t===n.getType(s)&&o.push(n.toRegion(s));e.toggleCollapseState(o)}function jye(e,t){const i=$pe(e,e=>t<e.startLineNumber)-1;return i>=0&&e[i].endLineNumber>=t?e[i]:null}function $ye(e){if(!hle(e)){if(!rle(e))return!1;const t=e;if(!hle(t.levels)&&!lle(t.levels))return!1;if(!hle(t.direction)&&!sle(t.direction))return!1;if(!(hle(t.selectionLines)||Array.isArray(t.selectionLines)&&t.selectionLines.every(lle)))return!1}return!0}function Gye(e,t,i){const n=[],o=new MZ,s=e.ordered(i);for(const a of s)n.push(a),a.extensionId&&o.add(a.extensionId);const r=t.ordered(i);for(const a of r){if(a.extensionId){if(o.has(a.extensionId))continue;o.add(a.extensionId)}n.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits:(e,t,i)=>a.provideDocumentRangeFormattingEdits(e,e.getFullModelRange(),t,i)})}return n}async function Zye(e,t,i,n,o,s,r){const a=e.get(Jn),{documentRangeFormattingEditProvider:l}=e.get(Tx),d=HCe(t)?t.getModel():t,c=l.ordered(d),h=await TZ.select(c,d,n,2);h&&(o.report(h),await a.invokeFunction(Yye,h,t,i,s,r))}async function Yye(e,t,i,n,o,s){const r=e.get(DM),a=e.get(Ks),l=e.get(NL);let d,c;HCe(i)?(d=i.getModel(),c=new fA(i,5,void 0,o)):(d=i,c=new _A(i,o));const h=[];let u=0;for(const _ of gce(n).sort(mr.compareRangesUsingStarts))u>0&&mr.areIntersectingOrTouching(h[u-1],_)?h[u-1]=mr.fromPositions(h[u-1].getStartPosition(),_.getEndPosition()):u=h.push(_);const g=async e=>{a.trace("[format][provideDocumentRangeFormattingEdits] (request)",t.extensionId?.value,e);const i=await t.provideDocumentRangeFormattingEdits(d,e,d.getFormattingOptions(),c.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",t.extensionId?.value,i),i},p=(e,t)=>{if(!e.length||!t.length)return!1;const i=e.reduce((e,t)=>mr.plusRange(e,t.range),e[0].range);if(!t.some(e=>mr.intersectRanges(i,e.range)))return!1;for(const n of e)for(const e of t)if(mr.intersectRanges(n.range,e.range))return!0;return!1},m=[],f=[];try{if("function"==typeof t.provideDocumentRangesFormattingEdits){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",t.extensionId?.value,h);const e=await t.provideDocumentRangesFormattingEdits(d,h,d.getFormattingOptions(),c.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",t.extensionId?.value,e),f.push(e)}else{for(const e of h){if(c.token.isCancellationRequested)return!0;f.push(await g(e))}for(let e=0;e<h.length;++e)for(let t=e+1;t<h.length;++t){if(c.token.isCancellationRequested)return!0;if(p(f[e],f[t])){const i=mr.plusRange(h[e],h[t]),n=await g(i);h.splice(t,1),h.splice(e,1),h.push(i),f.splice(t,1),f.splice(e,1),f.push(n),e=0,t=0}}}for(const e of f){if(c.token.isCancellationRequested)return!0;const t=await r.computeMoreMinimalEdits(d.uri,e);t&&m.push(...t)}if(c.token.isCancellationRequested)return!0}finally{c.dispose()}if(0===m.length)return!1;if(HCe(i))NZ.execute(i,m,!0),i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1);else{const[{range:e}]=m,t=new fr(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);d.pushEditOperations([t],m.map(e=>({text:e.text,range:mr.lift(e.range),forceMoveMarkers:!0})),e=>{for(const{range:i}of e)if(mr.areIntersectingOrTouching(i,t))return[new fr(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null})}return l.playSignal(TL.format,{userGesture:s}),!0}async function Qye(e,t,i,n,o,s){const r=e.get(Jn),a=e.get(Tx),l=HCe(t)?t.getModel():t,d=Gye(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),c=await TZ.select(d,l,i,1);c&&(n.report(c),await r.invokeFunction(Xye,c,t,i,o,s))}async function Xye(e,t,i,n,o,s){const r=e.get(DM),a=e.get(NL);let l,d,c;HCe(i)?(l=i.getModel(),d=new fA(i,5,void 0,o)):(l=i,d=new _A(i,o));try{const e=await t.provideDocumentFormattingEdits(l,l.getFormattingOptions(),d.token);if(c=await r.computeMoreMinimalEdits(l.uri,e),d.token.isCancellationRequested)return!0}finally{d.dispose()}if(!c||0===c.length)return!1;if(HCe(i))NZ.execute(i,c,2!==n),2!==n&&i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1);else{const[{range:e}]=c,t=new fr(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);l.pushEditOperations([t],c.map(e=>({text:e.text,range:mr.lift(e.range),forceMoveMarkers:!0})),e=>{for(const{range:i}of e)if(mr.areIntersectingOrTouching(i,t))return[new fr(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null})}return a.playSignal(TL.format,{userGesture:s}),!0}function Jye(e,t,i,n,o,s,r){const a=t.onTypeFormattingEditProvider.ordered(i);return 0===a.length||a[0].autoFormatTriggerCharacters.indexOf(o)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(i,n,o,s,r)).catch(Gae).then(t=>e.computeMoreMinimalEdits(i.uri,t))}function eSe(){return nY}function tSe(e){return new sY(e)}async function iSe(e,t,i,n=gY.default,o={triggerKind:0},s=it.None){const r=new Fe;i=i.clone();const a=t.getWordAtPosition(i),l=a?new mr(i.lineNumber,a.startColumn,i.lineNumber,a.endColumn):mr.fromPositions(i),d={replace:l,insert:l.setEndPosition(i.lineNumber,i.column)},c=[],h=new De,u=[];let g=!1;const p=(e,t,o)=>{let s=!1;if(!t)return s;for(const r of t.suggestions)if(!n.kindFilter.has(r.kind)){if(!n.showDeprecated&&r?.tags?.includes(1))continue;r.range||(r.range=d),r.sortText||(r.sortText="string"==typeof r.label?r.label:r.label.label),!g&&r.insertTextRules&&4&r.insertTextRules&&(g=hP.guessNeedsClipboard(r.insertText)),c.push(new uY(i,r,t,e)),s=!0}return xle(t)&&h.add(t),u.push({providerName:e._debugDisplayName??"unknown_provider",elapsedProvider:t.duration??-1,elapsedOverall:o.elapsed()}),s},m=(async()=>{})();for(const _ of e.orderedGroups(t)){let e=!1;if(await Promise.all(_.map(async r=>{if(n.providerItemsToReuse.has(r)){const t=n.providerItemsToReuse.get(r);return t.forEach(e=>c.push(e)),void(e=e||t.length>0)}if(!(n.providerFilter.size>0)||n.providerFilter.has(r))try{const n=new Fe;e=p(r,await r.provideCompletionItems(t,i,o,s),n)||e}catch(a){Gae(a)}})),e||s.isCancellationRequested)break}return await m,s.isCancellationRequested?(h.dispose(),Promise.reject(new v)):new pY(c.sort((f=n.snippetSortOrder,mY.get(f))),g,{entries:u,elapsed:r.elapsed()},h);var f}function nSe(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLow<t.sortTextLow)return-1;if(e.sortTextLow>t.sortTextLow)return 1}return e.textLabel<t.textLabel?-1:e.textLabel>t.textLabel?1:e.completion.kind-t.completion.kind}function oSe(e,t){if(e.completion.kind!==t.completion.kind){if(28===e.completion.kind)return-1;if(28===t.completion.kind)return 1}return nSe(e,t)}function sSe(e,t){if(e.completion.kind!==t.completion.kind){if(28===e.completion.kind)return 1;if(28===t.completion.kind)return-1}return nSe(e,t)}function rSe(e,t){let i=0;for(let n=0;n<e.length;n++)"\t"===e.charAt(n)?i+=t:i++;return i}function aSe(e,t,i){e=e<0?0:e;let n="";if(!i){const i=Math.floor(e/t);e%=t;for(let e=0;e<i;e++)n+="\t"}for(let o=0;o<e;o++)n+=" ";return n}function lSe(e,t,i){const n=t.startLineNumber;let o=t.endLineNumber;if(1===t.endColumn&&o--,n>=o)return null;const s=[];for(let a=n;a<=o;a++)s.push(e.getLineContent(a));let r=s.slice(0);return r.sort(xY._COLLATOR.value.compare),!0===i&&(r=r.reverse()),{startLineNumber:n,endLineNumber:o,before:s,after:r}}function dSe(e,t=P){return function(e,t=P){return!!t&&wue(e.charCodeAt(0))&&58===e.charCodeAt(1)}(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}function cSe(e){return new BQ(e)}function hSe(e){return function(e){const t=Wi.createSortPermutation(e,fce(e=>e.range,mr.compareRangesUsingStarts)),i=new lC(t.apply(e)).getNewRanges();return t.inverse().apply(i)}(e).map(e=>e.getEndPosition())}function uSe(e,t){return new Promise(i=>{let n;const o=setTimeout(()=>{n&&n.dispose(),i()},e);t&&(n=t.onCancellationRequested(()=>{clearTimeout(o),n&&n.dispose(),i()}))})}function gSe(e,t,i,n){return e===n?t+i:i*(1-Math.pow(2,-10*e/n))+t}function pSe(e,t,i,n){return i*((e=e/n-1)*e*e+1)+t}function mSe(e,t){return Zde(e,t,fSe)}function fSe(e,t){return e===t||!(!e||!t)&&(e instanceof jQ&&t instanceof jQ||e instanceof GQ&&t instanceof GQ)&&e.equals(t)}function _Se(e,t,i){const n=i?e.range.intersectRanges(i):e.range;if(!n)return e;const o=e.text.replaceAll("\r\n","\n"),s=t.getValueInRange(n,1),r=sde(s,o),a=eC.ofText(s.substring(0,r)).addToPosition(e.range.getStartPosition()),l=o.substring(r);return new dC(mr.fromPositions(a,e.range.getEndPosition()),l)}function bSe(e,t){return e.text.startsWith(t.text)&&(i=e.range,(n=t.range).getStartPosition().equals(i.getStartPosition())&&n.getEndPosition().isBeforeOrEqual(i.getEndPosition()));var i,n}function vSe(e,t,i,n,o=0){let s=_Se(e,t);if(s.range.endLineNumber!==s.range.startLineNumber)return;const r=t.getLineContent(s.range.startLineNumber),a=$le(r).length;if(s.range.startColumn-1<=a){const e=$le(s.text).length,t=r.substring(s.range.startColumn-1,a),[i,n]=[s.range.getStartPosition(),s.range.getEndPosition()],o=i.column+t.length<=n.column?i.delta(0,t.length):n;s=new dC(mr.fromPositions(o,n),s.text.startsWith(t)?s.text.substring(t.length):s.text.substring(e))}const l=t.getValueInRange(s.range),d=function(e,t){if(ZQ?.originalValue===e&&ZQ?.newValue===t)return ZQ?.changes;{let i=CSe(e,t,!0);if(i){const n=wSe(i);if(n>0){const o=CSe(e,t,!1);o&&wSe(o)<n&&(i=o)}}return ZQ={originalValue:e,newValue:t,changes:i},i}}(l,s.text);if(!d)return;const c=s.range.startLineNumber,h=new Array;if("prefix"===i){const e=d.filter(e=>0===e.originalLength);if(e.length>1||1===e.length&&e[0].originalStart!==l.length)return}const u=s.text.length-o;for(const g of d){const e=s.range.startColumn+g.originalStart+g.originalLength;if("subwordSmart"===i&&n&&n.lineNumber===s.range.startLineNumber&&e<n.column)return;if(g.originalLength>0)return;if(0===g.modifiedLength)continue;const t=g.modifiedStart+g.modifiedLength,o=Math.max(g.modifiedStart,Math.min(t,u)),r=s.text.substring(g.modifiedStart,o),a=s.text.substring(o,Math.max(g.modifiedStart,t));r.length>0&&h.push(new $Q(e,r,!1)),a.length>0&&h.push(new $Q(e,a,!0))}return new jQ(c,h)}function wSe(e){let t=0;for(const i of e)t+=i.originalLength;return t}function CSe(e,t,i){if(e.length>5e3||t.length>5e3)return;function n(e){let t=0;for(let i=0,n=e.length;i<n;i++){const n=e.charCodeAt(i);n>t&&(t=n)}return t}const o=Math.max(n(e),n(t));function s(e){if(e<0)throw new Error("unexpected");return o+e+1}function r(e){let t=0,n=0;const o=new Int32Array(e.length);for(let r=0,a=e.length;r<a;r++)i&&"("===e[r]?(o[r]=s(2*(100*n+t)),t++):i&&")"===e[r]?(t=Math.max(t-1,0),o[r]=s(2*(100*n+t)+1),0===t&&n++):o[r]=e.charCodeAt(r);return o}const a=r(e),l=r(t);return new Bz({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}function ySe(e){if(!e)return!1;const t=e.toLowerCase();return"github.copilot"===t||"github.copilot-chat"===t}function SSe(e,t,i,n){return new Bz(e,t,i).ComputeDiff(n)}function xSe(e,t){const i=jle(e);return-1===i?t:i+1}function kSe(e,t){const i=Gle(e);return-1===i?t:i+2}function LSe(e){if(0===e)return()=>!0;const t=Date.now();return()=>Date.now()-t<e}function DSe(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}function ISe(e){return e>=65&&e<=90}function NSe(e){return fX[e]}function ESe(e){return 10===e?8:13===e?7:lwe(e)?6:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:-1===e?3:44===e||59===e?5:4}function MSe(e,t,i,n,o,s){let{moves:r,excludedChanges:a}=function(e,t,i,n){const o=[],s=e.filter(e=>e.modified.isEmpty&&e.original.length>=3).map(e=>new UM(e.original,t,e)),r=new Set(e.filter(e=>e.original.isEmpty&&e.modified.length>=3).map(e=>new UM(e.modified,i,e))),a=new Set;for(const l of s){let e,t=-1;for(const i of r){const n=l.computeSimilarity(i);n>t&&(t=n,e=i)}if(t>.9&&e&&(r.delete(e),o.push(new WE(l.range,e.range)),a.add(l.source),a.add(e.source)),!n.isValid())return{moves:o,excludedChanges:a}}return{moves:o,excludedChanges:a}}(e,t,i,s);if(!s.isValid())return[];const l=function(e,t,i,n,o,s){const r=[],a=new Is;for(const u of e)for(let e=u.original.startLineNumber;e<u.original.endLineNumberExclusive-2;e++){const i=`${t[e-1]}:${t[e+1-1]}:${t[e+2-1]}`;a.add(i,{range:new Qw(e,e+3)})}const l=[];e.sort(fce(e=>e.modified.startLineNumber,Oi));for(const u of e){let e=[];for(let t=u.modified.startLineNumber;t<u.modified.endLineNumberExclusive-2;t++){const n=`${i[t-1]}:${i[t+1-1]}:${i[t+2-1]}`,o=new Qw(t,t+3),s=[];a.forEach(n,({range:t})=>{for(const n of e)if(n.originalLineRange.endLineNumberExclusive+1===t.endLineNumberExclusive&&n.modifiedLineRange.endLineNumberExclusive+1===o.endLineNumberExclusive)return n.originalLineRange=new Qw(n.originalLineRange.startLineNumber,t.endLineNumberExclusive),n.modifiedLineRange=new Qw(n.modifiedLineRange.startLineNumber,o.endLineNumberExclusive),void s.push(n);const i={modifiedLineRange:o,originalLineRange:t};l.push(i),s.push(i)}),e=s}if(!s.isValid())return[]}l.sort(_ce(fce(e=>e.modifiedLineRange.length,Oi)));const d=new Xw,c=new Xw;for(const u of l){const e=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,t=d.subtractFrom(u.modifiedLineRange),i=c.subtractFrom(u.originalLineRange).getWithDelta(e),n=t.getIntersection(i);for(const o of n.ranges){if(o.length<3)continue;const t=o,i=o.delta(-e);r.push(new WE(i,t)),d.addRange(t),c.addRange(i)}}r.sort(fce(e=>e.original.startLineNumber,Oi));const h=new B_(e);for(let u=0;u<r.length;u++){const t=r[u],i=h.findLastMonotonous(e=>e.original.startLineNumber<=t.original.startLineNumber),a=qpe(e,e=>e.modified.startLineNumber<=t.modified.startLineNumber),l=Math.max(t.original.startLineNumber-i.original.startLineNumber,t.modified.startLineNumber-a.modified.startLineNumber),g=h.findLastMonotonous(e=>e.original.startLineNumber<t.original.endLineNumberExclusive),p=qpe(e,e=>e.modified.startLineNumber<t.modified.endLineNumberExclusive),m=Math.max(g.original.endLineNumberExclusive-t.original.endLineNumberExclusive,p.modified.endLineNumberExclusive-t.modified.endLineNumberExclusive);let f,_;for(f=0;f<l;f++){const e=t.original.startLineNumber-f-1,i=t.modified.startLineNumber-f-1;if(e>n.length||i>o.length)break;if(d.contains(i)||c.contains(e))break;if(!TSe(n[e-1],o[i-1],s))break}for(f>0&&(c.addRange(new Qw(t.original.startLineNumber-f,t.original.startLineNumber)),d.addRange(new Qw(t.modified.startLineNumber-f,t.modified.startLineNumber))),_=0;_<m;_++){const e=t.original.endLineNumberExclusive+_,i=t.modified.endLineNumberExclusive+_;if(e>n.length||i>o.length)break;if(d.contains(i)||c.contains(e))break;if(!TSe(n[e-1],o[i-1],s))break}_>0&&(c.addRange(new Qw(t.original.endLineNumberExclusive,t.original.endLineNumberExclusive+_)),d.addRange(new Qw(t.modified.endLineNumberExclusive,t.modified.endLineNumberExclusive+_))),(f>0||_>0)&&(r[u]=new WE(new Qw(t.original.startLineNumber-f,t.original.endLineNumberExclusive+_),new Qw(t.modified.startLineNumber-f,t.modified.endLineNumberExclusive+_)))}return r}(e.filter(e=>!a.has(e)),n,o,t,i,s);return hce(r,l),r=function(e){if(0===e.length)return e;e.sort(fce(e=>e.original.startLineNumber,Oi));const t=[e[0]];for(let i=1;i<e.length;i++){const n=t[t.length-1],o=e[i],s=o.original.startLineNumber-n.original.endLineNumberExclusive,r=o.modified.startLineNumber-n.modified.endLineNumberExclusive;s>=0&&r>=0&&s+r<=2?t[t.length-1]=n.join(o):t.push(o)}return t}(r),r=r.filter(e=>{const i=e.original.toOffsetRange().slice(t).map(e=>e.trim());return i.join("\n").length>=15&&function(e,t){let i=0;for(const n of e)t(n)&&i++;return i}(i,e=>e.length>=2)>=2}),r=function(e,t){const i=new B_(e);return t=t.filter(t=>(i.findLastMonotonous(e=>e.original.startLineNumber<t.original.endLineNumberExclusive)||new WE(new Qw(1,1),new Qw(1,1)))!==qpe(e,e=>e.modified.startLineNumber<t.modified.endLineNumberExclusive))}(e,r),r}function TSe(e,t,i){if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;const n=(new hX).compute(new mX([e],new mr(1,1,1,e.length),!1),new mX([t],new mr(1,1,1,t.length),!1),i);let o=0;const s=WM.invert(n.diffs,e.length);for(const a of s)a.seq1Range.forEach(t=>{lwe(e.charCodeAt(t))||o++});const r=function(t){let i=0;for(let n=0;n<e.length;n++)lwe(t.charCodeAt(n))||i++;return i}(e.length>t.length?e:t);return o/r>.6&&r>10}function RSe(e,t,i){let n=i;return n=OSe(e,t,n),n=OSe(e,t,n),n=function(e,t,i){if(!e.getBoundaryScore||!t.getBoundaryScore)return i;for(let n=0;n<i.length;n++){const o=n>0?i[n-1]:void 0,s=i[n],r=n+1<i.length?i[n+1]:void 0,a=new hl(o?o.seq1Range.endExclusive+1:0,r?r.seq1Range.start-1:e.length),l=new hl(o?o.seq2Range.endExclusive+1:0,r?r.seq2Range.start-1:t.length);s.seq1Range.isEmpty?i[n]=ASe(s,e,t,a,l):s.seq2Range.isEmpty&&(i[n]=ASe(s.swap(),t,e,l,a).swap())}return i}(e,t,n),n}function OSe(e,t,i){if(0===i.length)return i;const n=[];n.push(i[0]);for(let s=1;s<i.length;s++){const o=n[n.length-1];let r=i[s];if(r.seq1Range.isEmpty||r.seq2Range.isEmpty){const i=r.seq1Range.start-o.seq1Range.endExclusive;let s;for(s=1;s<=i&&e.getElement(r.seq1Range.start-s)===e.getElement(r.seq1Range.endExclusive-s)&&t.getElement(r.seq2Range.start-s)===t.getElement(r.seq2Range.endExclusive-s);s++);if(s--,s===i){n[n.length-1]=new WM(new hl(o.seq1Range.start,r.seq1Range.endExclusive-i),new hl(o.seq2Range.start,r.seq2Range.endExclusive-i));continue}r=r.delta(-s)}n.push(r)}const o=[];for(let s=0;s<n.length-1;s++){const i=n[s+1];let r=n[s];if(r.seq1Range.isEmpty||r.seq2Range.isEmpty){const o=i.seq1Range.start-r.seq1Range.endExclusive;let a;for(a=0;a<o&&e.isStronglyEqual(r.seq1Range.start+a,r.seq1Range.endExclusive+a)&&t.isStronglyEqual(r.seq2Range.start+a,r.seq2Range.endExclusive+a);a++);if(a===o){n[s+1]=new WM(new hl(r.seq1Range.start+o,i.seq1Range.endExclusive),new hl(r.seq2Range.start+o,i.seq2Range.endExclusive));continue}a>0&&(r=r.delta(a))}o.push(r)}return n.length>0&&o.push(n[n.length-1]),o}function ASe(e,t,i,n,o){let s=1;for(;e.seq1Range.start-s>=n.start&&e.seq2Range.start-s>=o.start&&i.isStronglyEqual(e.seq2Range.start-s,e.seq2Range.endExclusive-s)&&s<100;)s++;s--;let r=0;for(;e.seq1Range.start+r<n.endExclusive&&e.seq2Range.endExclusive+r<o.endExclusive&&i.isStronglyEqual(e.seq2Range.start+r,e.seq2Range.endExclusive+r)&&r<100;)r++;if(0===s&&0===r)return e;let a=0,l=-1;for(let d=-s;d<=r;d++){const n=e.seq2Range.start+d,o=e.seq2Range.endExclusive+d,s=e.seq1Range.start+d,r=t.getBoundaryScore(s)+i.getBoundaryScore(n)+i.getBoundaryScore(o);r>l&&(l=r,a=d)}return e.delta(a)}function PSe(e,t,i,n,o=!1){const s=WM.invert(i,e.length),r=[];let a=new BM(0,0);function l(i,l){if(i.offset1<a.offset1||i.offset2<a.offset2)return;const d=n(e,i.offset1),c=n(t,i.offset2);if(!d||!c)return;let h=new WM(d,c);const u=h.intersect(l);let g=u.seq1Range.length,p=u.seq2Range.length;for(;s.length>0;){const i=s[0];if(!i.seq1Range.intersects(h.seq1Range)&&!i.seq2Range.intersects(h.seq2Range))break;const o=new WM(n(e,i.seq1Range.start),n(t,i.seq2Range.start)),r=o.intersect(i);if(g+=r.seq1Range.length,p+=r.seq2Range.length,h=h.join(o),!(h.seq1Range.endExclusive>=i.seq1Range.endExclusive))break;s.shift()}(o&&g+p<h.seq1Range.length+h.seq2Range.length||g+p<2*(h.seq1Range.length+h.seq2Range.length)/3)&&r.push(h),a=h.getEndExclusives()}for(;s.length>0;){const e=s.shift();e.seq1Range.isEmpty||(l(e.getStarts(),e),l(e.getEndExclusives().delta(-1),e))}return function(e,t){const i=[];for(;e.length>0||t.length>0;){const n=e[0],o=t[0];let s;s=n&&(!o||n.seq1Range.start<o.seq1Range.start)?e.shift():t.shift(),i.length>0&&i[i.length-1].seq1Range.endExclusive>=s.seq1Range.start?i[i.length-1]=i[i.length-1].join(s):i.push(s)}return i}(i,r)}function FSe(e){let t=0;for(;t<e.length&&(32===e.charCodeAt(t)||9===e.charCodeAt(t));)t++;return t}function WSe(e,t,i,n){const o=_Se(e,i),s=e.range;if(!s||t&&!t.getStartPosition().equals(s.getStartPosition())||n.lineNumber!==o.range.startLineNumber||o.isEmpty)return!1;const r=i.getValueInRange(o.range,1),a=o.text,l=Math.max(0,n.column-o.range.startColumn);let d=a.substring(0,l),c=a.substring(l),h=r.substring(0,l),u=r.substring(l);const g=i.getLineIndentColumn(o.range.startLineNumber);return o.range.startColumn<=g&&(h=h.trimStart(),0===h.length&&(u=u.trimStart()),d=d.trimStart(),0===d.length&&(c=c.trimStart())),d.startsWith(h)&&!!rbe(u,c)}function BSe(e,t,i){const n=e.getEOL(),o=e.getValueInRange(t),s=i.replace(/\r\n|\r|\n/g,n),r=vX.getDefault().computeDiff(qle(o),qle(s),{ignoreTrimWhitespace:!1,computeMoves:!1,extendToSubwords:!0,maxComputationTimeMs:500}).changes.flatMap(e=>e.innerChanges??[]),a=new aC(s);return new Zw(r.map(i=>{const n=function(e,t){const i=eC.fromPosition(t.getStartPosition());return eC.ofRange(t).createRange(i.addToPosition(e))}(t.getStartPosition(),i.originalRange);return function(e,t,i,n){const o=n.getEOL();if(e.newText.endsWith(o)&&t.endsWith(o)&&(e=new Yw(e.replaceRange.deltaEnd(-o.length),e.newText.slice(0,-o.length))),1===i&&e.replaceRange.isEmpty&&e.newText.includes(o)){const t=n.getPositionAt(e.replaceRange.start);0!==n.getLineLength(t.lineNumber)&&(e=VSe(e,n))}if(1===i){const i=sde(t,e.newText),n=rde(t.slice(i),e.newText.slice(i));if(i+n===t.length)return new Yw(e.replaceRange.deltaStart(i).deltaEnd(-n),e.newText.substring(i,e.newText.length-n));if(i+n===e.newText.length)return new Yw(e.replaceRange.deltaStart(i).deltaEnd(-n),"")}return e}(new Yw(cSe(e).getOffsetRange(n),a.getValueOfRange(i.modifiedRange)),e.getValueInRange(n),r.length,e)}))}function VSe(e,t){if(!e.replaceRange.isEmpty)throw new y("Unexpected original range");if(0===e.replaceRange.start)return e;const i=t.getEOL(),n=t.getPositionAt(e.replaceRange.start),o=n.column,s=n.lineNumber;return 1===o&&s>1&&e.newText.endsWith(i)&&!e.newText.startsWith(i)?new Yw(e.replaceRange.delta(-1),i+e.newText.slice(0,-i.length)):e}function HSe(e,t,i,n,o,s){const r=Wpe("icr"),a=new ot;let l;const d={...n,requestUuid:r},c=function(e,t){const i=t.getWordAtPosition(e),n=t.getLineMaxColumn(e.lineNumber);return i?new mr(e.lineNumber,i.startColumn,e.lineNumber,n):mr.fromPositions(e,e.with(void 0,n))}(t,i),h=function(e,t){const i=new Map;for(const n of e){const e=t(n);let o=i.get(e);o||(o=[],i.set(e,o)),o.push(n)}return i}(e,e=>e.groupId),u=IX.from(e,e=>e.yieldsToGroupIds?.flatMap(e=>h.get(e)??[])??[]),{foundCycles:g}=u.removeCycles();g.length>0&&Gae(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${g.map(e=>e.toString?e.toString():""+e).join(" -> ")}`));let p=0;const m=new Dt(async e=>{try{if(p++,a.token.isCancellationRequested)return;const r=u.getOutgoing(e);for(const e of r){const n=await m.get(e);if(n)for(const e of n.inlineSuggestions.items){if(e.isInlineEdit||"string"!=typeof e.insertText&&void 0!==e.insertText)return;if(void 0!==e.insertText&&WSe(new dC(mr.lift(e.range)??c,e.insertText),void 0,i,t))return}}let h;const g=Date.now();try{h=await e.provideInlineCompletions(i,t,d,a.token)}catch(n){return void Gae(n)}const f=Date.now();if(!h)return;const _=[],b=new RX(h,_,e);if(b.addRef(),zSe(a.token,()=>b.removeRef(l)),a.token.isCancellationRequested)return;for(const e of h.items)_.push(USe(e,b,c,i,s,d,o,{startTime:g,endTime:f}));return b}finally{p--}});return{contextWithUuid:d,get didAllProvidersReturn(){return 0===p},lists:xt.fromPromisesResolveOrder(e.map(e=>m.get(e))).filter(ule),cancelAndDispose:e=>{void 0===l&&(l=e,a.dispose(!0))}}}function zSe(e,t){if(e.isCancellationRequested)return t(),Ie.None;{const i=e.onCancellationRequested(()=>{i.dispose(),t()});return{dispose:()=>i.dispose()}}}function USe(e,t,i,n,o,s,r,a){let l,d,c=e.range?mr.lift(e.range):i;if("string"==typeof e.insertText){if(l=e.insertText,o&&e.completeBracketPairs){l=KSe(l,c.getStartPosition(),n,o);const t=l.length-e.insertText.length;0!==t&&(c=new mr(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+t))}d=void 0}else if(void 0===e.insertText)l="",d=void 0,c=new mr(1,1,1,1);else if("snippet"in e.insertText){const t=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=KSe(e.insertText.snippet,c.getStartPosition(),n,o);const i=e.insertText.snippet.length-t;0!==i&&(c=new mr(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn+i))}const i=(new hP).parse(e.insertText.snippet);1===i.children.length&&i.children[0]instanceof nP?(l=i.children[0].value,d=void 0):(l=i.toString(),d={snippet:e.insertText.snippet,range:c})}else ele(e.insertText);return new MX(c,l,d,_i.revive(e.uri),e.hint,e.additionalTextEdits||VQ,e,t,s,e.isInlineEdit??!1,r,a,e.correlationId)}function KSe(e,t,i,n){const o=i.getLineContent(t.lineNumber),s=Yw.replace(new hl(t.column-1,o.length),e),r=i.tokenization.tokenizeLinesAt(t.lineNumber,[s.replace(o)])?.[0].sliceZeroCopy(s.getRangeAfterReplace());return r?function(e,t){const i=new ky(new ay,e=>t.getLanguageConfiguration(e)),n=Xme(new Cy(new DX([e]),i),[],void 0,!0);let o="";const s=e.getLineContent();return function e(t,n){if(2===t.kind)if(e(t.openingBracket,n),n=Wme(n,t.openingBracket.length),t.child&&(e(t.child,n),n=Wme(n,t.child.length)),t.closingBracket)e(t.closingBracket,n),n=Wme(n,t.closingBracket.length);else{const e=i.getSingleLanguageBracketTokens(t.openingBracket.languageId).findClosingTokenText(t.openingBracket.bracketIds);o+=e}else if(3===t.kind);else if(0===t.kind||1===t.kind)o+=s.substring(n,Wme(n,t.length));else if(4===t.kind)for(const i of t.children)e(i,n),n=Wme(n,i.length)}(n,0),o}(r,n):e}function qSe(e,t,i){if(1===t.length)return[];const n=new zR(e),o=n.getTransformer(),s=o.getOffset(t[0]),r=t.slice(1).map(e=>o.getOffset(e));i=i.removeCommonPrefixAndSuffix(n);const a=o.getStringReplacement(i),l=a.replaceRange.start-s,d=a.replaceRange.join(hl.emptyAt(s)),c=n.getValueOfOffsetRange(d);return r.map(e=>{const t=e+l,i=new hl(t,t+a.replaceRange.length),s=i.join(hl.emptyAt(e));if(n.getValueOfOffsetRange(s)!==c)return;const r=new Yw(i,a.newText);return o.getTextReplacement(r)}).filter(ule)}function jSe(e){return!!e&&Boolean(e.completion.documentation||e.completion.detail&&e.completion.detail!==e.completion.label)}function $Se(e,t,i,n,o){if(mo.isThemeIcon(o))return[`codicon-${o.id}`,"predefined-file-icon"];if(_i.isUri(o))return[];const s=n===jJ.ROOT_FOLDER?["rootfolder-icon"]:n===jJ.FOLDER?["folder-icon"]:["file-icon"];if(i){let o;if(i.scheme===yi.data)o=Us.parseMetaData(i).get(Us.META_DATA_LABEL);else{const e=i.path.match($J);e?(o=GSe(e[2].toLowerCase()),e[1]&&s.push(`${GSe(e[1].toLowerCase())}-name-dir-icon`)):o=GSe(i.authority.toLowerCase())}if(n===jJ.ROOT_FOLDER)s.push(`${o}-root-name-folder-icon`);else if(n===jJ.FOLDER)s.push(`${o}-name-folder-icon`);else{if(o){if(s.push(`${o}-name-file-icon`),s.push("name-file-icon"),o.length<=255){const e=o.split(".");for(let t=1;t<e.length;t++)s.push(`${e.slice(t).join(".")}-ext-file-icon`)}s.push("ext-file-icon")}const n=function(e,t,i){if(!i)return null;let n=null;if(i.scheme===yi.data){const e=Us.parseMetaData(i).get(Us.META_DATA_MIME);e&&(n=t.getLanguageIdByMimeType(e))}else{const t=e.getModel(i);t&&(n=t.getLanguageId())}return n&&"plaintext"!==n?n:t.guessLanguageIdByFilepathOrFirstLine(i)}(e,t,i);n&&s.push(`${GSe(n)}-lang-file-icon`)}}return s}function GSe(e){return e.replace(/[\s]/g,"/")}function ZSe(e){return e.replace(/\r\n|\r|\n/g,"")}function YSe(e){return xhe(e)&&e.classList.contains(N1)}function QSe(e){return e.map(e=>e===NX.Accept?A0:O0)}function XSe(e){return e.map(e=>e===NX.Accept?P0:R0)}function JSe(e,t){let i;i="string"==typeof e?exe(e,t):e.map((e,i)=>exe(e,t).read(i));const n=exe(wh,t);return i.map((e,t)=>e.makeOpaque(n.read(t)))}function exe(e,t){return zce({owner:{observeColor:e},equalsFn:(e,t)=>e.equals(t),debugName:()=>`observeColor(${e})`},t.onDidColorThemeChange,()=>{const i=t.getColorTheme().getColor(e);if(!i)throw new y(`Missing color: ${e}`);return i})}function txe(e,t,i){e.layoutInfo.read(i),e.value.read(i);const n=e.model.read(i);if(!n)return 0;let o=0;e.scrollTop.read(i);for(let r=t.startLineNumber;r<t.endLineNumberExclusive;r++){const t=n.getLineMaxColumn(r);let i=e.editor.getOffsetForColumn(r,t);-1===i&&(i=t*e.editor.getOption(59).typicalHalfwidthCharacterWidth),o=Math.max(o,i)}const s=t.mapToLineArray(e=>n.getLineContent(e));return o<5&&s.some(e=>e.length>0)&&"file"!==n.uri.scheme&&console.error("unexpected width"),o}function ixe(e,t,i,n,o=void 0){const s=n.getModel();if(!s)return{prefixTrim:0,prefixLeftOffset:0};const r=e.map(e=>e.isSingleLine()?e.startColumn-1:0),a=t.mapToLineArray(e=>y_e(s.getLineContent(e))),l=i.filter(e=>""!==e).map(e=>y_e(e)),d=Math.min(...r,...a,...l);let c;if(s.getLineIndentColumn(t.startLineNumber)>=d+1)bwe(n).scrollTop.read(o),c=n.getOffsetForColumn(t.startLineNumber,d+1);else{if(!(i.length>0))return{prefixTrim:0,prefixLeftOffset:0};c=nxe(i[0].slice(0,d),n,s)}return{prefixTrim:d,prefixLeftOffset:c}}function nxe(e,t,i){const n=t.getOption(59).typicalHalfwidthCharacterWidth,o=i.getOptions().tabSize*n,s=e.split("\t").length-1;return(e.length-s)*n+s*o}function oxe(e){const t=e.layoutInfoContentLeft,i=Dce({name:"editor.validOverlay.width"},i=>{const n=0!==e.layoutInfoMinimap.read(i).minimapLeft,o=e.layoutInfoWidth.read(i)-t.read(i);return n?o-(e.layoutInfoMinimap.read(i).minimapWidth+e.layoutInfoVerticalScrollbarWidth.read(i)):o}),n=Dce({name:"editor.validOverlay.height"},t=>e.layoutInfoHeight.read(t)+e.contentHeight.read(t));return Dce({name:"editor.validOverlay"},e=>H1.fromLeftTopWidthHeight(t.read(e),0,i.read(e),n.read(e)))}function sxe(...e){return e.filter(e=>"string"==typeof e).join(" ")}function rxe(e,t,i){const n=qle(e),o=[],s=Ype(t.mapToLineArray(e=>function(e,t){let i=0;e:for(let n=0,o=e.length;n<o;n++)switch(e.charCodeAt(n)){case 9:i+=t;break;case 32:i++;break;default:break e}return i-i%t}(n[e-1],i)),Oi);return t.forEach(e=>{const t=function(e,t,i){let n=t-t%i,o=0;for(;o<e.length&&0!==n;o++)switch(e.charCodeAt(o)){case 9:n-=i;break;case 32:n--;break;default:throw new y("Unexpected character found while calculating indent length")}return o}(n[e-1],s,i);var r,a;o.push(new dC((r=new hl(0,t),a=new to(e,1),new mr(a.lineNumber,a.column+r.start,a.lineNumber,a.column+r.endExclusive)),""))}),new lC(o)}function axe(e){const t=qce(void 0,(t,i)=>e.read(t)||i);return Nce({debugName:()=>`${e.debugName}.mapOutFalsy`},i=>{if(t.read(i),e.read(i))return t})}function lxe(e,t=Hi.ofCaller()){return{left:Dce({name:"editor.validOverlay.left"},t=>e(t).left,t),top:Dce({name:"editor.validOverlay.top"},t=>e(t).top,t),width:Dce({name:"editor.validOverlay.width"},t=>e(t).right-e(t).left,t),height:Dce({name:"editor.validOverlay.height"},t=>e(t).bottom-e(t).top,t)}}function dxe(e){return Dce({name:"inlineEdits.option"},t=>zn.div({class:["monaco-menu-option",e.isActive?.map(e=>e&&"active")],onmouseenter:()=>e.onHoverChange?.(!0),onmouseleave:()=>e.onHoverChange?.(!1),onclick:e.onAction,onkeydown:t=>{"Enter"===t.key&&e.onAction?.()},tabIndex:0,style:{borderRadius:3}},[zn.elem("span",{style:{fontSize:16,display:"flex"}},[mo.isThemeIcon(e.icon)?pve(e.icon):e.icon.map(e=>pve(e))]),zn.elem("span",{},[e.title]),zn.div({style:{marginLeft:"auto"},ref:i=>{const n=t.store.add(new fP(i,Y,{disableTitle:!0,...oR,keybindingLabelShadow:void 0,keybindingLabelForeground:gpe(ah),keybindingLabelBackground:"transparent",keybindingLabelBorder:"transparent",keybindingLabelBottomBorder:void 0}));t.store.add(Rce(t=>{n.set(e.keybinding.read(t))}))}})]))}function cxe(){return zn.div({id:"inline-edit-gutter-indicator-menu-separator",class:"menu-separator",style:{color:gpe(Zg),padding:"2px 0"}},zn.div({style:{borderBottom:`1px solid ${gpe(qh)}`}}))}function hxe(e){return!!e.innerChanges&&e.innerChanges.every(e=>_we(e.modifiedRange)&&_we(e.originalRange))}function uxe(e){return e.every(e=>e.innerChanges.every(e=>function(e){return!!e.originalRange.isEmpty()&&e.modifiedRange.startLineNumber===e.modifiedRange.endLineNumber}(e)))}function gxe(e,t){if(!t)return!1;if(!uxe(e))return!1;const i=t;return e.every(e=>e.innerChanges.every(e=>function(e){const t=e.originalRange.getStartPosition();return!!i.isBeforeOrEqual(t)||t.lineNumber<i.lineNumber}(e)))}function pxe(e){const t=e.flatMap(e=>e.innerChanges??[]);if(1!==t.length)return!1;const i=t[0];return!!i.originalRange.isEmpty()&&i.modifiedRange.startLineNumber!==i.modifiedRange.endLineNumber}function mxe(e,t,i){return e.map(e=>({original:t.originalText.getValueOfRange(e.originalRange),modified:i.getValueOfRange(e.modifiedRange)})).every(({original:e,modified:t})=>""===t.trim()&&e.length>0&&(e.length>t.length||""!==e.trim()))}function fxe(e,t){return _xe(e,t,e=>!/^\s$/.test(e))}function _xe(e,t,i){const n=[];e.sort((e,t)=>mr.compareRangesUsingStarts(e.range,t.range));for(const s of e){let e=s.range.startColumn-1,i=s.range.endColumn-2,r="",a="";const l=t.getLineAt(s.range.startLineNumber),d=t.getLineAt(s.range.endLineNumber);if(o(l[e]))for(;o(l[e-1]);)r=l[e-1]+r,e--;if(o(d[i])||i<e)for(;o(d[i+1]);)a+=d[i+1],i++;let c=new dC(new mr(s.range.startLineNumber,e+1,s.range.endLineNumber,i+2),r+s.text+a);n.length>0&&mr.areIntersectingOrTouching(n[n.length-1].range,c.range)&&(c=dC.joinReplacements([n.pop(),c],t)),n.push(c)}function o(e){return void 0!==e&&i(e)}return n}function bxe(e,t,i,n){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return[];const o=t.getLanguageConfiguration(e.getLanguageId()).indentRulesSupport;if(!o)return[];const s=new bl(e,o,t);for(n=Math.min(n,e.getLineCount());i<=n&&s.shouldIgnore(i);)i++;if(i>n-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=e.getOptions(),d=(e,t)=>(t=t||1,kl.shiftIndent(e,e.length+t,r,a,l)),c=(e,t)=>(t=t||1,kl.unshiftIndent(e,e.length+t,r,a,l)),h=[];let u=$le(e.getLineContent(i)),g=u;s.shouldIncrease(i)?(g=d(g),u=d(u)):s.shouldIndentNextLine(i)&&(g=d(g));for(let p=++i;p<=n;p++){if(vxe(e,p))continue;const t=$le(e.getLineContent(p)),i=g;s.shouldDecrease(p,i)&&(g=c(g),u=c(u)),t!==g&&h.push(VH.replaceMove(new fr(p,1,p,t.length+1),Tue(g,a,l))),s.shouldIgnore(p)||(s.shouldIncrease(p,i)?(u=d(u),g=u):g=s.shouldIndentNextLine(p,i)?d(g):u)}return h}function vxe(e,t){return!!e.tokenization.isCheapToTokenize(t)&&2===e.tokenization.getLineTokens(t).getStandardTokenType(0)}function wxe(e,t,i,n){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return;let o="";for(let r=0;r<i;r++)o+=" ";const s=new RegExp(o,"gi");for(let r=1,a=e.getLineCount();r<=a;r++){let i=e.getLineFirstNonWhitespaceColumn(r);if(0===i&&(i=e.getLineMaxColumn(r)),1===i)continue;const a=new mr(r,1,r,i),l=e.getValueInRange(a),d=n?l.replace(/\t/gi,o):l.replace(s,"\t");t.addEditOperation(a,d)}}function Cxe(e,t,i,n){return Ole(e.ordered(t).map(e=>async()=>{try{return await e.provideLinkedEditingRanges(t,i,n)}catch(o){return void Gae(o)}}),e=>!!e&&sce(e?.ranges))}async function yxe(e,t,i){const n=[],o=e.ordered(t).reverse().map(async(e,o)=>{try{const s=await e.provideLinks(t,i);s&&(n[o]=[s,e])}catch(s){Gae(s)}});await Promise.all(o);let s=new c5(ice(n));return i.isCancellationRequested&&(s.dispose(),s=c5.Empty),s}function Sxe(e){return e===yb.Write?L5:e===yb.Text?D5:E5}function xxe(e){return e?N5:I5}function kxe(e,t){const i=t.filter(t=>!e.find(e=>e.equals(t)));if(i.length>=1){const e=i.map(e=>`line ${e.viewState.position.lineNumber} column ${e.viewState.position.column}`).join(", ");Xhe(1===i.length?Vae(1288,"Cursor added: {0}",e):Vae(1289,"Cursors added: {0}",e))}}function Lxe(e,t,i){const n=Dxe(e,t[0],!i);for(let o=1,s=t.length;o<s;o++){const s=t[o];if(s.isEmpty())return!1;if(n!==Dxe(e,s,!i))return!1}return!0}function Dxe(e,t,i){const n=e.getValueInRange(t);return i?n.toLowerCase():n}async function Ixe(e,t,i,n,o){const s=e.ordered(t);for(const a of s)try{const e=await a.provideSignatureHelp(t,i,o,n);if(e)return e}catch(r){Gae(r)}}function Nxe(e,t){switch(t.triggerKind){case Cb.Invoke:return t;case Cb.ContentChange:return e;case Cb.TriggerCharacter:default:return t}}function Exe(e,t,i){const n=e.data,o=e.data.length/5|0,s=Math.max(Math.ceil(o/1024),400),r=[];let a=0,l=1,d=0;for(;a<o;){const e=a;let c=Math.min(e+s,o);if(c<o){let t=c;for(;t-1>e&&0===n[5*t];)t--;if(t-1===e){let e=c;for(;e+1<o&&0===n[5*e];)e++;c=e}else c=t}let h=new Uint32Array(4*(c-e)),u=0,g=0,p=0,m=0;for(;a<c;){const e=5*a,o=n[e],s=n[e+1],r=l+o|0,c=0===o?d+s|0:s,f=c+n[e+2]|0,_=n[e+3],b=n[e+4];if(f<=c)t.warnInvalidLengthSemanticTokens(r,c+1);else if(p===r&&m>c)t.warnOverlappingSemanticTokens(r,c+1);else{const e=t.getMetadata(_,b,i);2147483647!==e&&(0===g&&(g=r),h[u]=r-g,h[u+1]=c,h[u+2]=f,h[u+3]=e,u+=4,p=r,m=f)}l=r,d=c,a++}u!==h.length&&(h=h.subarray(0,u));const f=q3.create(g,h);r.push(f)}return r}function Mxe(e){const t=new Uint32Array(function(e){let t=0;if(t+=2,"full"===e.type)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(const i of e.deltas)i.data&&(t+=i.data.length)}return t}(e));let i=0;if(t[i++]=e.id,"full"===e.type)t[i++]=1,t[i++]=e.data.length,t.set(e.data,i),i+=e.data.length;else{t[i++]=2,t[i++]=e.deltas.length;for(const n of e.deltas)t[i++]=n.start,t[i++]=n.deleteCount,n.data?(t[i++]=n.data.length,t.set(n.data,i),i+=n.data.length):t[i++]=0}return function(e){const t=new Uint8Array(e.buffer,e.byteOffset,4*e.length);return ble()||function(e){for(let t=0,i=e.length;t<i;t+=4){const i=e[t+0],n=e[t+1],o=e[t+2],s=e[t+3];e[t+0]=s,e[t+1]=o,e[t+2]=n,e[t+3]=i}}(t),Ni.wrap(t)}(t)}function Txe(e){return e&&!!e.data}function Rxe(e){return e&&Array.isArray(e.edits)}function Oxe(e,t){return e.has(t)}async function Axe(e,t,i,n,o){const s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}(e,t),r=await Promise.all(s.map(async e=>{let s,r=null;try{s=await e.provideDocumentSemanticTokens(t,e===i?n:null,o)}catch(a){r=a,s=null}return s&&(Txe(s)||Rxe(s))||(s=null),new e6(e,s,r)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function Pxe(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}async function Fxe(e,t,i,n){const o=Pxe(e,t),s=await Promise.all(o.map(async e=>{let o;try{o=await e.provideDocumentRangeSemanticTokens(t,i,n)}catch(s){Gae(s),o=null}return o&&Txe(o)||(o=null),new t6(e,o)}));for(const r of s)if(r.tokens)return r;return s.length>0?s[0]:null}function Wxe(e,t,i){const n=i.getValue(i6,{overrideIdentifier:e.getLanguageId(),resource:e.uri})?.enabled;return"boolean"==typeof n?n:t.getColorTheme().semanticHighlighting}async function Bxe(e,t,i,n,o){const s=e.all(t).concat(new p6(n.selectSubwords));1===s.length&&s.unshift(new DJ);const r=[],a=[];for(const l of s)r.push(Promise.resolve(l.provideSelectionRanges(t,i,o)).then(e=>{if(sce(e)&&e.length===i.length)for(let t=0;t<i.length;t++){a[t]||(a[t]=[]);for(const n of e[t])mr.isIRange(n.range)&&mr.containsPosition(n.range,i[t])&&a[t].push(mr.lift(n.range))}},Gae));return await Promise.all(r),a.map(e=>{if(0===e.length)return[];e.sort((e,t)=>to.isBefore(e.getStartPosition(),t.getStartPosition())?1:to.isBefore(t.getStartPosition(),e.getStartPosition())||to.isBefore(e.getEndPosition(),t.getEndPosition())?-1:to.isBefore(t.getEndPosition(),e.getEndPosition())?1:0);const i=[];let o;for(const t of e)(!o||mr.containsRange(t,o)&&!mr.equalsRange(t,o))&&(i.push(t),o=t);if(!n.selectLeadingAndTrailingWhitespace)return i;const s=[i[0]];for(let n=1;n<i.length;n++){const e=i[n-1],o=i[n];if(o.startLineNumber!==e.startLineNumber||o.endLineNumber!==e.endLineNumber){const i=new mr(e.startLineNumber,t.getLineFirstNonWhitespaceColumn(e.startLineNumber),e.endLineNumber,t.getLineLastNonWhitespaceColumn(e.endLineNumber));i.containsRange(e)&&!i.equalsRange(e)&&o.containsRange(i)&&!o.equalsRange(i)&&s.push(i);const n=new mr(e.startLineNumber,1,e.endLineNumber,t.getLineMaxColumn(e.endLineNumber));n.containsRange(e)&&!n.equalsRange(i)&&o.containsRange(n)&&!o.equalsRange(n)&&s.push(n)}s.push(o)}return s})}function Vxe(e){return" "===e||"\n"===e||"\t"===e}function Hxe(e){return`U+${e.toString(16).padStart(4,"0")}`}function zxe(e){let t=`\`${Hxe(e)}\``;return Bt.isInvisibleCharacter(e)||(t+=` "${function(e){return 96===e?"`` ` ``":"`"+String.fromCodePoint(e)+"`"}(e)}"`),t}function Uxe(e,t){return B6.computeUnicodeHighlightReason(e,t)}async function Kxe(e,t){const i=e.inspect(_c.allowedLocales).user?.value;let n;n="object"==typeof i&&i?Object.assign({},i):{};for(const o of t)n[o]=!0;await e.updateValue(_c.allowedLocales,n,2)}function qxe(e,t){switch(e){case 0:return"";case 1:return`${v9}*?`;default:return`(?:${b9}|${v9}+${b9}${t?`|${b9}${v9}+`:""})*?`}}function jxe(e,t){if(!e)return[];const i=[];let n=!1,o=!1,s="";for(const r of e){switch(r){case t:if(!n&&!o){i.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1}s+=r}return s&&i.push(s),i}function $xe(e){if(!e)return"";let t="";const i=jxe(e,"/");if(i.every(e=>"**"===e))t=".*";else{let e=!1;i.forEach((n,o)=>{if("**"===n){if(e)return;t+=qxe(2,o===i.length-1)}else{let e=!1,s="",r=!1,a="";for(const i of n)if("}"!==i&&e)s+=i;else{if(r&&("]"!==i||!a)){let e;e="-"===i?i:"^"!==i&&"!"!==i||a?"/"===i?"":Ble(i):"^",a+=e;continue}switch(i){case"{":e=!0;continue;case"[":r=!0;continue;case"}":{const i=`(?:${jxe(s,",").map(e=>$xe(e)).join("|")})`;t+=i,e=!1,s="";break}case"]":t+="["+a+"]",r=!1,a="";break;case"?":t+=v9;continue;case"*":t+=qxe(1);continue;default:t+=Ble(i)}}o<i.length-1&&("**"!==i[o+1]||o+2<i.length)&&(t+=b9)}e="**"===n})}return t}function Gxe(e,t){if(!e)return N9;let i;i="string"!=typeof e?e.pattern:e,i=i.trim();const n=t.ignoreCase??!1,o={...t,equals:n?ide:(e,t)=>e===t,endsWith:n?ode:(e,t)=>e.endsWith(t),isEqualOrParent:(e,t)=>vue(e,t,!W||n)},s=`${n?i.toLowerCase():i}_${!!t.trimForExclusions}_${n}`;let r,a=D9.get(s);return a||(a=C9.test(i)?function(e,t,i){return function(n,o){return"string"==typeof n&&i.endsWith(n,e)?t:null}}(i.substring(4),i,o):(r=y9.exec(Yxe(i,o)))?function(e,t,i){const n=`/${e}`,o=`\\${e}`,s=function(s,r){return"string"!=typeof s?null:r?i.equals(r,e)?t:null:i.equals(s,e)||i.endsWith(s,n)||i.endsWith(s,o)?t:null},r=[e];return s.basenames=r,s.patterns=[t],s.allBasenames=r,s}(r[1],i,o):(t.trimForExclusions?x9:S9).test(i)?function(e,t){const i=Jxe(e.slice(1,-1).split(",").map(e=>Gxe(e,t)).filter(e=>e!==N9),e),n=i.length;if(!n)return N9;if(1===n)return i[0];const o=function(t,n){for(let o=0,s=i.length;o<s;o++)if(i[o](t,n))return e;return null},s=i.find(e=>!!e.allBasenames);s&&(o.allBasenames=s.allBasenames);const r=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return r.length&&(o.allPaths=r),o}(i,o):(r=k9.exec(Yxe(i,o)))?Qxe(r[1].substring(1),i,!0,o):(r=L9.exec(Yxe(i,o)))?Qxe(r[1],i,!1,o):function(e,t){try{const i=new RegExp(`^${$xe(e)}$`,t.ignoreCase?"i":void 0);return function(t){return i.lastIndex=0,"string"==typeof t&&i.test(t)?e:null}}catch{return N9}}(i,o),D9.set(s,a)),Zxe(a,e,o)}function Zxe(e,t,i){if("string"==typeof t)return e;const n=function(n,o){return i.isEqualOrParent(n,t.base)?e(Hle(n.substring(t.base.length),ci),o):null};return n.allBasenames=e.allBasenames,n.allPaths=e.allPaths,n.basenames=e.basenames,n.patterns=e.patterns,n}function Yxe(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substring(0,e.length-2):e}function Qxe(e,t,i,n){const o=ci===ni.sep,s=o?e:e.replace(w9,ci),r=ci+s,a=ni.sep+e;let l;return l=i?function(i,l){return"string"==typeof i&&(n.equals(i,s)||n.endsWith(i,r)||!o&&(n.equals(i,e)||n.endsWith(i,a)))?t:null}:function(i,r){return"string"==typeof i&&(n.equals(i,s)||!o&&n.equals(i,e))?t:null},l.allPaths=[(i?"*/":"./")+e],l}function Xxe(e,t={}){if(!e)return I9;if("string"==typeof e||function(e){const t=e;return!!t&&"string"==typeof t.base&&"string"==typeof t.pattern}(e)){const i=Gxe(e,t);if(i===N9)return I9;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=Jxe(Object.getOwnPropertyNames(e).map(i=>function(e,t,i){if(!1===t)return N9;const n=Gxe(e,i);if(n===N9)return N9;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,o,s,r)=>{if(!r||!n(t,o))return null;const a=r(i.replace("$(basename)",()=>s));return Nle(a)?a.then(t=>t?e:null):a?e:null};return t.requiresSiblings=!0,t}}return n}(i,e[i],t)).filter(e=>e!==N9)),n=i.length;if(!n)return N9;if(!i.some(e=>!!e.requiresSiblings)){if(1===n)return i[0];const e=function(e,t){let n;for(let o=0,s=i.length;o<s;o++){const s=i[o](e,t);if("string"==typeof s)return s;Nle(s)&&(n||(n=[]),n.push(s))}return n?(async()=>{for(const e of n){const t=await e;if("string"==typeof t)return t}return null})():null},t=i.find(e=>!!e.allBasenames);t&&(e.allBasenames=t.allBasenames);const o=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return o.length&&(e.allPaths=o),e}const o=function(e,t,n){let o,s;for(let r=0,a=i.length;r<a;r++){const a=i[r];a.requiresSiblings&&n&&(t||(t=li(e)),o||(o=t.substring(0,t.length-di(e).length)));const l=a(e,t,o,n);if("string"==typeof l)return l;Nle(l)&&(s||(s=[]),s.push(l))}return s?(async()=>{for(const e of s){const t=await e;if("string"==typeof t)return t}return null})():null},s=i.find(e=>!!e.allBasenames);s&&(o.allBasenames=s.allBasenames);const r=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return r.length&&(o.allPaths=r),o}(e,t)}function Jxe(e,t){const i=e.filter(e=>!!e.basenames);if(i.length<2)return e;const n=i.reduce((e,t)=>{const i=t.basenames;return i?e.concat(i):e},[]);let o;if(t){o=[];for(let e=0,i=n.length;e<i;e++)o.push(t)}else o=i.reduce((e,t)=>{const i=t.patterns;return i?e.concat(i):e},[]);const s=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substring(i)}const i=n.indexOf(t);return-1!==i?o[i]:null};s.basenames=n,s.patterns=o,s.allBasenames=n;const r=e.filter(e=>!e.basenames);return r.push(s),r}function eke(e,t,i,n,o,s){if(Array.isArray(e)){let r=0;for(const a of e){const e=eke(a,t,i,n,o,s);if(10===e)return e;e>r&&(r=e)}return r}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:d,pattern:c,scheme:h,hasAccessToAllModels:u,notebookType:g}=e;if(!n&&!u)return 0;g&&o&&(t=o);let p=0;if(h)if(h===t.scheme)p=10;else{if("*"!==h)return 0;p=5}if(d)if(d===i)p=10;else{if("*"!==d)return 0;p=Math.max(p,5)}if(g)if(g===s)p=10;else{if("*"!==g||void 0===s)return 0;p=Math.max(p,5)}if(c){let e;if(e="string"==typeof c?c:{...c,base:oi(c.base)},e!==t.fsPath&&(r=e,a=t.fsPath,!r||"string"!=typeof a||!Xxe(r,l)(a)))return 0;p=10}return p}return 0;var r,a,l}function tke(e,t,i,n){return Ole(e.ordered(t).map(e=>()=>Promise.resolve(e.provideDocumentHighlights(t,i,n)).then(void 0,Gae)),e=>null!=e).then(e=>{if(e){const i=new ys;return i.set(t.uri,e),i}return new ys})}function ike(e,t,i=0,n=0){const o=t;return o.values&&o.values.length>1?function(e,t,i,n){let o=0;const s=[];for(const r of t){const[t,a]=nke(e,r,i,n);if("number"!=typeof t)return w8;o+=t,s.push(...a)}return[o,oke(s)]}(e,o.values,i,n):nke(e,t,i,n)}function nke(e,t,i,n){const o=Tbe(t.original,t.originalLowercase,i,e,e.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return o?[o[0],Lbe(o)]:w8}function oke(e){const t=e.sort((e,t)=>e.start-t.start),i=[];let n;for(const o of t)n&&ske(n,o)?(n.start=Math.min(n.start,o.start),n.end=Math.max(n.end,o.end)):(n=o,i.push(o));return i}function ske(e,t){return!(e.end<t.start||t.end<e.start)}function rke(e){return e.startsWith('"')&&e.endsWith('"')}function ake(e){"string"!=typeof e&&(e="");const t=e.toLowerCase(),{pathNormalized:i,normalized:n,normalizedLowercase:o}=lke(e),s=i.indexOf(ci)>=0,r=rke(e);let a;const l=e.split(C8);if(l.length>1)for(const d of l){const e=rke(d),{pathNormalized:t,normalized:i,normalizedLowercase:n}=lke(d);i&&(a||(a=[]),a.push({original:d,originalLowercase:d.toLowerCase(),pathNormalized:t,normalized:i,normalizedLowercase:n,expectContiguousMatch:e}))}return{original:e,originalLowercase:t,pathNormalized:i,normalized:n,normalizedLowercase:o,values:a,containsPathSeparator:s,expectContiguousMatch:r}}function lke(e){let t;t=P?e.replace(/\//g,ci):e.replace(/\\/g,ci);const i=t.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:t,normalized:i,normalizedLowercase:i.toLowerCase()}}function dke(e){return Array.isArray(e)?ake(e.map(e=>e.original).join(C8)):ake(e.original)}function cke(e){const t=e;return Array.isArray(t.items)}function hke(e){const t=e;return!!t.picks&&t.additionalPicks instanceof Promise}function uke(e){return function(e,t,i){if(!e)return e;const n=i.get(e);if(n)return n;let o;return o=F8.test(e)?e.normalize(t):e,i.set(e,o),o}(e,"NFD",P8)}function gke(e){return"vs"===e||"vs-dark"===e||"hc-black"===e||"hc-light"===e}function pke(e){switch(e){case"vs":return lee;case gee:return dee;case pee:return cee;case mee:return hee}}function mke(e){return new bee(e,pke(e))}function fke(){return{editor:void 0,languages:void 0,CancellationTokenSource:ot,Emitter:je,KeyCode:zee,KeyMod:mte,Position:to,Range:mr,Selection:fr,SelectionDirection:ote,MarkerSeverity:Uee,MarkerTag:Kee,Uri:_i,Token:cb}}function _ke(e){V&&(_te||(_te=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(e.message))}function bke(e){return"o"===e[0]&&"n"===e[1]&&tde(e.charCodeAt(2))}function vke(e){return/^onDynamic/.test(e)&&tde(e.charCodeAt(9))}function wke(e,t){const i=e.label||"anonymous"+t,n=qae();if(n){if("function"==typeof n.getWorker)return n.getWorker("workerMain.js",i);if("function"==typeof n.getWorkerUrl){const e=n.getWorkerUrl("workerMain.js",i);return new Worker(kte?kte.createScriptURL(e):e,{name:i,type:"module"})}}const o=e.esmModuleLocation;if(o){const e=function(e,t){if(/^((http:)|(https:)|(file:))/.test(t)&&t.substring(0,globalThis.origin.length)!==globalThis.origin);else{const i=t.lastIndexOf("?"),n=t.lastIndexOf("#",i),o=i>0?new URLSearchParams(t.substring(i+1,~n?n:void 0)):new URLSearchParams;Li.addSearchParam(o,!0,!0),t=o.toString()?`${t}?${o.toString()}#${e}`:`${t}#${e}`}const i=new Blob([ice([`/*${e}*/`,`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(Fae())};`,`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(Wae())};`,`globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(globalThis._VSCODE_FILE_ROOT)};`,"const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });","globalThis.workerttPolicy = ttPolicy;",`await import(ttPolicy?.createScriptURL(${JSON.stringify(t)}) ?? ${JSON.stringify(t)});`,"globalThis.postMessage({ type: 'vscode-worker-ready' });",`/*${e}*/`]).join("")],{type:"application/javascript"});return URL.createObjectURL(i)}(i,o.toString(!0));return s=new Worker(kte?kte.createScriptURL(e):e,{name:i,type:"module"}),new Promise((e,t)=>{s.onmessage=function(t){"vscode-worker-ready"===t.data.type&&(s.onmessage=null,e(s))},s.onerror=t})}var s;throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Cke(e){const t=[];for(const i of e){const e=Number(i);(e||0===e&&""!==i.replace(/\s/g,""))&&t.push(e)}return t}function yke(e,t,i,n){return{red:e/255,blue:i/255,green:t/255,alpha:n}}function Ske(e,t){const i=t.index,n=t[0].length;if(void 0===i)return;const o=e.positionAt(i);return{startLineNumber:o.lineNumber,startColumn:o.column,endLineNumber:o.lineNumber,endColumn:o.column+n}}function xke(e,t){if(!e)return;const i=eh.Format.CSS.parseHex(t);return i?{range:e,color:yke(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a)}:void 0}function kke(e,t,i){if(!e||1!==t.length)return;const n=Cke(t[0].values());return{range:e,color:yke(n[0],n[1],n[2],i?n[3]:1)}}function Lke(e,t,i){if(!e||1!==t.length)return;const n=Cke(t[0].values()),o=new eh(new Xc(n[0],n[1]/100,n[2]/100,i?n[3]:1));return{range:e,color:yke(o.rgba.r,o.rgba.g,o.rgba.b,o.rgba.a)}}function Dke(e,t){return"string"==typeof e?[...e.matchAll(t)]:e.findMatches(t)}function Ike(e){return e&&"function"==typeof e.getValue&&"function"==typeof e.positionAt?function(e){const t=[],i=Dke(e,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const n of i){const i=n.filter(e=>void 0!==e),o=i[1],s=i[2];if(!s)continue;let r;"rgb"===o?r=kke(Ske(e,n),Dke(s,/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm),!1):"rgba"===o?r=kke(Ske(e,n),Dke(s,/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm),!0):"hsl"===o?r=Lke(Ske(e,n),Dke(s,/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm),!1):"hsla"===o?r=Lke(Ske(e,n),Dke(s,/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm),!0):"#"===o&&(r=xke(Ske(e,n),o+s)),r&&t.push(r)}return t}(e):[]}function Nke(e,t){let i=[];if(t.findRegionSectionHeaders&&t.foldingRules?.markers){const n=function(e,t){const i=[],n=e.getLineCount();for(let o=1;o<=n;o++){const n=e.getLineContent(o),s=n.match(t.foldingRules.markers.start);if(s){const e={startLineNumber:o,startColumn:s[0].length+1,endLineNumber:o,endColumn:n.length+1};if(e.endColumn>e.startColumn){const t={range:e,...Eke(n.substring(s[0].length)),shouldBeInComments:!1};(t.text||t.hasSeparatorLine)&&i.push(t)}}}return i}(e,t);i=i.concat(n)}if(t.findMarkSectionHeaders){const n=function(e,t){const i=[],n=e.getLineCount();if(!t.markSectionHeaderRegex||""===t.markSectionHeaderRegex.trim())return i;const o=Yfe(t.markSectionHeaderRegex),s=new RegExp(t.markSectionHeaderRegex,"gdm"+(o?"s":""));if(Kle(s))return i;for(let r=1;r<=n;r+=Pte-Fte){const t=Math.min(r+Pte-1,n),o=[];for(let i=r;i<=t;i++)o.push(e.getLineContent(i));const a=o.join("\n");let l;for(s.lastIndex=0;null!==(l=s.exec(a));){const e=a.substring(0,l.index),t=r+(e.match(/\n/g)||[]).length,n=l[0].split("\n"),o=n.length,d=t+o-1,c=e.lastIndexOf("\n")+1,h=l.index-c+1,u=n[n.length-1],g={range:{startLineNumber:t,startColumn:h,endLineNumber:d,endColumn:1===o?h+l[0].length:u.length+1},text:(l.groups??{}).label??"",hasSeparatorLine:""!==((l.groups??{}).separator??""),shouldBeInComments:!0};(g.text||g.hasSeparatorLine)&&(0===i.length||i[i.length-1].range.endLineNumber<g.range.startLineNumber)&&i.push(g),s.lastIndex=l.index+l[0].length}}return i}(e,t);i=i.concat(n)}return i}function Eke(e){const t=(e=e.trim()).startsWith("-");return{text:e=e.replace(Ate,""),hasSeparatorLine:t}}function Mke(e,t){const i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}function Tke(e){return!function(e){return Array.isArray(e)}(e)}function Rke(e){return"string"==typeof e}function Oke(e){return!Rke(e)}function Ake(e){return!e}function Pke(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function Fke(e){return e.replace(/[&<>'"_]/g,"-")}function Wke(e,t){console.log(`${e.languageId}: ${t}`)}function Bke(e,t){return new Error(`${e.languageId}: ${t}`)}function Vke(e,t,i,n,o){let s=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,function(t,r,a,l,d,c,h,u,g){return Ake(a)?Ake(l)?!Ake(d)&&d<n.length?Pke(e,n[d]):!Ake(h)&&e&&"string"==typeof e[h]?e[h]:(null===s&&(s=o.split("."),s.unshift(o)),!Ake(c)&&c<s.length?Pke(e,s[c]):""):Pke(e,i):"$"})}function Hke(e,t){let i=t;for(;i&&i.length>0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}function zke(e,t){if(!t)return null;t=Pke(e,t);const i=e.brackets;for(const n of i){if(n.open===t)return{token:n.token,bracketType:1};if(n.close===t)return{token:n.token,bracketType:-1}}return null}function Uke(e,t,i,n){return new Promise((o,s)=>{const r=()=>{const a=function(e,t,i,n){let o=[],s=i.getInitialState();for(let r=0,a=e.length;r<a;r++){const a=e[r],l=i.tokenizeEncoded(a,!0,s);gl.convertToEndOffset(l.tokens,a.length);const d=new gl(l.tokens,a,n),c=iv.isBasicASCII(a,!0),h=Lpe(new Wp(!1,!0,a,!1,c,iv.containsRTL(a,c,!0),0,d.inflate(),[],t,0,0,0,0,-1,"none",!1,!1,null,null,0));o=o.concat(h.html),o.push("<br/>"),s=l.endState}return o.join("")}(e,t,i,n);if(i instanceof uie){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,s)}o(a)};r()})}function Kke(e,t,i){let n=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,r=e.length;s<r;s++){const r=e[s];o[0]=r.length;const a=new gl(o,r,i),l=iv.isBasicASCII(r,!0),d=Lpe(new Wp(!1,!0,r,!1,l,iv.containsRTL(r,l,!0),0,a,[],t,0,0,0,0,-1,"none",!1,!1,null,null,0));n=n.concat(d.html),n.push("<br/>")}return n.join("")}function qke(e){return e.scheme===yi.file?e.fsPath:e.path}function jke(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(jke):!!e.exclusive)}function $ke(e){return"string"!=typeof e&&(Array.isArray(e)?e.some($ke):Boolean(e.isBuiltin))}function Gke(e,t,i){const n=i.mode===Zie.ALIGN?i.offset:i.offset+i.size,o=i.mode===Zie.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=o?o-t:Math.max(e-t,0):t<=o?o-t:t<=e-n?n:0}function Zke(e){return"object"==typeof e&&"markdown"in e&&"markdownNotSupportedFallback"in e}function Yke(e){if(void 0!==e)return e?.id??e}function Qke(e){if(!xhe(e))return"string"==typeof e?e.toString():e.value}function Xke(e){const t="function"==typeof e?e():e;return sle(t)?Pbe(t):Zke(t)?t.markdownNotSupportedFallback:void 0}function Jke(e,t){return xhe(e.target)&&function(e,t){for(t=t??pn(e).document.body;!e.hasAttribute("custom-hover")&&e!==t;)e=e.parentElement;return e}(e.target,t)===t}function eLe(e){return Object.isFrozen(e)?e:function(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(Gr.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||ale(n)||t.push(n)}}return e}(e)}function tLe(e){return e?`${e.serialize()}`:"no when condition"}function iLe(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}function nLe(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n)return[];t.push(n)}return t}function oLe(e,t=!1){!function(e,t,i){const n=function(e,t){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:t,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?Xxe(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(ni.sep)>=0}}(e,t);yne.push(n),n.userConfigured?xne.push(n):Sne.push(n),i&&!n.userConfigured&&yne.forEach(e=>{e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}(e,!1,t)}function sLe(e,t){return function(e,t){let i;if(e)switch(e.scheme){case yi.file:i=e.fsPath;break;case yi.data:i=Us.parseMetaData(e).get(Us.META_DATA_LABEL);break;case yi.vscodeNotebookCell:i=void 0;break;default:i=e.path}if(!i)return[{id:"unknown",mime:Na.unknown}];i=i.toLowerCase();const n=li(i),o=rLe(i,n,xne);if(o)return[o,{id:Ga,mime:Na.text}];const s=rLe(i,n,Sne);if(s)return[s,{id:Ga,mime:Na.text}];if(t){const e=function(e){if(bde(e)&&(e=e.substr(1)),e.length>0)for(let t=yne.length-1;t>=0;t--){const i=yne[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i}}(t);if(e)return[e,{id:Ga,mime:Na.text}]}return[{id:"unknown",mime:Na.unknown}]}(e,t).map(e=>e.id)}function rLe(e,t,i){let n,o,s;for(let r=i.length-1;r>=0;r--){const a=i[r];if(t===a.filenameLowercase){n=a;break}if(a.filepattern&&(!o||a.filepattern.length>o.filepattern.length)){const i=a.filepatternOnPath?e:t;a.filepatternLowercase?.(i)&&(o=a)}a.extension&&(!s||a.extension.length>s.extension.length)&&t.endsWith(a.extensionLowercase)&&(s=a)}return n||o||s||void 0}function aLe(e){const t=nue()[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}function lLe(e){return e.toString()}function dLe(e,t,i){let n=e.iconClass||function(e){if(!e)return;let t;const i=e.dark.toString();return moe[i]?t=moe[i]:(t=foe.nextId(),ape(`.${t}, .hc-light .${t}`,`background-image: ${X_e(e.light||e.dark)}`),ape(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${X_e(e.dark)}`),moe[i]=t),t}(e.iconPath);return e.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible"),{id:t,label:"",tooltip:e.tooltip||"",class:n,enabled:!0,run:i}}function cLe(e,t,i){Rhe(t);const n=function(e){const t=[];let i,n=0;for(;i=poe.exec(e);){i.index-n>0&&t.push(e.substring(n,i.index));const[,o,s,,r]=i;r?t.push({label:o,href:s,title:r}):t.push({label:o,href:s}),n=i.index+i[0].length}return n<e.length&&t.push(e.substring(n)),new goe(t)}(e);let o=0;for(const s of n.nodes)if("string"==typeof s)t.append(...gve(s));else{let e=s.title;!e&&s.href.startsWith("command:")?e=Vae(1771,"Click to execute command '{0}'",s.href.substring(8)):e||(e=s.href);const n=Ahe("a",{href:s.href,title:e,tabIndex:o++},s.label);n.style.textDecoration="underline";const r=e=>{Nhe(e)&&An.stop(e,!0),i.callback(s.href)},a=i.disposables.add(new zm(n,On.CLICK)).event,l=i.disposables.add(new zm(n,On.KEY_DOWN)).event,d=Be.chain(l,e=>e.filter(e=>{const t=new we(e);return t.equals(10)||t.equals(3)}));i.disposables.add(pm.addTarget(n));const c=i.disposables.add(new zm(n,gm.Tap)).event;Be.any(a,c,d)(r,null,i.disposables),t.appendChild(n)}}function hLe(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=function(e,t,i){const n=e.toLowerCase(),o=t.toLowerCase(),s=n.startsWith(i),r=o.startsWith(i);if(s!==r)return s?-1:1;if(s&&r){if(n.length<o.length)return-1;if(n.length>o.length)return 1}return 0}(e,t,i);if(s)return s;const r=n.endsWith(i);if(r!==o.endsWith(i))return r?-1:1;const a=function(e,t){const i=e||"",n=t||"",o=Hoe.value.collator.compare(i,n);return Hoe.value.collatorIsNumeric&&0===o&&i!==n?i<n?-1:1:o}(n,o);return 0!==a?a:n.localeCompare(o)}function uLe(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1!==i?[{start:i,end:i+e.length}]:null}function gLe(e,t={}){ns.registerCommandAndKeybindingRule({weight:200,when:Po.and(Po.or(Po.equals(Soe,"quickPick"),Po.equals(Soe,"quickTree")),Coe),metadata:{description:Vae(1759,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...e,secondary:pLe(e.primary,e.secondary??[],t)})}function pLe(e,t,i={}){return i.withAltMod&&t.push(512+e),i.withCtrlMod&&(t.push(nse+e),i.withAltMod&&t.push(512+nse+e)),i.withCmdMod&&F&&(t.push(2048+e),i.withCtrlMod&&t.push(2304+e),i.withAltMod&&(t.push(2560+e),i.withCtrlMod&&t.push(2816+e))),t}function mLe(e,t){return i=>{const n=i.get(tA).currentQuickInput;if(n)return t&&n.quickNavigate?n.focus(t):n.focus(e)}}function fLe(e){let t=!1,i=!1,n=!1;for(const o of e){switch(o.element?.checked){case"mixed":n=!0;break;case!0:t=!0;break;default:i=!0}if(t&&i&&n)break}return i?(n||!!t)&&"mixed":n?"mixed":t}function _Le(e,t,i){e.get(es).createKey(String(t),function(e){return Vue(e,e=>"object"==typeof e&&1===e.$mid?_i.revive(e).toString():e instanceof _i?e.toString():void 0)}(i))}function bLe(e){return!(!e||"object"!=typeof e||e.overrideIdentifier&&"string"!=typeof e.overrideIdentifier||e.resource&&!(e.resource instanceof _i))}function vLe(e,t,i){if(!t)return;if(!(e instanceof Mre))return;const n=[];Object.keys(t).forEach(e=>{(function(e){return sCe()[`editor.${e}`]||!1})(e)&&n.push([`editor.${e}`,t[e]]),i&&function(e){return sCe()[`diffEditor.${e}`]||!1}(e)&&n.push([`diffEditor.${e}`,t[e]])}),n.length>0&&e.updateValues(n)}function wLe(e){if(!e){if(tae)return;tae=!0}!function(e){($n=document.createElement("div")).className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),$n.appendChild(e),e};Gn=t(),Zn=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),$n.appendChild(e),e};Yn=i(),Qn=i(),e.appendChild($n)}(e||r.document.body)}function CLe(e,t,i,n,o){if(i=i||"",!n){const n=i.indexOf("\n");let s=i;return-1!==n&&(s=i.substring(0,n)),yLe(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return yLe(e,i,t.createById(n),o)}function yLe(e,t,i,n){return e.createModel(t,i,n)}function SLe(e,t,i){return jre.initialize(i||{}).createInstance(nae,e,t)}function xLe(e){return jre.get(eo).onCodeEditorAdd(t=>{e(t)})}function kLe(e){return jre.get(eo).onDiffEditorAdd(t=>{e(t)})}function LLe(){return jre.get(eo).listCodeEditors()}function DLe(){return jre.get(eo).listDiffEditors()}function ILe(e,t,i){return jre.initialize(i||{}).createInstance(oae,e,t)}function NLe(e,t){return new fae(e,{},jre.initialize(t||{}))}function ELe(e){if("string"!=typeof e.id||"function"!=typeof e.run)throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return _o.registerCommand(e.id,e.run)}function MLe(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const t=Po.deserialize(e.precondition),i=new De;if(i.add(_o.registerCommand(e.id,(i,...n)=>sr.runEditorCommand(i,n,t,(t,i,n)=>Promise.resolve(e.run(i,...n))))),e.contextMenuGroupId){const n={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};i.add(us.appendMenuItem(ds.EditorContext,n))}if(Array.isArray(e.keybindings)){const n=jre.get(xw);if(n instanceof Nre){const o=Po.and(t,Po.deserialize(e.keybindingContext));i.add(n.addDynamicKeybindings(e.keybindings.map(t=>({keybinding:t,command:e.id,when:o}))))}else console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService")}return i}function TLe(e){return RLe([e])}function RLe(e){const t=jre.get(xw);return t instanceof Nre?t.addDynamicKeybindings(e.map(e=>({keybinding:e.keybinding,command:e.command,commandArgs:e.commandArgs,when:Po.deserialize(e.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Ie.None)}function OLe(e,t,i){const n=jre.get(La),o=n.getLanguageIdByMimeType(t)||t;return CLe(jre.get(io),n,e,o,i)}function ALe(e,t){const i=jre.get(La),n=i.getLanguageIdByMimeType(t)||t||"plaintext";e.setLanguage(i.createById(n))}function PLe(e,t,i){e&&jre.get(CF).changeOne(t,e.uri,i)}function FLe(e){jre.get(CF).changeAll(e,[])}function WLe(e){return jre.get(CF).read(e)}function BLe(e){return jre.get(CF).onMarkerChanged(e)}function VLe(e){return jre.get(io).getModel(e)}function HLe(){return jre.get(io).getModels()}function zLe(e){return jre.get(io).onModelAdded(e)}function ULe(e){return jre.get(io).onModelRemoved(e)}function KLe(e){return jre.get(io).onModelLanguageChanged(t=>{e({model:t.model,oldLanguage:t.oldLanguageId})})}function qLe(e){return function(e,t){return new Jte(e,t)}(jre.get(io),e)}function jLe(e,t){const i=jre.get(La),n=jre.get(Q7);return pie.colorizeElement(n,i,e,t).then(()=>{n.registerEditorContainer(e)})}function $Le(e,t,i){const n=jre.get(La);return jre.get(Q7).registerEditorContainer(r.document.body),pie.colorize(n,e,t,i)}function GLe(e,t,i=4){return jre.get(Q7).registerEditorContainer(r.document.body),pie.colorizeModelLine(e,t,i)}function ZLe(e,t){Mb.getOrCreate(t);const i=function(e){const t=Mb.get(e);return t||{getInitialState:()=>SS,tokenize:(t,i,n)=>c_e(e,n)}}(t),n=qle(e),o=[];let s=i.getInitialState();for(let r=0,a=n.length;r<a;r++){const e=n[r],t=i.tokenize(e,!0,s);o[r]=t.tokens,s=t.endState}return o}function YLe(e,t){jre.get(Q7).defineTheme(e,t)}function QLe(e){jre.get(Q7).setTheme(e)}function XLe(){Rc.clearAllFontInfos()}function JLe(e,t){return _o.registerCommand({id:e,handler:t})}function eDe(e){return jre.get(SA).registerOpener({open:async t=>("string"==typeof t&&(t=_i.parse(t)),e.open(t))})}function tDe(e){return jre.get(eo).registerCodeEditorOpenHandler(async(t,i,n)=>{if(!i)return null;const o=t.options?.selection;let s;return o&&"number"==typeof o.endLineNumber&&"number"==typeof o.endColumn?s=o:o&&(s={lineNumber:o.startLineNumber,column:o.startColumn}),await e.openCodeEditor(i,t.resource,s)?i:null})}function iDe(e,t){return"boolean"==typeof e?e:t}function nDe(e,t){return"string"==typeof e?e:t}function oDe(e,t=!1){t&&(e=e.map(function(e){return e.toLowerCase()}));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function sDe(e,t,i){t=t.replace(/@@/g,"");let n,o=0;do{n=!1,t=t.replace(/@(\w+)/g,function(i,o){n=!0;let s="";if("string"==typeof e[o])s=e[o];else{if(!(e[o]&&e[o]instanceof RegExp))throw void 0===e[o]?Bke(e,"language definition does not contain attribute '"+o+"', used at: "+t):Bke(e,"attribute reference '"+o+"' must be a string, used at: "+t);s=e[o].source}return Ake(s)?"":"(?:"+s+")"}),o++}while(n&&o<5);t=t.replace(/\x01/g,"@");const s=(e.ignoreCase?"i":"")+(e.unicode?"u":"");if(i&&t.match(/\$[sS](\d\d?)/g)){let i=null,n=null;return o=>(n&&i===o||(i=o,n=new RegExp(function(e,t,i){let n=null;return t.replace(/\$[sS](\d\d?)/g,function(t,o){return null===n&&(n=i.split("."),n.unshift(i)),!Ake(o)&&o<n.length?Ble(Pke(e,n[o])):""})}(e,t,o),s)),n)}return new RegExp(t,s)}function rDe(e,t,i,n){let o=-1,s=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(o=parseInt(r[3]),r[2]&&(o+=100)),s=r[4]);let a,l="~",d=s;if(s&&0!==s.length?/^\w*$/.test(d)?l="==":(r=s.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],d=r[2])):(l="!=",d=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(d))if("@"===l||"!@"===l){const i=e[d];if(!i)throw Bke(e,"the @ match target '"+d+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const i of t)if(!e(i))return!1;return!0}(function(e){return"string"==typeof e},i))throw Bke(e,"the @ match target '"+d+"' must be an array of strings, in rule: "+t);const n=oDe(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(d.indexOf("$")<0){const t=sDe(e,"^"+d+"$",!1);a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,o){return sDe(e,"^"+Vke(e,d,i,n,o)+"$",!1).test(t)};else if(d.indexOf("$")<0){const t=Pke(e,d);a=function(e){return"=="===l?e===t:e!==t}}else{const t=Pke(e,d);a=function(i,n,o,s,r){const a=Vke(e,t,n,o,s);return"=="===l?i===a:i!==a}}else{const t=oDe(d.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===o?{name:i,value:n,test:function(e,t,i,n){return a(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){const s=function(e,t,i,n){if(n<0)return e;if(n<t.length)return t[n];if(n>=100){n-=100;const e=i.split(".");if(e.unshift(i),n<e.length)return e[n]}return null}(e,t,i,o);return a(s||"",e,t,i,n)}}}function aDe(e,t,i){if(i){if("string"==typeof i)return i;if(i.token||""===i.token){if("string"!=typeof i.token)throw Bke(e,"a 'token' attribute must be of type string, in rule: "+t);{const n={token:i.token};if(i.token.indexOf("$")>=0&&(n.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw Bke(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!=typeof i.next)throw Bke(e,"the next state must be a string value in rule: "+t);{let o=i.next;if(!/^(@pop|@push|@popall)$/.test(o)&&("@"===o[0]&&(o=o.substr(1)),o.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(e,Vke(e,o,"",[],""))))throw Bke(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=o}}return"number"==typeof i.goBack&&(n.goBack=i.goBack),"string"==typeof i.switchTo&&(n.switchTo=i.switchTo),"string"==typeof i.log&&(n.log=i.log),"string"==typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=aDe(e,t,i[o]);return{group:n}}if(i.cases){const n=[];let o=!1;for(const r in i.cases)if(i.cases.hasOwnProperty(r)){const s=aDe(e,t,i.cases[r]);"@default"===r||"@"===r||""===r?n.push({test:void 0,value:s,name:r}):"@eos"===r?n.push({test:function(e,t,i,n){return n},value:s,name:r}):n.push(rDe(e,t,r,s)),o||(o=!sle(s)&&(s.hasEmbeddedEndInCases||["@pop","@popall"].includes(s.nextEmbedded||"")))}const s=e.defaultToken;return{hasEmbeddedEndInCases:o,test:function(e,t,i,o){for(const s of n)if(!s.test||s.test(e,t,i,o))return s.value;return s}}}throw Bke(e,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+t)}return{token:""}}function lDe(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const i={languageId:e,includeLF:iDe(t.includeLF,!1),noThrow:!1,maxStack:100,start:"string"==typeof t.start?t.start:null,ignoreCase:iDe(t.ignoreCase,!1),unicode:iDe(t.unicode,!1),tokenPostfix:nDe(t.tokenPostfix,"."+e),defaultToken:nDe(t.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},n=t;function o(e,s,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw Bke(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw Bke(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new _ae(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw Bke(i,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw Bke(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=iDe(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}s.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw Bke(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(const r in t.tokenizer)if(t.tokenizer.hasOwnProperty(r)){i.start||(i.start=r);const e=t.tokenizer[r];i.tokenizer[r]=new Array,o("tokenizer."+r,i.tokenizer[r],e)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw Bke(i,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const s=[];for(const r of t.brackets){let e=r;if(e&&Array.isArray(e)&&3===e.length&&(e={token:e[2],open:e[0],close:e[1]}),e.open===e.close)throw Bke(i,"open and close brackets in a 'brackets' attribute must be different: "+e.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof e.open||"string"!=typeof e.token||"string"!=typeof e.close)throw Bke(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:e.token+i.tokenPostfix,open:Pke(i,e.open),close:Pke(i,e.close)})}return i.brackets=s,i.noThrow=!0,i}function dDe(e){$a.registerLanguage(e)}function cDe(){let e=[];return e=e.concat($a.getLanguages()),e}function hDe(e){return jre.get(La).languageIdCodec.encodeLanguageId(e)}function uDe(e,t){return jre.withServices(()=>{const i=jre.get(La).onDidRequestRichLanguageFeatures(n=>{n===e&&(i.dispose(),t())});return i})}function gDe(e,t){return jre.withServices(()=>{const i=jre.get(La).onDidRequestBasicLanguageFeatures(n=>{n===e&&(i.dispose(),t())});return i})}function pDe(e,t){if(!jre.get(La).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return jre.get(il).register(e,t,100)}function mDe(e){return e&&"function"==typeof e.then}function fDe(e){const t=jre.get(Q7);if(e){const i=[null];for(let t=1,n=e.length;t<n;t++)i[t]=eh.fromHex(e[t]);t.setColorMapOverride(i)}else t.setColorMapOverride(null)}function _De(e,t){return function(e){return"tokenizeEncoded"in e}(t)?new bae(e,t):new vae(e,t,jre.get(La),jre.get(Q7))}function bDe(e,t){const i=new Eb(async()=>{const i=await Promise.resolve(t.create());return i?"function"==typeof i.getInitialState?_De(e,i):new uie(jre.get(La),jre.get(Q7),e,lDe(e,i),jre.get(ka)):null});return Mb.registerFactory(e,i)}function vDe(e,t){if(!jre.get(La).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return mDe(t)?bDe(e,{create:()=>t}):Mb.register(e,_De(e,t))}function wDe(e,t){return mDe(t)?bDe(e,{create:()=>t}):Mb.register(e,(t=>new uie(jre.get(La),jre.get(Q7),e,lDe(e,t),jre.get(ka)))(t))}function CDe(e,t){return jre.get(Tx).referenceProvider.register(e,t)}function yDe(e,t){return jre.get(Tx).renameProvider.register(e,t)}function SDe(e,t){return jre.get(Tx).newSymbolNamesProvider.register(e,t)}function xDe(e,t){return jre.get(Tx).signatureHelpProvider.register(e,t)}function kDe(e,t){return jre.get(Tx).hoverProvider.register(e,{provideHover:async(e,i,n,o)=>{const s=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n,o)).then(e=>{if(e)return!e.range&&s&&(e.range=new mr(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn)),e.range||(e.range=new mr(i.lineNumber,i.column,i.lineNumber,i.column)),e})}})}function LDe(e,t){return jre.get(Tx).documentSymbolProvider.register(e,t)}function DDe(e,t){return jre.get(Tx).documentHighlightProvider.register(e,t)}function IDe(e,t){return jre.get(Tx).linkedEditingRangeProvider.register(e,t)}function NDe(e,t){return jre.get(Tx).definitionProvider.register(e,t)}function EDe(e,t){return jre.get(Tx).implementationProvider.register(e,t)}function MDe(e,t){return jre.get(Tx).typeDefinitionProvider.register(e,t)}function TDe(e,t){return jre.get(Tx).codeLensProvider.register(e,t)}function RDe(e,t,i){return jre.get(Tx).codeActionProvider.register(e,{providedCodeActionKinds:i?.providedCodeActionKinds,documentation:i?.documentation,provideCodeActions:(e,i,n,o)=>{const s=jre.get(CF).read({resource:e.uri}).filter(e=>mr.areIntersectingOrTouching(e,i));return t.provideCodeActions(e,i,{markers:s,only:n.only,trigger:n.trigger},o)},resolveCodeAction:t.resolveCodeAction})}function ODe(e,t){return jre.get(Tx).documentFormattingEditProvider.register(e,t)}function ADe(e,t){return jre.get(Tx).documentRangeFormattingEditProvider.register(e,t)}function PDe(e,t){return jre.get(Tx).onTypeFormattingEditProvider.register(e,t)}function FDe(e,t){return jre.get(Tx).linkProvider.register(e,t)}function WDe(e,t){return jre.get(Tx).completionProvider.register(e,t)}function BDe(e,t){return jre.get(Tx).colorProvider.register(e,t)}function VDe(e,t){return jre.get(Tx).foldingRangeProvider.register(e,t)}function HDe(e,t){return jre.get(Tx).declarationProvider.register(e,t)}function zDe(e,t){return jre.get(Tx).selectionRangeProvider.register(e,t)}function UDe(e,t){return jre.get(Tx).documentSemanticTokensProvider.register(e,t)}function KDe(e,t){return jre.get(Tx).documentRangeSemanticTokensProvider.register(e,t)}function qDe(e,t){return jre.get(Tx).inlineCompletionsProvider.register(e,t)}function jDe(e,t){return jre.get(Tx).inlayHintsProvider.register(e,t)}return{setters:[function(e){i=e.n},function(e){n=e.P}],execute:function(){if((o=document.createElement("style")).textContent='.monaco-aria-container{position:absolute;left:-999em}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);background-color:var(--vscode-editor-background);overflow-wrap:initial;position:relative;overflow:visible}.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-rangeHighlightBorder)}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-symbolHighlightBorder)}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .editorCanvas{z-index:0;pointer-events:none;width:100%;height:100%;position:absolute}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .view-overlays>div,.monaco-editor .margin-view-overlays>div{width:100%;position:absolute}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{content:"";background:var(--vscode-editorError-background);width:100%;height:100%;display:block}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{content:"";background:var(--vscode-editorWarning-background);width:100%;height:100%;display:block}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{content:"";background:var(--vscode-editorInfo-background);width:100%;height:100%;display:block}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground,inherit)}.monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{display:none;position:absolute}.monaco-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;display:block;top:0;left:3px}.monaco-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;display:block;top:3px;left:0}.monaco-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar{background:var(--vscode-scrollbar-background)}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .blockDecorations-container{pointer-events:none;position:absolute;top:0}.monaco-editor .blockDecorations-block{box-sizing:border-box;position:absolute}.monaco-editor .view-overlays .current-line,.monaco-editor .margin-view-overlays .current-line{box-sizing:border-box;height:100%;display:block;position:absolute;top:0;left:0}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{height:100%;position:absolute}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{justify-content:center;align-items:center;display:flex;position:absolute}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.monaco-editor .lines-content .core-guide{box-sizing:border-box;height:100%;position:absolute}.monaco-editor .margin-view-overlays .line-numbers{font-variant-numeric:tabular-nums;text-align:right;vertical-align:middle;box-sizing:border-box;cursor:default;display:inline-block;position:absolute;bottom:0}.monaco-editor .relative-current-line-number{text-align:left;width:100%;display:inline-block}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}.monaco-mouse-cursor-text{cursor:text}.mtkcontrol{color:#fff!important;background:#960000!important}.mtkoverflow{background-color:var(--vscode-button-background,var(--vscode-editor-background));color:var(--vscode-button-foreground,var(--vscode-editor-foreground));border-style:solid;border-width:1px;border-color:var(--vscode-contrastBorder);cursor:pointer;border-radius:2px;padding:4px}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{user-select:text}.monaco-editor.enable-user-select{user-select:initial;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{box-sizing:border-box;width:100%;position:absolute}.monaco-editor .lines-content>.view-lines>.view-line>span{position:absolute;top:0;bottom:0}.monaco-editor .mtkw{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .lines-decorations{background:#fff;position:absolute;top:0}.monaco-editor .margin-view-overlays .cldr{height:100%;position:absolute}.monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}.monaco-editor .margin-view-overlays .cmdr{width:100%;height:100%;position:absolute;left:0}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover:hover .minimap-slider,.monaco-editor .minimap.slider-mouseover .minimap-slider.active{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{width:0;position:absolute}.monaco-editor .minimap-shadow-visible{pointer-events:none;width:6px;position:absolute;left:-6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{width:1px;position:absolute;left:-1px}.minimap.minimap-autohide-mouseover,.minimap.minimap-autohide-scroll{opacity:0;transition:opacity .5s}.minimap.minimap-autohide-scroll{pointer-events:none}.minimap.minimap-autohide-mouseover:hover,.minimap.minimap-autohide-scroll.active{opacity:1;pointer-events:auto}.monaco-editor .minimap{z-index:5}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset;position:absolute;top:0}.monaco-editor .scroll-decoration{height:6px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;position:absolute;top:0;left:0}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{box-sizing:border-box;position:absolute;overflow:hidden}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{border-style:solid;border-width:1px;background:0 0!important}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-style:solid;border-bottom-width:2px;background:0 0!important}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-style:solid;border-bottom-width:1px;background:0 0!important}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:.5s ease-in-out 20 alternate monaco-cursor-smooth}.cursor-phase{animation:.5s ease-in-out 20 alternate monaco-cursor-phase}.cursor-expand>.cursor{animation:.5s ease-in-out 20 alternate monaco-cursor-expand}.monaco-editor .mwh{position:absolute;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .monaco-decoration-css-rule-extractor{visibility:hidden;pointer-events:none}.monaco-editor .inputarea{resize:none;color:transparent;z-index:-10;background-color:transparent;border:none;min-width:0;min-height:0;margin:0;padding:0;position:absolute;overflow:hidden;outline:none!important}.monaco-editor .inputarea.ime-input{z-index:10;caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground)}.monaco-editor .native-edit-context{scrollbar-width:none;z-index:-10;white-space:pre-wrap;margin:0;padding:0;position:absolute;overflow-y:scroll}.monaco-editor .ime-text-area{resize:none;color:transparent;z-index:-10;background-color:transparent;border:none;min-width:0;min-height:0;margin:0;padding:0;position:absolute;overflow:hidden;outline:none!important}.monaco-editor .edit-context-composition-none{background-color:transparent;border-bottom:none}.monaco-editor :not(:-webkit-any(.hc-black,.hc-light)) .edit-context-composition-secondary{border-bottom:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :not(:is(.hc-black,.hc-light)) .edit-context-composition-secondary{border-bottom:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :not(:-webkit-any(.hc-black,.hc-light)) .edit-context-composition-primary{border-bottom:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor :not(:is(.hc-black,.hc-light)) .edit-context-composition-primary{border-bottom:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor :-webkit-any(.hc-black,.hc-light) .edit-context-composition-secondary{border:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :is(.hc-black,.hc-light) .edit-context-composition-secondary{border:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :-webkit-any(.hc-black,.hc-light) .edit-context-composition-primary{border:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor :is(.hc-black,.hc-light) .edit-context-composition-primary{border:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor .margin-view-overlays .gpu-mark{border-left:solid 2px var(--vscode-editorWarning-foreground);opacity:.2;width:100%;transition:background-color .1s linear;display:inline-block;position:absolute;top:0;bottom:0;left:0}.monaco-editor .margin-view-overlays .gpu-mark:hover{background-color:var(--vscode-editorWarning-foreground)}.monaco-select-box{cursor:pointer;border-radius:2px;width:100%}.monaco-select-box-dropdown-container{text-transform:none;font-size:13px;font-weight:400}.monaco-action-bar .action-item.select-container{cursor:default}.monaco-action-bar .action-item .monaco-select-box{cursor:pointer;min-width:100px;min-height:18px;padding:2px 23px 2px 8px}.mac .monaco-action-bar .action-item .monaco-select-box{border-radius:3px;min-height:24px;font-size:11px}.monaco-list{white-space:nowrap;width:100%;height:100%;position:relative}.monaco-list.mouse-support{user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{width:100%;height:100%;position:relative}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{box-sizing:border-box;width:100%;position:absolute;overflow:hidden}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-single,.monaco-list.selection-multiple{outline:0!important}.monaco-list-type-filter-message{box-sizing:border-box;text-align:center;white-space:normal;opacity:.7;pointer-events:none;width:100%;height:100%;padding:40px 1em 1em;position:absolute;top:0;left:0}.monaco-list-type-filter-message:empty{display:none}.monaco-drag-image{z-index:1000;background-color:var(--vscode-list-activeSelectionBackground);color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-list-focusOutline);outline-offset:-1px;text-overflow:ellipsis;white-space:nowrap;border-radius:10px;max-width:120px;padding:1px 7px;font-size:12px;display:inline-block;position:absolute;overflow:hidden}.monaco-select-box-dropdown-padding{--dropdown-padding-top:1px;--dropdown-padding-bottom:1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top:3px;--dropdown-padding-bottom:4px}.monaco-select-box-dropdown-container{box-sizing:border-box;display:none}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{line-height:15px;font-family:var(--monaco-monospace-font)}.monaco-select-box-dropdown-container.visible{text-align:left;border-bottom-right-radius:3px;border-bottom-left-radius:3px;flex-direction:column;width:1px;display:flex;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom);box-sizing:border-box;flex:none;align-self:flex-start;width:100%;padding-left:1px;padding-right:1px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{text-overflow:ellipsis;white-space:nowrap;float:left;padding-left:3.5px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{text-overflow:ellipsis;white-space:nowrap;float:left;opacity:.7;padding-left:3.5px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{text-overflow:ellipsis;white-space:nowrap;float:right;padding-right:10px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{width:1px;height:1px;position:absolute;top:auto;left:-10000px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{opacity:0;flex:auto;align-self:flex-start}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{max-height:0;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{white-space:nowrap;padding-left:4px;padding-right:8px}.monaco-action-bar{white-space:nowrap;height:100%}.monaco-action-bar .actions-container{align-items:center;width:100%;height:100%;margin:0 auto;padding:0;display:flex}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar .action-item{cursor:pointer;justify-content:center;align-items:center;display:block;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar .action-item .icon,.monaco-action-bar .action-item .codicon{display:block}.monaco-action-bar .action-item .codicon{align-items:center;width:16px;height:16px;display:flex}.monaco-action-bar .action-label{border-radius:5px;padding:3px;font-size:11px;display:flex}.monaco-action-bar .action-item.disabled .action-label:not(.icon),.monaco-action-bar .action-item.disabled .action-label:not(.icon):before,.monaco-action-bar .action-item.disabled .action-label:not(.icon):hover{color:var(--vscode-disabledForeground)}.monaco-action-bar .action-item.disabled .action-label.icon,.monaco-action-bar .action-item.disabled .action-label.icon:before,.monaco-action-bar .action-item.disabled .action-label.icon:hover{opacity:.6}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{border-bottom:1px solid var(--vscode-disabledForeground);margin-left:.8em;margin-right:.8em;padding-top:1px;display:block}.monaco-action-bar .action-item .action-label.separator{cursor:default;background-color:var(--vscode-disabledForeground);width:1px;min-width:1px;height:16px;padding:0;margin:5px 4px!important}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{flex:1;justify-content:center;align-items:center;min-width:60px;max-width:170px;margin-right:10px;display:flex;overflow:hidden}.monaco-action-bar .action-item.action-dropdown-item{display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{cursor:default;align-items:center;display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{width:1px}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review{user-select:none;z-index:99}.monaco-component.diff-review .diff-review-line-number{text-align:right;color:var(--vscode-editorLineNumber-foreground);display:inline-block}.monaco-component.diff-review .diff-review-summary{padding-left:10px}.monaco-component.diff-review .diff-review-shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset;position:absolute}.monaco-component.diff-review .diff-review-row{white-space:pre}.monaco-component.diff-review .diff-review-table{min-width:100%;display:table}.monaco-component.diff-review .diff-review-row{width:100%;display:table-row}.monaco-component.diff-review .diff-review-spacer{vertical-align:middle;width:10px;display:inline-block}.monaco-component.diff-review .diff-review-spacer>.codicon{font-size:9px!important}.monaco-component.diff-review .diff-review-actions{z-index:100;display:inline-block;position:absolute;top:2px;right:10px}.monaco-component.diff-review .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.monaco-component.diff-review .revertButton{cursor:pointer}.monaco-component.diff-review .action-label{background:var(--vscode-editorActionList-background)}:root{--vscode-sash-size:4px;--vscode-sash-hover-size:4px}.monaco-sash{z-index:35;touch-action:none;position:absolute}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;width:var(--vscode-sash-size);height:100%;top:0}.monaco-sash.horizontal{cursor:ns-resize;width:100%;height:var(--vscode-sash-size);left:0}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";height:calc(var(--vscode-sash-size) * 2);width:calc(var(--vscode-sash-size) * 2);z-index:100;cursor:all-scroll;display:block;position:absolute}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size) * -.5);top:calc(var(--vscode-sash-size) * -1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{left:calc(var(--vscode-sash-size) * -.5);bottom:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{top:calc(var(--vscode-sash-size) * -.5);left:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{top:calc(var(--vscode-sash-size) * -.5);right:calc(var(--vscode-sash-size) * -1)}.monaco-sash:before{content:"";pointer-events:none;background:0 0;width:100%;height:100%;position:absolute}.monaco-enable-motion .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.hover:before,.monaco-sash.active:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{width:var(--vscode-sash-hover-size);left:calc(50% - (var(--vscode-sash-hover-size) / 2))}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - (var(--vscode-sash-hover-size) / 2))}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:#0ff}.monaco-sash.debug.disabled{background:rgba(0,255,255,.2)}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}.monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{cursor:pointer;justify-content:center;align-items:center;height:100%;display:flex}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{border-radius:5px;flex-direction:row;display:flex!important}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{margin-left:-3px;padding-left:0;padding-right:0;font-size:12px;line-height:16px}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}.monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{padding:0;display:inline-block}.monaco-toolbar.responsive .monaco-action-bar>.actions-container>.action-item{flex-shrink:1;min-width:20px}.monaco-action-bar .action-item.menu-entry .action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;width:16px;height:16px}.monaco-action-bar .action-item.menu-entry.text-only .action-label{color:var(--vscode-descriptionForeground);border-radius:2px;overflow:hidden}.monaco-action-bar .action-item.menu-entry.text-only.use-comma:not(:last-of-type) .action-label:after{content:", "}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{color:var(--vscode-descriptionForeground)}.monaco-dropdown-with-default{border-radius:5px;flex-direction:row;display:flex!important}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{background-position:50%;background-repeat:no-repeat;background-size:16px;width:16px;height:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{margin-left:-3px;padding-left:0;padding-right:0;font-size:12px;line-height:16px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{background-position:50%;background-repeat:no-repeat;background-size:16px;display:block}.monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{height:0;font-size:13px;line-height:14px;transform:translateY(-10px)}.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines .bottom.dragging{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .top,.monaco-editor .diff-hidden-lines .bottom{background-color:transparent;background-clip:padding-box;border-top:4px solid transparent;border-bottom:2px solid transparent;height:4px;transition:background-color .1s ease-out}.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *,.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom){cursor:n-resize!important}.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom{cursor:s-resize!important}.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{z-index:1;background:var(--vscode-editor-background);justify-content:center;align-items:center;display:flex}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);color:var(--vscode-diffEditor-unchangedRegionForeground);text-overflow:ellipsis;white-space:nowrap;height:24px;box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow), inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow);display:block;overflow:hidden}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedOriginal,.monaco-editor .movedModified{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedOriginal.currentMove,.monaco-editor .movedModified.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{pointer-events:none;position:absolute}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2px}.monaco-editor .char-delete.diff-range-empty{border-left:solid var(--vscode-diffEditor-removedTextBackground) 3px;margin-left:-1px}.monaco-editor .char-insert.diff-range-empty{border-left:solid var(--vscode-diffEditor-insertedTextBackground) 3px}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{justify-content:flex-end;margin-top:-4px;display:flex}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{width:12px;height:12px;font-size:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:rgba(255,255,255,.01)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:0 0}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:rgba(171,171,171,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:0 0}.monaco-editor .insert-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-diff-editor .delete-sign{align-items:center;opacity:.7!important;font-size:11px!important;display:flex!important}.monaco-editor.hc-black .insert-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .delete-sign,.monaco-editor.hc-light .insert-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .delete-sign{opacity:1}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .inline-added-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{z-index:10;position:absolute}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-editor .char-insert,.monaco-diff-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .line-insert,.monaco-diff-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground,var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .line-insert,.monaco-editor .char-insert{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-insertedTextBorder)}.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .line-insert,.monaco-editor.hc-black .char-insert,.monaco-editor.hc-light .char-insert{border-style:dashed}.monaco-editor .line-delete,.monaco-editor .char-delete{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-removedTextBorder)}.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .line-delete,.monaco-editor.hc-black .char-delete,.monaco-editor.hc-light .char-delete{border-style:dashed}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .gutter-insert,.monaco-diff-editor .gutter-insert{background-color:var(--vscode-diffEditorGutter-insertedLineBackground,var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-delete,.monaco-diff-editor .char-delete,.monaco-editor .inline-deleted-text{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .inline-deleted-text{text-decoration:line-through}.monaco-editor .line-delete,.monaco-diff-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground,var(--vscode-diffEditor-removedTextBackground))}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .gutter-delete,.monaco-diff-editor .gutter-delete{background-color:var(--vscode-diffEditorGutter-removedLineBackground,var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow);border-left:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor.side-by-side .editor.original{box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow);border-right:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg, var(--vscode-diffEditor-diagonalFill) 12.5%, transparent 12.5%, transparent 50%, var(--vscode-diffEditor-diagonalFill) 50%, var(--vscode-diffEditor-diagonalFill) 62.5%, transparent 62.5%, transparent 100%);background-size:8px 8px}.monaco-diff-editor .gutter{flex-grow:0;flex-shrink:0;position:relative;overflow:hidden}.monaco-diff-editor .gutter>div{position:absolute}.monaco-diff-editor .gutter .gutterItem{opacity:0;transition:opacity .7s}.monaco-diff-editor .gutter .gutterItem.showAlways{opacity:1;transition:none}.monaco-diff-editor .gutter .gutterItem.noTransition{transition:none}.monaco-diff-editor .gutter:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.monaco-diff-editor .gutter .gutterItem .background{border-left:2px var(--vscode-menu-separatorBackground) solid;width:1px;height:100%;position:absolute;left:50%}.monaco-diff-editor .gutter .gutterItem .buttons{justify-content:center;align-items:center;width:100%;display:flex;position:absolute}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar{height:fit-content}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar{line-height:1}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container{background:var(--vscode-editorGutter-itemBackground);border-radius:4px;width:fit-content}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item .action-label{color:var(--vscode-editorGutter-itemGlyphForeground);padding:1px 2px}.monaco-diff-editor .diff-hidden-lines-compact{height:11px;display:flex}.monaco-diff-editor .diff-hidden-lines-compact .line-left{border-top:1px solid;border-color:var(--vscode-editorCodeLens-foreground);opacity:.5;width:100%;height:1px;margin:auto}.monaco-diff-editor .diff-hidden-lines-compact .line-right{border-top:1px solid;border-color:var(--vscode-editorCodeLens-foreground);opacity:.5;width:100%;height:1px;margin:auto}.monaco-diff-editor .diff-hidden-lines-compact .line-left{width:20px}.monaco-diff-editor .diff-hidden-lines-compact .text{color:var(--vscode-editorCodeLens-foreground);text-wrap:nowrap;margin:0 4px;font-size:11px;line-height:11px}.monaco-editor .line-delete-selectable{user-select:text!important;z-index:1!important}.line-delete-selectable .view-line{user-select:text!important}.monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}.monaco-editor .bracket-match{box-sizing:border-box;background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border)}.inline-editor-progress-decoration{width:1em;height:1em;display:inline-block}.inline-progress-widget{justify-content:center;align-items:center;display:flex!important}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{animation:none;font-size:90%!important}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-editor .monaco-editor-overlaymessage{z-index:10000;padding-bottom:8px}.monaco-editor .monaco-editor-overlaymessage.below{z-index:10000;padding-top:8px;padding-bottom:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:.15s ease-out fadeIn}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:.1s ease-out fadeOut}.monaco-editor .monaco-editor-overlaymessage .message{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px;padding:2px 4px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-top:0;margin-bottom:0}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{z-index:1000;border:8px solid transparent;position:absolute;left:2px;width:0!important;height:0!important}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,.monaco-editor .monaco-editor-overlaymessage.below .anchor.below{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}.monaco-text-button{box-sizing:border-box;text-align:center;cursor:pointer;border:1px solid var(--vscode-button-border,transparent);border-radius:2px;justify-content:center;align-items:center;width:100%;padding:4px;line-height:18px;display:flex}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled:focus,.monaco-button.disabled{cursor:default;opacity:.4!important}.monaco-text-button .codicon{margin:0 .2em;color:inherit!important}.monaco-text-button.monaco-text-button-with-short-label{flex-flow:wrap;height:28px;padding:0 4px;overflow:hidden}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;width:0;overflow:hidden}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{font-weight:400;font-style:inherit;justify-content:center;align-items:center;padding:4px 0;display:flex}.monaco-button-dropdown{cursor:pointer;display:flex}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus,.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{cursor:default;padding:4px 0}.monaco-button-dropdown .monaco-button-dropdown-separator>div{width:1px;height:100%}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{border:1px solid var(--vscode-button-border,transparent);border-radius:0 2px 2px 0;align-items:center;display:flex;border-left-width:0!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{flex-direction:column;align-items:center;margin:4px 5px;display:flex}.monaco-description-button .monaco-button-description{padding:4px 20px;font-size:11px;font-style:italic}.monaco-description-button .monaco-button-label,.monaco-description-button .monaco-button-description{justify-content:center;align-items:center;display:flex}.monaco-description-button .monaco-button-label>.codicon,.monaco-description-button .monaco-button-description>.codicon{margin:0 .2em;color:inherit!important}.monaco-button.default-colors,.monaco-button-dropdown.default-colors>.monaco-button{color:var(--vscode-button-foreground);background-color:var(--vscode-button-background)}.monaco-button.default-colors:hover,.monaco-button-dropdown.default-colors>.monaco-button:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button.default-colors.secondary,.monaco-button-dropdown.default-colors>.monaco-button.secondary{color:var(--vscode-button-secondaryForeground);background-color:var(--vscode-button-secondaryBackground)}.monaco-button.default-colors.secondary:hover,.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-top:1px solid var(--vscode-button-border);border-bottom:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}.action-widget{z-index:40;background-color:var(--vscode-menu-background);width:100%;min-width:100px;max-width:80vw;color:var(--vscode-menu-foreground);box-shadow:0 2px 8px var(--vscode-widget-shadow);border-radius:5px;padding:4px;font-size:13px;display:block;border:1px solid var(--vscode-menu-border)!important}.context-view-block{cursor:initial;z-index:-1;width:100%;height:100%;position:fixed;top:0;left:0}.context-view-pointerBlock{cursor:initial;z-index:2;width:100%;height:100%;position:fixed;top:0;left:0}.action-widget .monaco-list{user-select:none;border:0!important}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{white-space:nowrap;cursor:pointer;touch-action:none;border-radius:3px;width:100%;padding:0 4px}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-menu-selectionBorder,transparent);outline-offset:-1px;background-color:var(--vscode-list-activeSelectionBackground)!important}.action-widget .monaco-list-row.group-header{font-size:13px;font-weight:600;color:var(--vscode-descriptionForeground)!important}.action-widget .monaco-list-row.group-header:not(:first-of-type){margin-top:2px}.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator{border-top:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-descriptionForeground);cursor:default;user-select:none;border-radius:0;margin:4px 0 0;padding:0;font-size:12px}.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator.focused{background-color:transparent;border-radius:0;outline:0 solid}.action-widget .monaco-list-row.separator:first-of-type{border-top:none;margin-top:0}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled:before,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before{-webkit-touch-callout:none;user-select:none;cursor:default!important;background-color:transparent!important;outline:0 solid!important}.action-widget .monaco-list-row.action{align-items:center;gap:4px;display:flex}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{text-overflow:ellipsis;flex:1;overflow:hidden}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);border-radius:3px}.action-widget .action-widget-action-bar{background-color:var(--vscode-menu-background);border-top:1px solid var(--vscode-menu-border);margin-top:2px}.action-widget .action-widget-action-bar:before{content:"";width:100%;display:block}.action-widget .action-widget-action-bar .actions-container{padding:4px 8px 2px 24px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);pointer-events:all;padding:0;font-size:13px;line-height:22px}.action-widget-action-bar .action-item{pointer-events:none;margin-right:16px}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}.action-widget .monaco-list .monaco-list-row .description{opacity:.7;margin-left:.5em}.monaco-keybinding{align-items:center;line-height:10px;display:flex}.monaco-keybinding>.monaco-keybinding-key{vertical-align:middle;border-style:solid;border-width:1px;border-radius:3px;margin:0 2px;padding:3px 5px;font-size:11px;display:inline-block}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}.post-edit-widget{box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:1px solid var(--vscode-widget-border,transparent);color:var(--vscode-button-foreground);background-color:var(--vscode-button-background);border-radius:4px;overflow:hidden}.post-edit-widget .monaco-button{border:none;border-radius:0;padding:2px}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-hoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}@font-face{font-family:codicon;font-display:block;src:url(/tmagic-editor/playground/assets/codicon-ngg6Pgfi.ttf)format("truetype")}.codicon[class*=codicon-]{text-rendering:auto;text-align:center;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;user-select:none;font:16px/1 codicon;text-decoration:none;display:inline-block}.codicon-wrench-subaction{opacity:.5}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin{animation:1.5s steps(30,end) infinite codicon-spin}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-value,.monaco-editor .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-enum{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}.monaco-editor .lightBulbWidget{justify-content:center;align-items:center;display:flex}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground,var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground,var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{z-index:2;position:relative}.monaco-editor .lightBulbWidget:after{content:"";opacity:.3;z-index:1;width:100%;height:100%;display:block;position:absolute;top:0;left:0}.monaco-editor .glyph-margin-widgets .cgmr[class*=codicon-gutter-lightbulb]{cursor:pointer;display:block}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix{color:var(--vscode-editorLightBulbAutoFix-foreground,var(--vscode-editorLightBulb-foreground))}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground,var(--vscode-icon-foreground))}.monaco-editor .codelens-decoration{text-overflow:ellipsis;white-space:nowrap;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize);padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);font-family:var(--vscode-editorCodeLens-fontFamily), var(--vscode-editorCodeLens-fontFamilyDefault);align-items:center;overflow:hidden;display:inline-flex!important}.monaco-editor .codelens-decoration>span,.monaco-editor .codelens-decoration>a{user-select:none;white-space:nowrap;vertical-align:sub;align-items:center;display:inline-flex}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon[class*=codicon-]{vertical-align:middle;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize);color:currentColor!important}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:.1s linear fadein}.monaco-editor .inlineSuggestionsHints{padding:4px}.monaco-editor .inlineSuggestionsHints .warningMessage p{margin:0}.monaco-editor .inlineSuggestionsHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineSuggestionsHints a,.monaco-editor .inlineSuggestionsHints a:hover{color:var(--vscode-foreground)!important}.monaco-editor .inlineSuggestionsHints .keybinding{opacity:.6;margin-left:4px;display:flex}.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key{padding:2px 3px;font-size:8px}.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a{justify-content:center;min-width:19px;display:flex}.monaco-editor .inlineSuggestionStatusBarItemLabel{margin-right:2px}.monaco-hover{cursor:default;user-select:text;box-sizing:border-box;white-space:var(--vscode-hover-whiteSpace,normal);line-height:1.5em;position:absolute;overflow:hidden}.monaco-hover.fade-in{animation:.1s linear fadein}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:var(--vscode-hover-maxWidth,500px);word-wrap:break-word}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover p,.monaco-hover .code,.monaco-hover ul,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{box-sizing:border-box;border-left:0;border-right:0;height:1px;margin:4px -8px -4px}.monaco-hover p:first-child,.monaco-hover .code:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover p:last-child,.monaco-hover .code:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ul,.monaco-hover ol{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace,pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{padding:0 8px;font-style:italic}.monaco-hover .hover-row.status-bar .actions{width:100%;padding:0 8px;display:flex}.monaco-hover .hover-row.status-bar .actions .action-container{cursor:pointer;text-wrap:nowrap;text-overflow:ellipsis;margin-right:16px;overflow:hidden}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{vertical-align:middle;padding-right:4px}.monaco-hover .hover-row.status-bar .actions .action-container a{color:var(--vscode-textLink-foreground);text-decoration:var(--text-link-decoration)}.monaco-hover .hover-row.status-bar .actions .action-container a .icon.codicon{color:var(--vscode-textLink-foreground)}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link:hover,.monaco-hover .hover-contents a.code-link{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{text-underline-position:under;color:var(--vscode-textLink-foreground);border-bottom:1px solid transparent;text-decoration:underline}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) p:last-child [style*=background-color]{margin-bottom:4px;display:inline-block}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon{margin-bottom:2px}.monaco-hover-content .action-container a{user-select:none}.monaco-hover-content .action-container.disabled{pointer-events:none;opacity:.4;cursor:default}.monaco-hover .action-container,.monaco-hover .action,.monaco-hover button,.monaco-hover .monaco-button,.monaco-hover .monaco-text-button,.monaco-hover [role=button]{user-select:none}.monaco-custom-toggle{float:left;cursor:pointer;box-sizing:border-box;user-select:none;border:1px solid transparent;border-radius:3px;width:20px;height:20px;margin-left:2px;padding:1px;overflow:hidden}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-light .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{background:0 0}.monaco-custom-toggle.monaco-checkbox{opacity:1;border:1px solid transparent;border-radius:3px;width:18px;height:18px;margin-left:0;margin-right:9px;padding:0;background-size:16px!important}.monaco-action-bar .checkbox-action-item{border-radius:2px;align-items:center;padding-right:2px;display:flex}.monaco-action-bar .checkbox-action-item:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.monaco-editor .find-widget{z-index:35;box-sizing:border-box;height:33px;box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);border-bottom:1px solid var(--vscode-widget-border);background-color:var(--vscode-editorWidget-background);border-bottom-right-radius:4px;border-bottom-left-radius:4px;padding:0 4px;line-height:19px;transition:transform .2s linear;position:absolute;overflow:hidden;transform:translateY(calc(-100% - 10px))}.monaco-reduce-motion .monaco-editor .find-widget{transition:transform linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px;outline-color:var(--vscode-focusBorder)}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:3px 25px 0 17px;font-size:12px;display:flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions,.monaco-editor .find-widget>.replace-part .replace-actions{align-items:center;height:25px;display:flex}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;flex:1;display:flex}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{flex:initial;vertical-align:middle;box-sizing:border-box;text-align:center;height:25px;margin:0 0 0 3px;padding:2px 0 0 2px;line-height:23px;display:flex}.monaco-editor .find-widget .button{flex:initial;cursor:pointer;background-position:50%;background-repeat:no-repeat;border-radius:5px;justify-content:center;align-items:center;width:16px;height:16px;margin-left:3px;padding:3px;display:flex}.monaco-editor .find-widget .codicon-find-selection{border-radius:5px;width:22px;height:22px;padding:3px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{box-sizing:border-box;border-radius:0;width:18px;height:100%;position:absolute;top:0;left:3px}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{vertical-align:middle;flex:none;display:flex;position:relative}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;background-color:var(--vscode-editor-findMatchHighlightBackground);animation-name:inherit!important}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);box-sizing:border-box;padding:1px}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{background-color:var(--vscode-editorWidget-resizeBorder,var(--vscode-editorWidget-border));left:0!important}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;top:5px;right:4px}.monaco-inputbox{box-sizing:border-box;font-size:inherit;border-radius:2px;padding:0;display:block;position:relative}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{width:100%;position:relative}.monaco-inputbox>.ibwrapper>.input{box-sizing:border-box;width:100%;height:100%;line-height:inherit;font-family:inherit;font-size:inherit;resize:none;color:inherit;border:none;display:inline-block}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{scrollbar-width:none;outline:none;display:block}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word;width:100%;display:inline-block;position:absolute;top:0;left:0}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{text-align:left;box-sizing:border-box;word-wrap:break-word;width:100%;margin-top:-1px;padding:.4em;font-size:12px;line-height:17px;display:inline-block;overflow:hidden}.monaco-inputbox .monaco-action-bar{position:absolute;top:4px;right:2px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;width:16px;height:16px}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{width:100%;font-size:13px}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls,.hc-light .monaco-findInput.highlight-0 .controls{animation:.1s linear monaco-findInput-highlight-0}.monaco-findInput.highlight-1 .controls,.hc-light .monaco-findInput.highlight-1 .controls{animation:.1s linear monaco-findInput-highlight-1}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:.1s linear monaco-findInput-highlight-dark-0}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:.1s linear monaco-findInput-highlight-dark-1}@keyframes monaco-findInput-highlight-0{0%{background:rgba(253,255,0,.8)}to{background:0 0}}@keyframes monaco-findInput-highlight-1{0%{background:rgba(253,255,0,.8)}99%{background:0 0}}@keyframes monaco-findInput-highlight-dark-0{0%{background:rgba(255,255,255,.44)}to{background:0 0}}@keyframes monaco-findInput-highlight-dark-1{0%{background:rgba(255,255,255,.44)}99%{background:0 0}}.colorpicker-widget{user-select:none;height:190px}.colorpicker-color-decoration,.hc-light .colorpicker-color-decoration{box-sizing:border-box;cursor:pointer;border:.1em solid #000;width:.8em;height:.8em;margin:.1em .2em 0;line-height:.8em;display:inline-block}.hc-black .colorpicker-color-decoration,.vs-dark .colorpicker-color-decoration{border:.1em solid #eee}.colorpicker-header{height:24px;image-rendering:pixelated;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=) 0 0/9px 9px;display:flex;position:relative}.colorpicker-header .picked-color{cursor:pointer;color:#fff;white-space:nowrap;flex:1;justify-content:center;align-items:center;width:240px;line-height:24px;display:flex;overflow:hidden}.colorpicker-header .picked-color .picked-color-presentation{white-space:nowrap;margin-left:5px;margin-right:5px}.colorpicker-header .picked-color .codicon{color:inherit;font-size:14px}.colorpicker-header .picked-color.light{color:#000}.colorpicker-header .original-color{width:74px;z-index:inherit;cursor:pointer}.standalone-colorpicker{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header.standalone-colorpicker{border-bottom:none}.colorpicker-header .close-button{cursor:pointer;background-color:var(--vscode-editorHoverWidget-background);border-left:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header .close-button-inner-div{text-align:center;width:100%;height:100%}.colorpicker-header .close-button-inner-div:hover{background-color:var(--vscode-toolbar-hoverBackground)}.colorpicker-header .close-icon{padding:3px}.colorpicker-body{padding:8px;display:flex;position:relative}.colorpicker-body .saturation-wrap{flex:1;min-width:220px;height:150px;position:relative;overflow:hidden}.colorpicker-body .saturation-box{height:150px;position:absolute}.colorpicker-body .saturation-selection{border:1px solid #fff;border-radius:100%;width:9px;height:9px;margin:-5px 0 0 -5px;position:absolute;box-shadow:0 0 2px rgba(0,0,0,.8)}.colorpicker-body .strip{width:25px;height:150px}.colorpicker-body .standalone-strip{width:25px;height:122px}.colorpicker-body .hue-strip{cursor:grab;background:linear-gradient(red 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);margin-left:8px;position:relative}.colorpicker-body .opacity-strip{cursor:grab;image-rendering:pixelated;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=) 0 0/9px 9px;margin-left:8px;position:relative}.colorpicker-body .strip.grabbing{cursor:grabbing}.colorpicker-body .slider{box-sizing:border-box;border:1px solid rgba(255,255,255,.71);width:calc(100% + 4px);height:4px;position:absolute;top:0;left:-2px;box-shadow:0 0 1px rgba(0,0,0,.85)}.colorpicker-body .strip .overlay{pointer-events:none;height:150px}.colorpicker-body .standalone-strip .standalone-overlay{pointer-events:none;height:122px}.standalone-colorpicker-body{border:1px solid transparent;border-bottom:1px solid var(--vscode-editorHoverWidget-border);display:block;overflow:hidden}.colorpicker-body .insert-button{background:var(--vscode-button-background);width:58px;height:20px;color:var(--vscode-button-foreground);cursor:pointer;border:none;border-radius:2px;padding:0;position:absolute;bottom:8px;right:8px}.colorpicker-body .insert-button:hover{background:var(--vscode-button-hoverBackground)}.monaco-editor .peekview-widget .head{box-sizing:border-box;flex-wrap:nowrap;justify-content:space-between;display:flex}.monaco-editor .peekview-widget .head .peekview-title{text-overflow:ellipsis;align-items:baseline;min-width:0;margin-left:20px;font-size:13px;display:flex;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){margin-left:.5em;font-size:.9em}.monaco-editor .peekview-widget .head .peekview-title .meta{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{text-align:right;flex:1;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{align-self:center;margin-right:4px}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}.monaco-editor .zone-widget{z-index:10;position:absolute}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-top-width:0;border-bottom-style:solid;border-bottom-width:0;position:relative}.monaco-split-view2{width:100%;height:100%;position:relative}.monaco-split-view2>.sash-container{pointer-events:none;width:100%;height:100%;position:absolute}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:initial}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{white-space:nowrap;width:100%;height:100%;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:initial;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:" ";z-index:5;pointer-events:none;background-color:var(--separator-border);position:absolute;top:0;left:0}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{width:1px;height:100%}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{width:100%;height:1px}.monaco-table{white-space:nowrap;flex-direction:column;width:100%;height:100%;display:flex;position:relative;overflow:hidden}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{height:100%;display:flex}.monaco-table-th{text-overflow:ellipsis;width:100%;height:100%;font-weight:700;overflow:hidden}.monaco-table-th,.monaco-table-td{box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;flex-shrink:0;overflow:hidden}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{content:"";left:calc(var(--vscode-sash-size) / 2);border-left:1px solid transparent;width:0;position:absolute}.monaco-enable-motion .monaco-table>.monaco-split-view2,.monaco-enable-motion .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}.monaco-tl-row{align-items:center;height:100%;display:flex;position:relative}.monaco-tl-row.disabled{cursor:default}.monaco-tl-indent{pointer-events:none;height:100%;position:absolute;top:0;left:16px}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{box-sizing:border-box;opacity:0;border-left:1px solid transparent;height:100%;display:inline-block}.monaco-enable-motion .monaco-tl-indent>.indent-guide{transition:opacity .1s linear}.monaco-tl-twistie,.monaco-tl-contents{height:100%}.monaco-tl-twistie{text-align:right;flex-shrink:0;justify-content:center;align-items:center;width:16px;padding-right:6px;font-size:10px;transform:translate(3px);display:flex!important}.monaco-tl-contents{flex:1;overflow:hidden}.monaco-tl-twistie:before{border-radius:20px}.monaco-tl-twistie.collapsed:before{transform:rotate(-90deg)}.monaco-tl-twistie.codicon-tree-item-loading:before{animation:1.25s steps(30,end) infinite codicon-spin}.monaco-tree-type-filter{z-index:100;border:1px solid var(--vscode-widget-border);border-bottom-right-radius:4px;border-bottom-left-radius:4px;max-width:200px;margin:0 10px 0 6px;padding:3px;display:flex;position:absolute;top:0;right:0}.monaco-enable-motion .monaco-tree-type-filter{transition:top .3s}.monaco-tree-type-filter.disabled{top:-40px!important}.monaco-tree-type-filter-input{flex:1}.monaco-tree-type-filter-input .monaco-inputbox{height:23px}.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.input,.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.mirror{padding:2px 4px}.monaco-tree-type-filter-input .monaco-findInput>.controls{top:2px}.monaco-tree-type-filter-actionbar{margin-left:4px}.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label{padding:2px}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container{z-index:13;background-color:var(--vscode-sideBar-background);width:100%;height:0;position:absolute;top:0;left:0}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row.monaco-list-row{background-color:var(--vscode-sideBar-background);width:100%;position:absolute;overflow:hidden;opacity:1!important}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row:hover{cursor:pointer;background-color:var(--vscode-list-hoverBackground)!important}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty,.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty .monaco-tree-sticky-container-shadow{display:none}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow{width:100%;height:0;position:absolute;bottom:-3px;left:0}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container[tabindex="0"]:focus{outline:none}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{vertical-align:top;display:inline-block}.monaco-editor .reference-zone-widget .messages{text-align:center;width:100%;height:100%;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground);line-height:23px}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{width:100%;height:100%;color:var(--vscode-peekViewResult-fileForeground);display:inline-flex}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-left:auto;margin-right:12px}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{color:var(--vscode-peekViewResult-fileForeground)!important;background-color:var(--vscode-peekViewResult-matchHighlightBackground)!important}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder,transparent);box-sizing:border-box}.monaco-count-badge{text-align:center;box-sizing:border-box;border-radius:11px;min-width:18px;min-height:18px;padding:3px 5px;font-size:11px;font-weight:400;line-height:11px;display:inline-block}.monaco-count-badge.long{border-radius:2px;min-height:auto;padding:2px 3px;line-height:normal}.monaco-icon-label{text-overflow:ellipsis;display:flex;overflow:hidden}.monaco-icon-label:before{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;background-position:0;background-repeat:no-repeat;background-size:16px;flex-shrink:0;width:16px;height:22px;padding-right:6px;display:inline-block;line-height:inherit!important}.monaco-icon-label-iconpath{width:16px;height:22px;margin-right:6px;display:flex}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{opacity:.5;margin:0 2px}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix{opacity:.7;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;white-space:pre;margin-left:.5em;font-size:.9em}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.bold>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.bold>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-weight:700}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-style:italic}.monaco-icon-label.deprecated{opacity:.66;text-decoration:line-through}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;text-align:center;margin:auto 16px 0 5px;font-size:90%;font-weight:600}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{vertical-align:text-top;margin-right:4px;display:inline-block}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{padding-right:5px;display:inline-block}.monaco-editor .marker-widget .descriptioncontainer{white-space:pre;user-select:text;padding:8px 12px 0 20px;position:absolute}.monaco-editor .marker-widget .descriptioncontainer .message{flex-direction:column;display:flex}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{opacity:.6;color:inherit}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{text-underline-position:under;color:var(--vscode-textLink-activeForeground);border-bottom:1px solid transparent;text-decoration:underline}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer;color:var(--vscode-textLink-activeForeground)}.monaco-editor .zone-widget .codicon.codicon-error,.markers-panel .marker-icon.error,.markers-panel .marker-icon .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.extension-editor .codicon.codicon-error,.chat-attached-context-attachment .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-warning,.markers-panel .marker-icon.warning,.markers-panel .marker-icon .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.extension-editor .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-info,.markers-panel .marker-icon.info,.markers-panel .marker-icon .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.extension-editor .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}.monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-resizable-hover{border:1px solid var(--vscode-editorHoverWidget-border);box-sizing:content-box;border-radius:3px}.monaco-editor .monaco-resizable-hover>.monaco-hover{border-radius:none;border:none}.monaco-editor .monaco-hover{border:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border-radius:3px}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row.hover-row-with-copy{padding-right:20px;position:relative}.monaco-editor .monaco-hover .hover-row .hover-row-contents{flex-direction:column;min-width:0;display:flex}.monaco-editor .monaco-hover .hover-row .verbosity-actions{border-right:1px solid var(--vscode-editorHoverWidget-border);width:22px;overflow-y:clip}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner{flex-direction:column;justify-content:flex-end;padding-left:5px;padding-right:5px;display:flex;position:relative}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .monaco-hover .hover-copy-button{opacity:0;border-radius:3px;justify-content:center;align-items:center;padding:2px 4px;display:flex;position:absolute;top:4px;right:4px}.monaco-editor .monaco-hover .hover-row-with-copy:hover .hover-copy-button,.monaco-editor .monaco-hover .hover-row-with-copy:focus-within .hover-copy-button{opacity:1}.monaco-editor .monaco-hover .hover-copy-button:hover{background-color:var(--vscode-toolbar-hoverBackground);cursor:pointer}.monaco-editor .monaco-hover .hover-copy-button:focus{outline:1px solid var(--vscode-focusBorder);outline-offset:-1px}.monaco-editor .monaco-hover .hover-copy-button .codicon{color:var(--vscode-foreground);font-size:16px}.monaco-editor.vs .dnd-target,.monaco-editor.hc-light .dnd-target{color:#fff;border-right:2px dotted #000}.monaco-editor.vs-dark .dnd-target{color:#51504f;border-right:2px dotted #aeafad}.monaco-editor.hc-black .dnd-target{color:#000;border-right:2px dotted #fff}.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines,.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines{cursor:default}.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines,.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines{cursor:copy}.monaco-editor .findOptionsWidget{background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:2px solid var(--vscode-contrastBorder)}.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-editor .margin-view-overlays .codicon-folding-collapsed{cursor:pointer;opacity:0;justify-content:center;align-items:center;margin-left:2px;font-size:140%;transition:opacity .5s;display:flex}.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed{transition:initial}.monaco-editor .margin-view-overlays:hover .codicon,.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons{opacity:1}.monaco-editor .inline-folded:after{color:var(--vscode-editor-foldPlaceholderForeground);content:"⋯";cursor:pointer;margin:.1em .2em 0;line-height:1em;display:inline}.monaco-editor .folded-background{background-color:var(--vscode-editor-foldBackground)}.monaco-editor .cldr.codicon.codicon-folding-expanded,.monaco-editor .cldr.codicon.codicon-folding-collapsed,.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed{color:var(--vscode-editorGutter-foldingControlForeground)!important}.monaco-editor .snippet-placeholder{background-color:var(--vscode-editor-snippetTabstopHighlightBackground,transparent);outline-width:1px;outline-style:solid;outline-color:var(--vscode-editor-snippetTabstopHighlightBorder,transparent);min-width:2px}.monaco-editor .finish-snippet-placeholder{background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground,transparent);outline-width:1px;outline-style:solid;outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder,transparent)}.monaco-editor .suggest-widget{z-index:40;border-radius:3px;flex-direction:column;width:430px;display:flex}.monaco-editor .suggest-widget.message{flex-direction:row;align-items:center}.monaco-editor .suggest-widget,.monaco-editor .suggest-details{border-style:solid;border-width:1px;border-color:var(--vscode-editorSuggestWidget-border);background-color:var(--vscode-editorSuggestWidget-background);flex:0 auto;width:100%}.monaco-editor.hc-black .suggest-widget,.monaco-editor.hc-black .suggest-details,.monaco-editor.hc-light .suggest-widget,.monaco-editor.hc-light .suggest-details{border-width:2px}.monaco-editor .suggest-widget .suggest-status-bar{box-sizing:border-box;border-top:1px solid var(--vscode-editorSuggestWidget-border);flex-flow:row;justify-content:space-between;width:100%;padding:0 4px;font-size:80%;display:none;overflow:hidden}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar{display:flex}.monaco-editor .suggest-widget .suggest-status-bar .left{padding-right:8px}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-label{color:var(--vscode-editorSuggestWidgetStatus-foreground)}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label{margin-right:0}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label:after{content:", ";margin-right:.3em}.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row>.contents>.main>.right>.readMore,.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover>.contents>.main>.right.can-expand-details>.details-label{width:100%}.monaco-editor .suggest-widget>.message{padding-left:22px}.monaco-editor .suggest-widget>.tree{width:100%;height:100%}.monaco-editor .suggest-widget .monaco-list{user-select:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row{-mox-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;cursor:pointer;touch-action:none;background-position:2px 2px;background-repeat:no-repeat;padding-right:10px;display:flex}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused{color:var(--vscode-editorSuggestWidget-selectedForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon{color:var(--vscode-editorSuggestWidget-selectedIconForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents{flex:1;height:100%;padding-left:2px;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main{text-overflow:ellipsis;white-space:pre;justify-content:space-between;display:flex;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{display:flex}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.focused)>.contents>.main .monaco-icon-label{color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-highlightForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-focusHighlightForeground)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:before{color:inherit;opacity:1;cursor:pointer;font-size:14px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close{position:absolute;top:6px;right:2px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close:hover,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:hover{opacity:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{opacity:.7}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.signature-label{text-overflow:ellipsis;opacity:.6;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.qualifier-label{opacity:.4;font-size:85%;line-height:initial;text-overflow:ellipsis;align-self:center;margin-left:12px;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{text-overflow:ellipsis;white-space:nowrap;margin-left:1.1em;font-size:85%;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label>.monaco-tokenized-source{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{display:none}.monaco-editor .suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused>.contents>.main>.right>.details-label,.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.right>.details-label,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label)>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right.can-expand-details>.details-label{width:calc(100% - 26px)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left{flex-grow:1;flex-shrink:1;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.monaco-icon-label{flex-shrink:0}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.left>.monaco-icon-label{max-width:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.left>.monaco-icon-label{flex-shrink:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{flex-shrink:4;max-width:70%;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{visibility:hidden;width:18px;height:18px;display:inline-block;position:absolute;right:10px}.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none!important}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:inline-block}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right>.readMore{visibility:visible}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated{opacity:.66;text-decoration:unset}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-container>.monaco-icon-name-container{text-decoration:line-through}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon{background-position:50%;background-repeat:no-repeat;background-size:80%;width:16px;height:16px;margin-left:2px;display:block}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon{align-items:center;margin-right:4px;display:flex}.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon:before{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{border:.1em solid #000;width:.7em;height:.7em;margin:0 0 0 .3em;display:inline-block}.monaco-editor .suggest-details-container{z-index:41}.monaco-editor .suggest-details{cursor:default;color:var(--vscode-editorSuggestWidget-foreground);flex-direction:column;display:flex}.monaco-editor .suggest-details:focus{border-color:var(--vscode-focusBorder)}.monaco-editor .suggest-details a{color:var(--vscode-textLink-foreground)}.monaco-editor .suggest-details a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .suggest-details code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .suggest-details.no-docs{display:none}.monaco-editor .suggest-details>.monaco-scrollable-element{flex:1}.monaco-editor .suggest-details>.monaco-scrollable-element>.body{box-sizing:border-box;width:100%;height:100%}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type{text-overflow:ellipsis;opacity:.7;white-space:pre;flex:2;margin:0 24px 0 0;padding:4px 0 4px 5px;overflow:hidden}.monaco-editor .suggest-details.detail-and-doc>.monaco-scrollable-element>.body>.header>.type{padding-bottom:12px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type.auto-wrap{white-space:normal;word-break:break-all}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs{white-space:pre-wrap;margin:0;padding:4px 5px}.monaco-editor .suggest-details.no-type>.monaco-scrollable-element>.body>.docs{margin-right:24px;overflow:hidden}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs{white-space:initial;min-height:calc(1rem + 8px);padding:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty){padding:4px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child{margin-top:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child{margin-bottom:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .monaco-tokenized-source{white-space:pre}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs .code{white-space:pre-wrap;word-wrap:break-word}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .codicon{vertical-align:sub}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>p:empty{display:none}.monaco-editor .suggest-details code{border-radius:3px;padding:0 .4em}.monaco-editor .suggest-details ul,.monaco-editor .suggest-details ol{padding-left:20px}.monaco-editor .suggest-details p code{font-family:var(--monaco-monospace-font)}.monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{cursor:pointer;text-underline-position:under;text-decoration:underline;display:inline-block}.monaco-editor .ghost-text-hidden{opacity:0;font-size:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .suggest-preview-text.clickable .view-line{z-index:1}.monaco-editor .ghost-text-decoration.clickable,.monaco-editor .ghost-text-decoration-preview.clickable,.monaco-editor .suggest-preview-text.clickable .ghost-text{cursor:pointer}.monaco-editor .inline-completion-text-to-replace{text-underline-position:under;text-decoration:underline}:is(.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text).syntax-highlighted{opacity:.7}:is(.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text):not(.syntax-highlighted){color:var(--vscode-editorGhostText-foreground)}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border)}.monaco-editor .ghost-text-decoration.warning,.monaco-editor .ghost-text-decoration-preview.warning,.monaco-editor .suggest-preview-text .ghost-text.warning{background:var(--monaco-editor-warning-decoration) repeat-x bottom left;border-bottom:4px double var(--vscode-editorWarning-border)}.ghost-text-view-warning-widget-icon .codicon{color:var(--vscode-editorWarning-foreground)!important}.monaco-editor .edits-fadeout-decoration{opacity:var(--animation-opacity,1);background-color:var(--vscode-inlineEdit-modifiedChangedTextBackground)}.monaco-editor .sticky-widget{border-bottom:1px solid var(--vscode-editorStickyScroll-border);width:100%;box-shadow:var(--vscode-editorStickyScroll-shadow) 0 4px 2px -2px;z-index:4;margin-left:"0px";overflow:hidden;right:initial!important}.monaco-editor .sticky-widget .sticky-widget-line-numbers{float:left;background-color:var(--vscode-editorStickyScrollGutter-background)}.monaco-editor .sticky-widget.peek .sticky-widget-line-numbers{background-color:var(--vscode-peekViewEditorStickyScrollGutter-background)}.monaco-editor .sticky-widget .sticky-widget-lines-scrollable{width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:var(--vscode-editorStickyScroll-background);display:inline-block;position:absolute;overflow:hidden}.monaco-editor .sticky-widget.peek .sticky-widget-lines-scrollable{background-color:var(--vscode-peekViewEditorStickyScroll-background)}.monaco-editor .sticky-widget .sticky-widget-lines{background-color:inherit;position:absolute}.monaco-editor .sticky-widget .sticky-line-number,.monaco-editor .sticky-widget .sticky-line-content{color:var(--vscode-editorLineNumber-foreground);white-space:nowrap;background-color:inherit;display:inline-block;position:absolute}.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-expanded,.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-collapsed{float:right;transition:var(--vscode-editorStickyScroll-foldingOpacityTransition);margin-left:2px;position:absolute}.monaco-editor .sticky-widget .sticky-line-content{width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:inherit;white-space:nowrap}.monaco-editor .sticky-widget .sticky-line-number-inner{text-align:right;display:inline-block}.monaco-editor .sticky-widget .sticky-line-content:hover{background-color:var(--vscode-editorStickyScrollHover-background);cursor:pointer}.monaco-editor .inline-edits-view-indicator{z-index:34;height:20px;color:var(--vscode-inlineEdit-gutterIndicator-primaryForeground);background-color:var(--vscode-inlineEdit-gutterIndicator-background);border:1px solid var(--vscode-inlineEdit-gutterIndicator-primaryBorder);opacity:0;border-radius:3px;align-items:center;margin:0 4px;padding:2px 10px 2px 2px;display:flex}.monaco-editor .inline-edits-view-indicator.contained{transition:opacity .2s ease-in-out .4s}.monaco-editor .inline-edits-view-indicator.visible{opacity:1}.monaco-editor .inline-edits-view-indicator.top{opacity:1}.monaco-editor .inline-edits-view-indicator.top .icon{transform:rotate(90deg)}.monaco-editor .inline-edits-view-indicator.bottom{opacity:1}.monaco-editor .inline-edits-view-indicator.bottom .icon{transform:rotate(-90deg)}.monaco-editor .inline-edits-view-indicator .icon{align-items:center;margin:0 2px;transition:transform .2s ease-in-out;display:flex;transform:none}.monaco-editor .inline-edits-view-indicator .icon .codicon{color:var(--vscode-inlineEdit-gutterIndicator-primaryForeground)}.monaco-editor .inline-edits-view-indicator .label{justify-content:center;width:100%;margin:0 2px;display:flex}.monaco-editor .inline-edits-view .editorContainer .preview .monaco-editor .view-overlays .current-line-exact{border:none}.monaco-editor .inline-edits-view .editorContainer .preview .monaco-editor .current-line-margin{border:none}.monaco-editor .inline-edits-view .editorContainer .inline-edits-view-zone.diagonal-fill{opacity:.5}.monaco-editor .strike-through{text-decoration:line-through}.monaco-editor .inlineCompletions-line-insert{background:var(--vscode-inlineEdit-modifiedChangedLineBackground)}.monaco-editor .inlineCompletions-line-delete{background:var(--vscode-inlineEdit-originalChangedLineBackground)}.monaco-editor .inlineCompletions-char-insert{background:var(--vscode-inlineEdit-modifiedChangedTextBackground);cursor:pointer}.monaco-editor .inlineCompletions-char-delete{background:var(--vscode-inlineEdit-originalChangedTextBackground)}.monaco-editor .inlineCompletions-char-delete.diff-range-empty{border-left:solid var(--vscode-inlineEdit-originalChangedTextBackground) 3px;margin-left:-1px}.monaco-editor .inlineCompletions-char-insert.diff-range-empty{border-left:solid var(--vscode-inlineEdit-modifiedChangedTextBackground) 3px}.monaco-editor .inlineCompletions-char-delete.single-line-inline{border:1px solid var(--vscode-editorHoverWidget-border);margin:-2px 0 0 -2px}.monaco-editor .inlineCompletions-char-insert.single-line-inline{border-top:1px solid var(--vscode-inlineEdit-modifiedBorder);border-bottom:1px solid var(--vscode-inlineEdit-modifiedBorder)}.monaco-editor .inlineCompletions-char-insert.single-line-inline.start{border-left:1px solid var(--vscode-inlineEdit-modifiedBorder);border-top-left-radius:4px;border-bottom-left-radius:4px}.monaco-editor .inlineCompletions-char-insert.single-line-inline.end{border-right:1px solid var(--vscode-inlineEdit-modifiedBorder);border-top-right-radius:4px;border-bottom-right-radius:4px}.monaco-editor .inlineCompletions-char-delete.single-line-inline.empty{display:none}.monaco-editor .inlineCompletions-char-insert.single-line-inline.empty{display:none}.monaco-editor .inlineCompletions.strike-through{text-decoration-thickness:1px}.monaco-editor .inlineCompletions-modified-bubble{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)}.monaco-editor .inlineCompletions-original-bubble{background:var(--vscode-inlineEdit-originalChangedTextBackground)}.monaco-editor .inlineCompletions-modified-bubble{pointer-events:none;display:inline-block}.monaco-editor .inlineCompletions-original-bubble{pointer-events:none;display:inline-block}.monaco-editor .inline-edit.ghost-text.syntax-highlighted{opacity:1!important}.monaco-editor .inline-edit.ghost-text{font-style:normal!important}.monaco-editor .inline-edit.ghost-text-decoration.syntax-highlighted{opacity:1!important}.monaco-editor .inline-edit.ghost-text-decoration{font-style:normal!important}.monaco-editor .inline-edit.ghost-text-decoration-preview.syntax-highlighted{opacity:1!important}.monaco-editor .inline-edit.ghost-text-decoration-preview{font-style:normal!important}.monaco-editor .inline-edit.suggest-preview-text .ghost-text.syntax-highlighted{opacity:1!important}.monaco-editor .inline-edit.suggest-preview-text .ghost-text{font-style:normal!important}.monaco-editor .inline-edit.modified-background.ghost-text{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)!important;display:inline-block!important}.monaco-editor .inline-edit.modified-background.ghost-text-decoration{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)!important;display:inline-block!important}.monaco-editor .inline-edit.modified-background.ghost-text-decoration-preview{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)!important;display:inline-block!important}.monaco-editor .inline-edit.modified-background.suggest-preview-text .ghost-text{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)!important;display:inline-block!important}.monaco-editor .inlineCompletions-original-lines{background:var(--vscode-editor-background)}.monaco-menu-option{color:var(--vscode-editorActionList-foreground);cursor:pointer;border-radius:3px;align-items:center;gap:4px;padding:0 4px;font-size:13px;line-height:28px;display:flex}.monaco-menu-option .monaco-keybinding-key{opacity:.7;font-size:13px}.monaco-menu-option.active{background:var(--vscode-editorActionList-focusBackground);color:var(--vscode-editorActionList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder,transparent);outline-offset:-1px}.monaco-menu-option.active .monaco-keybinding-key{color:var(--vscode-editorActionList-focusForeground)}.monaco-editor .goto-definition-link{cursor:pointer;text-decoration:underline;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor.vs .valueSetReplacement{outline:solid 2px var(--vscode-editorBracketMatch-border)}.monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}.monaco-editor .detected-link,.monaco-editor .detected-link-active{text-underline-position:under;text-decoration:underline}.monaco-editor .detected-link-active{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .scroll-editor-on-middle-click-dot{cursor:all-scroll;z-index:1;background-color:var(--vscode-editor-foreground,white);border:1px solid var(--vscode-editor-background,black);opacity:.5;border-radius:50%;width:5px;height:5px;position:absolute;transform:translate(-50%,-50%)}.monaco-editor .scroll-editor-on-middle-click-dot.hidden{display:none}.monaco-editor.scroll-editor-on-middle-click-editor *{cursor:all-scroll}.monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-selectionHighlightBorder)}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightBorder)}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightStrongBorder)}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightTextBorder)}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}.monaco-editor .parameter-hints-widget{z-index:39;cursor:default;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);flex-direction:column;line-height:1.5em;display:flex}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{flex-direction:row;max-width:440px;display:flex}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{content:"";opacity:.5;border-left:1px solid var(--vscode-editorHoverWidget-border);height:100%;display:block;position:absolute}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .monaco-scrollable-element,.monaco-editor .parameter-hints-widget .body{flex-direction:column;flex:1;min-height:100%;display:flex}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{content:"";opacity:.5;border-bottom:1px solid var(--vscode-editorHoverWidget-border);width:100%;padding-top:4px;display:block;position:absolute;left:0}.monaco-editor .parameter-hints-widget .code{font-family:var(--vscode-parameterHintsWidget-editorFontFamily), var(--vscode-parameterHintsWidget-editorFontFamilyDefault)}.monaco-editor .parameter-hints-widget .docs{white-space:pre-wrap;padding:0 10px 0 5px}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:initial}.monaco-editor .parameter-hints-widget .docs code{font-family:var(--monaco-monospace-font);background-color:var(--vscode-textCodeBlock-background);border-radius:3px;padding:0 .4em}.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source,.monaco-editor .parameter-hints-widget .docs .code{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{flex-direction:column;justify-content:flex-end;align-items:center;min-width:22px;display:none}.monaco-editor .parameter-hints-widget.multiple .controls{padding:0 2px;display:flex}.monaco-editor .parameter-hints-widget.multiple .button{cursor:pointer;background-repeat:no-repeat;width:16px;height:16px}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{text-align:center;height:12px;line-height:12px;font-family:var(--monaco-monospace-font)}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{margin-right:.5em;font-weight:700}.monaco-editor .editorPlaceholder{text-overflow:ellipsis;text-wrap:nowrap;pointer-events:none;color:var(--vscode-editor-placeholder-foreground);position:absolute;top:0;overflow:hidden}.monaco-editor .rename-box{z-index:100;color:inherit;border-radius:4px}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{border-radius:2px;width:calc(100% - 8px);padding:3px}.monaco-editor .rename-box .rename-input{width:calc(100% - 8px);padding:0}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{cursor:pointer;background-color:transparent;border:none;border-radius:5px;align-items:center;padding:3px;display:flex}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{opacity:.8;display:none}.monaco-editor .rename-box.preview .rename-label{display:inherit}.monaco-editor .unicode-highlight{border:1px solid var(--vscode-editorUnicodeHighlight-border);background-color:var(--vscode-editorUnicodeHighlight-background);box-sizing:border-box}.editor-banner{box-sizing:border-box;cursor:default;background:var(--vscode-banner-background);width:100%;height:26px;font-size:12px;display:flex;overflow:visible}.editor-banner .icon-container{flex-shrink:0;align-items:center;padding:0 6px 0 10px;display:flex}.editor-banner .icon-container.custom-icon{background-position:50%;background-repeat:no-repeat;background-size:16px;width:16px;margin:0 6px 0 10px;padding:0}.editor-banner .message-container{text-overflow:ellipsis;white-space:nowrap;align-items:center;line-height:26px;display:flex;overflow:hidden}.editor-banner .message-container p{margin-top:0;margin-bottom:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;margin:0 4px;line-height:26px}.editor-banner .message-actions-container a.monaco-button{width:inherit;margin:2px 8px;padding:0 12px}.editor-banner .message-actions-container a{margin-left:12px;padding:3px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}.monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}.floating-menu-overlay-widget{color:var(--vscode-button-foreground);background-color:var(--vscode-button-background);border:1px solid var(--vscode-contrastBorder);z-index:10;box-shadow:0 2px 8px var(--vscode-widget-shadow);border-radius:2px;align-items:center;padding:0;display:flex;overflow:hidden}.floating-menu-overlay-widget .action-item>.action-label{border-radius:2px;padding:5px;font-size:12px}.floating-menu-overlay-widget .action-item>.action-label.codicon{color:var(--vscode-button-foreground)}.floating-menu-overlay-widget .action-item>.action-label.codicon:not(.separator){padding-top:6px;padding-bottom:6px}.floating-menu-overlay-widget .action-item:first-child>.action-label{padding-left:7px}.floating-menu-overlay-widget .action-item:last-child>.action-label{padding-right:7px}.floating-menu-overlay-widget .action-item .action-label.separator{background-color:var(--vscode-menu-separatorBackground)}.monaco-editor .iPadShowKeyboard{resize:none;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) 50% no-repeat;border:4px solid #f6f6f6;border-radius:4px;width:58px;min-width:0;height:36px;min-height:0;margin:0;padding:0;position:absolute;overflow:hidden}.monaco-editor.vs-dark .iPadShowKeyboard{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) 50% no-repeat;border:4px solid #252526}.monaco-editor .tokens-inspect-widget{z-index:50;user-select:text;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);padding:10px}.monaco-editor.hc-black .tokens-inspect-widget,.monaco-editor.hc-light .tokens-inspect-widget{border-width:2px}.monaco-editor .tokens-inspect-widget .tokens-inspect-separator{background-color:var(--vscode-editorHoverWidget-border);border:0;height:1px}.monaco-editor .tokens-inspect-widget .tm-token{font-family:var(--monaco-monospace-font)}.monaco-editor .tokens-inspect-widget .tm-token-length{float:right;font-size:60%;font-weight:400}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:var(--monaco-monospace-font);text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:var(--monaco-monospace-font)}.monaco-editor{--monaco-monospace-font:"SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif}.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label,.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{clip:rect(1px, 1px, 1px, 1px);clip-path:inset(50%);width:1px;height:1px;margin:-1px;padding:0;top:0;overflow:hidden;position:absolute!important}.monaco-editor .synthetic-focus,.monaco-diff-editor .synthetic-focus,.monaco-editor [tabindex="0"]:focus,.monaco-diff-editor [tabindex="0"]:focus,.monaco-editor [tabindex="-1"]:focus,.monaco-diff-editor [tabindex="-1"]:focus,.monaco-editor button:focus,.monaco-diff-editor button:focus,.monaco-editor input[type=button]:focus,.monaco-diff-editor input[type=button]:focus,.monaco-editor input[type=checkbox]:focus,.monaco-diff-editor input[type=checkbox]:focus,.monaco-editor input[type=search]:focus,.monaco-diff-editor input[type=search]:focus,.monaco-editor input[type=text]:focus,.monaco-diff-editor input[type=text]:focus,.monaco-editor select:focus,.monaco-diff-editor select:focus,.monaco-editor textarea:focus,.monaco-diff-editor textarea:focus{outline-offset:-1px;outline-width:1px;outline-style:solid;outline-color:var(--vscode-focusBorder);opacity:1}.monaco-hover.workbench-hover{z-index:40;background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);max-width:700px;color:var(--vscode-editorHoverWidget-foreground);box-shadow:0 2px 8px var(--vscode-widget-shadow);border-radius:5px;font-size:13px;line-height:19px;position:relative;overflow:hidden}.monaco-hover.workbench-hover .monaco-action-bar .action-item .codicon{width:13px;height:13px}.monaco-hover.workbench-hover hr{border-bottom:none}.monaco-hover.workbench-hover.compact{font-size:12px}.monaco-hover.workbench-hover.compact .monaco-action-bar .action-item .codicon{width:12px;height:12px}.monaco-hover.workbench-hover.compact .hover-contents{padding:2px 8px}.workbench-hover-container.locked .monaco-hover.workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.workbench-hover-container:focus-within.locked .monaco-hover.workbench-hover{outline-color:var(--vscode-focusBorder)}.workbench-hover-pointer{z-index:41;pointer-events:none;position:absolute}.workbench-hover-pointer:after{content:"";background-color:var(--vscode-editorHoverWidget-background);border-right:1px solid var(--vscode-editorHoverWidget-border);border-bottom:1px solid var(--vscode-editorHoverWidget-border);width:5px;height:5px;position:absolute}.workbench-hover-container:not(:focus-within).locked .workbench-hover-pointer:after{border-bottom-width:2px;border-right-width:2px;width:4px;height:4px}.workbench-hover-container:focus-within .workbench-hover-pointer:after{border-right:1px solid var(--vscode-focusBorder);border-bottom:1px solid var(--vscode-focusBorder)}.workbench-hover-pointer.left{left:-3px}.workbench-hover-pointer.right{right:3px}.workbench-hover-pointer.top{top:-3px}.workbench-hover-pointer.bottom{bottom:3px}.workbench-hover-pointer.left:after{transform:rotate(135deg)}.workbench-hover-pointer.right:after{transform:rotate(315deg)}.workbench-hover-pointer.top:after{transform:rotate(225deg)}.workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-hover.workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-hover.workbench-hover a:focus{outline-offset:-1px;outline:1px solid;outline-color:var(--vscode-focusBorder);text-decoration:underline}.monaco-hover.workbench-hover a.codicon:focus,.monaco-hover.workbench-hover a.monaco-button:focus{text-decoration:none}.monaco-hover.workbench-hover a:hover,.monaco-hover.workbench-hover a:active{color:var(--vscode-textLink-activeForeground)}.monaco-hover.workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-hover.workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-hover.workbench-hover.right-aligned{left:1px}.monaco-hover.workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-hover.workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-left:16px;margin-right:0}.context-view{position:absolute}.context-view.fixed{all:initial;color:inherit;font-family:inherit;font-size:13px;position:fixed}.quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight,.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight,.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight,.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight,.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight,.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{color:#555;background-color:rgba(221,221,221,.4);border:1px solid rgba(204,204,204,.4);border-bottom-color:rgba(187,187,187,.4);box-shadow:inset 0 -1px rgba(187,187,187,.4)}.hc-black .monaco-keybinding>.monaco-keybinding-key{box-shadow:none;color:#fff;background-color:transparent;border:1px solid #6fc3df}.hc-light .monaco-keybinding>.monaco-keybinding-key{box-shadow:none;color:#292929;background-color:transparent;border:1px solid #0f4a85}.vs-dark .monaco-keybinding>.monaco-keybinding-key{color:#ccc;background-color:rgba(128,128,128,.17);border:1px solid rgba(51,51,51,.6);border-bottom-color:rgba(68,68,68,.6);box-shadow:inset 0 -1px rgba(68,68,68,.6)}.quick-input-widget{z-index:2550;-webkit-app-region:no-drag;border-radius:6px;width:600px;position:absolute;left:50%}.quick-input-titlebar{cursor:grab;border-top-left-radius:5px;border-top-right-radius:5px;align-items:center;display:flex}.quick-input-left-action-bar{flex:1;margin-left:4px;display:flex}.quick-input-inline-action-bar>.actions-container>.action-item:first-child{margin-left:5px}.quick-input-inline-action-bar>.actions-container>.action-item{margin-top:2px}.quick-input-title{cursor:grab;text-align:center;text-overflow:ellipsis;padding:3px 0;overflow:hidden}.quick-input-right-action-bar{flex:1;margin-right:4px;display:flex}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-right-action-bar>.actions-container>.action-item{margin-left:4px}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:50%;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{flex:1;margin:4px 2px}.quick-input-header{cursor:grab;padding:6px 6px 2px;display:flex}.quick-input-widget.hidden-input .quick-input-header{margin-bottom:0;padding:0}.quick-input-and-message{flex-direction:column;flex-grow:1;min-width:0;display:flex;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-widget .quick-input-header .monaco-checkbox{margin-top:6px}.quick-input-filter{flex-grow:1;display:flex;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{position:absolute;left:-10000px}.quick-input-count{align-self:center;align-items:center;display:flex;position:absolute;right:4px}.quick-input-count .monaco-count-badge{vertical-align:middle;border-radius:2px;min-height:auto;padding:2px 4px;line-height:normal}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{align-items:center;height:25px;padding:0 6px;font-size:11px;display:flex}.quick-input-message{overflow-wrap:break-word;margin-top:-1px;padding:5px}.quick-input-message>.codicon{vertical-align:text-bottom;margin:0 .2em}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{max-height:440px;padding-bottom:5px;overflow:hidden}.quick-input-list .monaco-scrollable-element{padding:0 6px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;padding:0 6px;display:flex;overflow:hidden}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-style:solid;border-top-width:1px}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{flex:1;height:100%;display:flex;overflow:hidden}.quick-input-widget .monaco-checkbox{margin-right:0}.quick-input-widget .quick-input-list .monaco-checkbox,.quick-input-widget .quick-input-tree .monaco-checkbox{margin-top:4px}.quick-input-list .quick-input-list-icon{background-position:0;background-repeat:no-repeat;background-size:16px;justify-content:center;align-items:center;width:16px;height:22px;padding-right:6px;display:flex}.quick-input-list .quick-input-list-rows{text-overflow:ellipsis;flex-direction:column;flex:1;height:100%;margin-left:5px;display:flex;overflow:hidden}.quick-input-list .quick-input-list-rows>.quick-input-list-row{align-items:center;display:flex}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{opacity:.7;text-overflow:ellipsis;line-height:normal;overflow:hidden}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{background-color:unset;font-weight:700;color:var(--vscode-list-highlightForeground)!important}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{flex:0;display:flex;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-list .quick-input-list-entry-action-bar{margin-top:1px;margin-right:4px}.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list>.monaco-list:focus .monaco-list-row.focused{outline-offset:-1px;outline:1px solid var(--vscode-list-focusOutline)!important}.quick-input-list>.monaco-list:focus .monaco-list-row.focused .quick-input-list-entry.quick-input-list-separator-border{border-color:transparent}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:0 0}.quick-input-list .quick-input-list-separator-as-item{padding:4px 6px;font-size:12px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}.quick-input-tree .monaco-list{max-height:440px;padding-bottom:5px;overflow:hidden}.quick-input-tree .quick-input-tree-entry{box-sizing:border-box;padding:0 6px;display:flex;overflow:hidden}.quick-input-tree .quick-input-tree-label{flex:1;height:100%;display:flex;overflow:hidden}.quick-input-tree .quick-input-tree-icon{background-position:0;background-repeat:no-repeat;background-size:16px;justify-content:center;align-items:center;width:16px;height:22px;padding-right:6px;display:flex}.quick-input-tree .quick-input-tree-rows{text-overflow:ellipsis;flex-direction:column;flex:1;height:100%;margin-left:5px;display:flex;overflow:hidden}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row{align-items:center;display:flex}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .monaco-icon-label,.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-tree .quick-input-tree-rows .monaco-highlighted-label>span{opacity:1}.quick-input-tree .quick-input-tree-entry-action-bar{flex:0;display:flex;overflow:visible}.quick-input-tree .quick-input-tree-entry-action-bar .action-label{display:none}.quick-input-tree .quick-input-tree-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-tree .quick-input-tree-entry-action-bar{margin-top:1px;margin-right:4px}.quick-input-tree .quick-input-tree-entry .quick-input-tree-entry-action-bar .action-label.always-visible,.quick-input-tree .quick-input-tree-entry:hover .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .quick-input-tree-entry.focus-inside .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .monaco-list-row.focused .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .monaco-list-row.passive-focused .quick-input-tree-entry-action-bar .action-label{display:flex}.quick-input-tree>.monaco-list:focus .monaco-list-row.focused{outline-offset:-1px;outline:1px solid var(--vscode-list-focusOutline)!important}.monaco-progress-container{width:100%;height:2px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:2px;display:none;position:absolute;left:0}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{transition:width .1s linear;left:0}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-timing-function:linear;animation-iteration-count:infinite;transform:translate(0,0)}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100,end)}@keyframes progress{0%{transform:translate(0%)scaleX(1)}50%{transform:translate(2500%)scaleX(3)}to{transform:translate(4900%)scaleX(1)}}.monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);vertical-align:middle;border-radius:3px;padding:1px 3px}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}.monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);width:100%;height:100%;position:relative;overflow-y:hidden}.monaco-component.multiDiffEditor>div{width:100%;height:100%;position:absolute;top:0;left:0}.monaco-component.multiDiffEditor>div.placeholder{visibility:hidden}.monaco-component.multiDiffEditor>div.placeholder.visible{visibility:visible}.monaco-component.multiDiffEditor>div.placeholder{place-content:center;place-items:center;display:grid}.monaco-component.multiDiffEditor .active{--vscode-multiDiffEditor-border:var(--vscode-focusBorder)}.monaco-component.multiDiffEditor .multiDiffEntry{flex-direction:column;flex:1;display:flex;overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button{cursor:pointer;margin:0 5px}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button a{display:block}.monaco-component.multiDiffEditor .multiDiffEntry .header{z-index:1000;background:var(--vscode-editor-background)}.monaco-component.multiDiffEditor .multiDiffEntry .header:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content{border-top:1px solid var(--vscode-multiDiffEditor-border);color:var(--vscode-foreground);background:var(--vscode-multiDiffEditor-headerBackground);align-items:center;margin:8px 0 0;padding:4px 5px;display:flex}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0px 6px 6px -6px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path{flex:1;min-width:0;display:flex}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title{font-size:14px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title.original{text-overflow:ellipsis;flex:1;min-width:0}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .status{opacity:.75;margin:0 10px;font-weight:600;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .actions{padding:0 8px}.monaco-component.multiDiffEditor .multiDiffEntry .editorParent{border-bottom:1px solid var(--vscode-multiDiffEditor-border);flex-direction:column;flex:1;display:flex;overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .editorContainer{flex:1}\n/*$vite$:1*/',document.head.appendChild(o),s="pseudo"===Wae()||"undefined"!=typeof document&&document.location&&"string"==typeof document.location.hash&&document.location.hash.indexOf("pseudo=true")>=0,r=window,(a=l=class{constructor(){this.mapWindowIdToZoomFactor=new Map}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}}).INSTANCE=new a,d=navigator.userAgent,c=d.indexOf("Firefox")>=0,h=d.indexOf("AppleWebKit")>=0,u=d.indexOf("Chrome")>=0,g=!u&&d.indexOf("Safari")>=0,p=!u&&!g&&h,d.indexOf("Electron/"),m=d.indexOf("Android")>=0,f=!1,"function"==typeof r.matchMedia){const e=r.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=r.matchMedia("(display-mode: fullscreen)");f=e.matches,Uae(r,e,({matches:e})=>{f&&t.matches||(f=e)})}if(_=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{if(e.stack){if(C.isErrorNoTelemetry(e))throw new C(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},b="Canceled",v=class extends Error{constructor(){super(b),this.name=this.message}},w=class extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}},C=class e extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(t){if(t instanceof e)return t;const i=new e;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}},y=class e extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,e.prototype)}},S=!1,x=!1,k=!1,L=!1,D=!1,I=!1,N=!1,E="en",M=void 0,T=globalThis,R=void 0,void 0!==T.vscode&&void 0!==T.vscode.process?R=T.vscode.process:"undefined"!=typeof process&&"string"==typeof process?.versions?.node&&(R=process),O="string"==typeof R?.versions?.electron&&"renderer"===R?.type,"object"==typeof R){S="win32"===R.platform,x="darwin"===R.platform,(k="linux"===R.platform)&&R.env.SNAP&&R.env.SNAP_REVISION,R.env.CI||R.env.BUILD_ARTIFACTSTAGINGDIRECTORY||R.env.GITHUB_WORKSPACE,E="en";const e=R.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e);t.userLocale,t.osLocale,E=t.resolvedLanguage||"en",t.languagePack}catch(Fae){}L=!0}else"object"!=typeof navigator||O?console.error("Unable to resolve platform."):(M=navigator.userAgent,S=M.indexOf("Windows")>=0,x=M.indexOf("Macintosh")>=0,I=(M.indexOf("Macintosh")>=0||M.indexOf("iPad")>=0||M.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,k=M.indexOf("Linux")>=0,N=M?.indexOf("Mobi")>=0,D=!0,E=Wae()||"en",navigator.language.toLowerCase());A=0,x?A=1:S?A=3:k&&(A=2),P=S,F=x,W=k,B=L,V=D,H=D&&"function"==typeof T.importScripts,z=H?T.origin:void 0,U=I,K=N,q=A,j=M,$=E,G="function"==typeof T.postMessage&&!T.importScripts,Z=(()=>{if(G){const e=[];T.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i<n;i++){const n=e[i];if(n.id===t.data.vscodeScheduleAsyncWork)return e.splice(i,1),void n.callback()}});let t=0;return i=>{const n=++t;e.push({id:n,callback:i}),T.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),Y=x||I?2:S?1:3,Q=!0,X=!1,J=!!(j&&j.indexOf("Chrome")>=0),ee=!!(j&&j.indexOf("Firefox")>=0),te=!!(!J&&j&&j.indexOf("Safari")>=0),ie=!!(j&&j.indexOf("Edg/")>=0),ne=!!(j&&j.indexOf("Android")>=0),oe={clipboard:{writeText:B||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:B||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:r.PointerEvent&&("ontouchstart"in r||navigator.maxTouchPoints>0)},re=new(se=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}),ae=new se,le=new se,de=new Array(230),ce=Object.create(null),he=Object.create(null),ue=[];for(let e=0;e<=193;e++)ue[e]=-1;if(function(){const e="",t=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",e,e],[1,1,"Hyper",0,e,0,e,e,e],[1,2,"Super",0,e,0,e,e,e],[1,3,"Fn",0,e,0,e,e,e],[1,4,"FnLock",0,e,0,e,e,e],[1,5,"Suspend",0,e,0,e,e,e],[1,6,"Resume",0,e,0,e,e,e],[1,7,"Turbo",0,e,0,e,e,e],[1,8,"Sleep",0,e,0,"VK_SLEEP",e,e],[1,9,"WakeUp",0,e,0,e,e,e],[0,10,"KeyA",31,"A",65,"VK_A",e,e],[0,11,"KeyB",32,"B",66,"VK_B",e,e],[0,12,"KeyC",33,"C",67,"VK_C",e,e],[0,13,"KeyD",34,"D",68,"VK_D",e,e],[0,14,"KeyE",35,"E",69,"VK_E",e,e],[0,15,"KeyF",36,"F",70,"VK_F",e,e],[0,16,"KeyG",37,"G",71,"VK_G",e,e],[0,17,"KeyH",38,"H",72,"VK_H",e,e],[0,18,"KeyI",39,"I",73,"VK_I",e,e],[0,19,"KeyJ",40,"J",74,"VK_J",e,e],[0,20,"KeyK",41,"K",75,"VK_K",e,e],[0,21,"KeyL",42,"L",76,"VK_L",e,e],[0,22,"KeyM",43,"M",77,"VK_M",e,e],[0,23,"KeyN",44,"N",78,"VK_N",e,e],[0,24,"KeyO",45,"O",79,"VK_O",e,e],[0,25,"KeyP",46,"P",80,"VK_P",e,e],[0,26,"KeyQ",47,"Q",81,"VK_Q",e,e],[0,27,"KeyR",48,"R",82,"VK_R",e,e],[0,28,"KeyS",49,"S",83,"VK_S",e,e],[0,29,"KeyT",50,"T",84,"VK_T",e,e],[0,30,"KeyU",51,"U",85,"VK_U",e,e],[0,31,"KeyV",52,"V",86,"VK_V",e,e],[0,32,"KeyW",53,"W",87,"VK_W",e,e],[0,33,"KeyX",54,"X",88,"VK_X",e,e],[0,34,"KeyY",55,"Y",89,"VK_Y",e,e],[0,35,"KeyZ",56,"Z",90,"VK_Z",e,e],[0,36,"Digit1",22,"1",49,"VK_1",e,e],[0,37,"Digit2",23,"2",50,"VK_2",e,e],[0,38,"Digit3",24,"3",51,"VK_3",e,e],[0,39,"Digit4",25,"4",52,"VK_4",e,e],[0,40,"Digit5",26,"5",53,"VK_5",e,e],[0,41,"Digit6",27,"6",54,"VK_6",e,e],[0,42,"Digit7",28,"7",55,"VK_7",e,e],[0,43,"Digit8",29,"8",56,"VK_8",e,e],[0,44,"Digit9",30,"9",57,"VK_9",e,e],[0,45,"Digit0",21,"0",48,"VK_0",e,e],[1,46,"Enter",3,"Enter",13,"VK_RETURN",e,e],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",e,e],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",e,e],[1,49,"Tab",2,"Tab",9,"VK_TAB",e,e],[1,50,"Space",10,"Space",32,"VK_SPACE",e,e],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,e,0,e,e,e],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",e,e],[1,64,"F1",59,"F1",112,"VK_F1",e,e],[1,65,"F2",60,"F2",113,"VK_F2",e,e],[1,66,"F3",61,"F3",114,"VK_F3",e,e],[1,67,"F4",62,"F4",115,"VK_F4",e,e],[1,68,"F5",63,"F5",116,"VK_F5",e,e],[1,69,"F6",64,"F6",117,"VK_F6",e,e],[1,70,"F7",65,"F7",118,"VK_F7",e,e],[1,71,"F8",66,"F8",119,"VK_F8",e,e],[1,72,"F9",67,"F9",120,"VK_F9",e,e],[1,73,"F10",68,"F10",121,"VK_F10",e,e],[1,74,"F11",69,"F11",122,"VK_F11",e,e],[1,75,"F12",70,"F12",123,"VK_F12",e,e],[1,76,"PrintScreen",0,e,0,e,e,e],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",e,e],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",e,e],[1,79,"Insert",19,"Insert",45,"VK_INSERT",e,e],[1,80,"Home",14,"Home",36,"VK_HOME",e,e],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",e,e],[1,82,"Delete",20,"Delete",46,"VK_DELETE",e,e],[1,83,"End",13,"End",35,"VK_END",e,e],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",e,e],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",e],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",e],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",e],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",e],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",e,e],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",e,e],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",e,e],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",e,e],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",e,e],[1,94,"NumpadEnter",3,e,0,e,e,e],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",e,e],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",e,e],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",e,e],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",e,e],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",e,e],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",e,e],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",e,e],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",e,e],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",e,e],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",e,e],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",e,e],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",e,e],[1,107,"ContextMenu",58,"ContextMenu",93,e,e,e],[1,108,"Power",0,e,0,e,e,e],[1,109,"NumpadEqual",0,e,0,e,e,e],[1,110,"F13",71,"F13",124,"VK_F13",e,e],[1,111,"F14",72,"F14",125,"VK_F14",e,e],[1,112,"F15",73,"F15",126,"VK_F15",e,e],[1,113,"F16",74,"F16",127,"VK_F16",e,e],[1,114,"F17",75,"F17",128,"VK_F17",e,e],[1,115,"F18",76,"F18",129,"VK_F18",e,e],[1,116,"F19",77,"F19",130,"VK_F19",e,e],[1,117,"F20",78,"F20",131,"VK_F20",e,e],[1,118,"F21",79,"F21",132,"VK_F21",e,e],[1,119,"F22",80,"F22",133,"VK_F22",e,e],[1,120,"F23",81,"F23",134,"VK_F23",e,e],[1,121,"F24",82,"F24",135,"VK_F24",e,e],[1,122,"Open",0,e,0,e,e,e],[1,123,"Help",0,e,0,e,e,e],[1,124,"Select",0,e,0,e,e,e],[1,125,"Again",0,e,0,e,e,e],[1,126,"Undo",0,e,0,e,e,e],[1,127,"Cut",0,e,0,e,e,e],[1,128,"Copy",0,e,0,e,e,e],[1,129,"Paste",0,e,0,e,e,e],[1,130,"Find",0,e,0,e,e,e],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",e,e],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",e,e],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",e,e],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",e,e],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",e,e],[1,136,"KanaMode",0,e,0,e,e,e],[0,137,"IntlYen",0,e,0,e,e,e],[1,138,"Convert",0,e,0,e,e,e],[1,139,"NonConvert",0,e,0,e,e,e],[1,140,"Lang1",0,e,0,e,e,e],[1,141,"Lang2",0,e,0,e,e,e],[1,142,"Lang3",0,e,0,e,e,e],[1,143,"Lang4",0,e,0,e,e,e],[1,144,"Lang5",0,e,0,e,e,e],[1,145,"Abort",0,e,0,e,e,e],[1,146,"Props",0,e,0,e,e,e],[1,147,"NumpadParenLeft",0,e,0,e,e,e],[1,148,"NumpadParenRight",0,e,0,e,e,e],[1,149,"NumpadBackspace",0,e,0,e,e,e],[1,150,"NumpadMemoryStore",0,e,0,e,e,e],[1,151,"NumpadMemoryRecall",0,e,0,e,e,e],[1,152,"NumpadMemoryClear",0,e,0,e,e,e],[1,153,"NumpadMemoryAdd",0,e,0,e,e,e],[1,154,"NumpadMemorySubtract",0,e,0,e,e,e],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",e,e],[1,156,"NumpadClearEntry",0,e,0,e,e,e],[1,0,e,5,"Ctrl",17,"VK_CONTROL",e,e],[1,0,e,4,"Shift",16,"VK_SHIFT",e,e],[1,0,e,6,"Alt",18,"VK_MENU",e,e],[1,0,e,57,"Meta",91,"VK_COMMAND",e,e],[1,157,"ControlLeft",5,e,0,"VK_LCONTROL",e,e],[1,158,"ShiftLeft",4,e,0,"VK_LSHIFT",e,e],[1,159,"AltLeft",6,e,0,"VK_LMENU",e,e],[1,160,"MetaLeft",57,e,0,"VK_LWIN",e,e],[1,161,"ControlRight",5,e,0,"VK_RCONTROL",e,e],[1,162,"ShiftRight",4,e,0,"VK_RSHIFT",e,e],[1,163,"AltRight",6,e,0,"VK_RMENU",e,e],[1,164,"MetaRight",57,e,0,"VK_RWIN",e,e],[1,165,"BrightnessUp",0,e,0,e,e,e],[1,166,"BrightnessDown",0,e,0,e,e,e],[1,167,"MediaPlay",0,e,0,e,e,e],[1,168,"MediaRecord",0,e,0,e,e,e],[1,169,"MediaFastForward",0,e,0,e,e,e],[1,170,"MediaRewind",0,e,0,e,e,e],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",e,e],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",e,e],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",e,e],[1,174,"Eject",0,e,0,e,e,e],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",e,e],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",e,e],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",e,e],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",e,e],[1,179,"LaunchApp1",0,e,0,"VK_MEDIA_LAUNCH_APP1",e,e],[1,180,"SelectTask",0,e,0,e,e,e],[1,181,"LaunchScreenSaver",0,e,0,e,e,e],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",e,e],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",e,e],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",e,e],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",e,e],[1,186,"BrowserStop",0,e,0,"VK_BROWSER_STOP",e,e],[1,187,"BrowserRefresh",0,e,0,"VK_BROWSER_REFRESH",e,e],[1,188,"BrowserFavorites",0,e,0,"VK_BROWSER_FAVORITES",e,e],[1,189,"ZoomToggle",0,e,0,e,e,e],[1,190,"MailReply",0,e,0,e,e,e],[1,191,"MailForward",0,e,0,e,e,e],[1,192,"MailSend",0,e,0,e,e,e],[1,0,e,114,"KeyInComposition",229,e,e,e],[1,0,e,116,"ABNT_C2",194,"VK_ABNT_C2",e,e],[1,0,e,96,"OEM_8",223,"VK_OEM_8",e,e],[1,0,e,0,e,0,"VK_KANA",e,e],[1,0,e,0,e,0,"VK_HANGUL",e,e],[1,0,e,0,e,0,"VK_JUNJA",e,e],[1,0,e,0,e,0,"VK_FINAL",e,e],[1,0,e,0,e,0,"VK_HANJA",e,e],[1,0,e,0,e,0,"VK_KANJI",e,e],[1,0,e,0,e,0,"VK_CONVERT",e,e],[1,0,e,0,e,0,"VK_NONCONVERT",e,e],[1,0,e,0,e,0,"VK_ACCEPT",e,e],[1,0,e,0,e,0,"VK_MODECHANGE",e,e],[1,0,e,0,e,0,"VK_SELECT",e,e],[1,0,e,0,e,0,"VK_PRINT",e,e],[1,0,e,0,e,0,"VK_EXECUTE",e,e],[1,0,e,0,e,0,"VK_SNAPSHOT",e,e],[1,0,e,0,e,0,"VK_HELP",e,e],[1,0,e,0,e,0,"VK_APPS",e,e],[1,0,e,0,e,0,"VK_PROCESSKEY",e,e],[1,0,e,0,e,0,"VK_PACKET",e,e],[1,0,e,0,e,0,"VK_DBE_SBCSCHAR",e,e],[1,0,e,0,e,0,"VK_DBE_DBCSCHAR",e,e],[1,0,e,0,e,0,"VK_ATTN",e,e],[1,0,e,0,e,0,"VK_CRSEL",e,e],[1,0,e,0,e,0,"VK_EXSEL",e,e],[1,0,e,0,e,0,"VK_EREOF",e,e],[1,0,e,0,e,0,"VK_PLAY",e,e],[1,0,e,0,e,0,"VK_ZOOM",e,e],[1,0,e,0,e,0,"VK_NONAME",e,e],[1,0,e,0,e,0,"VK_PA1",e,e],[1,0,e,0,e,0,"VK_OEM_CLEAR",e,e]],i=[],n=[];for(const o of t){const[e,t,s,r,a,l,d,c,h]=o;if(n[t]||(n[t]=!0,ce[s]=t,he[s.toLowerCase()]=t,e&&(ue[t]=r)),!i[r]){if(i[r]=!0,!a)throw new Error(`String representation missing for key code ${r} around scan code ${s}`);re.define(r,a),ae.define(r,c||a),le.define(r,h||c||a)}l&&(de[l]=r)}}(),function(e){e.toString=function(e){return re.keyCodeToStr(e)},e.fromString=function(e){return re.strToKeyCode(e)},e.toUserSettingsUS=function(e){return ae.keyCodeToStr(e)},e.toUserSettingsGeneral=function(e){return le.keyCodeToStr(e)},e.fromUserSettings=function(e){return ae.strToKeyCode(e)||le.strToKeyCode(e)},e.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return re.keyCodeToStr(e)}}(ge||(ge={})),pe=class e{constructor(e,t,i,n,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=o}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}},me=class{constructor(e){if(0===e.length)throw Qae("chords");this.chords=e}},fe=class{constructor(e,t,i,n,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=o,this.keyAriaLabel=s}},_e=class{},be=F?256:2048,ve=F?2048:256,we=class{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=function(e){if(e.charCode){const t=String.fromCharCode(e.charCode).toUpperCase();return ge.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(c)switch(t){case 59:return 85;case 60:if(W)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(F)return 57}else if(h){if(F&&93===t)return 57;if(!F&&92===t)return 57}return de[t]||0}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=be),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=ve),t|=e,t}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new pe(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Ce=new WeakMap,ye=class{static getSameOriginWindowChain(e){let t=Ce.get(e);if(!t){t=[],Ce.set(e,t);let i,n=e;do{i=yle(n),i?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=i}while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0;const o=this.getSameOriginWindowChain(e);for(const s of o){const e=s.window.deref();if(i+=e?.scrollY??0,n+=e?.scrollX??0,e===t)break;if(!s.iframeElement)break;const o=s.iframeElement.getBoundingClientRect();i+=o.top,n+=o.left}return{top:i,left:n}}},Se=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=0===t.button,this.middleButton=1===t.button,this.rightButton=2===t.button,this.buttons=t.buttons,this.defaultPrevented=t.defaultPrevented,this.target=t.target,this.detail=t.detail||1,"dblclick"===t.type&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,"number"==typeof t.pageX?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const i=ye.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},xe=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let n=!1;if(u){const e=navigator.userAgent.match(/Chrome\/(\d+)/);n=(e?parseInt(e[1]):123)<=122}if(e){const t=e,i=e,o=e.view?.devicePixelRatio||1;if(void 0!==t.wheelDeltaY)this.deltaY=n?t.wheelDeltaY/(120*o):t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaY=c&&!F?-e.deltaY/3:-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)this.deltaX=g&&P?-t.wheelDeltaX/120:n?t.wheelDeltaX/(120*o):t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaX=c&&!F?-e.deltaX/3:-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=n?e.wheelDelta/(120*o):e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},function(e){function t(e){return!!e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function*n(e){yield e}e.empty=function(){return i},e.single=n,e.wrap=function(e){return t(e)?e:n(e)},e.from=function(e){return e||i},e.reverse=function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){let i=0;for(const n of e)if(t(n,i++))return!0;return!1},e.every=function(e,t){let i=0;for(const n of e)if(!t(n,i++))return!1;return!0},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(const n of e)yield t(n,i++)},e.flatMap=function*(e,t){let i=0;for(const n of e)yield*t(n,i++)},e.concat=function*(...e){for(const t of e)dle(t)?yield*t:yield t},e.reduce=function(e,t,i){let n=i;for(const o of e)n=t(n,o);return n},e.length=function(e){let t=0;for(const i of e)t++;return t},e.slice=function*(e,t,i=e.length){for(t<-e.length&&(t=0),t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t<i;t++)yield e[t]},e.consume=function(t,i=Number.POSITIVE_INFINITY){const n=[];if(0===i)return[n,t];const o=t[Symbol.iterator]();for(let s=0;s<i;s++){const t=o.next();if(t.done)return[n,e.empty()];n.push(t.value)}return[n,{[Symbol.iterator]:()=>o}]},e.asyncToArray=async function(e){const t=[];for await(const i of e)t.push(i);return t},e.asyncToArrayFlat=async function(e){let t=[];for await(const i of e)t=t.concat(i);return t}}(ke||(ke={})),Le=class{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}},(De=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{kle(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t||t===Ie.None)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}}).DISABLE_DISPOSED_WARNING=!1,(Ie=class{constructor(){this._store=new De,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}).None=Object.freeze({dispose(){}}),Ne=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},Ee=class{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return 0===--this._counter&&this._disposable.dispose(),this}},Me=class{constructor(e){this.object=e}dispose(){}},Te=class{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{kle(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||this._store.get(e)?.dispose(),this._store.set(e,t)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}},(Re=Oe=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}}).Undefined=new Re(void 0),Ae=class{constructor(){this._first=Oe.Undefined,this._last=Oe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Oe.Undefined}clear(){let e=this._first;for(;e!==Oe.Undefined;){const t=e.next;e.prev=Oe.Undefined,e.next=Oe.Undefined,e=t}this._first=Oe.Undefined,this._last=Oe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new Oe(e);if(this._first===Oe.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==Oe.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Oe.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Oe.Undefined&&e.next!==Oe.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Oe.Undefined&&e.next===Oe.Undefined?(this._first=Oe.Undefined,this._last=Oe.Undefined):e.next===Oe.Undefined?(this._last=this._last.prev,this._last.next=Oe.Undefined):e.prev===Oe.Undefined&&(this._first=this._first.next,this._first.prev=Oe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Oe.Undefined;)yield e.element,e=e.next}},Pe=globalThis.performance.now.bind(globalThis.performance),Fe=class e{static create(t){return new e(t)}constructor(e){this._now=!1===e?Date.now:Pe,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}},function(e){function t(e){return(t,i=null,n)=>{let o,s=!1;return o=e(e=>{if(!s)return o?o.dispose():s=!0,t.call(i,e)},null,n),s&&o.dispose(),o}}function i(e,t,i){return o((i,n=null,o)=>e(e=>i.call(n,t(e)),null,o),i)}function n(e,t,i){return o((i,n=null,o)=>e(e=>t(e)&&i.call(n,e),null,o),i)}function o(e,t){let i;const n=new je({onWillAddFirstListener(){i=e(n.fire,n)},onDidRemoveLastListener(){i?.dispose()}});return t?.add(n),n.event}function s(e,t,i=100,n=!1,o=!1,s,r){let a,l,d,c,h=0;const u=new je({leakWarningThreshold:s,onWillAddFirstListener(){a=e(e=>{h++,l=t(l,e),n&&!d&&(u.fire(l),l=void 0),c=()=>{const e=l;l=void 0,d=void 0,(!n||h>1)&&u.fire(e),h=0},"number"==typeof i?(d&&clearTimeout(d),d=setTimeout(c,i)):void 0===d&&(d=null,queueMicrotask(c))})},onWillRemoveListener(){o&&h>0&&c?.()},onDidRemoveLastListener(){c=void 0,a.dispose()}});return r?.add(u),u.event}e.None=()=>Ie.None,e.defer=function(e,t){return s(e,()=>{},0,void 0,!0,void 0,t)},e.once=t,e.onceIf=function(t,i){return e.once(e.filter(t,i))},e.map=i,e.forEach=function(e,t,i){return o((i,n=null,o)=>e(e=>{t(e),i.call(n,e)},null,o),i)},e.filter=n,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>{return o=Lle(...e.map(e=>e(e=>t.call(i,e)))),(s=n)instanceof Array?s.push(o):s&&s.add(o),o;var o,s}},e.reduce=function(e,t,n,o){let s=n;return i(e,e=>(s=t(s,e),s),o)},e.debounce=s,e.accumulate=function(t,i=0,n){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],i,void 0,!0,void 0,n)},e.latch=function(e,t=(e,t)=>e===t,i){let o,s=!0;return n(e,e=>{const i=s||!t(e,o);return s=!1,o=e,i},i)},e.split=function(t,i,n){return[e.filter(t,i,n),e.filter(t,e=>!i(e),n)]},e.buffer=function(e,t=!1,i=[],n){let o=i.slice(),s=e(e=>{o?o.push(e):a.fire(e)});n&&n.add(s);const r=()=>{o?.forEach(e=>a.fire(e)),o=null},a=new je({onWillAddFirstListener(){s||(s=e(e=>a.fire(e)),n&&n.add(s))},onDidAddFirstListener(){o&&(t?setTimeout(r):r())},onDidRemoveLastListener(){s&&s.dispose(),s=null}});return n&&n.add(a),a.event},e.chain=function(e,t){return(i,n,o)=>{const s=t(new a);return e(function(e){const t=s.evaluate(e);t!==r&&i.call(n,t)},void 0,o)}};const r=Symbol("HaltChainable");class a{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:r),this}reduce(e,t){let i=t;return this.steps.push(t=>(i=e(i,t),i)),this}latch(e=(e,t)=>e===t){let t,i=!0;return this.steps.push(n=>{const o=i||!e(n,t);return i=!1,t=n,o?n:r}),this}evaluate(e){for(const t of this.steps)if((e=t(e))===r)break;return e}}e.fromNodeEventEmitter=function(e,t,i=e=>e){const n=(...e)=>o.fire(i(...e)),o=new je({onWillAddFirstListener:()=>e.on(t,n),onDidRemoveLastListener:()=>e.removeListener(t,n)});return o.event},e.fromDOMEventEmitter=function(e,t,i=e=>e){const n=(...e)=>o.fire(i(...e)),o=new je({onWillAddFirstListener:()=>e.addEventListener(t,n),onDidRemoveLastListener:()=>e.removeEventListener(t,n)});return o.event},e.toPromise=function(e,i){let n;const o=new Promise((o,s)=>{const r=t(e)(o,null,i);n=()=>r.dispose()});return o.cancel=n,o},e.forward=function(e,t){return e(e=>t.fire(e))},e.runAndSubscribe=function(e,t,i){return t(i),e(e=>t(e))};class l{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1,this.emitter=new je({onWillAddFirstListener:()=>{e.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{e.removeObserver(this)}}),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,t){return new l(e,t).emitter.event},e.fromObservableLight=function(e){return(t,i,n)=>{let o=0,s=!1;const r={beginUpdate(){o++},endUpdate(){o--,0===o&&(e.reportChanges(),s&&(s=!1,t.call(i)))},handlePossibleChange(){},handleChange(){s=!0}};e.addObserver(r),e.reportChanges();const a={dispose(){e.removeObserver(r)}};return n instanceof De?n.add(a):Array.isArray(n)&&n.push(a),a}}}(Be||(Be={})),(We=Ve=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new Fe,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}).all=new Set,We._idPool=0,(He=class e{constructor(t,i,n=(e._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){const i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);const n=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,n+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=.5*i;const[e,n]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${n}):`;console.warn(o),console.warn(e);const s=new Ue(o,e);this._errorHandler(s)}return()=>{const t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,n]of this._stacks)(!e||t<n)&&(e=[i,n],t=n);return e}})._idPool=1,ze=class e{static create(){return new e((new Error).stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}},Ue=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},Ke=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},qe=class{constructor(e){this.value=e}},je=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new He(e?.onListenerError??$ae,this._options?.leakWarningThreshold??-1):void 0,this._perfMon=this._options?._profName?new Ve(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??(this._event=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);const t=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],i=new Ke(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||$ae)(i),Ie.None}if(this._disposed)return Ie.None;t&&(e=e.bind(t));const n=new qe(e);let o;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(n.stack=ze.create(),o=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof qe?(this._deliveryQueue??(this._deliveryQueue=new Ge),this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const s=Dle(()=>{o?.(),this._removeListener(n)});return i instanceof De?i.add(s):Array.isArray(i)&&i.push(s),s}),this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size)return this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),void(this._size=0);const t=this._listeners,i=t.indexOf(e);if(-1===i)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const n=this._deliveryQueue.current===this;if(2*this._size<=t.length){let e=0;for(let i=0;i<t.length;i++)t[i]?t[e++]=t[i]:n&&e<this._deliveryQueue.end&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;const i=this._options?.onListenerError||$ae;if(i)try{e.value(t)}catch(Fae){i(Fae)}else e.value(t)}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof qe)this._deliver(this._listeners,e);else{const t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},$e=()=>new Ge,Ge=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ze=class extends je{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Ae,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0===--this._isPaused)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}},Ye=class extends Ze{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}},Qe=class extends je{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(e=>super.fire(e)),this._queuedEvents=[]}))}},Xe=class{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new je({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Dle(Sle(()=>{this.hasListeners&&this.unhook(t);const e=this.events.indexOf(t);this.events.splice(e,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(e=>this.emitter.fire(e))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(const e of this.events)e.listener?.dispose();this.events=[]}},Je=class{constructor(){this.data=[]}wrapEvent(e,t,i){return(n,o,s)=>e(e=>{const s=this.data[this.data.length-1];if(!t)return void(s?s.buffers.push(()=>n.call(o,e)):n.call(o,e));const r=s;r?(r.items??(r.items=[]),r.items.push(e),0===r.buffers.length&&s.buffers.push(()=>{r.reducedResult??(r.reducedResult=i?r.items.reduce(t,i):r.items.reduce(t)),n.call(o,r.reducedResult)})):n.call(o,t(i,e))},void 0,s)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(e=>e()),i}},et=class{constructor(){this.listening=!1,this.inputEvent=Be.None,this.inputEventListener=Ie.None,this.emitter=new je({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}},tt=Object.freeze(function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||t instanceof nt||!(!t||"object"!=typeof t)&&"boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Be.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tt})}(it||(it={})),nt=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tt:(this._emitter||(this._emitter=new je),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},ot=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new nt),this._token}cancel(){this._token?this._token instanceof nt&&this._token.cancel():this._token=it.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof nt&&this._token.dispose():this._token=it.None}},st=Symbol("MicrotaskDelay"),lt=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new ot}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const e=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise(t=>{this.activePromise.then(e,e).then(t)})}return new Promise((e,t)=>{this.queuedPromise.then(e,t)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((e,t)=>{this.activePromise.then(t=>{this.activePromise=null,e(t)},e=>{this.activePromise=null,t(e)})})}dispose(){this.cancellationTokenSource.cancel()}},dt=(e,t)=>{let i=!0;const n=setTimeout(()=>{i=!1,t()},e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}},ct=e=>{let t=!0;return queueMicrotask(()=>{t&&(t=!1,e())}),{isTriggered:()=>t,dispose:()=>{t=!1}}},ht=class{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((e,t)=>{this.doResolve=e,this.doReject=t}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}}));const i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===st?ct(i):dt(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new v),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}},ut=class{constructor(e){this.delayer=new ht(e),this.throttler=new lt}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}},gt=class{constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){const t=new Ct;return this._pendingTasks.push({task:e,deferred:t,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),t.p}_runIfNotRunning(){void 0===this._runningTask&&this._processQueue()}async _processQueue(){if(0===this._pendingTasks.length)return;const e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new y;this._runningTask=e.task;try{const t=await e.task();e.deferred.complete(t)}catch(Fae){e.deferred.error(Fae)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){const e=this._pendingTasks;this._pendingTasks=[];for(const t of e)t.setUndefinedWhenCleared?t.deferred.complete(void 0):t.deferred.error(new v)}},pt=class{constructor(e,t){this._isDisposed=!1,this._token=void 0,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){void 0!==this._token&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,t){if(this._isDisposed)throw new y("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new y("Calling 'setIfNotSet' on a disposed TimeoutTimer");void 0===this._token&&(this._token=setTimeout(()=>{this._token=void 0,e()},t))}},mt=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new y("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();const n=i.setInterval(()=>{e()},t);this.disposable=Dle(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},ft=class{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return void 0!==this.timeoutToken}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}},function(){const e=globalThis;bt="function"!=typeof e.requestIdleCallback||"function"!=typeof e.cancelIdleCallback?(e,t,i)=>{Z(()=>{if(n)return;const e=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,e-Date.now())}))});let n=!1;return{dispose(){n||(n=!0)}}}:(e,t,i)=>{const n=e.requestIdleCallback(t,"number"==typeof i?{timeout:i}:void 0);let o=!1;return{dispose(){o||(o=!0,e.cancelIdleCallback(n))}}},_t=(e,t)=>bt(globalThis,e,t)}(),vt=class{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=bt(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}},wt=class extends vt{constructor(e){super(globalThis,e)}},Ct=class{get isRejected(){return 1===this.outcome?.outcome}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new v)}},function(e){e.settled=async function(e){let t;const i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if(void 0!==t)throw t;return i},e.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(n){i(n)}})}}(yt||(yt={})),St=class{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new y("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}{const e=new Ct;return this._unsatisfiedConsumers.push(e),e.p}}},at=Symbol.asyncIterator,(rt=xt=class e{constructor(e,t){this._onReturn=t,this._producerConsumer=new St,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async e=>(this._finishError(e),{done:!0,value:void 0})},queueMicrotask(async()=>{const t=e({emitOne:e=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:e}}),emitMany:e=>{for(const t of e)this._producerConsumer.produce({ok:!0,value:{done:!1,value:t}})},reject:e=>this._finishError(e)});if(!this._producerConsumer.hasFinalValue)try{await t,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromisesResolveOrder(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(const i of t)e.emitOne(i)}))})}static map(t,i){return new e(async e=>{for await(const n of t)e.emitOne(i(n))})}map(t){return e.map(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static filter(t,i){return new e(async e=>{for await(const n of t)i(n)&&e.emitOne(n)})}filter(t){return e.filter(this,t)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[at](){return this._iterator}}).EMPTY=rt.fromArray([]),kt=class extends xt{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}},Lt=class{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,"function"==typeof e?(this._fn=e,this._computeKey=Ale):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}},Dt=class{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,"function"==typeof e?(this._fn=e,this._computeKey=Ale):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){const t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);const i=this._fn(e);return this._map.set(e,i),this._map2.set(t,i),i}},function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Running=1]="Running",e[e.Completed=2]="Completed"}(It||(It={})),Nt=class{constructor(e){this.executor=e,this._state=It.Uninitialized}get value(){if(this._state===It.Uninitialized){this._state=It.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=It.Completed}}else if(this._state===It.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}},Mt=/{(\d+)}/g,Tt=class{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=function(e,t){const i=e.charCodeAt(t-1);if(lde(i)&&t>1){const n=e.charCodeAt(t-2);if(ade(n))return dde(n,i)}return i}(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=cde(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}},Rt=class{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new Tt(e,t)}nextGraphemeLength(){const e=Ft.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const i=t.offset,o=e.getGraphemeBreakType(t.nextCodePoint());if(wde(n,o)){t.setOffset(i);break}n=o}return t.offset-i}prevGraphemeLength(){const e=Ft.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const i=t.offset,o=e.getGraphemeBreakType(t.prevCodePoint());if(wde(o,n)){t.setOffset(i);break}n=o}return i-t.offset}eol(){return this._iterator.eol()}},Ot=void 0,At=/^[\t\n\r\x20-\x7E]*$/,Pt=/[\u2028\u2029]/,String.fromCharCode(65279),(Ft=class e{static getInstance(){return e._INSTANCE||(e._INSTANCE=new e),e._INSTANCE}constructor(){this._data=JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(e<t[3*n])n*=2;else{if(!(e>t[3*n+1]))return t[3*n+2];n=2*n+1}return 0}})._INSTANCE=null,(Et=Wt=class e{static getInstance(t){return e.cache.get(Array.from(t))}static getLocales(){return e._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}).ambiguousCharacterData=new Nt(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}')),Et.cache=new Lt({getCacheKey:JSON.stringify},e=>{function t(e){const t=new Map;for(let i=0;i<e.length;i+=2)t.set(e[i],e[i+1]);return t}function i(e,t){if(!e)return t;const i=new Map;for(const[n,o]of e)t.has(n)&&i.set(n,o);return i}const n=Et.ambiguousCharacterData.value;let o,s=e.filter(e=>!e.startsWith("_")&&Object.hasOwn(n,e));0===s.length&&(s=["_default"]);for(const a of s)o=i(o,t(n[a]));const r=function(e,t){const i=new Map(e);for(const[n,o]of t)i.set(n,o);return i}(t(n._common),o);return new Et(r)}),Et._locales=new Nt(()=>Object.keys(Et.ambiguousCharacterData.value).filter(e=>!e.startsWith("_"))),(Bt=class e{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static getData(){return this._data||(this._data=new Set([...Object.values(e.getRawData())].flat())),this._data}static isInvisibleCharacter(t){return e.getData().has(t)}static get codePoints(){return e.getData()}})._data=void 0,void 0!==(Ht=globalThis.vscode)&&void 0!==Ht.process){const e=Ht.process;Vt={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else Vt="undefined"!=typeof process&&"string"==typeof process?.versions?.node?{get platform(){return process.platform},get arch(){return process.arch},get env(){return{}},cwd:()=>({}.VSCODE_CWD||process.cwd())}:{get platform(){return P?"win32":F?"darwin":"linux"},get arch(){},get env(){return{}},cwd:()=>"/"};var t,$n,Gn,Zn,Yn,Qn,pa,ma,fa;if(zt=Vt.cwd,Ut=Vt.env,Kt=Vt.platform,qt=65,jt=97,$t=90,Gt=122,Zt=46,Yt=47,Qt=92,Xt=58,Jt=class extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let o=`The "${e}" ${-1!==e.indexOf(".")?"property":"argument"} ${n} of type ${t}`;o+=". Received type "+typeof i,super(o),this.code="ERR_INVALID_ARG_TYPE"}},ei="win32"===Kt,ti={resolve(...e){let t="",i="",n=!1;for(let o=e.length-1;o>=-1;o--){let s;if(o>=0){if(s=e[o],Sde(s,`paths[${o}]`),0===s.length)continue}else 0===t.length?s=zt():(s=Ut[`=${t}`]||zt(),(void 0===s||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===Qt)&&(s=`${t}\\`));const r=s.length;let a=0,l="",d=!1;const c=s.charCodeAt(0);if(1===r)xde(c)&&(a=1,d=!0);else if(xde(c))if(d=!0,xde(s.charCodeAt(1))){let e=2,t=e;for(;e<r&&!xde(s.charCodeAt(e));)e++;if(e<r&&e!==t){const i=s.slice(t,e);for(t=e;e<r&&xde(s.charCodeAt(e));)e++;if(e<r&&e!==t){for(t=e;e<r&&!xde(s.charCodeAt(e));)e++;e!==r&&e===t||(l=`\\\\${i}\\${s.slice(t,e)}`,a=e)}}}else a=1;else Lde(c)&&s.charCodeAt(1)===Xt&&(l=s.slice(0,2),a=2,r>2&&xde(s.charCodeAt(2))&&(d=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${s.slice(a)}\\${i}`,n=d,d&&t.length>0)break}return i=Dde(i,!n,"\\",xde),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){Sde(e,"path");const t=e.length;if(0===t)return".";let i,n=0,o=!1;const s=e.charCodeAt(0);if(1===t)return kde(s)?"\\":e;if(xde(s))if(o=!0,xde(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!xde(e.charCodeAt(o));)o++;if(o<t&&o!==s){const r=e.slice(s,o);for(s=o;o<t&&xde(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!xde(e.charCodeAt(o));)o++;if(o===t)return`\\\\${r}\\${e.slice(s)}\\`;o!==s&&(i=`\\\\${r}\\${e.slice(s,o)}`,n=o)}}}else n=1;else Lde(s)&&e.charCodeAt(1)===Xt&&(i=e.slice(0,2),n=2,t>2&&xde(e.charCodeAt(2))&&(o=!0,n=3));let r=n<t?Dde(e.slice(n),!o,"\\",xde):"";if(0!==r.length||o||(r="."),r.length>0&&xde(e.charCodeAt(t-1))&&(r+="\\"),!o&&void 0===i&&e.includes(":")){if(r.length>=2&&Lde(r.charCodeAt(0))&&r.charCodeAt(1)===Xt)return`.\\${r}`;let i=e.indexOf(":");do{if(i===t-1||xde(e.charCodeAt(i+1)))return`.\\${r}`}while(-1!==(i=e.indexOf(":",i+1)))}return void 0===i?o?`\\${r}`:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){Sde(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return xde(i)||t>2&&Lde(i)&&e.charCodeAt(1)===Xt&&xde(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let s=0;s<e.length;++s){const n=e[s];Sde(n,"path"),n.length>0&&(void 0===t?t=i=n:t+=`\\${n}`)}if(void 0===t)return".";let n=!0,o=0;if("string"==typeof i&&xde(i.charCodeAt(0))){++o;const e=i.length;e>1&&xde(i.charCodeAt(1))&&(++o,e>2&&(xde(i.charCodeAt(2))?++o:n=!1))}if(n){for(;o<t.length&&xde(t.charCodeAt(o));)o++;o>=2&&(t=`\\${t.slice(o)}`)}return ti.normalize(t)},relative(e,t){if(Sde(e,"from"),Sde(t,"to"),e===t)return"";const i=ti.resolve(e),n=ti.resolve(t);if(i===n)return"";if((e=i.toLowerCase())===(t=n.toLowerCase()))return"";if(i.length!==e.length||n.length!==t.length){const e=i.split("\\"),t=n.split("\\");""===e[e.length-1]&&e.pop(),""===t[t.length-1]&&t.pop();const o=e.length,s=t.length,r=o<s?o:s;let a;for(a=0;a<r&&e[a].toLowerCase()===t[a].toLowerCase();a++);return 0===a?n:a===r?s>r?t.slice(a).join("\\"):o>r?"..\\".repeat(o-1-a)+"..":"":"..\\".repeat(o-a)+t.slice(a).join("\\")}let o=0;for(;o<e.length&&e.charCodeAt(o)===Qt;)o++;let s=e.length;for(;s-1>o&&e.charCodeAt(s-1)===Qt;)s--;const r=s-o;let a=0;for(;a<t.length&&t.charCodeAt(a)===Qt;)a++;let l=t.length;for(;l-1>a&&t.charCodeAt(l-1)===Qt;)l--;const d=l-a,c=r<d?r:d;let h=-1,u=0;for(;u<c;u++){const i=e.charCodeAt(o+u);if(i!==t.charCodeAt(a+u))break;i===Qt&&(h=u)}if(u!==c){if(-1===h)return n}else{if(d>c){if(t.charCodeAt(a+u)===Qt)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>c&&(e.charCodeAt(o+u)===Qt?h=u:2===u&&(h=3)),-1===h&&(h=0)}let g="";for(u=o+h+1;u<=s;++u)u!==s&&e.charCodeAt(u)!==Qt||(g+=0===g.length?"..":"\\..");return a+=h,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===Qt&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e||0===e.length)return e;const t=ti.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===Qt){if(t.charCodeAt(1)===Qt){const e=t.charCodeAt(2);if(63!==e&&e!==Zt)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(Lde(t.charCodeAt(0))&&t.charCodeAt(1)===Xt&&t.charCodeAt(2)===Qt)return`\\\\?\\${t}`;return t},dirname(e){Sde(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return xde(o)?e:".";if(xde(o)){if(i=n=1,xde(e.charCodeAt(1))){let o=2,s=o;for(;o<t&&!xde(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&xde(e.charCodeAt(o));)o++;if(o<t&&o!==s){for(s=o;o<t&&!xde(e.charCodeAt(o));)o++;if(o===t)return e;o!==s&&(i=n=o+1)}}}}else Lde(o)&&e.charCodeAt(1)===Xt&&(i=t>2&&xde(e.charCodeAt(2))?3:2,n=i);let s=-1,r=!0;for(let a=t-1;a>=n;--a)if(xde(e.charCodeAt(a))){if(!r){s=a;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&Sde(t,"suffix"),Sde(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&Lde(e.charCodeAt(0))&&e.charCodeAt(1)===Xt&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(xde(l)){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1===--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=n;--i)if(xde(e.charCodeAt(i))){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){Sde(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&e.charCodeAt(1)===Xt&&Lde(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(xde(t)){if(!s){n=a+1;break}}else-1===o&&(s=!1,o=a+1),t===Zt?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===o||0===r||1===r&&i===o-1&&i===n+1?"":e.slice(i,o)},format:Ide.bind(null,"\\"),parse(e){Sde(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,o=e.charCodeAt(0);if(1===i)return xde(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(xde(o)){if(n=1,xde(e.charCodeAt(1))){let t=2,o=t;for(;t<i&&!xde(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&xde(e.charCodeAt(t));)t++;if(t<i&&t!==o){for(o=t;t<i&&!xde(e.charCodeAt(t));)t++;t===i?n=t:t!==o&&(n=t+1)}}}}else if(Lde(o)&&e.charCodeAt(1)===Xt){if(i<=2)return t.root=t.dir=e,t;if(n=2,xde(e.charCodeAt(2))){if(3===i)return t.root=t.dir=e,t;n=3}}n>0&&(t.root=e.slice(0,n));let s=-1,r=n,a=-1,l=!0,d=e.length-1,c=0;for(;d>=n;--d)if(o=e.charCodeAt(d),xde(o)){if(!l){r=d+1;break}}else-1===a&&(l=!1,a=d+1),o===Zt?-1===s?s=d:1!==c&&(c=1):-1!==s&&(c=-1);return-1!==a&&(-1===s||0===c||1===c&&s===a-1&&s===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,s),t.base=e.slice(r,a),t.ext=e.slice(s,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},ii=(()=>{if(ei){const e=/\\/g;return()=>{const t=zt().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>zt()})(),ni={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=0&&!i;n--){const o=e[n];Sde(o,`paths[${n}]`),0!==o.length&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Yt)}if(!i){const e=ii();t=`${e}/${t}`,i=e.charCodeAt(0)===Yt}return t=Dde(t,!i,"/",kde),i?`/${t}`:t.length>0?t:"."},normalize(e){if(Sde(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Yt,i=e.charCodeAt(e.length-1)===Yt;return 0===(e=Dde(e,!t,"/",kde)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(Sde(e,"path"),e.length>0&&e.charCodeAt(0)===Yt),join(...e){if(0===e.length)return".";const t=[];for(let i=0;i<e.length;++i){const n=e[i];Sde(n,"path"),n.length>0&&t.push(n)}return 0===t.length?".":ni.normalize(t.join("/"))},relative(e,t){if(Sde(e,"from"),Sde(t,"to"),e===t)return"";if((e=ni.resolve(e))===(t=ni.resolve(t)))return"";const i=e.length,n=i-1,o=t.length-1,s=n<o?n:o;let r=-1,a=0;for(;a<s;a++){const i=e.charCodeAt(1+a);if(i!==t.charCodeAt(1+a))break;i===Yt&&(r=a)}if(a===s)if(o>s){if(t.charCodeAt(1+a)===Yt)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>s&&(e.charCodeAt(1+a)===Yt?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&e.charCodeAt(a)!==Yt||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(Sde(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Yt;let i=-1,n=!0;for(let o=e.length-1;o>=1;--o)if(e.charCodeAt(o)===Yt){if(!n){i=o;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&Sde(t,"suffix"),Sde(e,"path");let i,n=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(l===Yt){if(!s){n=i+1;break}}else-1===a&&(s=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1===--r&&(o=i):(r=-1,o=a))}return n===o?o=a:-1===o&&(o=e.length),e.slice(n,o)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===Yt){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){Sde(e,"path");let t=-1,i=0,n=-1,o=!0,s=0;for(let r=e.length-1;r>=0;--r){const a=e[r];if("/"!==a)-1===n&&(o=!1,n=r+1),"."===a?-1===t?t=r:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){i=r+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===i+1?"":e.slice(t,n)},format:Ide.bind(null,"/"),parse(e){Sde(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===Yt;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,a=!0,l=e.length-1,d=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==Yt)-1===r&&(a=!1,r=l+1),t===Zt?-1===o?o=l:1!==d&&(d=1):-1!==o&&(d=-1);else if(!a){s=l+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===d||1===d&&o===r-1&&o===s+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,o),t.base=e.slice(n,r),t.ext=e.slice(o,r))}return s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null},ni.win32=ti.win32=ti,ni.posix=ti.posix=ni,oi=ei?ti.normalize:ni.normalize,si=ei?ti.resolve:ni.resolve,ri=ei?ti.relative:ni.relative,ai=ei?ti.dirname:ni.dirname,li=ei?ti.basename:ni.basename,di=ei?ti.extname:ni.extname,ci=ei?ti.sep:ni.sep,hi=/^\w[\w\d+.-]*$/,ui=/^\//,gi=/^\/\//,pi="",mi="/",fi=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,_i=class e{static isUri(t){return t instanceof e||!(!t||"object"!=typeof t)&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme&&"string"==typeof t.fsPath&&"function"==typeof t.with&&"function"==typeof t.toString}constructor(e,t,i,n,o,s=!1){"object"==typeof e?(this.scheme=e.scheme||pi,this.authority=e.authority||pi,this.path=e.path||pi,this.query=e.query||pi,this.fragment=e.fragment||pi):(this.scheme=function(e,t){return e||t?e:"file"}(e,s),this.authority=t||pi,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==mi&&(t=mi+t):t=mi}return t}(this.scheme,i||pi),this.query=n||pi,this.fragment=o||pi,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!hi.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!ui.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(gi.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,s))}get fsPath(){return Mde(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:o,fragment:s}=e;return void 0===t?t=this.scheme:null===t&&(t=pi),void 0===i?i=this.authority:null===i&&(i=pi),void 0===n?n=this.path:null===n&&(n=pi),void 0===o?o=this.query:null===o&&(o=pi),void 0===s?s=this.fragment:null===s&&(s=pi),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new vi(t,i,n,o,s)}static parse(e,t=!1){const i=fi.exec(e);return i?new vi(i[2]||pi,Ode(i[4]||pi),Ode(i[5]||pi),Ode(i[7]||pi),Ode(i[9]||pi),t):new vi(pi,pi,pi,pi,pi)}static file(e){let t=pi;if(P&&(e=e.replace(/\\/g,mi)),e[0]===mi&&e[1]===mi){const i=e.indexOf(mi,2);-1===i?(t=e.substring(2),e=mi):(t=e.substring(2,i),e=e.substring(i)||mi)}return new vi("file",t,e,pi,pi)}static from(e,t){return new vi(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(t,...i){if(!t.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return n=P&&"file"===t.scheme?e.file(ti.join(Mde(t,!0),...i)).path:ni.join(t.path,...i),t.with({path:n})}toString(e=!1){return Tde(this,e)}toJSON(){return this}static revive(t){if(t){if(t instanceof e)return t;{const e=new vi(t);return e._formatted=t.external??null,e._fsPath=t._sep===bi?t.fsPath??null:null,e}}return t}},bi=P?1:void 0,vi=class extends _i{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Mde(this,!1)),this._fsPath}toString(e=!1){return e?Tde(this,!0):(this._formatted||(this._formatted=Tde(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=bi),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},wi={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"},Ci=/(%[0-9A-Za-z][0-9A-Za-z])+/g,function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data",e.command="command",e.vscodeRemote="vscode-remote",e.vscodeRemoteResource="vscode-remote-resource",e.vscodeManagedRemoteResource="vscode-managed-remote-resource",e.vscodeUserData="vscode-userdata",e.vscodeCustomEditor="vscode-custom-editor",e.vscodeNotebookCell="vscode-notebook-cell",e.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",e.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",e.vscodeNotebookCellOutput="vscode-notebook-cell-output",e.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",e.vscodeNotebookMetadata="vscode-notebook-metadata",e.vscodeInteractiveInput="vscode-interactive-input",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.vscodeChatCodeBlock="vscode-chat-code-block",e.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",e.vscodeChatEditor="vscode-chat-editor",e.vscodeChatInput="chatSessionInput",e.vscodeLocalChatSession="vscode-chat-session",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp",e.vsls="vsls",e.vscodeSourceControl="vscode-scm",e.commentsInput="comment",e.codeSetting="code-setting",e.outputChannel="output",e.accessibleView="accessible-view",e.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",e.chatEditingModel="chat-editing-text-model",e.copilotPr="copilot-pr"}(yi||(yi={})),Si=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return ni.join(this._serverRootPath,yi.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(r){return $ae(r),e}const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&-1===i.indexOf("[")&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return"string"==typeof o&&(s+=`&tkn=${encodeURIComponent(o)}`),_i.from({scheme:V?this._preferredWebSchema:yi.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:s})}},(xi=class e{uriToBrowserUri(t){return t.scheme===yi.vscodeRemote?Si.rewrite(t):t.scheme!==yi.file||!B&&z!==`${yi.vscodeFileResource}://${e.FALLBACK_AUTHORITY}`?t:t.with({scheme:yi.vscodeFileResource,authority:t.authority||e.FALLBACK_AUTHORITY,query:null,fragment:null})}}).FALLBACK_AUTHORITY="vscode-app",ki=new xi,function(e){const t=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);e.CoopAndCoep=Object.freeze(t.get("3"));const i="vscode-coi";e.getHeadersFromQuery=function(e){let n;"string"==typeof e?n=new URL(e).searchParams:e instanceof URL?n=e.searchParams:_i.isUri(e)&&(n=new URL(e.toString(!0)).searchParams);const o=n?.get(i);if(o)return t.get(o)},e.addSearchParam=function(e,t,n){if(!globalThis.crossOriginIsolated)return;const o=t&&n?"3":n?"2":"1";e instanceof URLSearchParams?e.set(i,o):e[i]=o}}(Li||(Li={})),Di="undefined"!=typeof Buffer,new Nt(()=>new Uint8Array(256)),Ni=class e{static wrap(t){return Di&&!Buffer.isBuffer(t)&&(t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)),new e(t)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Di?this.buffer.toString():(Ii||(Ii=new TextDecoder),Ii.decode(this.buffer))}},Ei="0123456789abcdef",(Mi=class e{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let n,o,s=this._buffLen,r=this._leftoverHighSurrogate;for(0!==r?(n=r,o=-1,r=0):(n=e.charCodeAt(0),o=0);;){let a=n;if(ade(n)){if(!(o+1<t)){r=n;break}{const t=e.charCodeAt(o+1);lde(t)?(o++,a=dde(n,t)):a=65533}}else lde(n)&&(a=65533);if(s=this._push(i,s,a),o++,!(o<t))break;n=e.charCodeAt(o)}this._buffLen=s,this._leftoverHighSurrogate=r}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(1984&i)>>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Gde(this._h0)+Gde(this._h1)+Gde(this._h2)+Gde(this._h3)+Gde(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const t=e._bigBlock32,i=this._buffDV;for(let e=0;e<64;e+=4)t.setUint32(e,i.getUint32(e,!1),!1);for(let e=64;e<320;e+=4)t.setUint32(e,$de(t.getUint32(e-12,!1)^t.getUint32(e-32,!1)^t.getUint32(e-56,!1)^t.getUint32(e-64,!1),1),!1);let n,o,s,r=this._h0,a=this._h1,l=this._h2,d=this._h3,c=this._h4;for(let e=0;e<80;e++)e<20?(n=a&l|~a&d,o=1518500249):e<40?(n=a^l^d,o=1859775393):e<60?(n=a&l|a&d|l&d,o=2400959708):(n=a^l^d,o=3395469782),s=$de(r,5)+n+c+o+t.getUint32(4*e,!1)&4294967295,c=d,d=l,l=$de(a,30),a=r,r=s;this._h0=this._h0+r&4294967295,this._h1=this._h1+a&4294967295,this._h2=this._h2+l&4294967295,this._h3=this._h3+d&4294967295,this._h4=this._h4+c&4294967295}})._bigBlock32=new DataView(new ArrayBuffer(320)),function(e){e.isLessThan=function(e){return e<0},e.isLessThanOrEqual=function(e){return e<=0},e.isGreaterThan=function(e){return e>0},e.isNeitherLessOrGreaterThan=function(e){return 0===e},e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0}(Ri||(Ri={})),Oi=(e,t)=>e-t,Ai=(e,t)=>Oi(e?1:0,t?1:0),Pi=class{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}},Fi=class e{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(i=>!t(i)||e(i)))}map(t){return new e(e=>this.iterate(i=>e(t(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(n=>((i||Ri.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}},(Ti=Fi).empty=new Ti(e=>{}),Wi=class e{constructor(e){this._indexMap=e}static createSortPermutation(t,i){return new e(Array.from(t.keys()).sort((e,n)=>i(t[e],t[n])))}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const t=this._indexMap.slice();for(let e=0;e<this._indexMap.length;e++)t[this._indexMap[e]]=e;return new e(t)}},Vi=class{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(const i of this.loggers)i.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(const i of this.loggers)i.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(const i of this.loggers)i.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(const i of this.loggers)i.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(const t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,i){for(const n of this.loggers)n.handleAutorunDependencyChanged(e,t,i)}handleAutorunStarted(e){for(const t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(const t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,i){for(const n of this.loggers)n.handleDerivedDependencyChanged(e,t,i)}handleDerivedCleared(e){for(const t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(const t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(const t of this.loggers)t.handleEndTransaction(e)}},function(e){let t=!1;e.enable=function(){t=!0},e.ofCaller=function(){if(!t)return;const e=Error,i=e.stackTraceLimit;e.stackTraceLimit=3;const n=(new Error).stack;return e.stackTraceLimit=i,zi.fromStack(n,2)}}(Hi||(Hi={})),zi=class e{static fromStack(t,i){const n=function(e){const t=e.match(/\((.*):(\d+):(\d+)\)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:e};const i=e.match(/at ([^\(\)]*):(\d+):(\d+)/);return i?{fileName:i[1],line:parseInt(i[2]),column:parseInt(i[3]),id:e}:void 0}(t.split("\n")[i+1]);return n?new e(n.fileName,n.line,n.column,n.id):void 0}constructor(e,t,i,n){this.fileName=e,this.line=t,this.column=i,this.id=n}},Ui=(e,t)=>e===t,Ki=class{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return Sce(e,this)}},qi=new Map,ji=new WeakMap,$i=new Map,Gi=new WeakMap,Qi=class{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t,i=Hi.ofCaller()){const n=void 0===t?void 0:e,o=void 0===t?e:t;return Zi({owner:n,debugName:()=>{const e=kce(o);if(void 0!==e)return e;const t=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(o.toString());return t?`${this.debugName}.${t[2]}`:n?void 0:`${this.debugName} (mapped)`},debugReferenceFn:o},e=>o(this.read(e),e),i)}flatten(){return Zi({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(Yi(this,t)),this}},Xi=class extends Qi{constructor(e){super(),this._observers=new Set,vce()?.handleObservableCreated(this,e)}addObserver(e){const t=this._observers.size;this._observers.add(e),0===t&&this.onFirstObserverAdded(),t!==this._observers.size&&vce()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){const t=this._observers.delete(e);t&&0===this._observers.size&&this.onLastObserverRemoved(),t&&vce()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}debugGetObservers(){return this._observers}},Ji=class extends Xi{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n=void 0,o,s){super(s),this._debugNameData=e,this._computeFn=t,this._changeTracker=i,this._handleLastObserverRemoved=n,this._equalityComparator=o,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,vce()?.handleDerivedCleared(this);for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),void 0!==this._store&&(this._store.dispose(),this._store=void 0),void 0!==this._delayedStore&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,0===this._observers.size){let e;try{let t;this._isReaderValid=!0,this._changeTracker&&(t=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,t)),e=this._computeFn(this,t)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),e}do{if(1===this._state)for(const e of this._dependencies)if(e.reportChanges(),2===this._state)break;1===this._state&&(this._state=3),3!==this._state&&this._recompute()}while(3!==this._state);return this._value}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;const t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{const t=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,t),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(t));const i=0!==this._state,n=this._value;this._state=3;const o=this._delayedStore;void 0!==o&&(this._delayedStore=void 0);try{void 0!==this._store&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,t)}finally{this._isReaderValid=!1;for(const e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear(),void 0!==o&&o.dispose()}e=this._didReportChange||i&&!this._equalityComparator(n,this._value),vce()?.handleObservableUpdated(this,{oldValue:n,newValue:this._value,change:void 0,didChange:e,hadValue:i})}catch(Fae){jae(Fae)}if(this._isComputing=!1,!this._didReportChange&&e)for(const i of this._observers)i.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new y("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{const e=1===this._updateCount;if(3===this._state&&(this._state=1,!e))for(const t of this._observers)t.handlePossibleChange(this);if(e)for(const t of this._observers)t.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,0===this._updateCount){const e=[...this._observers];for(const t of e)t.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){const e=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(const t of e)t.endUpdate(this)}}nle(()=>this._updateCount>=0)}handlePossibleChange(e){if(3===this._state&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(const e of this._observers)e.handlePossibleChange(this)}}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){vce()?.handleDerivedDependencyChanged(this,e,t);let i=!1;try{i=!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary)}catch(Fae){jae(Fae)}const n=3===this._state;if(i&&(1===this._state||n)&&(this._state=2,n))for(const e of this._observers)e.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new y("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){return this._ensureReaderValid(),void 0===this._store&&(this._store=new De),this._store}addObserver(e){const t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:Lce(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this._isComputing?this._state=2:this._recompute()}setValue(e,t,i){this._value=e;const n=this._observers;t.updateObserver(this,this);for(const o of n)o.handleChange(this,i)}},en=class extends Ji{constructor(e,t,i,n=void 0,o,s,r){super(e,t,i,n,o,r),this.set=s}},function(e){Zi=e}(Nce),tn=class{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n){this._debugNameData=e,this._runFn=t,this._changeTracker=i,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),vce()?.handleAutorunCreated(this,n),this._run()}dispose(){if(!this._disposed){this._disposed=!0;for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),void 0!==this._store&&this._store.dispose(),void 0!==this._delayedStore&&this._delayedStore.dispose(),vce()?.handleAutorunDisposed(this)}}_run(){const e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){vce()?.handleAutorunStarted(this);const e=this._changeSummary,t=this._delayedStore;void 0!==t&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,e),this._changeSummary=this._changeTracker.createChangeSummary(e)),void 0!==this._store&&(this._store.dispose(),this._store=void 0),this._runFn(this,e)}catch(Fae){jae(Fae)}finally{this._isRunning=!1,void 0!==t&&t.dispose()}}}finally{this._disposed||vce()?.handleAutorunFinished(this);for(const e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){3===this._state&&(this._state=1),this._updateCount++}endUpdate(e){try{if(1===this._updateCount)do{if(1===this._state){this._state=3;for(const e of this._dependencies)if(e.reportChanges(),2===this._state)break}3!==this._state&&this._run()}while(3!==this._state)}finally{this._updateCount--}nle(()=>this._updateCount>=0)}handlePossibleChange(e){3===this._state&&this._isDependency(e)&&(this._state=1)}handleChange(e,t){if(this._isDependency(e)){vce()?.handleAutorunDependencyChanged(this,e,t);try{this._changeTracker&&!this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary)||(this._state=2)}catch(Fae){jae(Fae)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new y("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new y("Cannot access store after dispose");return void 0===this._store&&(this._store=new De),this._store}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:Tce(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}},nn=void 0,on=class{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],vce()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():kce(this._fn)}updateObserver(e,t){if(!this._updatingObservers)return Fce("Transaction already finished!"),void Wce(i=>{i.updateObserver(e,t)});this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this._updatingObservers;if(e){for(let t=0;t<e.length;t++){const{observer:i,observable:n}=e[t];i.endUpdate(n)}this._updatingObservers=null,vce()?.handleEndTransaction(this)}else Fce("transaction.finish() has already been called!")}debugGetUpdatingObservers(){return this._updatingObservers}},sn=class extends Xi{constructor(e,t,i,n,o,s){super(s),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=o,this._hasValue=!1,this.handleEvent=e=>{const t=this._getValue(e),i=this._value,n=!this._hasValue||!this._equalityComparator(i,t);let o=!1;n&&(this._value=t,this._hasValue&&(o=!0,Vce(this._getTransaction(),e=>{vce()?.handleObservableUpdated(this,{oldValue:i,newValue:t,change:void 0,didChange:n,hadValue:this._hasValue});for(const t of this._observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>{const e=this.getDebugName();return"Event fired"+(e?`: ${e}`:"")})),this._hasValue=!0),o||vce()?.handleObservableUpdated(this,{oldValue:i,newValue:t,change:void 0,didChange:n,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}},function(e){e.Observer=sn,e.batchEventsGlobally=function(e,t){let i=!1;void 0===sn.globalTransaction&&(sn.globalTransaction=e,i=!0);try{t()}finally{i&&(sn.globalTransaction=void 0)}}}(Hce||(Hce={})),function(e){Yi=e}(Kce),rn=class{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){1===this._counter&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}},an=class{constructor(e,t){this._map=e,this._keySelector=t,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){const t=[],i=new Set(this._cache.keys());for(const n of e){const e=this._keySelector?this._keySelector(n):n;let o=this._cache.get(e);if(o)i.delete(e);else{const t=new De;o={out:this._map(n,t),store:t},this._cache.set(e,o)}t.push(o.out)}for(const n of i)this._cache.get(n).store.dispose(),this._cache.delete(n);this._items=t}getItems(){return this._items}},ln=class e{static createClient(t,i){return new e(t,i)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:e=>{const t=e,i=this._getHandler().notifications[t[0]];if(!i)throw new Error(`Unknown notification "${t[0]}"!`);i(...t[1])},handleRequest:e=>{const t=e;try{return{type:"result",value:this._getHandler().requests[t[0]](...t[1])}}catch(Fae){return{type:"error",value:Fae}}}});const i=new Proxy({},{get:(e,t)=>async(...e)=>{const i=await this._channel.sendRequest([t,e]);if("error"===i.type)throw i.value;return i.value}});this.api={notifications:new Proxy({},{get:(e,t)=>(...e)=>{this._channel.sendNotification([t,e])}}),requests:i}}},dn=class{constructor(){this._timeout=void 0}throttle(e,t){void 0===this._timeout&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},t))}dispose(){void 0!==this._timeout&&clearTimeout(this._timeout)}},cn=class extends Xi{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._value=t,vce()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,i){if(void 0===i&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new on(()=>{},()=>`Setting ${this.debugName}`));try{const n=this._value;this._setValue(e),vce()?.handleObservableUpdated(this,{oldValue:n,newValue:e,change:i,didChange:!0,hadValue:!0});for(const e of this._observers)t.updateObserver(e,this),e.handleChange(this,i)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}},hn=class extends cn{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}},un=class e{static getInstance(){return void 0===e._instance&&(e._instance=new e),e._instance}getTransactionState(){const e=[],t=[...this._activeTransactions];if(0===t.length)return;const i=t.flatMap(e=>e.debugGetUpdatingObservers()??[]).map(e=>e.observer),n=new Set;for(;i.length>0;){const t=i.shift();if(n.has(t))continue;n.add(t);const o=this._getInfo(t,e=>{n.has(e)||i.push(e)});o&&e.push(o)}return{names:t.map(e=>e.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){const t=this._instanceInfos.get(e);if(t)return t;$ae(new y("No info found"))}_getAutorunInfo(e){const t=this._instanceInfos.get(e);if(t)return t;$ae(new y("No info found"))}_getInfo(e,t){if(e instanceof Ji){const i=[...e.debugGetObservers()];for(const e of i)t(e);const n=this._getObservableInfo(e);if(!n)return;const o=e.debugGetState(),s={name:e.debugName,instanceId:n.instanceId,updateCount:o.updateCount},r=[...n.changedObservables].map(e=>this._instanceInfos.get(e)?.instanceId).filter(ule);if(o.isComputing)return{...s,type:"observable/derived",state:"updating",changedDependencies:r,initialComputation:!1};switch(o.state){case 0:return{...s,type:"observable/derived",state:"noValue"};case 3:return{...s,type:"observable/derived",state:"upToDate"};case 2:return{...s,type:"observable/derived",state:"stale",changedDependencies:r};case 1:return{...s,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof tn){const t=this._getAutorunInfo(e);if(!t)return;const i={name:e.debugName,instanceId:t.instanceId,updateCount:t.updateCount},n=[...t.changedObservables].map(e=>this._instanceInfos.get(e).instanceId);if(e.debugGetState().isRunning)return{...i,type:"autorun",state:"updating",changedDependencies:n};switch(e.debugGetState().state){case 3:return{...i,type:"autorun",state:"upToDate"};case 2:return{...i,type:"autorun",state:"stale",changedDependencies:n};case 1:return{...i,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){const t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof Ji)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};const t=this._getAutorunInfo(e);return t?{name:e.toString(),instanceId:t.instanceId}:void 0}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=Gce("observableDevTools",()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log("logObservableValue",e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{const e={};for(const t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(e=>this._formatObserver(e)).filter(ule)}),getDerivedInfo:e=>{const t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(e=>this._formatObservable(e)).filter(ule),observers:[...t.debugGetObservers()].map(e=>this._formatObserver(e)).filter(ule)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(e=>this._formatObservable(e)).filter(ule)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{const i=this._aliveInstances.get(e);if(i instanceof Ji)i.debugSetValue(t);else if(i instanceof cn)i.debugSetValue(t);else{if(!(i instanceof sn))throw new y("Observable is not supported");i.debugSetValue(t)}const n=[...i.debugGetObservers()];for(const o of n)o.beginUpdate(i);for(const o of n)o.handleChange(i,void 0);for(const o of n)o.endUpdate(i)},getValue:e=>{const t=this._aliveInstances.get(e);return t instanceof Ji||t instanceof cn?$ce(t.debugGetState().value,200):void 0},logValue:e=>{const t=this._aliveInstances.get(e);if(!t||!("get"in t))throw new y("Observable is not supported");console.log("Logged Value:",t.get())},rerun:e=>{const t=this._aliveInstances.get(e);if(t instanceof Ji)t.debugRecompute();else{if(!(t instanceof tn))throw new y("Observable is not supported");t.debugRerun()}}}})),this._pendingChanges=null,this._changeThrottler=new dn,this._fullState={},this._flushUpdates=()=>{null!==this._pendingChanges&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},Hi.enable()}_handleChange(e){Yce(this._fullState,e),null===this._pendingChanges?this._pendingChanges=e:Zce(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return-1;let i=this._declarations.get(t.id);return void 0===i&&(i={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,i),this._handleChange({decls:{[i.id]:i}})),i.id}handleObservableCreated(e,t){const i={declarationId:this._getDeclarationId("observable/value",t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i)}handleOnListenerCountChanged(e,t){const i=this._getObservableInfo(e);if(i){if(0===i.listenerCount&&t>0){const t=e instanceof Ji?"observable/derived":"observable/value";this._aliveInstances.set(i.instanceId,e),this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,formattedValue:i.lastValue,type:t,name:e.debugName}}})}else i.listenerCount>0&&0===t&&(this._handleChange({instances:{[i.instanceId]:null}}),this._aliveInstances.delete(i.instanceId));i.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof Ji)return void this._handleDerivedRecomputed(e,t);const i=this._getObservableInfo(e);i&&t.didChange&&(i.lastValue=$ce(t.newValue,30),i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:i.lastValue}}}))}handleAutorunCreated(e,t){const i={declarationId:this._getDeclarationId("autorun",t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i),this._aliveInstances.set(i.instanceId,e),i&&this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){const t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,i){const n=this._getAutorunInfo(e);n&&n.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){const t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,i){const n=this._getObservableInfo(e);n&&n.changedObservables.add(t)}_handleDerivedRecomputed(e,t){const i=this._getObservableInfo(e);if(!i)return;const n=$ce(t.newValue,30);i.updateCount++,i.changedObservables.clear(),i.lastValue=n,i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:n,recomputationCount:i.updateCount}}})}handleDerivedCleared(e){const t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}},un._instance=void 0,Ut&&Ut.VSCODE_DEV_DEBUG_OBSERVABLES&&(t=un.getInstance(),Bi?Bi instanceof Vi?Bi.loggers.push(t):Bi=new Vi([Bi,t]):Bi=t),({getWindow:pn,getDocument:mn,getWindows:fn,getWindowsCount:_n,getWindowId:bn,getWindowById:vn,onDidRegisterWindow:wn,onWillUnregisterWindow:Cn,onDidUnregisterWindow:yn}=function(){const e=new Map;!function(e,t){const i=e;"number"!=typeof i.vscodeWindowId&&Object.defineProperty(i,"vscodeWindowId",{get:()=>t})}(r,1);const t={window:r,disposables:new De};e.set(r.vscodeWindowId,t);const i=new je,n=new je,o=new je;return{onDidRegisterWindow:i.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:n.event,registerWindow(t){if(e.has(t.vscodeWindowId))return Ie.None;const s=new De,r={window:t,disposables:s.add(new De)};return e.set(t.vscodeWindowId,r),s.add(Dle(()=>{e.delete(t.vscodeWindowId),n.fire(t)})),s.add(ehe(t,On.BEFORE_UNLOAD,()=>{o.fire(t)})),i.fire(r),s},getWindows:()=>e.values(),getWindowsCount:()=>e.size,getWindowId:e=>e.vscodeWindowId,hasWindow:t=>e.has(t),getWindowById:function(i,n){return("number"==typeof i?e.get(i):void 0)??(n?t:void 0)},getWindow(e){const t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;const i=e;return i?.view?i.view.window:r},getDocument:e=>pn(e).document}}()),Sn=class{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}},xn=function(e,t,i,n){let o=i;return"click"===t||"mousedown"===t||"contextmenu"===t?o=the(pn(e),i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=function(e){return function(t){return e(new we(t))}}(i)),ehe(e,t,o,n)},kn=function(e,t,i){return ihe(e,the(pn(e),t),i)},Ln=class extends vt{constructor(e,t){super(e,t)}},Nn=class extends mt{constructor(e){super(),this.defaultTarget=e&&pn(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},En=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(Fae){$ae(Fae)}}static sort(e,t){return t.priority-e.priority}},function(){const e=new Map,t=new Map,i=new Map,n=new Map;In=(o,s,r=0)=>{const a=bn(o),l=new En(s,r);let d=e.get(a);return d||(d=[],e.set(a,d)),d.push(l),i.get(a)||(i.set(a,!0),o.requestAnimationFrame(()=>(o=>{i.set(o,!1);const s=e.get(o)??[];for(t.set(o,s),e.set(o,[]),n.set(o,!0);s.length>0;)s.sort(En.sort),s.shift().execute();n.set(o,!1)})(a))),l},Dn=(e,i,o)=>{const s=bn(e);if(n.get(s)){const e=new En(i,o);let n=t.get(s);return n||(n=[],t.set(s,n)),n.push(e),e}return In(e,i,o)}}(),Mn=class e{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(t,i){const n=she(t),o=n?n.getPropertyValue(i):"0";return e.convertToPixels(t,o)}static getBorderLeftWidth(t){return e.getDimension(t,"border-left-width")}static getBorderRightWidth(t){return e.getDimension(t,"border-right-width")}static getBorderTopWidth(t){return e.getDimension(t,"border-top-width")}static getBorderBottomWidth(t){return e.getDimension(t,"border-bottom-width")}static getPaddingLeft(t){return e.getDimension(t,"padding-left")}static getPaddingRight(t){return e.getDimension(t,"padding-right")}static getPaddingTop(t){return e.getDimension(t,"padding-top")}static getPaddingBottom(t){return e.getDimension(t,"padding-bottom")}static getMarginLeft(t){return e.getDimension(t,"margin-left")}static getMarginTop(t){return e.getDimension(t,"margin-top")}static getMarginRight(t){return e.getDimension(t,"margin-right")}static getMarginBottom(t){return e.getDimension(t,"margin-bottom")}},Tn=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new e(t,i):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t||!(!e||!t)&&e.width===t.width&&e.height===t.height}},(gn=Tn).None=new gn(0,0),Rn=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let n=this.mutationObservers.get(e);n||(n=new Map,this.mutationObservers.set(e,n));const o=Ude(i);let s=n.get(o);if(s)s.users+=1;else{const r=new je,a=new MutationObserver(e=>r.fire(e));a.observe(e,i);const l=s={users:1,observer:a,onDidMutate:r.event};t.add(Dle(()=>{l.users-=1,0===l.users&&(r.dispose(),a.disconnect(),n?.delete(o),0===n?.size&&this.mutationObservers.delete(e))})),n.set(o,s)}return s.onDidMutate}},On={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend"},An={stop:(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e)},Pn=class e extends Ie{get onDidFocus(){return this._onDidFocus.event}get onDidBlur(){return this._onDidBlur.event}static hasFocusWithin(e){if(xhe(e)){const t=bhe(e);return phe(t?t.activeElement:e.ownerDocument.activeElement,e)}{const t=e;return phe(t.document.activeElement,t.document)}}constructor(t){super(),this._onDidFocus=this._register(new je),this._onDidBlur=this._register(new je);let i=e.hasFocusWithin(t),n=!1;const o=()=>{n=!1,i||(i=!0,this._onDidFocus.fire())},s=()=>{i&&(n=!0,(xhe(t)?pn(t):t).setTimeout(()=>{n&&(n=!1,i=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{e.hasFocusWithin(t)!==i&&(i?s():o())},this._register(ehe(t,On.FOCUS,o,!0)),this._register(ehe(t,On.BLUR,s,!0)),xhe(t)&&(this._register(ehe(t,On.FOCUS_IN,()=>this._refreshStateHandler())),this._register(ehe(t,On.FOCUS_OUT,()=>this._refreshStateHandler())))}},Fn=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/,function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(Wn||(Wn={})),Ahe.SVG=function(e,t,...i){return Ohe(Wn.SVG,e,t,...i)},Si.setPreferredWebSchema(/^https:/.test(r.location.href)?"https":"http"),Bn=class e extends je{constructor(){super(),this._subscriptions=new De,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(Be.runAndSubscribe(wn,({window:e,disposables:t})=>this.registerListeners(e,t),{window:r,disposables:this._subscriptions}))}registerListeners(e,t){t.add(ehe(e,"keydown",e=>{if(e.defaultPrevented)return;const t=new we(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),t.add(ehe(e,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),t.add(ehe(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ehe(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(ehe(e.document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(ehe(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return e.instance||(e.instance=new e),e.instance}dispose(){super.dispose(),this._subscriptions.dispose()}},Vn=class extends Ie{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(ehe(this.element,On.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(ehe(this.element,On.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(ehe(this.element,On.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(ehe(this.element,On.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(ehe(this.element,On.DRAG_LEAVE,e=>{this.counter--,0===this.counter&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(ehe(this.element,On.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(ehe(this.element,On.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}},Hn=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/,function(e){function t(e=void 0){return(t,i,n)=>{const o=i.class;delete i.class;const s=i.ref;delete i.ref;const r=i.obsRef;return delete i.obsRef,new qn(t,s,r,e,o,i,n)}}function i(e,i=void 0){const n=t(i);return(t,i)=>n(e,t,i)}e.div=i("div"),e.elem=t(void 0),e.svg=i("svg","http://www.w3.org/2000/svg"),e.svgElem=t("http://www.w3.org/2000/svg"),e.ref=function(){let e;const t=function(t){e=t};return Object.defineProperty(t,"element",{get(){if(!e)throw new y("Make sure the ref is set before accessing the element. Maybe wrong initialization order?");return e}}),t}}(zn||(zn={})),Un=class e{constructor(t,i,n,o,s,r,a){this._deriveds=[],this._element=o?document.createElementNS(o,t):document.createElement(t),i&&i(this._element),n&&this._deriveds.push(Dce(e=>{n(this),e.store.add({dispose:()=>{n(null)}})})),s&&(jhe(s)?this._deriveds.push(Dce(this,e=>{Uhe(this._element,qhe(s,e))})):Uhe(this._element,qhe(s,void 0)));for(const[l,d]of Object.entries(r))if("style"===l)for(const[c,h]of Object.entries(d)){const u=Hhe(c);Yhe(h)?this._deriveds.push(Nce({owner:this,debugName:()=>`set.style.${u}`},e=>{this._element.style.setProperty(u,$he(h.read(e)))})):this._element.style.setProperty(u,$he(h))}else"tabIndex"===l?Yhe(d)?this._deriveds.push(Dce(this,e=>{this._element.tabIndex=d.read(e)})):this._element.tabIndex=d:l.startsWith("on")?this._element[l]=d:Yhe(d)?this._deriveds.push(Nce({owner:this,debugName:()=>`set.${l}`},e=>{Zhe(this._element,l,d.read(e))})):Zhe(this._element,l,d);if(a){function g(t,i){return Yhe(i)?g(t,i.read(t)):Array.isArray(i)?i.flatMap(e=>g(t,e)):i instanceof e?(t&&i.readEffect(t),[i._element]):i?[i]:[]}const p=Dce(this,e=>{this._element.replaceChildren(...g(e,a))});this._deriveds.push(p),Ghe(a)||p.get()}}readEffect(e){for(const t of this._deriveds)t.read(e)}keepUpdated(e){return Dce(e=>{this.readEffect(e)}).recomputeInitiallyAndOnChange(e),this}toDisposableLiveElement(){const e=new De;return this.keepUpdated(e),new Kn(this._element,e)}},Kn=class{constructor(e,t){this.element=e,this._disposable=t}dispose(){this._disposable.dispose()}},qn=class extends Un{constructor(){super(...arguments),this._isHovered=void 0,this._didMouseMoveDuringHover=void 0}get element(){return this._element}get isHovered(){if(!this._isHovered){const e=Qce("hovered",!1);this._element.addEventListener("mouseenter",t=>e.set(!0,void 0)),this._element.addEventListener("mouseleave",t=>e.set(!1,void 0)),this._isHovered=e}return this._isHovered}get didMouseMoveDuringHover(){if(!this._didMouseMoveDuringHover){let e=!1;const t=Qce("didMouseMoveDuringHover",!1);this._element.addEventListener("mouseenter",t=>{e=!0}),this._element.addEventListener("mousemove",i=>{e&&t.set(!0,void 0)}),this._element.addEventListener("mouseleave",i=>{e=!1,t.set(!1,void 0)}),this._didMouseMoveDuringHover=t}return this._didMouseMoveDuringHover}},jn=2e4,function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(Xn||(Xn={})),Jn=eue("instantiationService"),eo=eue("codeEditorService"),to=class e{constructor(e,t){this.lineNumber=e,this.column=t}with(t=this.lineNumber,i=this.column){return t===this.lineNumber&&i===this.column?this:new e(t,i)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(t){return e.equals(this,t)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(t){return e.isBefore(this,t)}static isBefore(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(t){return e.isBeforeOrEqual(this,t)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){const i=0|e.lineNumber,n=0|t.lineNumber;return i===n?(0|e.column)-(0|t.column):i-n}clone(){return new e(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(t){return new e(t.lineNumber,t.column)}static isIPosition(e){return!!e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}},io=eue("modelService"),no=eue("textModelService"),oo=class extends Ie{get onDidChange(){return this._onDidChange.event}constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new je),this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}},so=class extends Ie{constructor(){super(...arguments),this._onWillRun=this._register(new je),this._onDidRun=this._register(new je)}get onWillRun(){return this._onWillRun.event}get onDidRun(){return this._onDidRun.event}async run(e,t){if(!e.enabled)return;let i;this._onWillRun.fire({action:e});try{await this.runAction(e,t)}catch(Fae){i=Fae}this._onDidRun.fire({action:e,error:i})}async runAction(e,t){await e.run(t)}},ro=class e{constructor(){this.id=e.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...t){let i=[];for(const n of t)n.length&&(i=i.length?[...i,new e,...n]:n);return i}async run(){}},ro.ID="vs.actions.separator",ao=class{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}},(lo=class e extends oo{constructor(){super(e.ID,Vae(28,"(empty)"),void 0,!1)}}).ID="vs.actions.empty",co=Object.create(null),ho={add:iue("add",6e4),plus:iue("plus",6e4),gistNew:iue("gist-new",6e4),repoCreate:iue("repo-create",6e4),lightbulb:iue("lightbulb",60001),lightBulb:iue("light-bulb",60001),repo:iue("repo",60002),repoDelete:iue("repo-delete",60002),gistFork:iue("gist-fork",60003),repoForked:iue("repo-forked",60003),gitPullRequest:iue("git-pull-request",60004),gitPullRequestAbandoned:iue("git-pull-request-abandoned",60004),recordKeys:iue("record-keys",60005),keyboard:iue("keyboard",60005),tag:iue("tag",60006),gitPullRequestLabel:iue("git-pull-request-label",60006),tagAdd:iue("tag-add",60006),tagRemove:iue("tag-remove",60006),person:iue("person",60007),personFollow:iue("person-follow",60007),personOutline:iue("person-outline",60007),personFilled:iue("person-filled",60007),sourceControl:iue("source-control",60008),mirror:iue("mirror",60009),mirrorPublic:iue("mirror-public",60009),star:iue("star",60010),starAdd:iue("star-add",60010),starDelete:iue("star-delete",60010),starEmpty:iue("star-empty",60010),comment:iue("comment",60011),commentAdd:iue("comment-add",60011),alert:iue("alert",60012),warning:iue("warning",60012),search:iue("search",60013),searchSave:iue("search-save",60013),logOut:iue("log-out",60014),signOut:iue("sign-out",60014),logIn:iue("log-in",60015),signIn:iue("sign-in",60015),eye:iue("eye",60016),eyeUnwatch:iue("eye-unwatch",60016),eyeWatch:iue("eye-watch",60016),circleFilled:iue("circle-filled",60017),primitiveDot:iue("primitive-dot",60017),closeDirty:iue("close-dirty",60017),debugBreakpoint:iue("debug-breakpoint",60017),debugBreakpointDisabled:iue("debug-breakpoint-disabled",60017),debugHint:iue("debug-hint",60017),terminalDecorationSuccess:iue("terminal-decoration-success",60017),primitiveSquare:iue("primitive-square",60018),edit:iue("edit",60019),pencil:iue("pencil",60019),info:iue("info",60020),issueOpened:iue("issue-opened",60020),gistPrivate:iue("gist-private",60021),gitForkPrivate:iue("git-fork-private",60021),lock:iue("lock",60021),mirrorPrivate:iue("mirror-private",60021),close:iue("close",60022),removeClose:iue("remove-close",60022),x:iue("x",60022),repoSync:iue("repo-sync",60023),sync:iue("sync",60023),clone:iue("clone",60024),desktopDownload:iue("desktop-download",60024),beaker:iue("beaker",60025),microscope:iue("microscope",60025),vm:iue("vm",60026),deviceDesktop:iue("device-desktop",60026),file:iue("file",60027),more:iue("more",60028),ellipsis:iue("ellipsis",60028),kebabHorizontal:iue("kebab-horizontal",60028),mailReply:iue("mail-reply",60029),reply:iue("reply",60029),organization:iue("organization",60030),organizationFilled:iue("organization-filled",60030),organizationOutline:iue("organization-outline",60030),newFile:iue("new-file",60031),fileAdd:iue("file-add",60031),newFolder:iue("new-folder",60032),fileDirectoryCreate:iue("file-directory-create",60032),trash:iue("trash",60033),trashcan:iue("trashcan",60033),history:iue("history",60034),clock:iue("clock",60034),folder:iue("folder",60035),fileDirectory:iue("file-directory",60035),symbolFolder:iue("symbol-folder",60035),logoGithub:iue("logo-github",60036),markGithub:iue("mark-github",60036),github:iue("github",60036),terminal:iue("terminal",60037),console:iue("console",60037),repl:iue("repl",60037),zap:iue("zap",60038),symbolEvent:iue("symbol-event",60038),error:iue("error",60039),stop:iue("stop",60039),variable:iue("variable",60040),symbolVariable:iue("symbol-variable",60040),array:iue("array",60042),symbolArray:iue("symbol-array",60042),symbolModule:iue("symbol-module",60043),symbolPackage:iue("symbol-package",60043),symbolNamespace:iue("symbol-namespace",60043),symbolObject:iue("symbol-object",60043),symbolMethod:iue("symbol-method",60044),symbolFunction:iue("symbol-function",60044),symbolConstructor:iue("symbol-constructor",60044),symbolBoolean:iue("symbol-boolean",60047),symbolNull:iue("symbol-null",60047),symbolNumeric:iue("symbol-numeric",60048),symbolNumber:iue("symbol-number",60048),symbolStructure:iue("symbol-structure",60049),symbolStruct:iue("symbol-struct",60049),symbolParameter:iue("symbol-parameter",60050),symbolTypeParameter:iue("symbol-type-parameter",60050),symbolKey:iue("symbol-key",60051),symbolText:iue("symbol-text",60051),symbolReference:iue("symbol-reference",60052),goToFile:iue("go-to-file",60052),symbolEnum:iue("symbol-enum",60053),symbolValue:iue("symbol-value",60053),symbolRuler:iue("symbol-ruler",60054),symbolUnit:iue("symbol-unit",60054),activateBreakpoints:iue("activate-breakpoints",60055),archive:iue("archive",60056),arrowBoth:iue("arrow-both",60057),arrowDown:iue("arrow-down",60058),arrowLeft:iue("arrow-left",60059),arrowRight:iue("arrow-right",60060),arrowSmallDown:iue("arrow-small-down",60061),arrowSmallLeft:iue("arrow-small-left",60062),arrowSmallRight:iue("arrow-small-right",60063),arrowSmallUp:iue("arrow-small-up",60064),arrowUp:iue("arrow-up",60065),bell:iue("bell",60066),bold:iue("bold",60067),book:iue("book",60068),bookmark:iue("bookmark",60069),debugBreakpointConditionalUnverified:iue("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:iue("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:iue("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:iue("debug-breakpoint-data-unverified",60072),debugBreakpointData:iue("debug-breakpoint-data",60073),debugBreakpointDataDisabled:iue("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:iue("debug-breakpoint-log-unverified",60074),debugBreakpointLog:iue("debug-breakpoint-log",60075),debugBreakpointLogDisabled:iue("debug-breakpoint-log-disabled",60075),briefcase:iue("briefcase",60076),broadcast:iue("broadcast",60077),browser:iue("browser",60078),bug:iue("bug",60079),calendar:iue("calendar",60080),caseSensitive:iue("case-sensitive",60081),check:iue("check",60082),checklist:iue("checklist",60083),chevronDown:iue("chevron-down",60084),chevronLeft:iue("chevron-left",60085),chevronRight:iue("chevron-right",60086),chevronUp:iue("chevron-up",60087),chromeClose:iue("chrome-close",60088),chromeMaximize:iue("chrome-maximize",60089),chromeMinimize:iue("chrome-minimize",60090),chromeRestore:iue("chrome-restore",60091),circleOutline:iue("circle-outline",60092),circle:iue("circle",60092),debugBreakpointUnverified:iue("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:iue("terminal-decoration-incomplete",60092),circleSlash:iue("circle-slash",60093),circuitBoard:iue("circuit-board",60094),clearAll:iue("clear-all",60095),clippy:iue("clippy",60096),closeAll:iue("close-all",60097),cloudDownload:iue("cloud-download",60098),cloudUpload:iue("cloud-upload",60099),code:iue("code",60100),collapseAll:iue("collapse-all",60101),colorMode:iue("color-mode",60102),commentDiscussion:iue("comment-discussion",60103),creditCard:iue("credit-card",60105),dash:iue("dash",60108),dashboard:iue("dashboard",60109),database:iue("database",60110),debugContinue:iue("debug-continue",60111),debugDisconnect:iue("debug-disconnect",60112),debugPause:iue("debug-pause",60113),debugRestart:iue("debug-restart",60114),debugStart:iue("debug-start",60115),debugStepInto:iue("debug-step-into",60116),debugStepOut:iue("debug-step-out",60117),debugStepOver:iue("debug-step-over",60118),debugStop:iue("debug-stop",60119),debug:iue("debug",60120),deviceCameraVideo:iue("device-camera-video",60121),deviceCamera:iue("device-camera",60122),deviceMobile:iue("device-mobile",60123),diffAdded:iue("diff-added",60124),diffIgnored:iue("diff-ignored",60125),diffModified:iue("diff-modified",60126),diffRemoved:iue("diff-removed",60127),diffRenamed:iue("diff-renamed",60128),diff:iue("diff",60129),diffSidebyside:iue("diff-sidebyside",60129),discard:iue("discard",60130),editorLayout:iue("editor-layout",60131),emptyWindow:iue("empty-window",60132),exclude:iue("exclude",60133),extensions:iue("extensions",60134),eyeClosed:iue("eye-closed",60135),fileBinary:iue("file-binary",60136),fileCode:iue("file-code",60137),fileMedia:iue("file-media",60138),filePdf:iue("file-pdf",60139),fileSubmodule:iue("file-submodule",60140),fileSymlinkDirectory:iue("file-symlink-directory",60141),fileSymlinkFile:iue("file-symlink-file",60142),fileZip:iue("file-zip",60143),files:iue("files",60144),filter:iue("filter",60145),flame:iue("flame",60146),foldDown:iue("fold-down",60147),foldUp:iue("fold-up",60148),fold:iue("fold",60149),folderActive:iue("folder-active",60150),folderOpened:iue("folder-opened",60151),gear:iue("gear",60152),gift:iue("gift",60153),gistSecret:iue("gist-secret",60154),gist:iue("gist",60155),gitCommit:iue("git-commit",60156),gitCompare:iue("git-compare",60157),compareChanges:iue("compare-changes",60157),gitMerge:iue("git-merge",60158),githubAction:iue("github-action",60159),githubAlt:iue("github-alt",60160),globe:iue("globe",60161),grabber:iue("grabber",60162),graph:iue("graph",60163),gripper:iue("gripper",60164),heart:iue("heart",60165),home:iue("home",60166),horizontalRule:iue("horizontal-rule",60167),hubot:iue("hubot",60168),inbox:iue("inbox",60169),issueReopened:iue("issue-reopened",60171),issues:iue("issues",60172),italic:iue("italic",60173),jersey:iue("jersey",60174),json:iue("json",60175),kebabVertical:iue("kebab-vertical",60176),key:iue("key",60177),law:iue("law",60178),lightbulbAutofix:iue("lightbulb-autofix",60179),linkExternal:iue("link-external",60180),link:iue("link",60181),listOrdered:iue("list-ordered",60182),listUnordered:iue("list-unordered",60183),liveShare:iue("live-share",60184),loading:iue("loading",60185),location:iue("location",60186),mailRead:iue("mail-read",60187),mail:iue("mail",60188),markdown:iue("markdown",60189),megaphone:iue("megaphone",60190),mention:iue("mention",60191),milestone:iue("milestone",60192),gitPullRequestMilestone:iue("git-pull-request-milestone",60192),mortarBoard:iue("mortar-board",60193),move:iue("move",60194),multipleWindows:iue("multiple-windows",60195),mute:iue("mute",60196),noNewline:iue("no-newline",60197),note:iue("note",60198),octoface:iue("octoface",60199),openPreview:iue("open-preview",60200),package:iue("package",60201),paintcan:iue("paintcan",60202),pin:iue("pin",60203),play:iue("play",60204),run:iue("run",60204),plug:iue("plug",60205),preserveCase:iue("preserve-case",60206),preview:iue("preview",60207),project:iue("project",60208),pulse:iue("pulse",60209),question:iue("question",60210),quote:iue("quote",60211),radioTower:iue("radio-tower",60212),reactions:iue("reactions",60213),references:iue("references",60214),refresh:iue("refresh",60215),regex:iue("regex",60216),remoteExplorer:iue("remote-explorer",60217),remote:iue("remote",60218),remove:iue("remove",60219),replaceAll:iue("replace-all",60220),replace:iue("replace",60221),repoClone:iue("repo-clone",60222),repoForcePush:iue("repo-force-push",60223),repoPull:iue("repo-pull",60224),repoPush:iue("repo-push",60225),report:iue("report",60226),requestChanges:iue("request-changes",60227),rocket:iue("rocket",60228),rootFolderOpened:iue("root-folder-opened",60229),rootFolder:iue("root-folder",60230),rss:iue("rss",60231),ruby:iue("ruby",60232),saveAll:iue("save-all",60233),saveAs:iue("save-as",60234),save:iue("save",60235),screenFull:iue("screen-full",60236),screenNormal:iue("screen-normal",60237),searchStop:iue("search-stop",60238),server:iue("server",60240),settingsGear:iue("settings-gear",60241),settings:iue("settings",60242),shield:iue("shield",60243),smiley:iue("smiley",60244),sortPrecedence:iue("sort-precedence",60245),splitHorizontal:iue("split-horizontal",60246),splitVertical:iue("split-vertical",60247),squirrel:iue("squirrel",60248),starFull:iue("star-full",60249),starHalf:iue("star-half",60250),symbolClass:iue("symbol-class",60251),symbolColor:iue("symbol-color",60252),symbolConstant:iue("symbol-constant",60253),symbolEnumMember:iue("symbol-enum-member",60254),symbolField:iue("symbol-field",60255),symbolFile:iue("symbol-file",60256),symbolInterface:iue("symbol-interface",60257),symbolKeyword:iue("symbol-keyword",60258),symbolMisc:iue("symbol-misc",60259),symbolOperator:iue("symbol-operator",60260),symbolProperty:iue("symbol-property",60261),wrench:iue("wrench",60261),wrenchSubaction:iue("wrench-subaction",60261),symbolSnippet:iue("symbol-snippet",60262),tasklist:iue("tasklist",60263),telescope:iue("telescope",60264),textSize:iue("text-size",60265),threeBars:iue("three-bars",60266),thumbsdown:iue("thumbsdown",60267),thumbsup:iue("thumbsup",60268),tools:iue("tools",60269),triangleDown:iue("triangle-down",60270),triangleLeft:iue("triangle-left",60271),triangleRight:iue("triangle-right",60272),triangleUp:iue("triangle-up",60273),twitter:iue("twitter",60274),unfold:iue("unfold",60275),unlock:iue("unlock",60276),unmute:iue("unmute",60277),unverified:iue("unverified",60278),verified:iue("verified",60279),versions:iue("versions",60280),vmActive:iue("vm-active",60281),vmOutline:iue("vm-outline",60282),vmRunning:iue("vm-running",60283),watch:iue("watch",60284),whitespace:iue("whitespace",60285),wholeWord:iue("whole-word",60286),window:iue("window",60287),wordWrap:iue("word-wrap",60288),zoomIn:iue("zoom-in",60289),zoomOut:iue("zoom-out",60290),listFilter:iue("list-filter",60291),listFlat:iue("list-flat",60292),listSelection:iue("list-selection",60293),selection:iue("selection",60293),listTree:iue("list-tree",60294),debugBreakpointFunctionUnverified:iue("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:iue("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:iue("debug-breakpoint-function-disabled",60296),debugStackframeActive:iue("debug-stackframe-active",60297),circleSmallFilled:iue("circle-small-filled",60298),debugStackframeDot:iue("debug-stackframe-dot",60298),terminalDecorationMark:iue("terminal-decoration-mark",60298),debugStackframe:iue("debug-stackframe",60299),debugStackframeFocused:iue("debug-stackframe-focused",60299),debugBreakpointUnsupported:iue("debug-breakpoint-unsupported",60300),symbolString:iue("symbol-string",60301),debugReverseContinue:iue("debug-reverse-continue",60302),debugStepBack:iue("debug-step-back",60303),debugRestartFrame:iue("debug-restart-frame",60304),debugAlt:iue("debug-alt",60305),callIncoming:iue("call-incoming",60306),callOutgoing:iue("call-outgoing",60307),menu:iue("menu",60308),expandAll:iue("expand-all",60309),feedback:iue("feedback",60310),gitPullRequestReviewer:iue("git-pull-request-reviewer",60310),groupByRefType:iue("group-by-ref-type",60311),ungroupByRefType:iue("ungroup-by-ref-type",60312),account:iue("account",60313),gitPullRequestAssignee:iue("git-pull-request-assignee",60313),bellDot:iue("bell-dot",60314),debugConsole:iue("debug-console",60315),library:iue("library",60316),output:iue("output",60317),runAll:iue("run-all",60318),syncIgnored:iue("sync-ignored",60319),pinned:iue("pinned",60320),githubInverted:iue("github-inverted",60321),serverProcess:iue("server-process",60322),serverEnvironment:iue("server-environment",60323),pass:iue("pass",60324),issueClosed:iue("issue-closed",60324),stopCircle:iue("stop-circle",60325),playCircle:iue("play-circle",60326),record:iue("record",60327),debugAltSmall:iue("debug-alt-small",60328),vmConnect:iue("vm-connect",60329),cloud:iue("cloud",60330),merge:iue("merge",60331),export:iue("export",60332),graphLeft:iue("graph-left",60333),magnet:iue("magnet",60334),notebook:iue("notebook",60335),redo:iue("redo",60336),checkAll:iue("check-all",60337),pinnedDirty:iue("pinned-dirty",60338),passFilled:iue("pass-filled",60339),circleLargeFilled:iue("circle-large-filled",60340),circleLarge:iue("circle-large",60341),circleLargeOutline:iue("circle-large-outline",60341),combine:iue("combine",60342),gather:iue("gather",60342),table:iue("table",60343),variableGroup:iue("variable-group",60344),typeHierarchy:iue("type-hierarchy",60345),typeHierarchySub:iue("type-hierarchy-sub",60346),typeHierarchySuper:iue("type-hierarchy-super",60347),gitPullRequestCreate:iue("git-pull-request-create",60348),runAbove:iue("run-above",60349),runBelow:iue("run-below",60350),notebookTemplate:iue("notebook-template",60351),debugRerun:iue("debug-rerun",60352),workspaceTrusted:iue("workspace-trusted",60353),workspaceUntrusted:iue("workspace-untrusted",60354),workspaceUnknown:iue("workspace-unknown",60355),terminalCmd:iue("terminal-cmd",60356),terminalDebian:iue("terminal-debian",60357),terminalLinux:iue("terminal-linux",60358),terminalPowershell:iue("terminal-powershell",60359),terminalTmux:iue("terminal-tmux",60360),terminalUbuntu:iue("terminal-ubuntu",60361),terminalBash:iue("terminal-bash",60362),arrowSwap:iue("arrow-swap",60363),copy:iue("copy",60364),personAdd:iue("person-add",60365),filterFilled:iue("filter-filled",60366),wand:iue("wand",60367),debugLineByLine:iue("debug-line-by-line",60368),inspect:iue("inspect",60369),layers:iue("layers",60370),layersDot:iue("layers-dot",60371),layersActive:iue("layers-active",60372),compass:iue("compass",60373),compassDot:iue("compass-dot",60374),compassActive:iue("compass-active",60375),azure:iue("azure",60376),issueDraft:iue("issue-draft",60377),gitPullRequestClosed:iue("git-pull-request-closed",60378),gitPullRequestDraft:iue("git-pull-request-draft",60379),debugAll:iue("debug-all",60380),debugCoverage:iue("debug-coverage",60381),runErrors:iue("run-errors",60382),folderLibrary:iue("folder-library",60383),debugContinueSmall:iue("debug-continue-small",60384),beakerStop:iue("beaker-stop",60385),graphLine:iue("graph-line",60386),graphScatter:iue("graph-scatter",60387),pieChart:iue("pie-chart",60388),bracket:iue("bracket",60175),bracketDot:iue("bracket-dot",60389),bracketError:iue("bracket-error",60390),lockSmall:iue("lock-small",60391),azureDevops:iue("azure-devops",60392),verifiedFilled:iue("verified-filled",60393),newline:iue("newline",60394),layout:iue("layout",60395),layoutActivitybarLeft:iue("layout-activitybar-left",60396),layoutActivitybarRight:iue("layout-activitybar-right",60397),layoutPanelLeft:iue("layout-panel-left",60398),layoutPanelCenter:iue("layout-panel-center",60399),layoutPanelJustify:iue("layout-panel-justify",60400),layoutPanelRight:iue("layout-panel-right",60401),layoutPanel:iue("layout-panel",60402),layoutSidebarLeft:iue("layout-sidebar-left",60403),layoutSidebarRight:iue("layout-sidebar-right",60404),layoutStatusbar:iue("layout-statusbar",60405),layoutMenubar:iue("layout-menubar",60406),layoutCentered:iue("layout-centered",60407),target:iue("target",60408),indent:iue("indent",60409),recordSmall:iue("record-small",60410),errorSmall:iue("error-small",60411),terminalDecorationError:iue("terminal-decoration-error",60411),arrowCircleDown:iue("arrow-circle-down",60412),arrowCircleLeft:iue("arrow-circle-left",60413),arrowCircleRight:iue("arrow-circle-right",60414),arrowCircleUp:iue("arrow-circle-up",60415),layoutSidebarRightOff:iue("layout-sidebar-right-off",60416),layoutPanelOff:iue("layout-panel-off",60417),layoutSidebarLeftOff:iue("layout-sidebar-left-off",60418),blank:iue("blank",60419),heartFilled:iue("heart-filled",60420),map:iue("map",60421),mapHorizontal:iue("map-horizontal",60421),foldHorizontal:iue("fold-horizontal",60421),mapFilled:iue("map-filled",60422),mapHorizontalFilled:iue("map-horizontal-filled",60422),foldHorizontalFilled:iue("fold-horizontal-filled",60422),circleSmall:iue("circle-small",60423),bellSlash:iue("bell-slash",60424),bellSlashDot:iue("bell-slash-dot",60425),commentUnresolved:iue("comment-unresolved",60426),gitPullRequestGoToChanges:iue("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:iue("git-pull-request-new-changes",60428),searchFuzzy:iue("search-fuzzy",60429),commentDraft:iue("comment-draft",60430),send:iue("send",60431),sparkle:iue("sparkle",60432),insert:iue("insert",60433),mic:iue("mic",60434),thumbsdownFilled:iue("thumbsdown-filled",60435),thumbsupFilled:iue("thumbsup-filled",60436),coffee:iue("coffee",60437),snake:iue("snake",60438),game:iue("game",60439),vr:iue("vr",60440),chip:iue("chip",60441),piano:iue("piano",60442),music:iue("music",60443),micFilled:iue("mic-filled",60444),repoFetch:iue("repo-fetch",60445),copilot:iue("copilot",60446),lightbulbSparkle:iue("lightbulb-sparkle",60447),robot:iue("robot",60448),sparkleFilled:iue("sparkle-filled",60449),diffSingle:iue("diff-single",60450),diffMultiple:iue("diff-multiple",60451),surroundWith:iue("surround-with",60452),share:iue("share",60453),gitStash:iue("git-stash",60454),gitStashApply:iue("git-stash-apply",60455),gitStashPop:iue("git-stash-pop",60456),vscode:iue("vscode",60457),vscodeInsiders:iue("vscode-insiders",60458),codeOss:iue("code-oss",60459),runCoverage:iue("run-coverage",60460),runAllCoverage:iue("run-all-coverage",60461),coverage:iue("coverage",60462),githubProject:iue("github-project",60463),mapVertical:iue("map-vertical",60464),foldVertical:iue("fold-vertical",60464),mapVerticalFilled:iue("map-vertical-filled",60465),foldVerticalFilled:iue("fold-vertical-filled",60465),goToSearch:iue("go-to-search",60466),percentage:iue("percentage",60467),sortPercentage:iue("sort-percentage",60467),attach:iue("attach",60468),goToEditingSession:iue("go-to-editing-session",60469),editSession:iue("edit-session",60470),codeReview:iue("code-review",60471),copilotWarning:iue("copilot-warning",60472),python:iue("python",60473),copilotLarge:iue("copilot-large",60474),copilotWarningLarge:iue("copilot-warning-large",60475),keyboardTab:iue("keyboard-tab",60476),copilotBlocked:iue("copilot-blocked",60477),copilotNotConnected:iue("copilot-not-connected",60478),flag:iue("flag",60479),lightbulbEmpty:iue("lightbulb-empty",60480),symbolMethodArrow:iue("symbol-method-arrow",60481),copilotUnavailable:iue("copilot-unavailable",60482),repoPinned:iue("repo-pinned",60483),keyboardTabAbove:iue("keyboard-tab-above",60484),keyboardTabBelow:iue("keyboard-tab-below",60485),gitPullRequestDone:iue("git-pull-request-done",60486),mcp:iue("mcp",60487),extensionsLarge:iue("extensions-large",60488),layoutPanelDock:iue("layout-panel-dock",60489),layoutSidebarLeftDock:iue("layout-sidebar-left-dock",60490),layoutSidebarRightDock:iue("layout-sidebar-right-dock",60491),copilotInProgress:iue("copilot-in-progress",60492),copilotError:iue("copilot-error",60493),copilotSuccess:iue("copilot-success",60494),chatSparkle:iue("chat-sparkle",60495),searchSparkle:iue("search-sparkle",60496),editSparkle:iue("edit-sparkle",60497),copilotSnooze:iue("copilot-snooze",60498),sendToRemoteAgent:iue("send-to-remote-agent",60499),commentDiscussionSparkle:iue("comment-discussion-sparkle",60500),chatSparkleWarning:iue("chat-sparkle-warning",60501),chatSparkleError:iue("chat-sparkle-error",60502),collection:iue("collection",60503),newCollection:iue("new-collection",60504),thinking:iue("thinking",60505),build:iue("build",60506),commentDiscussionQuote:iue("comment-discussion-quote",60507),cursor:iue("cursor",60508),eraser:iue("eraser",60509),fileText:iue("file-text",60510),gitLens:iue("git-lens",60511),quotes:iue("quotes",60512),rename:iue("rename",60513),runWithDeps:iue("run-with-deps",60514),debugConnected:iue("debug-connected",60515),strikethrough:iue("strikethrough",60516),openInProduct:iue("open-in-product",60517),indexZero:iue("index-zero",60518),agent:iue("agent",60519),editCode:iue("edit-code",60520),repoSelected:iue("repo-selected",60521),skip:iue("skip",60522),mergeInto:iue("merge-into",60523),gitBranchChanges:iue("git-branch-changes",60524),gitBranchStagedChanges:iue("git-branch-staged-changes",60525),gitBranchConflicts:iue("git-branch-conflicts",60526),gitBranch:iue("git-branch",60527),gitBranchCreate:iue("git-branch-create",60527),gitBranchDelete:iue("git-branch-delete",60527),searchLarge:iue("search-large",60528),terminalGitBash:iue("terminal-git-bash",60529)},uo={dialogError:iue("dialog-error","error"),dialogWarning:iue("dialog-warning","warning"),dialogInfo:iue("dialog-info","info"),dialogClose:iue("dialog-close","close"),treeItemExpanded:iue("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:iue("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:iue("tree-filter-on-type-off","list-selection"),treeFilterClear:iue("tree-filter-clear","close"),treeItemLoading:iue("tree-item-loading","loading"),menuSelection:iue("menu-selection","check"),menuSubmenu:iue("menu-submenu","chevron-right"),menuBarMore:iue("menubar-more","more"),scrollbarButtonLeft:iue("scrollbar-button-left","triangle-left"),scrollbarButtonRight:iue("scrollbar-button-right","triangle-right"),scrollbarButtonUp:iue("scrollbar-button-up","triangle-up"),scrollbarButtonDown:iue("scrollbar-button-down","triangle-down"),toolBarMore:iue("toolbar-more","more"),quickInputBack:iue("quick-input-back","arrow-left"),dropDownButton:iue("drop-down-button",60084),symbolCustomColor:iue("symbol-customcolor",60252),exportIcon:iue("export",60332),workspaceUnspecified:iue("workspace-unspecified",60355),newLine:iue("newline",60394),thumbsDownFilled:iue("thumbsdown-filled",60435),thumbsUpFilled:iue("thumbsup-filled",60436),gitFetch:iue("git-fetch",60445),lightbulbSparkleAutofix:iue("lightbulb-sparkle-autofix",60447),debugBreakpointPending:iue("debug-breakpoint-pending",60377)},go={...ho,...uo},function(e){e.isThemeColor=function(e){return!!e&&"object"==typeof e&&"string"==typeof e.id}}(po||(po={})),function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9-]+",e.iconModifierExpression="~[A-Za-z]+",e.iconNameCharacter="[A-Za-z0-9~-]";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){const n=t.exec(e.id);if(!n)return i(go.error);const[,o,s]=n,r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s.substring(1)),r}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")},e.isThemeIcon=function(e){return!!e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||po.isThemeColor(e.color))};const n=new RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);e.fromString=function(e){const t=n.exec(e);if(!t)return;const[,i]=t;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.getModifier=function(e){const t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){return e.id===t.id&&e.color?.id===t.color?.id},e.isFile=function(e){return e?.id===go.file.id},e.isFolder=function(e){return e?.id===go.folder.id}}(mo||(mo={})),fo=eue("commandService"),_o=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new je,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.metadata&&Array.isArray(e.metadata.args)){const t=[];for(const n of e.metadata.args)t.push(n.constraint);const i=e.handler;e.handler=function(e,...n){return function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n<i;n++)_le(e[n],t[n])}(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new Ae,this._commands.set(i,n));const o=n.unshift(e),s=Dle(()=>{o(),this._commands.get(i)?.isEmpty()&&this._commands.delete(i)});return this._onDidRegisterCommand.fire(i),s}registerCommandAlias(e,t){return _o.registerCommand(e,(e,...i)=>e.get(fo).executeCommand(t,...i))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return ke.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}},_o.registerCommand("noop",()=>{}),vo=Vae(1696,"Did you forget to open or close the quote?"),wo=Vae(1697,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'."),Co=class e{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:case 8:return">=";case 9:return"=~";case 10:case 17:case 18:case 19:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 20:return"EOF";default:throw Xae(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(oue("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(oue("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(oue("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return!this._isAtEnd()&&this._input.charCodeAt(this._current)===e&&(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;const t=this.stringRe.exec(this._input);if(t){this._current=this._start+t[0].length;const i=this._input.substring(this._start,this._current),n=e._keywords.get(i);n?this._addToken(n):this._tokens.push({type:17,lexeme:i,offset:this._start})}}_quotedString(){for(;39!==this._peek()&&!this._isAtEnd();)this._advance();this._isAtEnd()?this._error(vo):(this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1}))}_regex(){let t=this._current,i=!1,n=!1;for(;;){if(t>=this._input.length)return this._current=t,void this._error(wo);const e=this._input.charCodeAt(t);if(i)i=!1;else{if(47===e&&!n){t++;break}91===e?n=!0:92===e?i=!0:93===e&&(n=!1)}t++}for(;t<this._input.length&&e._regexFlags.has(this._input.charCodeAt(t));)t++;this._current=t;const o=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:o,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}},(bo=Co)._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0))),bo._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]),(xo=new Map).set("false",!1),xo.set("true",!0),xo.set("isMac",F),xo.set("isLinux",W),xo.set("isWindows",P),xo.set("isWeb",V),xo.set("isMacNative",F&&!V),xo.set("isEdge",ie),xo.set("isFirefox",ee),xo.set("isChrome",J),xo.set("isSafari",te),ko=Object.prototype.hasOwnProperty,Lo={regexParsingWithErrorRecovery:!0},Do=Vae(1675,"Empty context key expression"),Io=Vae(1676,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),No=Vae(1677,"'in' after 'not'."),Eo=Vae(1678,"closing parenthesis ')'"),Mo=Vae(1679,"Unexpected token"),To=Vae(1680,"Did you forget to put && or || before the token?"),Ro=Vae(1681,"Unexpected end of expression"),Oo=Vae(1682,"Did you forget to put a context key?"),Ao=class e{constructor(e=Lo){this._config=e,this._scanner=new Co,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(t){if(""!==t){this._tokens=this._scanner.reset(t).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const t=this._peek(),i=17===t.type?To:void 0;throw this._parsingErrors.push({message:Mo,offset:t.offset,lexeme:Co.getLexeme(t),additionalInfo:i}),e._parseError}return t}catch(Fae){if(Fae!==e._parseError)throw Fae;return}}else this._parsingErrors.push({message:Do,offset:0,lexeme:"",additionalInfo:Io})}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return 1===e.length?e[0]:Po.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return 1===e.length?e[0]:Po.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Fo.INSTANCE;case 12:return this._advance(),Wo.INSTANCE;case 0:{this._advance();const e=this._expr();return this._consume(1,Eo),e?.negate()}case 17:return this._advance(),Ko.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const t=this._peek();switch(t.type){case 11:return this._advance(),Po.true();case 12:return this._advance(),Po.false();case 0:{this._advance();const e=this._expr();return this._consume(1,Eo),e}case 17:{const e=t.lexeme;if(this._advance(),this._matchOne(9)){const t=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),10!==t.type)throw this._errExpectedButGot("REGEX",t);const i=t.lexeme,n=i.lastIndexOf("/"),o=n===i.length-1?void 0:this._removeFlagsGY(i.substring(n+1));let s;try{s=new RegExp(i.substring(1,n),o)}catch(Fae){throw this._errExpectedButGot("REGEX",t)}return Zo.create(e,s)}switch(t.type){case 10:case 19:{const i=[t.lexeme];this._advance();let n=this._peek(),o=0;for(let e=0;e<t.lexeme.length;e++)40===t.lexeme.charCodeAt(e)?o++:41===t.lexeme.charCodeAt(e)&&o--;for(;!this._isAtEnd()&&15!==n.type&&16!==n.type;){switch(n.type){case 0:o++;break;case 1:o--;break;case 10:case 18:for(let e=0;e<n.lexeme.length;e++)40===n.lexeme.charCodeAt(e)?o++:41===t.lexeme.charCodeAt(e)&&o--}if(o<0)break;i.push(Co.getLexeme(n)),this._advance(),n=this._peek()}const s=i.join(""),r=s.lastIndexOf("/"),a=r===s.length-1?void 0:this._removeFlagsGY(s.substring(r+1));let l;try{l=new RegExp(s.substring(1,r),a)}catch(Fae){throw this._errExpectedButGot("REGEX",t)}return Po.regex(e,l)}case 18:{const n=t.lexeme;this._advance();let o=null;if(!Ple(n)){const e=n.indexOf("/"),s=n.lastIndexOf("/");if(e!==s&&e>=0){const r=n.slice(e+1,s),a="i"===n[s+1]?"i":"";try{o=new RegExp(r,a)}catch(i){throw this._errExpectedButGot("REGEX",t)}}}if(null===o)throw this._errExpectedButGot("REGEX",t);return Zo.create(e,o)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,No);const t=this._value();return Po.notIn(e,t)}switch(this._peek().type){case 3:{this._advance();const t=this._value();if(18===this._previous().type)return Po.equals(e,t);switch(t){case"true":return Po.has(e);case"false":return Po.not(e);default:return Po.equals(e,t)}}case 4:{this._advance();const t=this._value();if(18===this._previous().type)return Po.notEquals(e,t);switch(t){case"true":return Po.not(e);case"false":return Po.has(e);default:return Po.notEquals(e,t)}}case 5:return this._advance(),$o.create(e,this._value());case 6:return this._advance(),Go.create(e,this._value());case 7:return this._advance(),qo.create(e,this._value());case 8:return this._advance(),jo.create(e,this._value());case 13:return this._advance(),Po.in(e,this._value());default:return Po.has(e)}}case 20:throw this._parsingErrors.push({message:Ro,offset:t.offset,lexeme:"",additionalInfo:Oo}),e._parseError;default:throw this._errExpectedButGot("true | false | KEY \n\t| KEY '=~' REGEX \n\t| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value",this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return!!this._check(e)&&(this._advance(),!0)}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(t,i,n){const o=Vae(1683,"Expected: {0}\nReceived: '{1}'.",t,Co.getLexeme(i)),s=i.offset,r=Co.getLexeme(i);return this._parsingErrors.push({message:o,offset:s,lexeme:r,additionalInfo:n}),e._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return 20===this._peek().type}},Ao._parseError=new Error,(Po=class{static false(){return Fo.INSTANCE}static true(){return Wo.INSTANCE}static has(e){return Bo.create(e)}static equals(e,t){return Vo.create(e,t)}static notEquals(e,t){return Uo.create(e,t)}static regex(e,t){return Zo.create(e,t)}static in(e,t){return Ho.create(e,t)}static notIn(e,t){return zo.create(e,t)}static not(e){return Ko.create(e)}static and(...e){return Qo.create(e,null,!0)}static or(...e){return Xo.create(e,null,!0)}static deserialize(e){if(null!=e)return this._parser.parse(e)}})._parser=new Ao({regexParsingWithErrorRecovery:!1}),(yo=Fo=class{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Wo.INSTANCE}}).INSTANCE=new yo,(So=Wo=class{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return Fo.INSTANCE}}).INSTANCE=new So,Bo=class e{static create(t,i=null){const n=xo.get(t);return"boolean"==typeof n?n?Wo.INSTANCE:Fo.INSTANCE:new e(t,i)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:lue(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=xo.get(this.key);return"boolean"==typeof e?e?Wo.INSTANCE:Fo.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Ko.create(this.key,this)),this.negated}},Vo=class e{static create(t,i,n=null){if("boolean"==typeof i)return i?Bo.create(t,n):Ko.create(t,n);const o=xo.get(t);return"boolean"==typeof o?i===(o?"true":"false")?Wo.INSTANCE:Fo.INSTANCE:new e(t,i,n)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:due(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=xo.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?Wo.INSTANCE:Fo.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Uo.create(this.key,this.value,this)),this.negated}},Ho=class e{static create(t,i){return new e(t,i)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:due(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&this.key===e.key&&this.valueKey===e.valueKey}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):"string"==typeof i&&"object"==typeof t&&null!==t&&ko.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=zo.create(this.key,this.valueKey)),this.negated}},zo=class e{static create(t,i){return new e(t,i)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=Ho.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type&&this._negated.equals(e._negated)}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}},Uo=class e{static create(t,i,n=null){if("boolean"==typeof i)return i?Ko.create(t,n):Bo.create(t,n);const o=xo.get(t);return"boolean"==typeof o?i===(o?"true":"false")?Fo.INSTANCE:Wo.INSTANCE:new e(t,i,n)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:due(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){const e=xo.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?Fo.INSTANCE:Wo.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Vo.create(this.key,this.value,this)),this.negated}},Ko=class e{static create(t,i=null){const n=xo.get(t);return"boolean"==typeof n?n?Fo.INSTANCE:Wo.INSTANCE:new e(t,i)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:lue(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=xo.get(this.key);return"boolean"==typeof e?e?Fo.INSTANCE:Wo.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Bo.create(this.key,this)),this.negated}},qo=class e{static create(t,i,n=null){return rue(i,i=>new e(t,i,n))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:due(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Go.create(this.key,this.value,this)),this.negated}},jo=class e{static create(t,i,n=null){return rue(i,i=>new e(t,i,n))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:due(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=$o.create(this.key,this.value,this)),this.negated}},$o=class e{static create(t,i,n=null){return rue(i,i=>new e(t,i,n))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:due(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=jo.create(this.key,this.value,this)),this.negated}},Go=class e{static create(t,i,n=null){return rue(i,i=>new e(t,i,n))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:due(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=qo.create(this.key,this.value,this)),this.negated}},Zo=class e{static create(t,i){return new e(t,i)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Yo.create(this)),this.negated}},Yo=class e{static create(t){return new e(t)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}},Qo=class e{static create(t,i,n){return e._normalizeArr(t,i,n)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=sue(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const t=aue(this.expr);return t===this.expr?this:e.create(t,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(t,i,n){const o=[];let s=!1;for(const e of t)if(e)if(1!==e.type){if(0===e.type)return Fo.INSTANCE;6!==e.type?o.push(e):o.push(...e.expr)}else s=!0;if(0===o.length&&s)return Wo.INSTANCE;if(0!==o.length){if(1===o.length)return o[0];o.sort(sue);for(let e=1;e<o.length;e++)o[e-1].equals(o[e])&&(o.splice(e,1),e--);if(1===o.length)return o[0];for(;o.length>1;){const t=o[o.length-1];if(9!==t.type)break;o.pop();const i=o.pop(),s=0===o.length,r=Xo.create(t.expr.map(t=>e.create([t,i],null,n)),null,s);r&&(o.push(r),o.sort(sue))}if(1===o.length)return o[0];if(n){for(let e=0;e<o.length;e++)for(let t=e+1;t<o.length;t++)if(o[e].negate().equals(o[t]))return Fo.INSTANCE;if(1===o.length)return o[0]}return new e(o,i)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Xo.create(e,this,!0)}return this.negated}},Xo=class e{static create(t,i,n){return e._normalizeArr(t,i,n)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){const i=sue(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const t=aue(this.expr);return t===this.expr?this:e.create(t,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(t,i,n){let o=[],s=!1;if(t){for(let e=0,i=t.length;e<i;e++){const i=t[e];if(i)if(0!==i.type){if(1===i.type)return Wo.INSTANCE;9!==i.type?o.push(i):o=o.concat(i.expr)}else s=!0}if(0===o.length&&s)return Fo.INSTANCE;o.sort(sue)}if(0!==o.length){if(1===o.length)return o[0];for(let e=1;e<o.length;e++)o[e-1].equals(o[e])&&(o.splice(e,1),e--);if(1===o.length)return o[0];if(n){for(let e=0;e<o.length;e++)for(let t=e+1;t<o.length;t++)if(o[e].negate().equals(o[t]))return Wo.INSTANCE;if(1===o.length)return o[0]}return new e(o,i)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const t=[];for(const e of this.expr)t.push(e.negate());for(;t.length>1;){const i=t.shift(),n=t.shift(),o=[];for(const e of uue(i))for(const t of uue(n))o.push(Qo.create([e,t],null,!1));t.unshift(e.create(o,null,!1))}this.negated=e.create(t,this,!0)}return this.negated}},(Jo=class e extends Bo{static all(){return e._info.values()}constructor(t,i,n){super(t,null),this._defaultValue=i,"object"==typeof n?e._info.push({...n,key:t}):!0!==n&&e._info.push({key:t,description:n,type:null!=i?typeof i:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Vo.create(this.key,e)}})._info=[],es=eue("contextKeyService"),ts=new class{constructor(){this.data=new Map}add(e,t){Jae(sle(e)),Jae(rle(t)),Jae(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}dispose(){this.data.forEach(e=>{fle(e.dispose)&&e.dispose()}),this.data.clear()}},is=class e{constructor(){this._coreKeybindings=new Ae,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===Y){if(e&&e.win)return e.win}else if(2===Y){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(t){const i=e.bindToCurrentPlatform(t),n=new De;if(i&&i.primary){const e=wle(i.primary,Y);e&&n.add(this._registerDefaultKeybinding(e,t.id,t.args,t.weight,0,t.when))}if(i&&Array.isArray(i.secondary))for(let e=0,o=i.secondary.length;e<o;e++){const o=wle(i.secondary[e],Y);o&&n.add(this._registerDefaultKeybinding(o,t.id,t.args,t.weight,-e-1,t.when))}return n}registerCommandAndKeybindingRule(e){return Lle(this.registerKeybindingRule(e),_o.registerCommand(e))}_registerDefaultKeybinding(e,t,i,n,o,s){const r=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:s,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,Dle(()=>{r(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(gue)),this._cachedMergedKeybindings.slice(0)}},ns=new is,os={EditorModes:"platform.keybindingsRegistry"},ts.add(os.EditorModes,ns),rs=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},as=function(e,t){return function(i,n){t(i,n,e)}},(ss=ds=class e{constructor(t){if(e._instances.has(t))throw new TypeError(`MenuId with identifier '${t}' already exists. Use MenuId.for(ident) or a unique identifier`);e._instances.set(t,this),this.id=t}})._instances=new Map,ss.CommandPalette=new ss("CommandPalette"),ss.DebugBreakpointsContext=new ss("DebugBreakpointsContext"),ss.DebugCallStackContext=new ss("DebugCallStackContext"),ss.DebugConsoleContext=new ss("DebugConsoleContext"),ss.DebugVariablesContext=new ss("DebugVariablesContext"),ss.NotebookVariablesContext=new ss("NotebookVariablesContext"),ss.DebugHoverContext=new ss("DebugHoverContext"),ss.DebugWatchContext=new ss("DebugWatchContext"),ss.DebugToolBar=new ss("DebugToolBar"),ss.DebugToolBarStop=new ss("DebugToolBarStop"),ss.DebugDisassemblyContext=new ss("DebugDisassemblyContext"),ss.DebugCallStackToolbar=new ss("DebugCallStackToolbar"),ss.DebugCreateConfiguration=new ss("DebugCreateConfiguration"),ss.EditorContext=new ss("EditorContext"),ss.SimpleEditorContext=new ss("SimpleEditorContext"),ss.EditorContent=new ss("EditorContent"),ss.EditorLineNumberContext=new ss("EditorLineNumberContext"),ss.EditorContextCopy=new ss("EditorContextCopy"),ss.EditorContextPeek=new ss("EditorContextPeek"),ss.EditorContextShare=new ss("EditorContextShare"),ss.EditorTitle=new ss("EditorTitle"),ss.CompactWindowEditorTitle=new ss("CompactWindowEditorTitle"),ss.EditorTitleRun=new ss("EditorTitleRun"),ss.EditorTitleContext=new ss("EditorTitleContext"),ss.EditorTitleContextShare=new ss("EditorTitleContextShare"),ss.EmptyEditorGroup=new ss("EmptyEditorGroup"),ss.EmptyEditorGroupContext=new ss("EmptyEditorGroupContext"),ss.EditorTabsBarContext=new ss("EditorTabsBarContext"),ss.EditorTabsBarShowTabsSubmenu=new ss("EditorTabsBarShowTabsSubmenu"),ss.EditorTabsBarShowTabsZenModeSubmenu=new ss("EditorTabsBarShowTabsZenModeSubmenu"),ss.EditorActionsPositionSubmenu=new ss("EditorActionsPositionSubmenu"),ss.EditorSplitMoveSubmenu=new ss("EditorSplitMoveSubmenu"),ss.ExplorerContext=new ss("ExplorerContext"),ss.ExplorerContextShare=new ss("ExplorerContextShare"),ss.ExtensionContext=new ss("ExtensionContext"),ss.ExtensionEditorContextMenu=new ss("ExtensionEditorContextMenu"),ss.GlobalActivity=new ss("GlobalActivity"),ss.CommandCenter=new ss("CommandCenter"),ss.CommandCenterCenter=new ss("CommandCenterCenter"),ss.LayoutControlMenuSubmenu=new ss("LayoutControlMenuSubmenu"),ss.LayoutControlMenu=new ss("LayoutControlMenu"),ss.MenubarMainMenu=new ss("MenubarMainMenu"),ss.MenubarAppearanceMenu=new ss("MenubarAppearanceMenu"),ss.MenubarDebugMenu=new ss("MenubarDebugMenu"),ss.MenubarEditMenu=new ss("MenubarEditMenu"),ss.MenubarCopy=new ss("MenubarCopy"),ss.MenubarFileMenu=new ss("MenubarFileMenu"),ss.MenubarGoMenu=new ss("MenubarGoMenu"),ss.MenubarHelpMenu=new ss("MenubarHelpMenu"),ss.MenubarLayoutMenu=new ss("MenubarLayoutMenu"),ss.MenubarNewBreakpointMenu=new ss("MenubarNewBreakpointMenu"),ss.PanelAlignmentMenu=new ss("PanelAlignmentMenu"),ss.PanelPositionMenu=new ss("PanelPositionMenu"),ss.ActivityBarPositionMenu=new ss("ActivityBarPositionMenu"),ss.MenubarPreferencesMenu=new ss("MenubarPreferencesMenu"),ss.MenubarRecentMenu=new ss("MenubarRecentMenu"),ss.MenubarSelectionMenu=new ss("MenubarSelectionMenu"),ss.MenubarShare=new ss("MenubarShare"),ss.MenubarSwitchEditorMenu=new ss("MenubarSwitchEditorMenu"),ss.MenubarSwitchGroupMenu=new ss("MenubarSwitchGroupMenu"),ss.MenubarTerminalMenu=new ss("MenubarTerminalMenu"),ss.MenubarTerminalSuggestStatusMenu=new ss("MenubarTerminalSuggestStatusMenu"),ss.MenubarViewMenu=new ss("MenubarViewMenu"),ss.MenubarHomeMenu=new ss("MenubarHomeMenu"),ss.OpenEditorsContext=new ss("OpenEditorsContext"),ss.OpenEditorsContextShare=new ss("OpenEditorsContextShare"),ss.ProblemsPanelContext=new ss("ProblemsPanelContext"),ss.SCMInputBox=new ss("SCMInputBox"),ss.SCMChangeContext=new ss("SCMChangeContext"),ss.SCMResourceContext=new ss("SCMResourceContext"),ss.SCMResourceContextShare=new ss("SCMResourceContextShare"),ss.SCMResourceFolderContext=new ss("SCMResourceFolderContext"),ss.SCMResourceGroupContext=new ss("SCMResourceGroupContext"),ss.SCMSourceControl=new ss("SCMSourceControl"),ss.SCMSourceControlInline=new ss("SCMSourceControlInline"),ss.SCMSourceControlTitle=new ss("SCMSourceControlTitle"),ss.SCMHistoryTitle=new ss("SCMHistoryTitle"),ss.SCMHistoryItemContext=new ss("SCMHistoryItemContext"),ss.SCMHistoryItemChangeContext=new ss("SCMHistoryItemChangeContext"),ss.SCMHistoryItemRefContext=new ss("SCMHistoryItemRefContext"),ss.SCMArtifactGroupContext=new ss("SCMArtifactGroupContext"),ss.SCMArtifactContext=new ss("SCMArtifactContext"),ss.SCMQuickDiffDecorations=new ss("SCMQuickDiffDecorations"),ss.SCMTitle=new ss("SCMTitle"),ss.SearchContext=new ss("SearchContext"),ss.SearchActionMenu=new ss("SearchActionContext"),ss.StatusBarWindowIndicatorMenu=new ss("StatusBarWindowIndicatorMenu"),ss.StatusBarRemoteIndicatorMenu=new ss("StatusBarRemoteIndicatorMenu"),ss.StickyScrollContext=new ss("StickyScrollContext"),ss.TestItem=new ss("TestItem"),ss.TestItemGutter=new ss("TestItemGutter"),ss.TestProfilesContext=new ss("TestProfilesContext"),ss.TestMessageContext=new ss("TestMessageContext"),ss.TestMessageContent=new ss("TestMessageContent"),ss.TestPeekElement=new ss("TestPeekElement"),ss.TestPeekTitle=new ss("TestPeekTitle"),ss.TestCallStack=new ss("TestCallStack"),ss.TestCoverageFilterItem=new ss("TestCoverageFilterItem"),ss.TouchBarContext=new ss("TouchBarContext"),ss.TitleBar=new ss("TitleBar"),ss.TitleBarContext=new ss("TitleBarContext"),ss.TitleBarTitleContext=new ss("TitleBarTitleContext"),ss.TunnelContext=new ss("TunnelContext"),ss.TunnelPrivacy=new ss("TunnelPrivacy"),ss.TunnelProtocol=new ss("TunnelProtocol"),ss.TunnelPortInline=new ss("TunnelInline"),ss.TunnelTitle=new ss("TunnelTitle"),ss.TunnelLocalAddressInline=new ss("TunnelLocalAddressInline"),ss.TunnelOriginInline=new ss("TunnelOriginInline"),ss.ViewItemContext=new ss("ViewItemContext"),ss.ViewContainerTitle=new ss("ViewContainerTitle"),ss.ViewContainerTitleContext=new ss("ViewContainerTitleContext"),ss.ViewTitle=new ss("ViewTitle"),ss.ViewTitleContext=new ss("ViewTitleContext"),ss.CommentEditorActions=new ss("CommentEditorActions"),ss.CommentThreadTitle=new ss("CommentThreadTitle"),ss.CommentThreadActions=new ss("CommentThreadActions"),ss.CommentThreadAdditionalActions=new ss("CommentThreadAdditionalActions"),ss.CommentThreadTitleContext=new ss("CommentThreadTitleContext"),ss.CommentThreadCommentContext=new ss("CommentThreadCommentContext"),ss.CommentTitle=new ss("CommentTitle"),ss.CommentActions=new ss("CommentActions"),ss.CommentsViewThreadActions=new ss("CommentsViewThreadActions"),ss.InteractiveToolbar=new ss("InteractiveToolbar"),ss.InteractiveCellTitle=new ss("InteractiveCellTitle"),ss.InteractiveCellDelete=new ss("InteractiveCellDelete"),ss.InteractiveCellExecute=new ss("InteractiveCellExecute"),ss.InteractiveInputExecute=new ss("InteractiveInputExecute"),ss.InteractiveInputConfig=new ss("InteractiveInputConfig"),ss.ReplInputExecute=new ss("ReplInputExecute"),ss.IssueReporter=new ss("IssueReporter"),ss.NotebookToolbar=new ss("NotebookToolbar"),ss.NotebookToolbarContext=new ss("NotebookToolbarContext"),ss.NotebookStickyScrollContext=new ss("NotebookStickyScrollContext"),ss.NotebookCellTitle=new ss("NotebookCellTitle"),ss.NotebookCellDelete=new ss("NotebookCellDelete"),ss.NotebookCellInsert=new ss("NotebookCellInsert"),ss.NotebookCellBetween=new ss("NotebookCellBetween"),ss.NotebookCellListTop=new ss("NotebookCellTop"),ss.NotebookCellExecute=new ss("NotebookCellExecute"),ss.NotebookCellExecuteGoTo=new ss("NotebookCellExecuteGoTo"),ss.NotebookCellExecutePrimary=new ss("NotebookCellExecutePrimary"),ss.NotebookDiffCellInputTitle=new ss("NotebookDiffCellInputTitle"),ss.NotebookDiffDocumentMetadata=new ss("NotebookDiffDocumentMetadata"),ss.NotebookDiffCellMetadataTitle=new ss("NotebookDiffCellMetadataTitle"),ss.NotebookDiffCellOutputsTitle=new ss("NotebookDiffCellOutputsTitle"),ss.NotebookOutputToolbar=new ss("NotebookOutputToolbar"),ss.NotebookOutlineFilter=new ss("NotebookOutlineFilter"),ss.NotebookOutlineActionMenu=new ss("NotebookOutlineActionMenu"),ss.NotebookEditorLayoutConfigure=new ss("NotebookEditorLayoutConfigure"),ss.NotebookKernelSource=new ss("NotebookKernelSource"),ss.BulkEditTitle=new ss("BulkEditTitle"),ss.BulkEditContext=new ss("BulkEditContext"),ss.TimelineItemContext=new ss("TimelineItemContext"),ss.TimelineTitle=new ss("TimelineTitle"),ss.TimelineTitleContext=new ss("TimelineTitleContext"),ss.TimelineFilterSubMenu=new ss("TimelineFilterSubMenu"),ss.AccountsContext=new ss("AccountsContext"),ss.SidebarTitle=new ss("SidebarTitle"),ss.PanelTitle=new ss("PanelTitle"),ss.AuxiliaryBarTitle=new ss("AuxiliaryBarTitle"),ss.TerminalInstanceContext=new ss("TerminalInstanceContext"),ss.TerminalEditorInstanceContext=new ss("TerminalEditorInstanceContext"),ss.TerminalNewDropdownContext=new ss("TerminalNewDropdownContext"),ss.TerminalTabContext=new ss("TerminalTabContext"),ss.TerminalTabEmptyAreaContext=new ss("TerminalTabEmptyAreaContext"),ss.TerminalStickyScrollContext=new ss("TerminalStickyScrollContext"),ss.WebviewContext=new ss("WebviewContext"),ss.InlineCompletionsActions=new ss("InlineCompletionsActions"),ss.InlineEditsActions=new ss("InlineEditsActions"),ss.NewFile=new ss("NewFile"),ss.MergeInput1Toolbar=new ss("MergeToolbar1Toolbar"),ss.MergeInput2Toolbar=new ss("MergeToolbar2Toolbar"),ss.MergeBaseToolbar=new ss("MergeBaseToolbar"),ss.MergeInputResultToolbar=new ss("MergeToolbarResultToolbar"),ss.InlineSuggestionToolbar=new ss("InlineSuggestionToolbar"),ss.InlineEditToolbar=new ss("InlineEditToolbar"),ss.ChatContext=new ss("ChatContext"),ss.ChatCodeBlock=new ss("ChatCodeblock"),ss.ChatCompareBlock=new ss("ChatCompareBlock"),ss.ChatMessageTitle=new ss("ChatMessageTitle"),ss.ChatHistory=new ss("ChatHistory"),ss.ChatWelcomeContext=new ss("ChatWelcomeContext"),ss.ChatMessageFooter=new ss("ChatMessageFooter"),ss.ChatExecute=new ss("ChatExecute"),ss.ChatInput=new ss("ChatInput"),ss.ChatInputSide=new ss("ChatInputSide"),ss.ChatModePicker=new ss("ChatModePicker"),ss.ChatEditingWidgetToolbar=new ss("ChatEditingWidgetToolbar"),ss.ChatEditingEditorContent=new ss("ChatEditingEditorContent"),ss.ChatEditingEditorHunk=new ss("ChatEditingEditorHunk"),ss.ChatEditingDeletedNotebookCell=new ss("ChatEditingDeletedNotebookCell"),ss.ChatInputAttachmentToolbar=new ss("ChatInputAttachmentToolbar"),ss.ChatEditingWidgetModifiedFilesToolbar=new ss("ChatEditingWidgetModifiedFilesToolbar"),ss.ChatInputResourceAttachmentContext=new ss("ChatInputResourceAttachmentContext"),ss.ChatInputSymbolAttachmentContext=new ss("ChatInputSymbolAttachmentContext"),ss.ChatInlineResourceAnchorContext=new ss("ChatInlineResourceAnchorContext"),ss.ChatInlineSymbolAnchorContext=new ss("ChatInlineSymbolAnchorContext"),ss.ChatMessageCheckpoint=new ss("ChatMessageCheckpoint"),ss.ChatMessageRestoreCheckpoint=new ss("ChatMessageRestoreCheckpoint"),ss.ChatNewMenu=new ss("ChatNewMenu"),ss.ChatEditingCodeBlockContext=new ss("ChatEditingCodeBlockContext"),ss.ChatTitleBarMenu=new ss("ChatTitleBarMenu"),ss.ChatAttachmentsContext=new ss("ChatAttachmentsContext"),ss.ChatToolOutputResourceToolbar=new ss("ChatToolOutputResourceToolbar"),ss.ChatTextEditorMenu=new ss("ChatTextEditorMenu"),ss.ChatToolOutputResourceContext=new ss("ChatToolOutputResourceContext"),ss.ChatMultiDiffContext=new ss("ChatMultiDiffContext"),ss.ChatSessionsMenu=new ss("ChatSessionsMenu"),ss.ChatSessionsCreateSubMenu=new ss("ChatSessionsCreateSubMenu"),ss.ChatConfirmationMenu=new ss("ChatConfirmationMenu"),ss.ChatEditorInlineExecute=new ss("ChatEditorInputExecute"),ss.ChatEditorInlineInputSide=new ss("ChatEditorInputSide"),ss.AccessibleView=new ss("AccessibleView"),ss.MultiDiffEditorFileToolbar=new ss("MultiDiffEditorFileToolbar"),ss.DiffEditorHunkToolbar=new ss("DiffEditorHunkToolbar"),ss.DiffEditorSelectionToolbar=new ss("DiffEditorSelectionToolbar"),cs=eue("menuService"),(hs=class e{static for(t){let i=this._all.get(t);return i||(i=new e(t),this._all.set(t,i)),i}static merge(t){const i=new Set;for(const n of t)n instanceof e&&i.add(n.id);return i}constructor(e){this.id=e,this.has=t=>t===e}})._all=new Map,us=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Qe({merge:hs.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(hs.for(ds.CommandPalette)),Dle(()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(hs.for(ds.CommandPalette))})}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach((t,i)=>e.set(i,t)),e}appendMenuItem(e,t){let i=this._menuItems.get(e);i||(i=new Ae,this._menuItems.set(e,i));const n=i.push(t);return this._onDidChangeMenu.fire(hs.for(e)),Dle(()=>{n(),this._onDidChangeMenu.fire(hs.for(e))})}appendMenuItems(e){const t=new De;for(const{id:i,item:n}of e)t.add(this.appendMenuItem(i,n));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===ds.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)pue(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach((i,n)=>{t.has(n)||e.push({command:i})})}},gs=class extends ao{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}},ps=ls=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value}constructor(e,t,i,n,o,s,r){let a;if(this.hideActions=n,this.menuKeybinding=o,this._commandService=r,this.id=e.id,this.label=ls.label(e,i),this.tooltip=("string"==typeof e.tooltip?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||s.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=s.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip="string"==typeof t.tooltip?t.tooltip:t.tooltip.value),this.checked&&mo.isThemeIcon(t.icon)&&(a=t.icon),this.checked&&t.title&&(this.label="string"==typeof t.title?t.title:t.title.value)}a||(a=mo.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new ls(t,void 0,i,n,void 0,s,r):void 0,this._options=i,this.class=a&&mo.asClassName(a)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}},ps=ls=rs([as(5,es),as(6,fo)],ps),ms=class{constructor(e){this.desc=e}},fs=eue("telemetryService"),Cs=class{constructor(e,t){this.uri=e,this.value=t}},bs=Symbol.toStringTag,_s=Symbol.iterator,(ys=class e{constructor(t,i){if(this[bs]="ResourceMap",t instanceof e)this.map=new Map(t.map),this.toKey=i??e.defaultToKey;else if(function(e){return Array.isArray(e)}(t)){this.map=new Map,this.toKey=i??e.defaultToKey;for(const[e,i]of t)this.set(e,i)}else this.map=new Map,this.toKey=t??e.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Cs(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(const[i,n]of this.map)e(n.value,n.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[_s](){for(const[,e]of this.map)yield[e.uri,e.value]}}).defaultToKey=e=>e.toString(),Ss=class{constructor(e,t){this[vs]="ResourceSet",e&&"function"!=typeof e?(this._map=new ys(t),e.forEach(this.add,this)):this._map=new ys(e)}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,t){this._map.forEach((i,n)=>e.call(t,n,n,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(vs=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},xs=class{constructor(){this[ws]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");n=n.next}}keys(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(ws=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._tail,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.previous,i--;this._tail=t,this._size=i,t&&(t.next=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}},ks=class extends xs{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Ls=class extends ks{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}},Ds=class{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return void 0!==t&&(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}},Is=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}},Ns=class{constructor(){this._data=new Map}set(e,...t){let i=this._data;for(let n=0;n<t.length-1;n++)i.has(t[n])||i.set(t[n],new Map),i=i.get(t[n]);i.set(t[t.length-1],e)}get(...e){let t=this._data;for(let i=0;i<e.length-1;i++){if(!t.has(e[i]))return;t=t.get(e[i])}return t.get(e[e.length-1])}clear(){this._data.clear()}toString(){const e=(t,i)=>{let n="";for(const[o,s]of t)n+=`${" ".repeat(i)}${o}: `,s instanceof Map?n+="\n"+e(s,i+1):n+=`${s}\n`;return n};return e(this._data,0)}},Es=class{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Zle(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===yi.file)return vue(Cue(e),Cue(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(Hs(e.authority,t.authority))return vue(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return _i.joinPath(e,...t)}basenameOrAuthority(e){return Os(e)||e.authority}basename(e){return ni.basename(e.path)}extname(e){return ni.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===yi.file?t=_i.file(ai(Cue(e))).path:(t=ni.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===yi.file?_i.file(oi(Cue(e))).path:ni.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!Hs(e.authority,t.authority))return;if(e.scheme===yi.file){const i=ri(Cue(e),Cue(t));return P?_ue(i):i}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(i.length,n.length);e<t&&(i.charCodeAt(e)===n.charCodeAt(e)||i.charAt(e).toLowerCase()===n.charAt(e).toLowerCase());e++);i=n.substr(0,e)+i.substr(e)}return ni.relative(i,n)}resolvePath(e,t){if(e.scheme===yi.file){const i=_i.file(si(Cue(e),t));return e.with({authority:i.authority,path:i.path})}var i;return-1===(i=t).indexOf("/")&&(i=_ue(i)),/^[a-zA-Z]:(\/|$)/.test(i)&&(i="/"+i),t=i,e.with({path:ni.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&"/"===e.path[0]}isEqualAuthority(e,t){return e===t||void 0!==e&&void 0!==t&&ide(e,t)}hasTrailingPathSeparator(e,t=ci){if(e.scheme===yi.file){const i=Cue(e);return i.length>bue(i).length&&i[i.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=ci){return zs(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=ci){let i=!1;if(e.scheme===yi.file){const n=Cue(e);i=void 0!==n&&n.length===bue(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||zs(e,t)?e:e.with({path:e.path+"/"})}},Ms=new Es(()=>!1),Ts=Ms.isEqual.bind(Ms),Ms.isEqualOrParent.bind(Ms),Ms.getComparisonKey.bind(Ms),Rs=Ms.basenameOrAuthority.bind(Ms),Os=Ms.basename.bind(Ms),As=Ms.extname.bind(Ms),Ps=Ms.dirname.bind(Ms),Fs=Ms.joinPath.bind(Ms),Ws=Ms.normalizePath.bind(Ms),Bs=Ms.relativePath.bind(Ms),Vs=Ms.resolvePath.bind(Ms),Ms.isAbsolutePath.bind(Ms),Hs=Ms.isEqualAuthority.bind(Ms),zs=Ms.hasTrailingPathSeparator.bind(Ms),Ms.removeTrailingPathSeparator.bind(Ms),Ms.addTrailingPathSeparator.bind(Ms),function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)});const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}(Us||(Us={})),Ks=eue("logService"),qs=eue("loggerService"),function(e){e[e.Off=0]="Off",e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warning=4]="Warning",e[e.Error=5]="Error"}(js||(js={})),$s=js.Info,Gs=class extends Ie{constructor(){super(...arguments),this.level=$s,this._onDidChangeLogLevel=this._register(new je)}get onDidChangeLogLevel(){return this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return yue(this.level,e)}canLog(e){return!this._store.isDisposed&&this.checkLogLevel(e)}},Zs=class extends Gs{constructor(e=$s,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.canLog(js.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.canLog(js.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.canLog(js.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.canLog(js.Warning)&&(this.useColors?console.warn("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.canLog(js.Error)&&(this.useColors?console.error("%c ERR","color: #f33",e,...t):console.error(e,...t))}},Ys=class extends Gs{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose();super.dispose()}},Qs=class extends Ie{constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new ys,this._onDidChangeLoggers=this._register(new je),this._onDidChangeVisibility=this._register(new je),i)for(const n of i)this._loggers.set(n.resource,{logger:void 0,info:n})}getLoggerEntry(e){return sle(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}createLogger(e,t){const i=this.toResource(e),n=sle(e)?e:t?.id??Ude(i.toString()).toString(16);let o=this._loggers.get(i)?.logger;const s="always"===t?.logLevel?js.Trace:t?.logLevel;o||(o=this.doCreateLogger(i,s??this.getLogLevel(i)??this.logLevel,{...t,id:n}));const r={logger:o,info:{resource:i,id:n,logLevel:s,name:t?.name,hidden:t?.hidden,group:t?.group,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(r.info),this._loggers.set(i,r),o}toResource(e){return sle(e)?Fs(this.logsHome,`${e}.log`):e}setVisibility(e,t){const i=this.getLoggerEntry(e);i&&t!==!i.info.hidden&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){const t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}dispose(){this._loggers.forEach(e=>e.logger?.dispose()),this._loggers.clear(),super.dispose()}},Xs=class{constructor(){this.onDidChangeLogLevel=(new je).event}setLevel(e){}getLevel(){return js.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}dispose(){}},Js=class extends Qs{constructor(){super(js.Off,_i.parse("log:///log"))}doCreateLogger(e,t,i){return new Xs}},new Jo("logLevel",function(e){switch(e){case js.Trace:return"trace";case js.Debug:return"debug";case js.Info:return"info";case js.Warning:return"warn";case js.Error:return"error";case js.Off:return"off"}}(js.Info)),(er=class e{static getRegisteredCommands(){return[...e.REGISTERED_COMMANDS]}static registerCommand(t){e.REGISTERED_COMMANDS.add(t)}}).REGISTERED_COMMANDS=new Set,ir=class{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata,this.canTriggerInlineEdits=e.canTriggerInlineEdits}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let e=t.kbExpr;this.precondition&&(e=e?Po.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};ns.registerKeybindingRule(i)}}_o.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata}),this.canTriggerInlineEdits&&er.registerCommand(this.id)}_registerMenuItem(e){us.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}},nr=class extends ir{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort((e,t)=>t.priority-e.priority),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===i)return void this._implementations.splice(e,1)}}}runCommand(e,t){const i=e.get(Ks),n=e.get(es);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const o of this._implementations){if(o.when){const e=n.getContext(vhe());if(!o.when.evaluate(e))continue}const s=o.implementation(e,t);if(s){if(i.trace(`Command '${this.id}' was handled by '${o.name}'.`),"boolean"==typeof s)return;return s}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}},or=class extends ir{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}},sr=class e extends ir{static bindToContribution(t){return class extends e{constructor(e){super(e),this._callback=e.handler}runEditorCommand(e,i,n){const o=t(i);o&&this._callback(o,n)}}}static runEditorCommand(e,t,i,n){const o=e.get(eo),s=o.getFocusedCodeEditor()||o.getActiveCodeEditor();if(s)return s.invokeWithinContext(e=>{if(e.get(es).contextMatchesRules(i??void 0))return n(e,s,t)})}runCommand(t,i){return e.runEditorCommand(t,i,this.precondition,(e,t,i)=>this.runEditorCommand(e,t,i))}},rr=class e extends sr{static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=ds.EditorContext),t.title||(t.title="string"==typeof e.label?e.label:e.label.value),t.when=Po.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(t){super(e.convertOptions(t)),"string"==typeof t.label?(this.label=t.label,this.alias=t.alias??t.label):(this.label=t.label.value,this.alias=t.alias??t.label.original)}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(fs).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}},ar=class extends rr{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((e,t)=>t[0]-e[0]),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e][1]===t)return void this._implementations.splice(e,1)}}}run(e,t,i){for(const n of this._implementations){const o=n[1](e,t,i);if(o){if("boolean"==typeof o)return;return o}}}},lr=class extends ms{run(e,...t){const i=e.get(eo),n=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(n)return n.invokeWithinContext(e=>{const i=e.get(es),o=e.get(Ks);if(i.contextMatchesRules(this.desc.precondition??void 0))return this.runEditorCommand(e,n,...t);o.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,this.desc.precondition?.serialize())})}},function(e){e.getEditorCommand=function(e){return hr.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return hr.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return hr.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return hr.INSTANCE.getEditorContributions().filter(t=>e.indexOf(t.id)>=0)},e.getDiffEditorContributions=function(){return hr.INSTANCE.getDiffEditorContributions()}}(dr||(dr={})),cr={EditorCommonContributions:"editor.contributions"},(tr=hr=class{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}).INSTANCE=new tr,ts.add(cr.EditorCommonContributions,hr.INSTANCE),ur=Nue(new nr({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:ds.MenubarEditMenu,group:"1_do",title:Vae(69,"&&Undo"),order:1},{menuId:ds.CommandPalette,group:"",title:Vae(70,"Undo"),order:1},{menuId:ds.SimpleEditorContext,group:"1_do",title:Vae(71,"Undo"),order:1}]})),Nue(new or(ur,{id:"default:undo",precondition:void 0})),gr=Nue(new nr({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:ds.MenubarEditMenu,group:"1_do",title:Vae(72,"&&Redo"),order:2},{menuId:ds.CommandPalette,group:"",title:Vae(73,"Redo"),order:1},{menuId:ds.SimpleEditorContext,group:"1_do",title:Vae(74,"Redo"),order:2}]})),Nue(new or(gr,{id:"default:redo",precondition:void 0})),pr=Nue(new nr({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:ds.MenubarSelectionMenu,group:"1_basic",title:Vae(75,"&&Select All"),order:1},{menuId:ds.CommandPalette,group:"",title:Vae(76,"Select All"),order:1},{menuId:ds.SimpleEditorContext,group:"9_select",title:Vae(77,"Select All"),order:1}]})),mr=class e{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return e.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(t){return e.containsPosition(this,t)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(t){return e.containsRange(this,t)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(t){return e.strictContainsRange(this,t)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(t){return e.plusRange(this,t)}static plusRange(t,i){let n,o,s,r;return i.startLineNumber<t.startLineNumber?(n=i.startLineNumber,o=i.startColumn):i.startLineNumber===t.startLineNumber?(n=i.startLineNumber,o=Math.min(i.startColumn,t.startColumn)):(n=t.startLineNumber,o=t.startColumn),i.endLineNumber>t.endLineNumber?(s=i.endLineNumber,r=i.endColumn):i.endLineNumber===t.endLineNumber?(s=i.endLineNumber,r=Math.max(i.endColumn,t.endColumn)):(s=t.endLineNumber,r=t.endColumn),new e(n,o,s,r)}intersectRanges(t){return e.intersectRanges(this,t)}static intersectRanges(t,i){let n=t.startLineNumber,o=t.startColumn,s=t.endLineNumber,r=t.endColumn;const a=i.startLineNumber,l=i.startColumn,d=i.endLineNumber,c=i.endColumn;return n<a?(n=a,o=l):n===a&&(o=Math.max(o,l)),s>d?(s=d,r=c):s===d&&(r=Math.min(r,c)),n>s||n===s&&o>r?null:new e(n,o,s,r)}equalsRange(t){return e.equalsRange(this,t)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return e.getEndPosition(this)}static getEndPosition(e){return new to(e.endLineNumber,e.endColumn)}getStartPosition(){return e.getStartPosition(this)}static getStartPosition(e){return new to(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(t,i){return new e(this.startLineNumber,this.startColumn,t,i)}setStartPosition(t,i){return new e(t,i,this.endLineNumber,this.endColumn)}collapseToStart(){return e.collapseToStart(this)}static collapseToStart(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)}collapseToEnd(){return e.collapseToEnd(this)}static collapseToEnd(t){return new e(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)}delta(t){return new e(this.startLineNumber+t,this.startColumn,this.endLineNumber+t,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(t,i=t){return new e(t.lineNumber,t.column,i.lineNumber,i.column)}static lift(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):null}static isIRange(e){return!!e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static areOnlyIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber-1||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn-1||t.endLineNumber<e.startLineNumber-1||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn-1)}static compareRangesUsingStarts(e,t){if(e&&t){const i=0|e.startLineNumber,n=0|t.startLineNumber;if(i===n){const i=0|e.startColumn,n=0|t.startColumn;if(i===n){const i=0|e.endLineNumber,n=0|t.endLineNumber;return i===n?(0|e.endColumn)-(0|t.endColumn):i-n}return i-n}return i-n}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}},fr=class e extends mr{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(t){return e.selectionsEqual(this,t)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(t,i){return 0===this.getDirection()?new e(this.startLineNumber,this.startColumn,t,i):new e(t,i,this.startLineNumber,this.startColumn)}getPosition(){return new to(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new to(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(t,i){return 0===this.getDirection()?new e(t,i,this.endLineNumber,this.endColumn):new e(this.endLineNumber,this.endColumn,t,i)}static fromPositions(t,i=t){return new e(t.lineNumber,t.column,i.lineNumber,i.column)}static fromRange(t,i){return 0===i?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new e(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}static liftSelection(t){return new e(t.selectionStartLineNumber,t.selectionStartColumn,t.positionLineNumber,t.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return!!e&&"number"==typeof e.selectionStartLineNumber&&"number"==typeof e.selectionStartColumn&&"number"==typeof e.positionLineNumber&&"number"==typeof e.positionColumn}static createWithDirection(t,i,n,o,s){return 0===s?new e(t,i,n,o):new e(n,o,t,i)}},_r=class{constructor(e,t,i,n,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=s,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}},br=class e{static _nextVisibleColumn(t,i,n){return 9===t?e.nextRenderTabStop(i,n):fde(t)||_de(t)?i+2:i+1}static visibleColumnFromColumn(e,t,i){const n=Math.min(t-1,e.length),o=e.substring(0,n),s=new Rt(o);let r=0;for(;!s.eol();){const e=cde(o,n,s.offset);s.nextGraphemeLength(),r=this._nextVisibleColumn(e,r,i)}return r}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const n=e.length,o=new Rt(e);let s=0,r=1;for(;!o.eol();){const a=cde(e,n,o.offset);o.nextGraphemeLength();const l=this._nextVisibleColumn(a,s,i),d=o.offset+1;if(l>=t)return l-t<t-s?d:r;s=l,r=d}return n+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(t,i){return e.nextRenderTabStop(t,i)}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(t,i){return e.prevRenderTabStop(t,i)}},vr=new class{constructor(){this._inputMode="insert",this._onDidChangeInputMode=new je,this.onDidChangeInputMode=this._onDidChangeInputMode.event}getInputMode(){return this._inputMode}},wr=()=>!0,Cr=()=>!1,yr=e=>" "===e||"\t"===e,Sr=class{static shouldRecreate(e){return e.hasChanged(165)||e.hasChanged(148)||e.hasChanged(45)||e.hasChanged(85)||e.hasChanged(88)||e.hasChanged(89)||e.hasChanged(10)||e.hasChanged(11)||e.hasChanged(15)||e.hasChanged(13)||e.hasChanged(14)||e.hasChanged(20)||e.hasChanged(145)||e.hasChanged(141)||e.hasChanged(59)||e.hasChanged(104)||e.hasChanged(147)||e.hasChanged(93)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,s=o.get(165),r=o.get(59);this.readOnly=o.get(104),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(132),this.lineHeight=r.lineHeight,this.typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(s.height/this.lineHeight)-2),this.useTabStops=o.get(145),this.trimWhitespaceOnDelete=o.get(141),this.wordSeparators=o.get(148),this.emptySelectionClipboard=o.get(45),this.copyWithSyntaxHighlighting=o.get(31),this.multiCursorMergeOverlapping=o.get(85),this.multiCursorPaste=o.get(88),this.multiCursorLimit=o.get(89),this.autoClosingBrackets=o.get(10),this.autoClosingComments=o.get(11),this.autoClosingQuotes=o.get(15),this.autoClosingDelete=o.get(13),this.autoClosingOvertype=o.get(14),this.autoSurround=o.get(20),this.autoIndent=o.get(16),this.wordSegmenterLocales=o.get(147),this.overtypeOnPaste=o.get(93),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const a=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(a)for(const l of a)this.surroundingPairs[l.open]=l.close;this.blockCommentStartToken=this.languageConfigurationService.getLanguageConfiguration(e).comments?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};const e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}get inputMode(){return vr.getInputMode()}onElectricCharacter(e,t,i){const n=Eue(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return Tue(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return yr;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return wr;case"never":return Cr}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return br.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=br.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(n<o)return o;const s=e.getLineMaxColumn(t);return n>s?s:n}},xr=class e{static fromModelState(e){return new kr(e)}static fromViewState(e){return new Lr(e)}static fromModelSelection(t){const i=fr.liftSelection(t),n=new Dr(mr.fromPositions(i.getSelectionStart()),0,0,i.getPosition(),0);return e.fromModelState(n)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}},kr=class{constructor(e){this.modelState=e,this.viewState=null}},Lr=class{constructor(e){this.modelState=null,this.viewState=e}},Dr=class e{constructor(t,i,n,o,s){this.selectionStart=t,this.selectionStartKind=i,this.selectionStartLeftoverVisibleColumns=n,this.position=o,this.leftoverVisibleColumns=s,this._singleCursorStateBrand=void 0,this.selection=e._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(t,i,n,o){return t?new e(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new to(i,n),o):new e(new mr(i,n,i,n),0,o,new to(i,n),o)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?fr.fromPositions(e.getStartPosition(),t):fr.fromPositions(e.getEndPosition(),t)}},Ir=class{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}},Nr=class e{static columnSelect(e,t,i,n,o,s){const r=Math.abs(o-i)+1,a=i>o,l=n>s,d=n<s,c=[];for(let h=0;h<r;h++){const o=i+(a?-h:h),r=e.columnFromVisibleColumn(t,o,n),u=e.columnFromVisibleColumn(t,o,s),g=e.visibleColumnFromColumn(t,new to(o,r)),p=e.visibleColumnFromColumn(t,new to(o,u));if(d){if(g>s)continue;if(p<n)continue}if(l){if(p>n)continue;if(g<s)continue}c.push(new Dr(new mr(o,r,o,r),0,0,new to(o,u),0))}if(0===c.length)for(let h=0;h<r;h++){const e=i+(a?-h:h),n=t.getLineMaxColumn(e);c.push(new Dr(new mr(e,n,e,n),0,0,new to(e,n),0))}return{viewStates:c,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:o,toVisualColumn:s}}static columnSelectLeft(t,i,n){let o=n.toViewVisualColumn;return o>0&&o--,e.columnSelect(t,i,n.fromViewLineNumber,n.fromViewVisualColumn,n.toViewLineNumber,o)}static columnSelectRight(e,t,i){let n=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let a=o;a<=s;a++){const i=t.getLineMaxColumn(a),o=e.visibleColumnFromColumn(t,new to(a,i));n=Math.max(n,o)}let r=i.toViewVisualColumn;return r<n&&r++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectUp(e,t,i,n){const o=n?e.pageSize:1,s=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){const o=n?e.pageSize:1,s=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}},Er=class{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return fr.fromPositions(i.getEndPosition())}},Mr=class{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){const i=this._range.getStartPosition(),n=this._range.getEndPosition(),o=n.lineNumber;let s=Oue(e,n,this._text.length+(this._range.isEmpty()?0:-1));s.lineNumber>o&&(s=new to(o,e.getLineMaxColumn(o)));const r=mr.fromPositions(i,s);t.addTrackedEditOperation(r,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return fr.fromPositions(i.getEndPosition())}},Tr=class{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return fr.fromRange(i,0)}},Rr=class{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return fr.fromPositions(i.getStartPosition())}},Or=class{constructor(e,t,i,n,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return fr.fromPositions(i.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}},Ar=class{constructor(e){this._range=e}getEditOperations(e,t){const i=e.getValueInRange(this._range),n=this._range.getEndPosition(),o=n.lineNumber;let s=Oue(e,n,i.length);s.lineNumber>o&&(s=new to(o,e.getLineMaxColumn(o)));const r=mr.fromPositions(n,s);t.addTrackedEditOperation(r,"")}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return fr.fromPositions(i.getEndPosition())}},Pr=class{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}},Fr=class e{static whitespaceVisibleColumn(e,t,i){const n=e.length;let o=0,s=-1,r=-1;for(let a=0;a<n;a++){if(a===t)return[s,r,o];switch(o%i===0&&(s=a,r=o),e.charCodeAt(a)){case 32:o+=1;break;case 9:o=br.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===n?[s,r,o]:[-1,-1,-1]}static atomicPosition(t,i,n,o){const s=t.length,[r,a,l]=e.whitespaceVisibleColumn(t,i,n);if(-1===l)return-1;let d;switch(o){case 0:d=!0;break;case 1:d=!1;break;case 2:if(l%n===0)return i;d=l%n<=n/2}if(d){if(-1===r)return-1;let e=a;for(let i=r;i<s;++i){if(e===a+n)return r;switch(t.charCodeAt(i)){case 32:e+=1;break;case 9:e=br.nextRenderTabStop(e,n);break;default:return-1}}return e===a+n?r:-1}const c=br.nextRenderTabStop(l,n);let h=l;for(let e=i;e<s;e++){if(h===c)return e;switch(t.charCodeAt(e)){case 32:h+=1;break;case 9:h=br.nextRenderTabStop(h,n);break;default:return-1}}return h===c?s:-1}},Wr=class{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}},Br=class e{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-ude(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new to(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=Fr.atomicPosition(o,t.column-1,i,0);if(-1!==s&&s+1>=n)return new to(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(t,i,n){const o=t.stickyTabStops?e.leftPositionAtomicSoftTabs(i,n,t.tabSize):e.leftPosition(i,n);return new Wr(o.lineNumber,o.column,0)}static moveLeft(t,i,n,o,s){let r,a;if(n.hasSelection()&&!o)r=n.selection.startLineNumber,a=n.selection.startColumn;else{const o=n.position.delta(void 0,-(s-1)),l=i.normalizePosition(e.clipPositionColumn(o,i),0),d=e.left(t,i,l);r=d.lineNumber,a=d.column}return n.move(o,r,a,0)}static clipPositionColumn(t,i){return new to(t.lineNumber,e.clipRange(t.column,i.getLineMinColumn(t.lineNumber),i.getLineMaxColumn(t.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i+=hde(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new to(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,o){if(i<e.getLineIndentColumn(t)){const o=e.getLineContent(t),s=Fr.atomicPosition(o,i-1,n,1);if(-1!==s)return new to(t,s+1)}return this.rightPosition(e,t,i)}static right(t,i,n){const o=t.stickyTabStops?e.rightPositionAtomicSoftTabs(i,n.lineNumber,n.column,t.tabSize,t.indentSize):e.rightPosition(i,n.lineNumber,n.column);return new Wr(o.lineNumber,o.column,0)}static moveRight(t,i,n,o,s){let r,a;if(n.hasSelection()&&!o)r=n.selection.endLineNumber,a=n.selection.endColumn;else{const o=n.position.delta(void 0,s-1),l=i.normalizePosition(e.clipPositionColumn(o,i),1),d=e.right(t,i,l);r=d.lineNumber,a=d.column}return n.move(o,r,a,0)}static vertical(e,t,i,n,o,s,r,a){const l=br.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,d=t.getLineCount(),c=1===i&&1===n,h=i===d&&n===t.getLineMaxColumn(i),u=s<i?c:h;if((i=s)<1?(i=1,n=r?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>d?(i=d,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),o=u?0:l-br.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){const e=new to(i,n),s=t.normalizePosition(e,a);o+=n-s.column,i=s.lineNumber,n=s.column}return new Wr(i,n,o)}static down(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i+s,r,4)}static moveDown(t,i,n,o,s){let r,a;n.hasSelection()&&!o?(r=n.selection.endLineNumber,a=n.selection.endColumn):(r=n.position.lineNumber,a=n.position.column);let l,d=0;do{if(l=e.down(t,i,r+d,a,n.leftoverVisibleColumns,s,!0),i.normalizePosition(new to(l.lineNumber,l.column),2).lineNumber>r)break}while(d++<10&&r+d<i.getLineCount());return n.move(o,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateDown(t,i,n){const o=n.selection,s=e.down(t,i,o.selectionStartLineNumber,o.selectionStartColumn,n.selectionStartLeftoverVisibleColumns,1,!1),r=e.down(t,i,o.positionLineNumber,o.positionColumn,n.leftoverVisibleColumns,1,!1);return new Dr(new mr(s.lineNumber,s.column,s.lineNumber,s.column),0,s.leftoverVisibleColumns,new to(r.lineNumber,r.column),r.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){return this.vertical(e,t,i,n,o,i-s,r,3)}static moveUp(t,i,n,o,s){let r,a;n.hasSelection()&&!o?(r=n.selection.startLineNumber,a=n.selection.startColumn):(r=n.position.lineNumber,a=n.position.column);const l=e.up(t,i,r,a,n.leftoverVisibleColumns,s,!0);return n.move(o,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateUp(t,i,n){const o=n.selection,s=e.up(t,i,o.selectionStartLineNumber,o.selectionStartColumn,n.selectionStartLeftoverVisibleColumns,1,!1),r=e.up(t,i,o.positionLineNumber,o.positionColumn,n.leftoverVisibleColumns,1,!1);return new Dr(new mr(s.lineNumber,s.column,s.lineNumber,s.column),0,s.leftoverVisibleColumns,new to(r.lineNumber,r.column),r.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(n,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,n){const o=t.getLineCount();let s=i.position.lineNumber;for(;s<o&&this._isBlankLine(t,s);)s++;for(;s<o&&!this._isBlankLine(t,s);)s++;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToBeginningOfLine(e,t,i,n){const o=i.position.lineNumber,s=t.getLineMinColumn(o),r=t.getLineFirstNonWhitespaceColumn(o)||s;let a;return a=i.position.column===r?s:r,i.move(n,o,a,0)}static moveToEndOfLine(e,t,i,n,o){const s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){const o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}},Vr=class e{static deleteRight(e,t,i,n){const o=[];let s=3!==e;for(let r=0,a=n.length;r<a;r++){const e=n[r],a=this.getDeleteRightRange(e,i,t);a.isEmpty()?o[r]=null:(a.startLineNumber!==a.endLineNumber&&(s=!0),o[r]=new Er(a,""))}return[s,o]}static getDeleteRightRange(e,t,i){if(!e.isEmpty())return e;const n=e.getPosition(),o=Br.right(i,t,n);if(i.trimWhitespaceOnDelete&&o.lineNumber!==n.lineNumber){const e=t.getLineFirstNonWhitespaceColumn(n.lineNumber)>0,i=t.getLineFirstNonWhitespaceColumn(o.lineNumber);if(e&&i>0)return new mr(o.lineNumber,i,n.lineNumber,n.column)}return new mr(o.lineNumber,o.column,n.lineNumber,n.column)}static isAutoClosingPairDelete(e,t,i,n,o,s,r){if("never"===t&&"never"===i)return!1;if("never"===e)return!1;for(let a=0,l=s.length;a<l;a++){const l=s[a],d=l.getPosition();if(!l.isEmpty())return!1;const c=o.getLineContent(d.lineNumber);if(d.column<2||d.column>=c.length+1)return!1;const h=c.charAt(d.column-2),u=n.get(h);if(!u)return!1;if(Rue(h)){if("never"===i)return!1}else if("never"===t)return!1;const g=c.charAt(d.column-1);let p=!1;for(const e of u)e.open===h&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t<i;t++){const i=r[t];if(d.lineNumber===i.startLineNumber&&d.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++){const e=i[o].getPosition();n[o]=new Er(new mr(e.lineNumber,e.column-1,e.lineNumber,e.column+1),"")}return[!0,n]}static deleteLeft(t,i,n,o,s){if(this.isAutoClosingPairDelete(i.autoClosingDelete,i.autoClosingBrackets,i.autoClosingQuotes,i.autoClosingPairs.autoClosingPairsOpenByEnd,n,o,s))return this._runAutoClosingPairDelete(i,n,o);const r=[];let a=2!==t;for(let l=0,d=o.length;l<d;l++){const t=e.getDeleteLeftRange(o[l],n,i);t.isEmpty()?r[l]=null:(t.startLineNumber!==t.endLineNumber&&(a=!0),r[l]=new Er(t,""))}return[a,r]}static getDeleteLeftRange(t,i,n){if(!t.isEmpty())return t;const o=t.getPosition();if(n.useTabStops&&o.column>1){const e=i.getLineContent(o.lineNumber),t=jle(e),s=-1===t?e.length+1:t+1;if(o.column<=s){const e=n.visibleColumnFromColumn(i,o),t=br.prevIndentTabStop(e,n.indentSize),s=n.columnFromVisibleColumn(i,o.lineNumber,t);return new mr(o.lineNumber,s,o.lineNumber,o.column)}}return mr.fromPositions(e.getPositionAfterDeleteLeft(o,i),o)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=Cde(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new to(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let o=null;i.sort((e,t)=>to.compare(e.getStartPosition(),t.getEndPosition()));for(let s=0,r=i.length;s<r;s++){const r=i[s];if(r.isEmpty())if(e.emptySelectionClipboard){const e=r.getPosition();let i,a,l,d;e.lineNumber<t.getLineCount()?(i=e.lineNumber,a=1,l=e.lineNumber+1,d=1):e.lineNumber>1&&o?.endLineNumber!==e.lineNumber?(i=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,d=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,a=1,l=e.lineNumber,d=t.getLineMaxColumn(e.lineNumber));const c=new mr(i,a,l,d);o=c,c.isEmpty()?n[s]=null:n[s]=new Er(c,"")}else n[s]=null;else n[s]=new Er(r,"")}return new Ir(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}},Hr={DateTimeFormat:(e,t)=>new Nt(()=>{try{return new Intl.DateTimeFormat(e,t)}catch{return new Intl.DateTimeFormat(void 0,t)}}),Collator:(e,t)=>new Nt(()=>{try{return new Intl.Collator(e,t)}catch{return new Intl.Collator(void 0,t)}}),Segmenter:(e,t)=>new Nt(()=>{try{return new Intl.Segmenter(e,t)}catch{return new Intl.Segmenter(void 0,t)}}),Locale:(e,t)=>new Nt(()=>{try{return new Intl.Locale(e,t)}catch{return new Intl.Locale("en",t)}}),NumberFormat:(e,t)=>new Nt(()=>{try{return new Intl.NumberFormat(e,t)}catch{return new Intl.NumberFormat(void 0,t)}})},zr=class e{constructor(t){const i=Aue(t);this._defaultValue=i,this._asciiMap=e._createAsciiMap(i),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=Aue(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}},Ur=class{constructor(){this._actual=new zr(0)}add(e){this._actual.set(e,1)}has(e){return 1===this._actual.get(e)}clear(){return this._actual.clear()}},Kr=class extends zr{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=Hr.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let i=0,n=e.length;i<n;i++)this.set(e.charCodeAt(i),2);this.set(32,1),this.set(9,1)}findPrevIntlWordBeforeOrAtOffset(e,t){let i=null;for(const n of this._getIntlSegmenterWordsOnLine(e)){if(n.index>t)break;i=n}return i}findNextIntlWordAtOrAfterOffset(e,t){for(const i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index<t))return i;return null}_getIntlSegmenterWordsOnLine(e){return this._segmenter?(this._cachedLine===e||(this._cachedLine=e,this._cachedSegments=this._filterWordSegments(this._segmenter.value.segment(e))),this._cachedSegments):[]}_filterWordSegments(e){const t=[];for(const i of e)this._isWordLike(i)&&t.push(i);return t}_isWordLike(e){return!!e.isWordLike}},qr=new Ls(10),jr=class e{static _createWord(e,t,i,n,o){return{start:n,end:o,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:1,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;const o=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let s=i.column-2;s>=0;s--){const i=e.charCodeAt(s),r=t.get(i);if(o&&s===o.index)return this._createIntlWord(o,r);if(0===r){if(2===n)return this._createWord(e,n,r,s+1,this._findEndOfWord(e,t,n,s+1));n=1}else if(2===r){if(1===n)return this._createWord(e,n,r,s+1,this._findEndOfWord(e,t,n,s+1));n=2}else if(1===r&&0!==n)return this._createWord(e,n,r,s+1,this._findEndOfWord(e,t,n,s+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const o=t.findNextIntlWordAtOrAfterOffset(e,n),s=e.length;for(let r=n;r<s;r++){const n=e.charCodeAt(r),s=t.get(n);if(o&&r===o.index+o.segment.length)return r;if(1===s)return r;if(1===i&&2===s)return r;if(2===i&&0===s)return r}return s}static _findNextWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0;const o=e.length,s=t.findNextIntlWordAtOrAfterOffset(e,i.column-1);for(let r=i.column-1;r<o;r++){const i=e.charCodeAt(r),o=t.get(i);if(s&&r===s.index)return this._createIntlWord(s,o);if(0===o){if(2===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,r-1),r);n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,r-1),r);n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,this._findStartOfWord(e,t,n,r-1),r)}return 0!==n?this._createWord(e,n,1,this._findStartOfWord(e,t,n,o-1),o):null}static _findStartOfWord(e,t,i,n){const o=t.findPrevIntlWordBeforeOrAtOffset(e,n);for(let s=n;s>=0;s--){const n=e.charCodeAt(s),r=t.get(n);if(o&&s===o.index)return s;if(1===r)return s+1;if(1===i&&2===r)return s+1;if(2===i&&0===r)return s+1}return 0}static moveWordLeft(t,i,n,o,s){let r=n.lineNumber,a=n.column;1===a&&r>1&&(r-=1,a=i.getLineMaxColumn(r));let l=e._findPreviousWordOnLine(t,i,new to(r,a));if(0===o)return new to(r,l?l.start+1:1);if(1===o)return!s&&l&&2===l.wordType&&l.end-l.start===1&&0===l.nextCharClass&&(l=e._findPreviousWordOnLine(t,i,new to(r,l.start+1))),new to(r,l?l.start+1:1);if(3===o){for(;l&&2===l.wordType;)l=e._findPreviousWordOnLine(t,i,new to(r,l.start+1));return new to(r,l?l.start+1:1)}return l&&a<=l.end+1&&(l=e._findPreviousWordOnLine(t,i,new to(r,l.start+1))),new to(r,l?l.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new to(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let s=t.column-1;s>1;s--){const e=o.charCodeAt(s-2),t=o.charCodeAt(s-1);if(95===e&&95!==t)return new to(i,s);if(45===e&&45!==t)return new to(i,s);if((ede(e)||Jle(e))&&tde(t))return new to(i,s);if(tde(e)&&tde(t)&&s+1<n){const e=o.charCodeAt(s);if(ede(e)||Jle(e))return new to(i,s)}}return new to(i,1)}static moveWordRight(t,i,n,o){let s=n.lineNumber,r=n.column,a=!1;r===i.getLineMaxColumn(s)&&s<i.getLineCount()&&(a=!0,s+=1,r=1);let l=e._findNextWordOnLine(t,i,new to(s,r));if(2===o)l&&2===l.wordType&&l.end-l.start===1&&0===l.nextCharClass&&(l=e._findNextWordOnLine(t,i,new to(s,l.end+1))),r=l?l.end+1:i.getLineMaxColumn(s);else if(3===o){for(a&&(r=0);l&&(2===l.wordType||l.start+1<=r);)l=e._findNextWordOnLine(t,i,new to(s,l.end+1));r=l?l.start+1:i.getLineMaxColumn(s)}else l&&!a&&r>=l.start+1&&(l=e._findNextWordOnLine(t,i,new to(s,l.end+1))),r=l?l.start+1:i.getLineMaxColumn(s);return new to(s,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new to(i+1,1):t;const o=e.getLineContent(i);for(let s=t.column+1;s<n;s++){const e=o.charCodeAt(s-2),t=o.charCodeAt(s-1);if(95!==e&&95===t)return new to(i,s);if(45!==e&&45===t)return new to(i,s);if((ede(e)||Jle(e))&&tde(t))return new to(i,s);if(tde(e)&&tde(t)&&s+1<n){const e=o.charCodeAt(s);if(ede(e)||Jle(e))return new to(i,s)}}return new to(i,n)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-2,o=Gle(i,n);return o+1<n?new mr(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(t,i){const n=t.wordSeparators,o=t.model,s=t.selection,r=t.whitespaceHeuristics;if(!s.isEmpty())return s;if(Vr.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,t.model,[t.selection],t.autoClosedCharacters)){const e=t.selection.getPosition();return new mr(e.lineNumber,e.column-1,e.lineNumber,e.column+1)}const a=new to(s.positionLineNumber,s.positionColumn);let l=a.lineNumber,d=a.column;if(1===l&&1===d)return null;if(r){const e=this._deleteWordLeftWhitespace(o,a);if(e)return e}let c=e._findPreviousWordOnLine(n,o,a);return 0===i?c?d=c.start+1:d>1?d=1:(l--,d=o.getLineMaxColumn(l)):(c&&d<=c.end+1&&(c=e._findPreviousWordOnLine(n,o,new to(l,c.start+1))),c?d=c.end+1:d>1?d=1:(l--,d=o.getLineMaxColumn(l))),new mr(l,d,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new to(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,n);return o||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+1<n&&this._charAtIsWhitespace(i,s+1);)s++;return new mr(t.lineNumber,o+1,t.lineNumber,s+2)}static _deleteInsideWordDetermineDeleteRange(t,i,n){const o=i.getLineContent(n.lineNumber),s=o.length;if(0===s)return n.lineNumber>1?new mr(n.lineNumber-1,i.getLineMaxColumn(n.lineNumber-1),n.lineNumber,1):n.lineNumber<i.getLineCount()?new mr(n.lineNumber,1,n.lineNumber+1,1):new mr(n.lineNumber,1,n.lineNumber,1);const r=e=>e.start+1<=n.column&&n.column<=e.end+1,a=(e,t)=>(e=Math.min(e,n.column),t=Math.max(t,n.column),new mr(n.lineNumber,e,n.lineNumber,t)),l=e=>{let t=e.start+1,i=e.end+1,n=!1;for(;i-1<s&&this._charAtIsWhitespace(o,i-1);)n=!0,i++;if(!n)for(;t>1&&this._charAtIsWhitespace(o,t-2);)t--;return a(t,i)},d=e._findPreviousWordOnLine(t,i,n);if(d&&r(d))return l(d);const c=e._findNextWordOnLine(t,i,n);return c&&r(c)?l(c):d&&c?a(d.end+1,c.start+1):d?a(d.start+1,d.end+1):c?a(c.start+1,c.end+1):a(1,s+1)}static _deleteWordPartLeft(t,i){if(!i.isEmpty())return i;const n=i.getPosition(),o=e._moveWordPartLeft(t,n);return new mr(n.lineNumber,n.column,o.lineNumber,o.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n<i;n++){const t=e.charAt(n);if(" "!==t&&"\t"!==t)return n}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=t.column-1,o=this._findFirstNonWhitespaceChar(i,n);return n+1<o?new mr(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(t,i){const n=t.wordSeparators,o=t.model,s=t.selection,r=t.whitespaceHeuristics;if(!s.isEmpty())return s;const a=new to(s.positionLineNumber,s.positionColumn);let l=a.lineNumber,d=a.column;const c=o.getLineCount(),h=o.getLineMaxColumn(l);if(l===c&&d===h)return null;if(r){const e=this._deleteWordRightWhitespace(o,a);if(e)return e}let u=e._findNextWordOnLine(n,o,a);return 2===i?u?d=u.end+1:d<h||l===c?d=h:(l++,u=e._findNextWordOnLine(n,o,new to(l,1)),d=u?u.start+1:o.getLineMaxColumn(l)):(u&&d>=u.start+1&&(u=e._findNextWordOnLine(n,o,new to(l,u.end+1))),u?d=u.start+1:d<h||l===c?d=h:(l++,u=e._findNextWordOnLine(n,o,new to(l,1)),d=u?u.start+1:o.getLineMaxColumn(l))),new mr(l,d,a.lineNumber,a.column)}static _deleteWordPartRight(t,i){if(!i.isEmpty())return i;const n=i.getPosition(),o=e._moveWordPartRight(t,n);return new mr(n.lineNumber,n.column,o.lineNumber,o.column)}static _createWordAtPosition(e,t,i){const n=new mr(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(t,i,n,o){const s=Fue(i,n),r=e._findPreviousWordOnLine(s,t,o);if(r&&1===r.wordType&&r.start<=o.column-1&&o.column-1<=r.end)return e._createWordAtPosition(t,o.lineNumber,r);const a=e._findNextWordOnLine(s,t,o);return a&&1===a.wordType&&a.start<=o.column-1&&o.column-1<=a.end?e._createWordAtPosition(t,o.lineNumber,a):null}static word(t,i,n,o,s){const r=Fue(t.wordSeparators,t.wordSegmenterLocales),a=e._findPreviousWordOnLine(r,i,s),l=e._findNextWordOnLine(r,i,s);if(!o){let e,t;return a&&1===a.wordType&&a.start<=s.column-1&&s.column-1<=a.end||a&&2===a.wordType&&a.start<=s.column-1&&s.column-1<a.end?(e=a.start+1,t=a.end+1):l&&1===l.wordType&&l.start<=s.column-1&&s.column-1<=l.end||l&&2===l.wordType&&l.start<=s.column-1&&s.column-1<l.end?(e=l.start+1,t=l.end+1):(e=a?a.end+1:1,t=l?l.start+1:i.getLineMaxColumn(s.lineNumber)),new Dr(new mr(s.lineNumber,e,s.lineNumber,t),1,0,new to(s.lineNumber,t),0)}let d,c;a&&1===a.wordType&&a.start<s.column-1&&s.column-1<a.end?(d=a.start+1,c=a.end+1):l&&1===l.wordType&&l.start<s.column-1&&s.column-1<l.end?(d=l.start+1,c=l.end+1):(d=s.column,c=s.column);const h=s.lineNumber;let u;if(n.selectionStart.containsPosition(s))u=n.selectionStart.endColumn;else if(s.isBeforeOrEqual(n.selectionStart.getStartPosition())){u=d;const e=new to(h,u);n.selectionStart.containsPosition(e)&&(u=n.selectionStart.endColumn)}else{u=c;const e=new to(h,u);n.selectionStart.containsPosition(e)&&(u=n.selectionStart.startColumn)}return n.move(!0,h,u,0)}},$r=class extends jr{static deleteWordPartLeft(e){const t=Wue([jr.deleteWordLeft(e,0),jr.deleteWordLeft(e,2),jr._deleteWordPartLeft(e.model,e.selection)]);return t.sort(mr.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=Wue([jr.deleteWordRight(e,0),jr.deleteWordRight(e,2),jr._deleteWordPartRight(e.model,e.selection)]);return t.sort(mr.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i,n){const o=Wue([jr.moveWordLeft(e,t,i,0,n),jr.moveWordLeft(e,t,i,2,n),jr._moveWordPartLeft(t,i)]);return o.sort(to.compare),o[2]}static moveWordPartRight(e,t,i){const n=Wue([jr.moveWordRight(e,t,i,0),jr.moveWordRight(e,t,i,2),jr._moveWordPartRight(t,i)]);return n.sort(to.compare),n[0]}},Gr=Object.prototype.hasOwnProperty,function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(Zr||(Zr={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"}(Yr||(Yr={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(Qr||(Qr={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(Xr||(Xr={})),Jr=class{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,0|e.tabSize),"tabSize"===e.indentSize?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,0|e.indentSize),this._indentSizeIsTabSize=!1),this.insertSpaces=Boolean(e.insertSpaces),this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=Boolean(e.trimAutoWhitespace),this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&Uue(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}},ea=class{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}},ta=class{constructor(e,t,i,n,o,s){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=n,this.isAutoWhitespaceEdit=o,this._isTracked=s}},ia=class{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}},na=class{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}},oa=class{static addCursorDown(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new xr(r.modelState,r.viewState),n[o++]=i?xr.fromModelState(Br.translateDown(e.cursorConfig,e.model,r.modelState)):xr.fromViewState(Br.translateDown(e.cursorConfig,e,r.viewState))}return n}static addCursorUp(e,t,i){const n=[];let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];n[o++]=new xr(r.modelState,r.viewState),n[o++]=i?xr.fromModelState(Br.translateUp(e.cursorConfig,e.model,r.modelState)):xr.fromViewState(Br.translateUp(e.cursorConfig,e,r.viewState))}return n}static moveToBeginningOfLine(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=this._moveToLineStart(e,s,i)}return n}static _moveToLineStart(e,t,i){const n=t.viewState.position.column,o=n===t.modelState.position.column,s=t.viewState.position.lineNumber,r=n===e.getLineFirstNonWhitespaceColumn(s);return o||r?this._moveToLineStartByModel(e,t,i):this._moveToLineStartByView(e,t,i)}static _moveToLineStartByView(e,t,i){return xr.fromViewState(Br.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return xr.fromModelState(Br.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=this._moveToLineEnd(e,r,i,n)}return o}static _moveToLineEnd(e,t,i,n){const o=t.viewState.position,s=e.getLineMaxColumn(o.lineNumber),r=o.column===s,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),d=s-o.column===l-a.column;return r||d?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return xr.fromViewState(Br.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return xr.fromModelState(Br.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.selection.startLineNumber,r=e.model.getLineCount();let a,l=o.modelState.selection.endLineNumber;l===r?a=e.model.getLineMaxColumn(r):(l++,a=1),i[n]=xr.fromModelState(new Dr(new mr(s,1,s,1),0,0,new to(l,a),0))}return i}static moveToBeginningOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=xr.fromModelState(Br.moveToBeginningOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o];n[o]=xr.fromModelState(Br.moveToEndOfBuffer(e.cursorConfig,e.model,s.modelState,i))}return n}static selectAll(e,t){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return xr.fromModelState(new Dr(new mr(1,1,1,1),0,0,new to(i,n),0))}static line(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new to(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);if(!i){const t=e.model.getLineCount();let i=s.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),xr.fromModelState(new Dr(new mr(s.lineNumber,1,i,n),2,0,new to(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumber<a)return xr.fromViewState(t.viewState.move(!0,r.lineNumber,1,0));if(s.lineNumber>a){const i=e.getLineCount();let n=r.lineNumber+1,o=1;return n>i&&(n=i,o=e.getLineMaxColumn(n)),xr.fromViewState(t.viewState.move(!0,n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return xr.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){const o=e.model.validatePosition(n);return xr.fromModelState(jr.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new xr(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return xr.fromViewState(new Dr(new mr(i,n,i,n),0,0,new to(i,n),0))}static moveTo(e,t,i,n,o){if(i){if(1===t.modelState.selectionStartKind)return this.word(e,t,i,n);if(2===t.modelState.selectionStartKind)return this.line(e,t,i,n,o)}const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new to(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return xr.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,o,s){switch(i){case 0:return 4===s?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,o);case 1:return 4===s?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,o);case 2:return 2===s?this._moveUpByViewLines(e,t,n,o):this._moveUpByModelLines(e,t,n,o);case 3:return 2===s?this._moveDownByViewLines(e,t,n,o):this._moveDownByModelLines(e,t,n,o);case 4:return 2===s?t.map(t=>xr.fromViewState(Br.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n))):t.map(t=>xr.fromModelState(Br.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n)));case 5:return 2===s?t.map(t=>xr.fromViewState(Br.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n))):t.map(t=>xr.fromModelState(Br.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n)));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,o){const s=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 14:{const i=[];for(let o=0,r=t.length;o<r;o++){const r=t[o];i[o]=this.findPositionInViewportIfOutside(e,r,s,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){const o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new xr(t.modelState,t.viewState);{let s;s=o>i.endLineNumber-1?i.endLineNumber-1:o<i.startLineNumber?i.startLineNumber:o;const r=Br.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,s,!1);return xr.fromViewState(t.viewState.move(n,r.lineNumber,r.column,r.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map(t=>{const o=e.getTextDirection(t.viewState.position.lineNumber)===Qr.RTL;return xr.fromViewState(o?Br.moveRight(e.cursorConfig,e,t.viewState,i,n):Br.moveLeft(e.cursorConfig,e,t.viewState,i,n))})}static _moveHalfLineLeft(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineLength(r)/2);n[o]=xr.fromViewState(Br.moveLeft(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveRight(e,t,i,n){return t.map(t=>{const o=e.getTextDirection(t.viewState.position.lineNumber)===Qr.RTL;return xr.fromViewState(o?Br.moveLeft(e.cursorConfig,e,t.viewState,i,n):Br.moveRight(e.cursorConfig,e,t.viewState,i,n))})}static _moveHalfLineRight(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round(e.getLineLength(r)/2);n[o]=xr.fromViewState(Br.moveRight(e.cursorConfig,e,s.viewState,i,a))}return n}static _moveDownByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=xr.fromViewState(Br.moveDown(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveDownByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=xr.fromModelState(Br.moveDown(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveUpByViewLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=xr.fromViewState(Br.moveUp(e.cursorConfig,e,r.viewState,i,n))}return o}static _moveUpByModelLines(e,t,i,n){const o=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];o[s]=xr.fromModelState(Br.moveUp(e.cursorConfig,e.model,r.modelState,i,n))}return o}static _moveToViewPosition(e,t,i,n,o){return xr.fromViewState(t.viewState.move(i,n,o,0))}static _moveToModelPosition(e,t,i,n,o){return xr.fromModelState(t.modelState.move(i,n,o,0))}static _moveToViewMinColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMinColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewCenterColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(r)+e.getLineMinColumn(r))/2);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewMaxColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineMaxColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=s.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(r);n[o]=this._moveToViewPosition(e,s,i,r,a)}return n}},function(e){e.metadata={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t\t* 'noHistory': If 'true' does not add the movement to navigation history. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!rle(e))return!1;const t=e;return!(!sle(t.to)||!hle(t.select)&&!cle(t.select)||!hle(t.by)&&!sle(t.by)||!hle(t.value)&&!lle(t.value)||!hle(t.noHistory)&&!cle(t.noHistory))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1},noHistory:{type:"boolean",default:!1}}}}]},e.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},e.parse=function(t){if(!t.to)return null;let i;switch(t.to){case e.RawDirection.Left:i=0;break;case e.RawDirection.Right:i=1;break;case e.RawDirection.Up:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.PrevBlankLine:i=4;break;case e.RawDirection.NextBlankLine:i=5;break;case e.RawDirection.WrappedLineStart:i=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:i=7;break;case e.RawDirection.WrappedLineColumnCenter:i=8;break;case e.RawDirection.WrappedLineEnd:i=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:i=10;break;case e.RawDirection.ViewPortTop:i=11;break;case e.RawDirection.ViewPortBottom:i=13;break;case e.RawDirection.ViewPortCenter:i=12;break;case e.RawDirection.ViewPortIfOutside:i=14;break;default:return null}let n=0;switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Character:n=3;break;case e.RawUnit.HalfLine:n=4}return{direction:i,unit:n,select:!!t.select,value:t.value||1,noHistory:!!t.noHistory}}}(sa||(sa={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(ra||(ra={})),aa=class{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(0===e.getTokenCount())return!0;const i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const e=String.fromCharCode(i);if(!this.open.includes(e)&&!this.close.includes(e))return e}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}},la=class{constructor(e){this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map;for(const t of e)que(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),que(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),que(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),que(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),1===t.close.length&&1===t.open.length&&que(this.autoClosingPairsCloseSingleChar,t.close,t)}},da="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",ca=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of da)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}(),(ha=new Ae).unshift({maxLen:1e3,windowSize:15,timeBudget:150}),(ua=ga=class e{constructor(t){if(t.autoClosingPairs?this._autoClosingPairs=t.autoClosingPairs.map(e=>new aa(e)):t.brackets?this._autoClosingPairs=t.brackets.map(e=>new aa({open:e[0],close:e[1]})):this._autoClosingPairs=[],t.__electricCharacterSupport&&t.__electricCharacterSupport.docComment){const e=t.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new aa({open:e.open,close:e.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof t.autoCloseBefore?t.autoCloseBefore:e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof t.autoCloseBefore?t.autoCloseBefore:e.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=t.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}).DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n\t",ua.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n\t",_a=class{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return Yue().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(0===t||ade(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}},ba=class e{constructor(t,i,n,o,s,r){this._richEditBracketBrand=void 0,this.languageId=t,this.index=i,this.open=n,this.close=o,this.forwardRegex=s,this.reversedRegex=r,this._openSet=e._toSet(this.open),this._closeSet=e._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}},va=class{constructor(e,t){this._richEditBracketsBrand=void 0;const i=function(e){const t=e.length;e=e.map(e=>[e[0].toLowerCase(),e[1].toLowerCase()]);const i=[];for(let r=0;r<t;r++)i[r]=r;const n=(e,t)=>{const[i,n]=e,[o,s]=t;return i===o||i===s||n===o||n===s},o=(e,n)=>{const o=Math.min(e,n),s=Math.max(e,n);for(let r=0;r<t;r++)i[r]===s&&(i[r]=o)};for(let r=0;r<t;r++){const s=e[r];for(let a=r+1;a<t;a++)n(s,e[a])&&o(i[r],i[a])}const s=[];for(let r=0;r<t;r++){const n=[],o=[];for(let s=0;s<t;s++)if(i[s]===r){const[t,i]=e[s];n.push(t),o.push(i)}n.length>0&&s.push({open:n,close:o})}return s}(t);this.brackets=i.map((t,n)=>new ba(e,n,t.open,t.close,function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let s=0,r=o.length;s<r;s++)Xue(o[s],i,n,o);return o=ege(o),o.sort(Jue),o.reverse(),ige(o)}(t.open,t.close,i,n),function(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let s=0,r=o.length;s<r;s++)Xue(o[s],i,n,o);return o=ege(o),o.sort(Jue),o.reverse(),ige(o.map(wa))}(t.open,t.close,i,n))),this.forwardRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=ege(t),ige(t)}(this.brackets),this.reversedRegex=function(e){let t=[];for(const i of e){for(const e of i.open)t.push(e);for(const e of i.close)t.push(e)}return t=ege(t),ige(t.map(wa))}(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const e of n.open)this.textIsBracket[e]=n,this.textIsOpenBracket[e]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,e.length);for(const e of n.close)this.textIsBracket[e]=n,this.textIsOpenBracket[e]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,e.length)}}},wa=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return Yue().decode(t)}(e)),t}}(),Ca=class{static _findPrevBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=i.length-(o.index||0),r=o[0].length,a=n+s;return new mr(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,o){const s=wa(i).substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,s,n)}static findNextBracketInText(e,t,i,n){const o=i.match(e);if(!o)return null;const s=o.index||0,r=o[0].length;if(0===r)return null;const a=n+s;return new mr(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}},ya=class{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const t=i.charAt(i.length-1);e.push(t)}return rce(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(Mue(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=Ca.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}},Sa=class{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&nge(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&nge(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&nge(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&nge(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}},xa=class e{constructor(t){(t=t||{}).brackets=t.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],t.brackets.forEach(t=>{const i=e._createOpenBracketRegExp(t[0]),n=e._createCloseBracketRegExp(t[1]);i&&n&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:n})}),this._regExpRules=t.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let o=0,s=this._regExpRules.length;o<s;o++){const e=this._regExpRules[o];if([{reg:e.beforeText,text:i},{reg:e.afterText,text:n},{reg:e.previousLineText,text:t}].every(e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text))))return e.action}if(e>=2&&i.length>0&&n.length>0)for(let o=0,s=this._brackets.length;o<s;o++){const e=this._brackets[o];if(e.openRegExp.test(i)&&e.closeRegExp.test(n))return{indentAction:ra.IndentOutdent}}if(e>=2&&i.length>0)for(let o=0,s=this._brackets.length;o<s;o++)if(this._brackets[o].openRegExp.test(i))return{indentAction:ra.Indent};return null}static _createOpenBracketRegExp(t){let i=Ble(t);return/\B/.test(i.charAt(0))||(i="\\b"+i),i+="\\s*$",e._safeRegExp(i)}static _createCloseBracketRegExp(t){let i=Ble(t);return/\B/.test(i.charAt(i.length-1))||(i+="\\b"),i="^\\s*"+i,e._safeRegExp(i)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return $ae(t),null}}},ka=eue("configurationService"),La=eue("languageService"),Da=class{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}},Ia=[],Na=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"}),Ea={JSONContribution:"base.contributions.json"},Ma=class extends Ie{constructor(){super(...arguments),this.schemasById={},this._onDidChangeSchema=this._register(new je)}registerSchema(e,t,i){const n=(o=e).length>0&&"#"===o.charAt(o.length-1)?o.substring(0,o.length-1):o;var o;this.schemasById[n]=t,this._onDidChangeSchema.fire(e),i&&i.add(Dle(()=>{delete this.schemasById[n],this._onDidChangeSchema.fire(e)}))}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}},Ta=new Ma,ts.add(Ea.JSONContribution,Ta),void 0!==(Oa=globalThis.vscode)&&void 0!==Oa.context){const e=Oa.context.configuration();if(!e)throw new Error("Sandbox: unable to resolve product configuration from preload script.");Ra=e.product}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(Ra=globalThis._VSCODE_PRODUCT_JSON,Ut.VSCODE_DEV&&Object.assign(Ra,{nameShort:`${Ra.nameShort} Dev`,nameLong:`${Ra.nameLong} Dev`,dataFolderName:`${Ra.dataFolderName}-dev`,serverDataFolderName:Ra.serverDataFolderName?`${Ra.serverDataFolderName}-dev`:void 0}),!Ra.version){const e=globalThis._VSCODE_PACKAGE_JSON;Object.assign(Ra,{version:e.version})}}else Ra={},0===Object.keys(Ra).length&&Object.assign(Ra,{version:"1.104.0-dev",nameShort:"Code - OSS Dev",nameLong:"Code - OSS Dev",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt"});Aa=Ra,Pa={Configuration:"base.contributions.configuration"},Fa="vscode://schemas/settings/resourceLanguage",Wa=ts.as(Ea.JSONContribution),Ba=class extends Ie{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new je),this._onDidUpdateConfiguration=this._register(new je),this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:Vae(1664,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Wa.registerSchema(Fa,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),Wa.registerSchema(Fa,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:n,source:o}of e)for(const e in n){t.add(e);const s=this.configurationDefaultsOverrides.get(e)??this.configurationDefaultsOverrides.set(e,{configurationDefaultOverrides:[]}).get(e),r=n[e];if(s.configurationDefaultOverrides.push({value:r,source:o}),za.test(e)){const t=this.mergeDefaultConfigurationsForOverrideIdentifier(e,r,o,s.configurationDefaultOverrideValue);if(!t)continue;s.configurationDefaultOverrideValue=t,this.updateDefaultOverrideProperty(e,t,o),i.push(...hge(e))}else{const t=this.mergeDefaultConfigurationsForConfigurationProperty(e,r,o,s.configurationDefaultOverrideValue);if(!t)continue;s.configurationDefaultOverrideValue=t;const i=this.configurationProperties[e];i&&(this.updatePropertyDefaultValue(e,i),this.updateSchema(e,i))}}this.doRegisterOverrideIdentifiers(i)}updateDefaultOverrideProperty(e,t,i){const n={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:"object",default:t.value,description:Vae(1665,"Configure settings to be overridden for {0}.",(o=e,o.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", "))),$ref:Fa,defaultDefaultValue:t.value,source:i,defaultValueSource:i};var o;this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){const o=n?.value||{},s=n?.source??new Map;if(s instanceof Map){for(const e of Object.keys(t)){const n=t[e];if(rle(n)&&(hle(o[e])||rle(o[e]))){if(o[e]={...o[e]??{},...n},i)for(const t in n)s.set(`${e}.${t}`,i)}else o[e]=n,i?s.set(e,i):s.delete(e)}return{value:o,source:s}}console.error("objectConfigurationSources is not a Map")}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){const o=this.configurationProperties[e],s=n?.value??o?.defaultDefaultValue;let r=i;if(rle(t)&&(void 0!==o&&"object"===o.type||void 0===o&&(hle(s)||rle(s)))){if(r=n?.source??new Map,!(r instanceof Map))return void console.error("defaultValueSource is not a Map");for(const n in t)i&&r.set(`${e}.${n}`,i);t={...rle(s)?s:{},...t}}return{value:t,source:r}}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,i),this.configurationContributors.push(e),this.registerJSONConfiguration(e)})}validateAndRegisterProperties(e,t=!0,i,n,o=4,s){o=gle(e.scope)?o:e.scope;const r=e.properties;if(r)for(const l in r){const a=r[l];if(a.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},t&&uge(l,a,i?.id)){delete r[l];continue}a.source=i,a.defaultDefaultValue=r[l].default,this.updatePropertyDefaultValue(l,a),za.test(l)?a.scope=void 0:(a.scope=gle(a.scope)?o:a.scope,a.restricted=gle(a.restricted)?!!n?.includes(l):a.restricted),a.experiment?a.tags?.some(e=>"onexp"===e.toLowerCase())||(a.tags=a.tags??[],a.tags.push("onExP")):a.tags?.some(e=>"onexp"===e.toLowerCase())&&(console.error(`Invalid tag 'onExP' found for property '${l}'. Please use 'experiment' property instead.`),a.experiment={mode:"startup"});const d=r[l].hasOwnProperty("included")&&!r[l].included,c=r[l].policy?.name;d?(this.excludedConfigurationProperties[l]=r[l],c&&(this.policyConfigurations.set(c,l),s.add(l)),delete r[l]):(s.add(l),c&&this.policyConfigurations.set(c,l),this.configurationProperties[l]=r[l],!r[l].deprecationMessage&&r[l].markdownDeprecationMessage&&(r[l].deprecationMessage=r[l].markdownDeprecationMessage))}const a=e.allOf;if(a)for(const l of a)this.validateAndRegisterProperties(l,t,i,n,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}registerJSONConfiguration(e){const t=e=>{const i=e.properties;if(i)for(const t in i)this.updateSchema(t,i[t]);e.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:case 2:case 3:case 7:case 4:case 5:break;case 6:this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:Vae(1666,"Configure editor settings to be overridden for a language."),errorMessage:Vae(1667,"This setting does not support per-language configuration."),$ref:Fa};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){Vae(1668,"Configure editor settings to be overridden for a language."),Vae(1669,"This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let n,o;!i||t.disallowConfigurationDefault&&i.source||(n=i.value,o=i.source),hle(n)&&(n=t.defaultDefaultValue,o=void 0),hle(n)&&(n=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=n,t.defaultValueSource=o}},Va="\\[([^\\]]+)\\]",Ha=new RegExp(Va,"g"),za=new RegExp(`^(${Va})+$`),Ua=new Ba,ts.add(Pa.Configuration,Ua),Ka=new Set(Aa.defaultChatAgent?[Aa.defaultChatAgent.extensionId,Aa.defaultChatAgent.chatExtensionId].map(e=>e.toLowerCase()):[]),qa={ModesRegistry:"editor.modesRegistry"},ja=class extends Ie{constructor(){super(),this._onDidChangeLanguages=this._register(new je),this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e)return void this._languages.splice(t,1)}}}getLanguages(){return this._languages}},$a=new ja,ts.add(qa.ModesRegistry,$a),Ga="plaintext",$a.registerLanguage({id:Ga,extensions:[".txt"],aliases:[Vae(784,"Plain Text"),"text"],mimetypes:[Na.text]}),ts.as(Pa.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1},"[go]":{"editor.insertSpaces":!1},"[makefile]":{"editor.insertSpaces":!1},"[shellscript]":{"files.eol":"\n"},"[yaml]":{"editor.insertSpaces":!0,"editor.tabSize":2}}}]),Za=class{constructor(e,t){this.languageId=e;const i=t.brackets?gge(t.brackets):[],n=new Dt(e=>{const t=new Set;return{info:new Qa(this,e,t),closing:t}}),o=new Dt(e=>{const t=new Set,i=new Set;return{info:new Xa(this,e,t,i),opening:t,openingColorized:i}});for(const[r,a]of i){const e=n.get(r),t=o.get(a);e.closing.add(t.info),t.opening.add(e.info)}const s=t.colorizedBracketPairs?gge(t.colorizedBracketPairs):i.filter(e=>!("<"===e[0]&&">"===e[1]));for(const[r,a]of s){const e=n.get(r),t=o.get(a);e.closing.add(t.info),t.openingColorized.add(e.info),t.opening.add(e.info)}this._openingBrackets=new Map([...n.cachedValues].map(([e,t])=>[e,t.info])),this._closingBrackets=new Map([...o.cachedValues].map(([e,t])=>[e,t.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){return ige(Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]),e)}},Ya=class{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}},Qa=class extends Ya{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}},Xa=class extends Ya{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config===this.config&&this.openingBrackets.has(e)}closesColorized(e){return e.config===this.config&&this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}},Ja=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},el=function(e,t){return function(i,n){t(i,n,e)}},tl=class{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}},il=eue("languageConfigurationService"),nl=class extends Ie{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new ll),this.onDidChangeEmitter=this._register(new je),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(ol));this._register(this.configurationService.onDidChangeConfiguration(e=>{const t=e.change.keys.some(e=>i.has(e)),n=e.change.overrides.filter(([e,t])=>t.some(e=>i.has(e))).map(([e])=>e);if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new tl(void 0));else for(const i of n)this.languageService.isRegisteredLanguageId(i)&&(this.configurations.delete(i),this.onDidChangeEmitter.fire(new tl(i)))})),this._register(this._registry.onDidChange(e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new tl(e.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=pge(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}},nl=Ja([el(0,ka),el(1,La)],nl),ol={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"},sl=class{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new rl(e,t,++this._order);return this._entries.push(i),this._resolved=null,Dle(()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===i){this._entries.splice(e,1),this._resolved=null;break}})}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new dl(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(rl.cmp),_ge(this._entries.map(e=>e.configuration)))}},rl=class{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}},al=class{constructor(e){this.languageId=e}},ll=class extends Ie{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new je),this.onDidChange=this._onDidChange.event,this._register(this.register(Ga,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new sl(e),this._entries.set(e,n));const o=n.register(t,i);return this._onDidChange.fire(new al(e)),Dle(()=>{o.dispose(),this._onDidChange.fire(new al(e))})}getLanguageConfiguration(e){return this._entries.get(e)?.getResolvedConfiguration()||null}},dl=class e{constructor(t,i){this.languageId=t,this.underlyingConfig=i,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new xa(this.underlyingConfig):null,this.comments=e._handleComments(this.underlyingConfig),this.characterPair=new ga(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||ca,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Sa(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new Za(t,this.underlyingConfig)}getWordDefinition(){return jue(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new va(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new ya(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new la(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&("string"==typeof t.lineComment?i.lineCommentToken=t.lineComment:(i.lineCommentToken=t.lineComment.comment,i.lineCommentNoIndent=t.lineComment.noIndent)),t.blockComment){const[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}},dge(il,nl,1),cl=class{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e);const i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),8&i&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let o=`color: ${t[i]};`;1&n&&(o+="font-style: italic;"),2&n&&(o+="font-weight: bold;");let s="";return 4&n&&(s+=" underline"),8&n&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:Boolean(1&i),bold:Boolean(2&i),underline:Boolean(4&i),strikethrough:Boolean(8&i)}}},hl=class e{static fromTo(t,i){return new e(t,i)}static addRange(t,i){let n=0;for(;n<i.length&&i[n].endExclusive<t.start;)n++;let o=n;for(;o<i.length&&i[o].start<=t.endExclusive;)o++;if(n===o)i.splice(n,0,t);else{const s=Math.min(t.start,i[n].start),r=Math.max(t.endExclusive,i[o-1].endExclusive);i.splice(n,o-n,new e(s,r))}}static tryCreate(t,i){if(!(t>i))return new e(t,i)}static ofLength(t){return new e(0,t)}static ofStartAndLength(t,i){return new e(t,t+i)}static emptyAt(t){return new e(t,t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new y(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(t){return new e(this.start+t,this.endExclusive+t)}deltaStart(t){return new e(this.start+t,this.endExclusive)}deltaEnd(t){return new e(this.start,this.endExclusive+t)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(t){return new e(Math.min(this.start,t.start),Math.max(this.endExclusive,t.endExclusive))}intersect(t){const i=Math.max(this.start,t.start),n=Math.min(this.endExclusive,t.endExclusive);if(i<=n)return new e(i,n)}intersectionLength(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,i-t)}intersects(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)}intersectsOrTouches(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new y(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new y(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}joinRightTouching(t){if(this.endExclusive!==t.start)throw new y(`Invalid join: ${this.toString()} and ${t.toString()}`);return new e(this.start,t.endExclusive)}},ul=class e{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const n=Math.min(e.start,this._sortedRanges[t].start),o=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new hl(n,o))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(t){const i=new e;for(const e of this._sortedRanges){const n=e.intersect(t);n&&i.addRange(n)}return i}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,t)=>e+t.length,0)}},gl=class e{static createEmpty(t,i){const n=e.defaultTokenMetadata,o=new Uint32Array(2);return o[0]=t.length,o[1]=n,new e(o,t,i)}static createFromTextAndMetadata(t,i){let n=0,o="";const s=new Array;for(const{text:e,metadata:r}of t)s.push(n+e.length,r),n+=e.length,o+=e;return new e(new Uint32Array(s),o,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let n=0;n<i;n++)e[n<<1]=e[n+1<<1];e[i<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;for(;i<n;){const o=i+Math.floor((n-i)/2),s=e[o<<1];if(s===t)return o+1;s<t?i=o+1:s>t&&(n=o)}return i}constructor(e,t,i){this._lineTokensBrand=void 0,(e.length>1?e[e.length-2]:0)!==t.length&&$ae(new Error("Token length and text length do not match!")),this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}getTextLength(){return this._text.length}equals(t){return t instanceof e&&this.slicedEquals(t,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,o=n+(i<<1);for(let s=n;s<o;s++)if(this._tokens[s]!==e._tokens[s])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=cl.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return cl.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return cl.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return cl.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return cl.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return cl.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(t){return e.findIndexInTokensArray(this._tokens,t)}inflate(){return this}sliceAndInflate(e,t,i){return new pl(this,e,t,i)}sliceZeroCopy(e){return this.sliceAndInflate(e.start,e.endExclusive,0)}withInserted(t){if(0===t.length)return this;let i=0,n=0,o="";const s=new Array;let r=0;for(;;){const e=i<this._tokensCount?this._tokens[i<<1]:-1,a=n<t.length?t[n]:null;if(-1!==e&&(null===a||e<=a.offset)){o+=this._text.substring(r,e);const t=this._tokens[1+(i<<1)];s.push(o.length,t),i++,r=e}else{if(!a)break;if(a.offset>r){o+=this._text.substring(r,a.offset);const e=this._tokens[1+(i<<1)];s.push(o.length,e),r=a.offset}o+=a.text,s.push(o.length,a.tokenMetadata),n++}}return new e(new Uint32Array(s),o,this.languageIdCodec)}getTokensInRange(e){const t=new _l,i=this.findTokenIndexAtOffset(e.start),n=this.findTokenIndexAtOffset(e.endExclusive);for(let o=i;o<=n;o++){const i=new hl(this.getStartOffset(o),this.getEndOffset(o)).intersectionLength(e);i>0&&t.add(i,this.getMetadata(o))}return t.build()}getTokenText(e){const t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){const t=this.getCount();for(let i=0;i<t;i++)e(i)}toString(){let e="";return this.forEach(t=>{e+=`[${this.getTokenText(t)}]{${this.getClassName(t)}}`}),e}},gl.defaultTokenMetadata=33587200,pl=class e{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let o=this._firstTokenIndex,s=e.getCount();o<s&&!(e.getStartOffset(o)>=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(t){return t instanceof e&&this._startOffset===t._startOffset&&this._endOffset===t._endOffset&&this._deltaOffset===t._deltaOffset&&this._source.slicedEquals(t._source,this._firstTokenIndex,this._tokensCount)}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){const t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),n=this._source.getEndOffset(t);let o=this._source.getTokenText(t);return i<this._startOffset&&(o=o.substring(this._startOffset-i)),n>this._endOffset&&(o=o.substring(0,o.length-(n-this._endOffset))),o}forEach(e){for(let t=0;t<this.getCount();t++)e(t)}},ml=class e{static fromLineTokens(t){const i=[];for(let e=0;e<t.getCount();e++)i.push(new fl(t.getEndOffset(e)-t.getStartOffset(e),t.getMetadata(e)));return e.create(i)}static create(t){return new e(t)}constructor(e){this._tokenInfo=e}toLineTokens(e,t){return gl.createFromTextAndMetadata(this.map((t,i)=>({text:t.substring(e),metadata:i.metadata})),t)}forEach(e){let t=0;for(const i of this._tokenInfo)e(new hl(t,t+i.length),i),t+=i.length}map(e){const t=[];let i=0;for(const n of this._tokenInfo){const o=new hl(i,i+n.length);t.push(e(o,n)),i+=n.length}return t}slice(t){const i=[];let n=0;for(const e of this._tokenInfo){const o=n,s=o+e.length;if(s>t.start){if(o>=t.endExclusive)break;const n=Math.max(0,t.start-o),r=Math.max(0,s-t.endExclusive);i.push(new fl(e.length-n-r,e.metadata))}n+=e.length}return e.create(i)}},fl=class{constructor(e,t){this.length=e,this.metadata=t}},_l=class{constructor(){this._tokens=[]}add(e,t){this._tokens.push(new fl(e,t))}build(){return ml.create(this._tokens)}},bl=class{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new wl(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}},vl=class{constructor(e,t){this.model=e,this.indentationLineProcessor=new wl(e,t)}getProcessedTokenContextAroundRange(e){return{beforeRangeProcessedTokens:this._getProcessedTokensBeforeRange(e),afterRangeProcessedTokens:this._getProcessedTokensAfterRange(e),previousLineProcessedTokens:this._getProcessedPreviousLineTokens(e)}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=Eue(t,e.startColumn-1);let n;if(bge(this.model,e.getStartPosition())){const o=e.startColumn-1-i.firstCharOffset,s=i.firstCharOffset,r=s+o;n=t.sliceAndInflate(s,r,0)}else{const i=e.startColumn-1;n=t.sliceAndInflate(0,i,0)}return this.indentationLineProcessor.getProcessedTokens(n)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),n=Eue(i,t.column-1),o=t.column-1-n.firstCharOffset,s=n.firstCharOffset+o,r=n.firstCharOffset+n.getLineLength(),a=i.sliceAndInflate(s,r,0);return this.indentationLineProcessor.getProcessedTokens(a)}_getProcessedPreviousLineTokens(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=Eue(this.model.tokenization.getLineTokens(e.startLineNumber),e.startColumn-1),i=gl.createEmpty("",t.languageIdCodec),n=e.startLineNumber-1;if(0===n)return i;if(0!==t.firstCharOffset)return i;const o=(e=>(this.model.tokenization.forceTokenization(e),Eue(this.model.tokenization.getLineTokens(e),this.model.getLineMaxColumn(e)-1)))(n);if(t.languageId!==o.languageId)return i;const s=o.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(s)}},wl=class{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){this.model.tokenization.forceTokenization?.(e);const i=this.model.tokenization.getLineTokens(e);let n=this.getProcessedTokens(i).getLineContent();return void 0!==t&&(n=((e,t)=>{const i=$le(e);return t+e.substring(i.length)})(n,t)),n}getProcessedTokens(e){const t=e.getLanguageId(0),i=this.languageConfigurationService.getLanguageConfiguration(t).bracketsNew.getBracketRegExp({global:!0}),n=[];return e.forEach(t=>{const o=e.getStandardTokenType(t);let s=e.getTokenText(t);(e=>2===e||3===e||1===e)(o)&&(s=s.replace(i,""));const r=e.getMetadata(t);n.push({text:s,metadata:r})}),gl.createFromTextAndMetadata(n,e.languageIdCodec)}},Cl=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},yl=function(e,t){return function(i,n){t(i,n,e)}},xl=Object.create(null),kl=Sl=class{static unshiftIndent(e,t,i,n,o){const s=br.visibleColumnFromColumn(e,t,i);return o?wge(wge(" ",n),br.prevIndentTabStop(s,n)/n):wge("\t",br.prevRenderTabStop(s,i)/i)}static shiftIndent(e,t,i,n,o){const s=br.visibleColumnFromColumn(e,t,i);return o?wge(wge(" ",n),br.nextIndentTabStop(s,n)/n):wge("\t",br.nextRenderTabStop(s,i)/i)}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;1===this._selection.endColumn&&i!==n&&(n-=1);const{tabSize:o,indentSize:s,insertSpaces:r}=this._opts,a=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,d=0;for(let c=i;c<=n;c++,l=d){d=0;const n=e.getLineContent(c);let h,u=jle(n);if((!this._opts.isUnshift||0!==n.length&&0!==u)&&(a||this._opts.isUnshift||0!==n.length)){if(-1===u&&(u=n.length),c>1&&br.visibleColumnFromColumn(n,u+1,o)%s!==0&&e.tokenization.isCheapToTokenize(c-1)){const t=vge(this._opts.autoIndent,e,new mr(c-1,e.getLineMaxColumn(c-1),c-1,e.getLineMaxColumn(c-1)),this._languageConfigurationService);if(t){if(d=l,t.appendText)for(let e=0,i=t.appendText.length;e<i&&d<s&&32===t.appendText.charCodeAt(e);e++)d++;t.removeText&&(d=Math.max(0,d-t.removeText));for(let e=0;e<d&&0!==u&&32===n.charCodeAt(u-1);e++)u--}}this._opts.isUnshift&&0===u||(h=this._opts.isUnshift?Sl.unshiftIndent(n,u+1,o,s,r):Sl.shiftIndent(n,u+1,o,s,r),this._addEditOperation(t,new mr(c,1,c,u+1),h),c!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=u+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===e.getLineLength(i)&&(this._useLastEditRangeForCursorEndPosition=!0);const o=r?wge(" ",s):"\t";for(let r=i;r<=n;r++){const n=e.getLineContent(r);let l=jle(n);if((!this._opts.isUnshift||0!==n.length&&0!==l)&&(a||this._opts.isUnshift||0!==n.length)&&(-1===l&&(l=n.length),!this._opts.isUnshift||0!==l))if(this._opts.isUnshift){l=Math.min(l,s);for(let e=0;e<l;e++)if(9===n.charCodeAt(e)){l=e+1;break}this._addEditOperation(t,new mr(r,1,r,l+1),"")}else this._addEditOperation(t,new mr(r,1,r,1),o),r!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const e=t.getInverseEditOperations()[0];return new fr(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const e=this._selection.startColumn;return i.startColumn<=e?i:0===i.getDirection()?new fr(i.startLineNumber,e,i.endLineNumber,i.endColumn):new fr(i.endLineNumber,i.endColumn,i.startLineNumber,e)}return i}},kl=Sl=Cl([yl(2,il)],kl),Ll=class{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new mr(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new mr(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection||null)}computeCursorState(e,t){const i=t.getInverseEditOperations(),n=i[0].range,o=i[1].range;return new fr(n.endLineNumber,n.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}},Dl=class{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new mr(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return new fr(i.endLineNumber,i.startColumn,i.endLineNumber,i.endColumn-this._charAfter.length)}},Il=class{static getEdits(e,t,i,n,o){if(!o&&this._isAutoIndentType(e,t,i)){const o=[];for(const r of i){const i=this._findActualIndentationForSelection(e,t,r,n);if(null===i)return;o.push({selection:r,indentation:i})}const s=Ml.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,o,n,s)}}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;n<o;n++)if(!t.tokenization.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _findActualIndentationForSelection(e,t,i,n){const o=function(e,t,i,n,o,s){const r=e.autoIndent;if(r<4)return null;if(bge(t,i.getStartPosition()))return null;const a=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),l=s.getLanguageConfiguration(a).indentRulesSupport;if(!l)return null;const d=new vl(t,s).getProcessedTokenContextAroundRange(i),c=d.beforeRangeProcessedTokens.getLineContent(),h=d.afterRangeProcessedTokens.getLineContent(),u=c+h,g=c+n+h;if(!l.shouldDecrease(u)&&l.shouldDecrease(g)){const e=Cge(r,t,i.startLineNumber,!1,s);if(!e)return null;let n=e.indentation;return e.action!==ra.Indent&&(n=o.unshiftIndent(n)),n}const p=i.startLineNumber-1;if(p>0){const a=t.getLineContent(p);if(l.shouldIndentNextLine(a)&&l.shouldIncrease(g)){const a=Cge(r,t,i.startLineNumber,!1,s)?.indentation;if(void 0!==a){const s=$le(t.getLineContent(i.startLineNumber)),r=o.shiftIndent(a)===s,l=/^\s*$/.test(u),d=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n),c=d&&d.length>0&&l;if(r&&c)return a}}}return null}(e,t,i,n,{shiftIndent:t=>Ege(e,t),unshiftIndent:t=>Mge(e,t)},e.languageConfigurationService);if(null===o)return null;const s=fge(t,i.startLineNumber,i.startColumn);return o===e.normalizeIndentation(s)?null:o}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,o){return new Ir(4,i.map(({selection:i,indentation:s})=>{if(null!==o)return new Ul(this._getEditFromIndentationAndSelection(e,t,s,i,n,!1),i,n,o);{const o=this._getEditFromIndentationAndSelection(e,t,s,i,n,!0);return Nge(o.range,o.text,!1)}}),{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _getEditFromIndentationAndSelection(e,t,i,n,o,s=!0){const r=n.startLineNumber,a=t.getLineFirstNonWhitespaceColumn(r);let l=e.normalizeIndentation(i);return 0!==a&&(l+=t.getLineContent(r).substring(a-1,n.startColumn-1)),l+=s?o:"",{range:new mr(r,1,n.endLineNumber,n.endColumn),text:l}}},Nl=class{static getEdits(e,t,i,n,o,s){if(Ige(t,i,n,o,s))return this._runAutoClosingOvertype(e,n,s)}static _runAutoClosingOvertype(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const e=t[o].getPosition();n[o]=new Er(new mr(e.lineNumber,e.column,e.lineNumber,e.column+1),i)}return new Ir(4,n,{shouldPushStackElementBefore:kge(e,4),shouldPushStackElementAfter:!1})}},El=class{static getEdits(e,t,i,n,o){if(Ige(e,t,i,n,o))return new Ir(4,i.map(e=>new Er(new mr(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)),{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}},Ml=class{static getEdits(e,t,i,n,o,s){if(!s){const s=this.getAutoClosingPairClose(e,t,i,n,o);if(null!==s)return this._runAutoClosingOpenCharType(i,n,o,s)}}static _runAutoClosingOpenCharType(e,t,i,n){const o=[];for(let s=0,r=e.length;s<r;s++){const r=e[s];o[s]=new zl(r,t,!i,n)}return new Ir(4,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static getAutoClosingPairClose(e,t,i,n,o){for(const u of i)if(!u.isEmpty())return null;const s=i.map(e=>{const t=e.getPosition();return o?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}}),r=this._findAutoClosingPairOpen(e,t,s.map(e=>new to(e.lineNumber,e.beforeColumn)),n);if(!r)return null;let a,l;if(Rue(n)?(a=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote):e.blockCommentStartToken&&r.open.includes(e.blockCommentStartToken)?(a=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(a=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket),"never"===a)return null;const d=this._findContainedAutoClosingPair(e,r),c=d?d.close:"";let h=!0;for(const u of s){const{lineNumber:i,beforeColumn:o,afterColumn:s}=u,d=t.getLineContent(i),g=d.substring(0,o-1),p=d.substring(s-1);if(p.startsWith(c)||(h=!1),p.length>0){const t=p.charAt(0);if(!this._isBeforeClosingBrace(e,p)&&!l(t))return null}if(1===r.open.length&&("'"===n||'"'===n)&&"always"!==a){const t=Fue(e.wordSeparators,[]);if(g.length>0){const e=g.charCodeAt(g.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(i))return null;t.tokenization.forceTokenization(i);const m=Eue(t.tokenization.getLineTokens(i),o-1);if(!r.shouldAutoClose(m,o-m.firstCharOffset))return null;const f=r.findNeutralCharacter();if(f){const e=t.tokenization.getTokenTypeIfInsertingCharacter(i,o,f);if(!r.isOK(e))return null}}return h?r.close.substring(0,r.close.length-c.length):r.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const s of n)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let s=null;for(const r of o)if(null===s||r.open.length>s.open.length){let e=!0;for(const o of i)if(t.getValueInRange(new mr(o.lineNumber,o.column-r.open.length+1,o.lineNumber,o.column))+n!==r.open){e=!1;break}e&&(s=r)}return s}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=n.some(e=>t.startsWith(e.open)),r=o.some(e=>t.startsWith(e.close));return!s&&r}},Tl=class{static getEdits(e,t){return"overtype"!==e.inputMode?null:new Ir(4,t.map(e=>new Ar(e.insertedTextRange)),{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}},Rl=class{static getEdits(e,t,i,n,o){if(!o&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=e.surroundingPairs[i];n[o]=new Ll(s,i,r)}return new Ir(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isSurroundSelectionType(e,t,i,n){if(!Tge(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;const o=Rue(n);for(const s of i){if(s.isEmpty())return!1;let e=!0;for(let i=s.startLineNumber;i<=s.endLineNumber;i++){const n=t.getLineContent(i),o=i===s.startLineNumber?s.startColumn-1:0,r=i===s.endLineNumber?s.endColumn-1:n.length,a=n.substring(o,r);if(/[^ \t]/.test(a)){e=!1;break}}if(e)return!1;if(o&&s.startLineNumber===s.endLineNumber&&s.startColumn+1===s.endColumn&&Rue(t.getValueInRange(s)))return!1}return!0}},Ol=class{static getEdits(e,t,i,n,o,s){if(!s&&this._isTypeInterceptorElectricChar(t,i,n)){const s=this._typeInterceptorElectricChar(e,t,i,n[0],o);if(s)return s}}static _isTypeInterceptorElectricChar(e,t,i){return!(1!==i.length||!t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,o){if(!t.electricChars.hasOwnProperty(o)||!n.isEmpty())return null;const s=n.getPosition();i.tokenization.forceTokenization(s.lineNumber);const r=i.tokenization.getLineTokens(s.lineNumber);let a;try{a=t.onElectricCharacter(o,r,s.column)}catch(Fae){return $ae(Fae),null}if(!a)return null;if(a.matchOpenBracket){const n=(r.getLineContent()+o).lastIndexOf(a.matchOpenBracket)+1,l=i.bracketPairs.findMatchingBracketUp(a.matchOpenBracket,{lineNumber:s.lineNumber,column:n},500);if(l){if(l.startLineNumber===s.lineNumber)return null;const n=$le(i.getLineContent(l.startLineNumber)),r=t.normalizeIndentation(n),a=i.getLineContent(s.lineNumber),d=i.getLineFirstNonWhitespaceColumn(s.lineNumber)||s.column,c=r+a.substring(d-1,s.column-1)+o,h=new Er(new mr(s.lineNumber,1,s.lineNumber,s.column),c);return new Ir(xge(c,e),[h],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}},Al=class{static getEdits(e,t,i,n,o){const s=[];for(let a=0,l=i.length;a<l;a++)s[a]=new("overtype"!==e.inputMode||o?Er:Mr)(i[a],n);const r=xge(n,t);return new Ir(r,s,{shouldPushStackElementBefore:kge(t,r),shouldPushStackElementAfter:!1})}},Pl=class{static getEdits(e,t,i,n,o){if(!o&&"\n"===n){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=this._enter(e,t,!1,i[o]);return new Ir(4,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}static _enter(e,t,i,n){if(0===e.autoIndent)return Nge(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const o=$le(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);return Nge(n,"\n"+e.normalizeIndentation(o),i)}const o=vge(e.autoIndent,t,n,e.languageConfigurationService);if(o){if(o.indentAction===ra.None)return Nge(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ra.Indent)return Nge(n,"\n"+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ra.IndentOutdent){const t=e.normalizeIndentation(o.indentation),s=e.normalizeIndentation(o.indentation+o.appendText),r="\n"+s+"\n"+t;return i?new Rr(n,r,!0):new Or(n,r,-1,s.length-t.length,!0)}if(o.indentAction===ra.Outdent){const t=Mge(e,o.indentation);return Nge(n,"\n"+e.normalizeIndentation(t+o.appendText),i)}}const s=$le(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);if(e.autoIndent>=4){const o=function(e,t,i,n,o){if(e<4)return null;const s=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),r=o.getLanguageConfiguration(s).indentRulesSupport;if(!r)return null;t.tokenization.forceTokenization(i.startLineNumber);const a=new vl(t,o).getProcessedTokenContextAroundRange(i),l=a.afterRangeProcessedTokens,d=a.beforeRangeProcessedTokens,c=$le(d.getLineContent()),h=function(e,t,i){return{tokenization:{getLineTokens:n=>n===t?i:e.tokenization.getLineTokens(n),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(t,i)=>e.getLanguageIdAtPosition(t,i)},getLineContent:n=>n===t?i.getLineContent():e.getLineContent(n)}}(t,i.startLineNumber,d),u=bge(t,i.getStartPosition()),g=$le(t.getLineContent(i.startLineNumber)),p=Cge(e,h,i.startLineNumber+1,void 0,o);if(!p){const e=u?g:c;return{beforeEnter:e,afterEnter:e}}let m=u?g:p.indentation;return p.action===ra.Indent&&(m=n.shiftIndent(m)),r.shouldDecrease(l.getLineContent())&&(m=n.unshiftIndent(m)),{beforeEnter:u?g:c,afterEnter:m}}(e.autoIndent,t,n,{unshiftIndent:t=>Mge(e,t),shiftIndent:t=>Ege(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(o){let s=e.visibleColumnFromColumn(t,n.getEndPosition());const r=n.endColumn,a=jle(t.getLineContent(n.endLineNumber));if(n=a>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,a+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Rr(n,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return r<=a+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new Or(n,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return Nge(n,"\n"+e.normalizeIndentation(s),i)}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){let s=i[o].positionLineNumber;if(1===s)n[o]=new Rr(new mr(1,1,1,1),"\n");else{s--;const i=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new mr(s,i,s,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o].positionLineNumber,r=t.getLineMaxColumn(s);n[o]=this._enter(e,t,!1,new mr(s,r,s,r))}return n}static lineBreakInsert(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=this._enter(e,t,!0,i[o]);return n}},Fl=class{static getEdits(e,t,i,n,o,s){const r=this._distributePasteToCursors(e,i,n,o,s);return r?(i=i.sort(mr.compareRangesUsingStarts),this._distributedPaste(e,t,i,r)):this._simplePaste(e,t,i,n,o)}static _distributePasteToCursors(e,t,i,n,o){if(n)return null;if(1===t.length)return null;if(o&&o.length===t.length)return o;if("spread"===e.multiCursorPaste){10===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1));const e=qle(i);if(e.length===t.length)return e}return null}static _distributedPaste(e,t,i,n){const o=[];for(let s=0,r=i.length;s<r;s++)o[s]=new(e.overtypeOnPaste&&"overtype"===e.inputMode?Mr:Er)(i[s],n[s]);return new Ir(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,o){const s=[];for(let r=0,a=i.length;r<a;r++){const t=i[r],a=t.getPosition();o&&!t.isEmpty()&&(o=!1),o&&n.indexOf("\n")!==n.length-1&&(o=!1),s[r]=o?new Pr(new mr(a.lineNumber,1,a.lineNumber,1),n,t,!0):new(e.overtypeOnPaste&&"overtype"===e.inputMode?Mr:Er)(t,n)}return new Ir(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}},Wl=class{static getEdits(e,t,i,n,o,s,r,a){return new Ir(4,n.map(e=>this._compositionType(i,e,o,s,r,a)),{shouldPushStackElementBefore:kge(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,s){if(!t.isEmpty())return null;const r=t.getPosition(),a=Math.max(1,r.column-n),l=Math.min(e.getLineMaxColumn(r.lineNumber),r.column+o);return new Or(new mr(r.lineNumber,a,r.lineNumber,l),i,0,s)}},Bl=class{static getEdits(e,t,i){const n=[];for(let s=0,r=t.length;s<r;s++)n[s]=new Er(t[s],i);const o=xge(i,e);return new Ir(o,n,{shouldPushStackElementBefore:kge(e,o),shouldPushStackElementAfter:!1})}},Vl=class{static getCommands(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++){const s=i[o];if(s.isEmpty()){const i=t.getLineContent(s.startLineNumber);if(/^\s*$/.test(i)&&t.tokenization.isCheapToTokenize(s.startLineNumber)){let r=this._goodIndentForLine(e,t,s.startLineNumber);r=r||"\t";const a=e.normalizeIndentation(r);if(!i.startsWith(a)){n[o]=new Er(new mr(s.startLineNumber,1,s.startLineNumber,i.length+1),a,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,s,!0)}else{if(s.startLineNumber===s.endLineNumber){const i=t.getLineMaxColumn(s.startLineNumber);if(1!==s.startColumn||s.endColumn!==i){n[o]=this._replaceJumpToNextIndent(e,t,s,!1);continue}}n[o]=new kl(s,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static _goodIndentForLine(e,t,i){let n=null,o="";const s=Cge(e.autoIndent,t,i,!1,e.languageConfigurationService);if(s)n=s.action,o=s.indentation;else if(i>1){let n;for(n=i-1;n>=1&&!(Gle(t.getLineContent(n))>=0);n--);if(n<1)return null;const s=t.getLineMaxColumn(n),r=vge(e.autoIndent,t,new mr(n,s,n,s),e.languageConfigurationService);r&&(o=r.indentation+r.appendText)}return n&&(n===ra.Indent&&(o=Ege(e,o)),n===ra.Outdent&&(o=Mge(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const s=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,s),n=e.indentSize,r=n-i%n;for(let e=0;e<r;e++)o+=" "}else o="\t";return new Er(i,o,n)}},Hl=class extends Or{constructor(e,t,i,n,o,s){super(e,t,i,n),this._openCharacter=o,this._closeCharacter=s,this.closeCharacterRange=null,this.enclosingRange=null}_computeCursorStateWithRange(e,t,i){return this.closeCharacterRange=new mr(t.startLineNumber,t.endColumn-this._closeCharacter.length,t.endLineNumber,t.endColumn),this.enclosingRange=new mr(t.startLineNumber,t.endColumn-this._openCharacter.length-this._closeCharacter.length,t.endLineNumber,t.endColumn),super.computeCursorState(e,i)}},zl=class extends Hl{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length,t,n)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this._computeCursorStateWithRange(e,i,t)}},Ul=class extends Hl{constructor(e,t,i,n){const o=i+n;super(t,o,0,i.length,i,n),this._autoIndentationEdit=e,this._autoClosingEdit={range:t,text:o}}getEditOperations(e,t){t.addTrackedEditOperation(this._autoIndentationEdit.range,this._autoIndentationEdit.text),t.addTrackedEditOperation(this._autoClosingEdit.range,this._autoClosingEdit.text)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(2!==i.length)throw new Error("There should be two inverse edit operations!");const n=i[0].range,o=i[1].range,s=n.plusRange(o);return this._computeCursorStateWithRange(e,s,t)}},Kl=class{static indent(e,t,i){if(null===t||null===i)return[];const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=new kl(i[o],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static outdent(e,t,i){const n=[];for(let o=0,s=i.length;o<s;o++)n[o]=new kl(i[o],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static paste(e,t,i,n,o,s){return Fl.getEdits(e,t,i,n,o,s)}static tab(e,t,i){return Vl.getCommands(e,t,i)}static compositionType(e,t,i,n,o,s,r,a){return Wl.getEdits(e,t,i,n,o,s,r,a)}static compositionEndWithInterceptors(e,t,i,n,o,s){if(!n)return null;let r=null;for(const h of n)if(null===r)r=h.insertedText;else if(r!==h.insertedText)return null;if(!r||1!==r.length)return Tl.getEdits(t,n);const a=r;let l=!1;for(const h of n)if(0!==h.deletedText.length){l=!0;break}if(l){if(!Tge(t,a)||!t.surroundingPairs.hasOwnProperty(a))return null;const e=Rue(a);for(const t of n){if(0!==t.deletedSelectionStart||t.deletedSelectionEnd!==t.deletedText.length)return null;if(/^[ \t]+$/.test(t.deletedText))return null;if(e&&Rue(t.deletedText))return null}const i=[];for(const t of o){if(!t.isEmpty())return null;i.push(t.getPosition())}if(i.length!==n.length)return null;const s=[];for(let o=0,r=i.length;o<r;o++)s.push(new Dl(i[o],n[o].deletedText,t.surroundingPairs[a]));return new Ir(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=El.getEdits(t,i,o,s,a);if(void 0!==d)return d;const c=Ml.getEdits(t,i,o,a,!0,!1);return void 0!==c?c:Tl.getEdits(t,n)}static typeWithInterceptors(e,t,i,n,o,s,r){const a=Pl.getEdits(i,n,o,r,e);if(void 0!==a)return a;const l=Il.getEdits(i,n,o,r,e);if(void 0!==l)return l;const d=Nl.getEdits(t,i,n,o,s,r);if(void 0!==d)return d;const c=Ml.getEdits(i,n,o,r,!1,e);if(void 0!==c)return c;const h=Rl.getEdits(i,n,o,r,e);if(void 0!==h)return h;const u=Ol.getEdits(t,i,n,o,r,e);return void 0!==u?u:Al.getEdits(i,t,o,r,e)}static typeWithoutInterceptors(e,t,i,n,o){return Bl.getEdits(e,n,o)}},ql=class{constructor(e,t,i,n,o,s,r){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=o,this.insertedSelectionEnd=s,this.insertedTextRange=r}},function(e){e.editorSimpleInput=new Jo("editorSimpleInput",!1,!0),e.editorTextFocus=new Jo("editorTextFocus",!1,Vae(681,"Whether the editor text has focus (cursor is blinking)")),e.focus=new Jo("editorFocus",!1,Vae(682,"Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),e.textInputFocus=new Jo("textInputFocus",!1,Vae(683,"Whether an editor or a rich text input has focus (cursor is blinking)")),e.readOnly=new Jo("editorReadonly",!1,Vae(684,"Whether the editor is read-only")),e.inDiffEditor=new Jo("inDiffEditor",!1,Vae(685,"Whether the context is a diff editor")),e.isEmbeddedDiffEditor=new Jo("isEmbeddedDiffEditor",!1,Vae(686,"Whether the context is an embedded diff editor")),e.inMultiDiffEditor=new Jo("inMultiDiffEditor",!1,Vae(687,"Whether the context is a multi diff editor")),e.multiDiffEditorAllCollapsed=new Jo("multiDiffEditorAllCollapsed",void 0,Vae(688,"Whether all files in multi diff editor are collapsed")),e.hasChanges=new Jo("diffEditorHasChanges",!1,Vae(689,"Whether the diff editor has changes")),e.comparingMovedCode=new Jo("comparingMovedCode",!1,Vae(690,"Whether a moved code block is selected for comparison")),e.accessibleDiffViewerVisible=new Jo("accessibleDiffViewerVisible",!1,Vae(691,"Whether the accessible diff viewer is visible")),e.diffEditorRenderSideBySideInlineBreakpointReached=new Jo("diffEditorRenderSideBySideInlineBreakpointReached",!1,Vae(692,"Whether the diff editor render side by side inline breakpoint is reached")),e.diffEditorInlineMode=new Jo("diffEditorInlineMode",!1,Vae(693,"Whether inline mode is active")),e.diffEditorOriginalWritable=new Jo("diffEditorOriginalWritable",!1,Vae(694,"Whether modified is writable in the diff editor")),e.diffEditorModifiedWritable=new Jo("diffEditorModifiedWritable",!1,Vae(695,"Whether modified is writable in the diff editor")),e.diffEditorOriginalUri=new Jo("diffEditorOriginalUri","",Vae(696,"The uri of the original document")),e.diffEditorModifiedUri=new Jo("diffEditorModifiedUri","",Vae(697,"The uri of the modified document")),e.columnSelection=new Jo("editorColumnSelection",!1,Vae(698,"Whether `editor.columnSelection` is enabled")),e.writable=e.readOnly.toNegated(),e.hasNonEmptySelection=new Jo("editorHasSelection",!1,Vae(699,"Whether the editor has text selected")),e.hasOnlyEmptySelection=e.hasNonEmptySelection.toNegated(),e.hasMultipleSelections=new Jo("editorHasMultipleSelections",!1,Vae(700,"Whether the editor has multiple selections")),e.hasSingleSelection=e.hasMultipleSelections.toNegated(),e.tabMovesFocus=new Jo("editorTabMovesFocus",!1,Vae(701,"Whether `Tab` will move focus out of the editor")),e.tabDoesNotMoveFocus=e.tabMovesFocus.toNegated(),e.isInEmbeddedEditor=new Jo("isInEmbeddedEditor",!1,!0),e.canUndo=new Jo("canUndo",!1,!0),e.canRedo=new Jo("canRedo",!1,!0),e.hoverVisible=new Jo("editorHoverVisible",!1,Vae(702,"Whether the editor hover is visible")),e.hoverFocused=new Jo("editorHoverFocused",!1,Vae(703,"Whether the editor hover is focused")),e.stickyScrollFocused=new Jo("stickyScrollFocused",!1,Vae(704,"Whether the sticky scroll is focused")),e.stickyScrollVisible=new Jo("stickyScrollVisible",!1,Vae(705,"Whether the sticky scroll is visible")),e.standaloneColorPickerVisible=new Jo("standaloneColorPickerVisible",!1,Vae(706,"Whether the standalone color picker is visible")),e.standaloneColorPickerFocused=new Jo("standaloneColorPickerFocused",!1,Vae(707,"Whether the standalone color picker is focused")),e.inCompositeEditor=new Jo("inCompositeEditor",void 0,Vae(708,"Whether the editor is part of a larger editor (e.g. notebooks)")),e.notInCompositeEditor=e.inCompositeEditor.toNegated(),e.languageId=new Jo("editorLangId","",Vae(709,"The language identifier of the editor")),e.hasCompletionItemProvider=new Jo("editorHasCompletionItemProvider",!1,Vae(710,"Whether the editor has a completion item provider")),e.hasCodeActionsProvider=new Jo("editorHasCodeActionsProvider",!1,Vae(711,"Whether the editor has a code actions provider")),e.hasCodeLensProvider=new Jo("editorHasCodeLensProvider",!1,Vae(712,"Whether the editor has a code lens provider")),e.hasDefinitionProvider=new Jo("editorHasDefinitionProvider",!1,Vae(713,"Whether the editor has a definition provider")),e.hasDeclarationProvider=new Jo("editorHasDeclarationProvider",!1,Vae(714,"Whether the editor has a declaration provider")),e.hasImplementationProvider=new Jo("editorHasImplementationProvider",!1,Vae(715,"Whether the editor has an implementation provider")),e.hasTypeDefinitionProvider=new Jo("editorHasTypeDefinitionProvider",!1,Vae(716,"Whether the editor has a type definition provider")),e.hasHoverProvider=new Jo("editorHasHoverProvider",!1,Vae(717,"Whether the editor has a hover provider")),e.hasDocumentHighlightProvider=new Jo("editorHasDocumentHighlightProvider",!1,Vae(718,"Whether the editor has a document highlight provider")),e.hasDocumentSymbolProvider=new Jo("editorHasDocumentSymbolProvider",!1,Vae(719,"Whether the editor has a document symbol provider")),e.hasReferenceProvider=new Jo("editorHasReferenceProvider",!1,Vae(720,"Whether the editor has a reference provider")),e.hasRenameProvider=new Jo("editorHasRenameProvider",!1,Vae(721,"Whether the editor has a rename provider")),e.hasSignatureHelpProvider=new Jo("editorHasSignatureHelpProvider",!1,Vae(722,"Whether the editor has a signature help provider")),e.hasInlayHintsProvider=new Jo("editorHasInlayHintsProvider",!1,Vae(723,"Whether the editor has an inline hints provider")),e.hasDocumentFormattingProvider=new Jo("editorHasDocumentFormattingProvider",!1,Vae(724,"Whether the editor has a document formatting provider")),e.hasDocumentSelectionFormattingProvider=new Jo("editorHasDocumentSelectionFormattingProvider",!1,Vae(725,"Whether the editor has a document selection formatting provider")),e.hasMultipleDocumentFormattingProvider=new Jo("editorHasMultipleDocumentFormattingProvider",!1,Vae(726,"Whether the editor has multiple document formatting providers")),e.hasMultipleDocumentSelectionFormattingProvider=new Jo("editorHasMultipleDocumentSelectionFormattingProvider",!1,Vae(727,"Whether the editor has multiple document selection formatting providers"))}(jl||(jl={})),$l=0,Gl=class extends sr{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}},function(e){e.metadata={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory direction value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'up', 'down'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n\t\t\t\t",constraint:function(e){if(!rle(e))return!1;const t=e;return!(!sle(t.to)||!hle(t.by)&&!sle(t.by)||!hle(t.value)&&!lle(t.value)||!hle(t.revealCursor)&&!cle(t.revealCursor))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},e.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"},e.parse=function(t){let i,n;switch(t.to){case e.RawDirection.Up:i=1;break;case e.RawDirection.Right:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.Left:i=4;break;default:return null}switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Page:n=3;break;case e.RawUnit.HalfPage:n=4;break;case e.RawUnit.Editor:n=5;break;case e.RawUnit.Column:n=6;break;default:n=2}return{direction:i,unit:n,value:Math.floor(t.value||1),revealCursor:!!t.revealCursor,select:!!t.select}}}(Zl||(Zl={})),function(e){e.metadata={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'lineNumber': A mandatory line number value.\n\t\t\t\t\t* 'at': Logical position at which line has to be revealed.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'top', 'center', 'bottom'\n\t\t\t\t\t\t```\n\t\t\t\t",constraint:function(e){if(!rle(e))return!1;const t=e;return!(!lle(t.lineNumber)&&!sle(t.lineNumber)||!hle(t.at)&&!sle(t.at))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},e.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}}(Yl||(Yl={})),Ql=class{constructor(e){e.addImplementation(1e4,"code-editor",(e,t)=>{const i=e.get(eo).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)}),e.addImplementation(1e3,"generic-dom-input-textarea",(e,t)=>{const i=vhe();return!(!i||!zhe(i)||(this.runDOMCommand(i),0))}),e.addImplementation(0,"generic-dom",(e,t)=>{const i=e.get(eo).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}},function(e){class t extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[oa.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&2!==t.revealType&&e.revealAllCursors(t.source,!0,!0))}}e.MoveTo=xue(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=xue(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends Gl{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,3,i.viewStates.map(e=>xr.fromViewState(e))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=xue(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;const o=e.model.validatePosition(n.position),s=e.coordinatesConverter.validateViewPosition(new to(n.viewPosition.lineNumber,n.viewPosition.column),o),r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return Nr.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=xue(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Nr.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=xue(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Nr.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Nr.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=xue(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=xue(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:3595,linux:{primary:0}}}));class o extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Nr.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=xue(new o({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=xue(new o({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:3596,linux:{primary:0}}}));class s extends Gl{constructor(){super({id:"cursorMove",precondition:void 0,metadata:sa.metadata})}runCoreEditorCommand(e,t){const i=sa.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){const n=i.noHistory?"api":t;e.model.pushStackElement(),e.setCursorStates(n,3,s._move(e,e.getCursorStates(),i)),e.revealAllCursors(n,!0)}static _move(e,t,i){const n=i.select,o=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return oa.simpleMove(e,t,i.direction,n,o,i.unit);case 11:case 13:case 12:case 14:return oa.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=s,e.CursorMove=xue(new s);class r extends Gl{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,oa.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealAllCursors(t.source,!0)}}e.CursorLeft=xue(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=xue(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:1039}})),e.CursorRight=xue(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=xue(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:1041}})),e.CursorUp=xue(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=xue(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=xue(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:11}})),e.CursorPageUpSelect=xue(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:1035}})),e.CursorDown=xue(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=xue(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=xue(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:12}})),e.CursorPageDownSelect=xue(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:1036}})),e.CreateCursor=xue(new class extends Gl{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i;i=t.wholeLine?oa.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):oa.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const o=i.modelState?i.modelState.position:null,s=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;i<r;i++){const r=n[i];if((!o||r.modelState.selection.containsPosition(o))&&(!s||r.viewState.selection.containsPosition(s)))return n.splice(i,1),e.model.pushStackElement(),void e.setCursorStates(t.source,3,n)}}n.push(i),e.model.pushStackElement(),e.setCursorStates(t.source,3,n)}}),e.LastCursorMoveToSelect=xue(new class extends Gl{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=oa.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class a extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,oa.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorHome=xue(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=xue(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i],o=n.modelState.position.lineNumber;t[i]=xr.fromModelState(n.modelState.move(this._inSelectionMode,o,1,0))}return t}}e.CursorLineStart=xue(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=xue(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:0,mac:{primary:1311}}}));class d extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,oa.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealAllCursors(t.source,!0)}}e.CursorEnd=xue(new d({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:$l,kbExpr:jl.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},metadata:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:Vae(66,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=xue(new d({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:$l,kbExpr:jl.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},metadata:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:Vae(67,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class h extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e,e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const o=t[n],s=o.modelState.position.lineNumber,r=e.model.getLineMaxColumn(s);i[n]=xr.fromModelState(o.modelState.move(this._inSelectionMode,s,r,0))}return i}}e.CursorLineEnd=xue(new h({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=xue(new h({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:0,mac:{primary:1315}}}));class u extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,oa.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorTop=xue(new u({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=xue(new u({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:3086,mac:{primary:3088}}}));class g extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,oa.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorBottom=xue(new g({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=xue(new g({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:3085,mac:{primary:3090}}}));class p extends Gl{constructor(){super({id:"editorScroll",precondition:void 0,metadata:Zl.metadata})}determineScrollMethod(e){return[6].includes(e.unit)&&[4,2].includes(e.direction)?this._runHorizontalEditorScroll.bind(this):[1,2,3,4,5,6].includes(e.unit)&&[1,3].includes(e.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(e,t){const i=Zl.parse(t);if(!i)return;const n=this.determineScrollMethod(i);n&&n(e,t.source,i)}_runVerticalEditorScroll(e,t,i){const n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){const o=e.getCompletelyVisibleViewRangeAtScrollTop(n);e.setCursorStates(t,3,[oa.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),o,i.select)])}e.viewLayout.setScrollPosition({scrollTop:n},0)}_computeDesiredScrollTop(e,t){if(1===t.unit){const i=e.viewLayout.getFutureViewport(),n=e.getCompletelyVisibleViewRangeAtScrollTop(i.top),o=e.coordinatesConverter.convertViewRangeToModelRange(n);let s;s=1===t.direction?Math.max(1,o.startLineNumber-t.value):Math.min(e.model.getLineCount(),o.startLineNumber+t.value);const r=e.coordinatesConverter.convertModelPositionToViewPosition(new to(s,1));return e.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber)}if(5===t.unit){let i=0;return 3===t.direction&&(i=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(i)}let i;i=3===t.unit?e.cursorConfig.pageSize*t.value:4===t.unit?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;const n=(1===t.direction?-1:1)*i;return e.viewLayout.getCurrentScrollTop()+n*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,i){const n=this._computeDesiredScrollLeft(e,i);e.viewLayout.setScrollPosition({scrollLeft:n},0)}_computeDesiredScrollLeft(e,t){const i=(4===t.direction?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+i*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=p,e.EditorScroll=xue(new p),e.ScrollLineUp=xue(new class extends Gl{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zl.RawDirection.Up,by:Zl.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageUp=xue(new class extends Gl{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zl.RawDirection.Up,by:Zl.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorTop=xue(new class extends Gl{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zl.RawDirection.Up,by:Zl.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLineDown=xue(new class extends Gl{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zl.RawDirection.Down,by:Zl.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageDown=xue(new class extends Gl{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zl.RawDirection.Down,by:Zl.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorBottom=xue(new class extends Gl{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zl.RawDirection.Down,by:Zl.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLeft=xue(new class extends Gl{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zl.RawDirection.Left,by:Zl.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollRight=xue(new class extends Gl{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:Zl.RawDirection.Right,by:Zl.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}});class m extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[oa.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),2!==t.revealType&&e.revealAllCursors(t.source,!0,!0))}}e.WordSelect=xue(new m({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=xue(new m({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=xue(new class extends Gl{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0),s=n[i];o[i]=oa.word(e,s,s.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}});class f extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[oa.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),2!==t.revealType&&e.revealAllCursors(t.source,!1,!0))}}e.LineSelect=xue(new f({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=xue(new f({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class _ extends Gl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;const i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),o=n.slice(0);o[i]=oa.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,o)}}e.LastCursorLineSelect=xue(new _({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=xue(new _({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=xue(new class extends Gl{constructor(){super({id:"cancelSelection",precondition:jl.hasNonEmptySelection,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[oa.cancelSelection(e,e.getPrimaryCursorState())]),e.revealAllCursors(t.source,!0)}}),e.RemoveSecondaryCursors=xue(new class extends Gl{constructor(){super({id:"removeSecondaryCursors",precondition:jl.hasMultipleSelections,kbOpts:{weight:$l+1,kbExpr:jl.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealAllCursors(t.source,!0),Xhe(Vae(68,"Removed secondary cursors"))}}),e.RevealLine=xue(new class extends Gl{constructor(){super({id:"revealLine",precondition:void 0,metadata:Yl.metadata})}runCoreEditorCommand(e,t){const i=t,n=i.lineNumber||0;let o="number"==typeof n?n+1:parseInt(n)+1;o<1&&(o=1);const s=e.model.getLineCount();o>s&&(o=s);const r=new mr(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case Yl.RawAtArgument.Top:a=3;break;case Yl.RawAtArgument.Center:a=1;break;case Yl.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends Ql{constructor(){super(pr)}runDOMCommand(e){c&&(e.focus(),e.select()),e.ownerDocument.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[oa.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=xue(new class extends Gl{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[xr.fromModelSelection(t.selection)]))}})}(Xl||(Xl={})),Jl=Po.and(jl.textInputFocus,jl.columnSelection),Rge(Xl.CursorColumnSelectLeft.id,1039),Rge(Xl.CursorColumnSelectRight.id,1041),Rge(Xl.CursorColumnSelectUp.id,1040),Rge(Xl.CursorColumnSelectPageUp.id,1035),Rge(Xl.CursorColumnSelectDown.id,1042),Rge(Xl.CursorColumnSelectPageDown.id,1036),function(e){class t extends sr{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=xue(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:jl.writable,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Pl.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=xue(new class extends t{constructor(){super({id:"outdent",precondition:jl.writable,kbOpts:{weight:$l,kbExpr:Po.and(jl.editorTextFocus,jl.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Kl.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=xue(new class extends t{constructor(){super({id:"tab",precondition:jl.writable,kbOpts:{weight:$l,kbExpr:Po.and(jl.editorTextFocus,jl.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Kl.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=xue(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=Vr.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=xue(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:$l,kbExpr:jl.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=Vr.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(3)}}),e.Undo=new class extends Ql{constructor(){super(ur)}runDOMCommand(e){e.ownerDocument.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(104))return t.getModel().undo()}},e.Redo=new class extends Ql{constructor(){super(gr)}runDOMCommand(e){e.ownerDocument.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(104))return t.getModel().redo()}}}(ed||(ed={})),td=class extends ir{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){const i=e.get(eo).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}},Age("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),Age("replacePreviousChar"),Age("compositionType"),Age("compositionStart"),Age("compositionEnd"),Age("paste"),Age("cut"),id=eue("markerDecorationsService"),od=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},sd=function(e,t){return function(i,n){t(i,n,e)}},(nd=class{constructor(e,t){}dispose(){}}).ID="editor.contrib.markerDecorations",rd=nd,Iue((rd=od([sd(1,id)],rd)).ID,rd,0),ad=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}focus(){this.domNode.focus()}setMaxWidth(e){const t=Pge(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Pge(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Pge(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Pge(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Pge(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Pge(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Pge(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Pge(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Pge(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Pge(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Pge(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}},ld=class extends Ie{constructor(e,t){super(),this._onDidChange=this._register(new je),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,n=!1;const o=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{In(pn(this._referenceDomElement),()=>{n=!1,o()})}};this._resizeObserver=new ResizeObserver(t=>{e=t&&t[0]&&t[0].contentRect?{width:t[0].contentRect.width,height:t[0].contentRect.height}:null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),this._width===i&&this._height===n||(this._width=i,this._height=n,e&&this._onDidChange.fire())}},dd=class extends Ie{constructor(e){super(),this._onDidChange=this._register(new je),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}},cd=class extends Ie{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new je),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);const t=this._register(new dd(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){const t=document.createElement("canvas").getContext("2d");return(e.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}},hd=new class{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){const t=bn(e);let i=this.mapWindowIdToPixelRatioMonitor.get(t);return i||(i=new cd(e),this.mapWindowIdToPixelRatioMonitor.set(t,i),Be.once(yn)(({vscodeWindowId:e})=>{e===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))})),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}},ud=class{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}},gd=class e{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){const t=document.createElement("div");t.style.position="absolute",t.style.top="-50000px",t.style.width="50000px";const i=document.createElement("div");Wge(i,this._bareFontInfo),t.appendChild(i);const n=document.createElement("div");Wge(n,this._bareFontInfo),n.style.fontWeight="bold",t.appendChild(n);const o=document.createElement("div");Wge(o,this._bareFontInfo),o.style.fontStyle="italic",t.appendChild(o);const s=[];for(const r of this._requests){let t;0===r.type&&(t=i),2===r.type&&(t=n),1===r.type&&(t=o),t.appendChild(document.createElement("br"));const a=document.createElement("span");e._render(a,r),t.appendChild(a),s.push(a)}this._container=t,this._testElements=s}static _render(e,t){if(" "===t.chr){let t=" ";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const t=this._requests[e],i=this._testElements[e];t.fulfill(i.offsetWidth/256)}}},pd=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new je,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},md=F?1.5:1.35,fd=class e{static _create(t,i,n,o,s,r,a,l,d){0===r?r=md*n:r<8&&(r*=n),(r=Math.round(r))<8&&(r=8);const c=1+(d?0:.1*pd.getZoomLevel());return n*=c,r*=c,"translate"===s&&("normal"===i||"bold"===i?s=bd:(s=`'wght' ${parseInt(i,10)}`,i="normal")),new e({pixelRatio:l,fontFamily:t,fontWeight:i,fontSize:n,fontFeatureSettings:o,fontVariationSettings:s,lineHeight:r,letterSpacing:a})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const t=vd.fontFamily,i=e._wrapInQuotes(this.fontFamily);return this.fontFamily!==t?`${i}, ${t}`:i}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}},_d=class extends fd{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=2,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}},bd="normal",vd={fontFamily:F?"Menlo, Monaco, 'Courier New', monospace":P?"Consolas, 'Courier New', monospace":"'Droid Sans Mono', 'monospace', monospace",fontWeight:"normal",fontSize:F?12:14,lineHeight:0,letterSpacing:0},wd={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},xd=class{constructor(e){this._values=e}hasChanged(e){return this._values[e]}},kd=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},Ld=class{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return Bge(e,t)}compute(e,t,i){return i}},Dd=class{constructor(e,t){this.newValue=e,this.didChange=t}},Id=class{constructor(e,t){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=t}applyUpdate(e,t){return Bge(e,t)}validate(e){return this.defaultValue}},Nd=class{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return Bge(e,t)}compute(e,t,i){return i}},Ed=class extends Nd{constructor(e,t,i,n=void 0){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return Vge(e,this.defaultValue)}},Md=class e extends Nd{static clampedInt(e,t,i,n){return Hge(e,t,i,n)}constructor(e,t,i,n,o,s=void 0){void 0!==s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}validate(t){return e.clampedInt(t,this.defaultValue,this.minimum,this.maximum)}},Td=class e extends Nd{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){return"string"==typeof e&&(e=parseFloat(e)),"number"!=typeof e||isNaN(e)?t:e}constructor(e,t,i,n,o,s,r){void 0!==o&&(o.type="number",o.default=i,o.minimum=s,o.maximum=r),super(e,t,i,o),this.validationFn=n,this.minimum=s,this.maximum=r}validate(t){return this.validationFn(e.float(t,this.defaultValue))}},Rd=class e extends Nd{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n=void 0){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(t){return e.string(t,this.defaultValue)}},Od=class extends Nd{constructor(e,t,i,n,o=void 0){void 0!==o&&(o.type="string",o.enum=n.slice(0),o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return Uge(e,this.defaultValue,this._allowedValues)}},Ad=class extends Ld{constructor(e,t,i,n,o,s,r=void 0){void 0!==r&&(r.type="string",r.enum=o,r.default=n),super(e,t,i,r),this._allowedValues=o,this._convert=s}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}},Pd=class extends Ld{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[Vae(201,"Use platform APIs to detect when a Screen Reader is attached."),Vae(202,"Optimize for usage with a Screen Reader."),Vae(203,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:Vae(204,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}},Fd=class extends Ld{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:Vae(205,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:Vae(206,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:Vge(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Vge(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}},function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(Wd||(Wd={})),Bd=class extends Id{constructor(){super(162,"")}compute(e,t,i){const n=["monaco-editor"];return t.get(48)&&n.push(t.get(48)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(82)?n.push("mouse-default"):"copy"===t.get(82)&&n.push("mouse-copy"),t.get(127)&&n.push("showUnused"),t.get(157)&&n.push("showDeprecated"),n.join(" ")}},Vd=class extends Ed{constructor(){super(45,"emptySelectionClipboard",!0,{description:Vae(207,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}},Hd=class extends Ld{constructor(){const e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:Vae(208,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[Vae(209,"Never seed search string from the editor selection."),Vae(210,"Always seed search string from the editor selection, including word at cursor position."),Vae(211,"Only seed search string from the editor selection.")],description:Vae(212,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[Vae(213,"Never turn on Find in Selection automatically (default)."),Vae(214,"Always turn on Find in Selection automatically."),Vae(215,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:Vae(216,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:Vae(217,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:F},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:Vae(218,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:Vae(219,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[Vae(220,"Do not store search history from the find widget."),Vae(221,"Store search history across the active workspace")],description:Vae(222,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[Vae(223,"Do not store history from the replace widget."),Vae(224,"Store replace history across the active workspace")],description:Vae(225,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:Vae(226,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:Vge(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:Vge(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:"boolean"==typeof t.seedSearchStringFromSelection?t.seedSearchStringFromSelection?"always":"never":Uge(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof t.autoFindInSelection?t.autoFindInSelection?"always":"never":Uge(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Vge(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Vge(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Vge(t.loop,this.defaultValue.loop),history:Uge(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:Uge(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}},(Cd=zd=class e extends Ld{constructor(){super(60,"fontLigatures",e.OFF,{anyOf:[{type:"boolean",description:Vae(227,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:Vae(228,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:Vae(229,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(t){return void 0===t?this.defaultValue:"string"==typeof t?"false"===t||0===t.length?e.OFF:"true"===t?e.ON:t:Boolean(t)?e.ON:e.OFF}}).OFF='"liga" off, "calt" off',Cd.ON='"liga" on, "calt" on',Ud=class e extends Ld{constructor(){super(63,"fontVariations",e.OFF,{anyOf:[{type:"boolean",description:Vae(230,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:Vae(231,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:Vae(232,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(t){return void 0===t?this.defaultValue:"string"==typeof t?"false"===t?e.OFF:"true"===t?e.TRANSLATE:t:Boolean(t)?e.TRANSLATE:e.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}},(yd=Ud).OFF=bd,yd.TRANSLATE="translate",Kd=class extends Id{constructor(){super(59,new _d({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,i){return e.fontInfo}},qd=class extends Id{constructor(){super(161,Wd.Line)}compute(e,t,i){return"overtype"===e.inputMode?t.get(92):t.get(34)}},jd=class extends Id{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}},$d=class extends Id{constructor(){super(172,!1)}compute(e,t){return 2===e.accessibilitySupport?t.get(7):t.get(6)}},Gd=class extends Nd{constructor(){super(61,"fontSize",vd.fontSize,{type:"number",minimum:6,maximum:100,default:vd.fontSize,description:Vae(233,"Controls the font size in pixels.")})}validate(e){const t=Td.float(e,this.defaultValue);return 0===t?vd.fontSize:Td.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}},(Sd=Zd=class e extends Ld{constructor(){super(62,"fontWeight",vd.fontWeight,{anyOf:[{type:"number",minimum:e.MINIMUM_VALUE,maximum:e.MAXIMUM_VALUE,errorMessage:Vae(234,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:e.SUGGESTION_VALUES}],default:vd.fontWeight,description:Vae(235,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(t){return"normal"===t||"bold"===t?t:String(Md.clampedInt(t,vd.fontWeight,e.MINIMUM_VALUE,e.MAXIMUM_VALUE))}}).SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],Sd.MINIMUM_VALUE=1,Sd.MAXIMUM_VALUE=1e3,Yd=class extends Ld{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[Vae(236,"Show Peek view of the results (default)"),Vae(237,"Go to the primary result and show a Peek view"),Vae(238,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:Vae(239,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:Vae(240,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:Vae(241,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:Vae(242,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:Vae(243,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:Vae(244,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:Vae(245,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:Vae(246,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:Vae(247,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:Vae(248,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:Vae(249,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{multiple:Uge(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:Uge(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:Uge(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:Uge(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:Uge(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:Uge(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:Uge(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Rd.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Rd.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Rd.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Rd.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Rd.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Rd.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}},Qd=class extends Ld{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:Vae(250,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:Vae(251,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:Vae(252,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:Vae(253,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:Vae(254,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Vge(t.enabled,this.defaultValue.enabled),delay:Md.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Vge(t.sticky,this.defaultValue.sticky),hidingDelay:Md.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Vge(t.above,this.defaultValue.above)}}},Xd=class e extends Id{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(t,i,n){return e.computeLayout(i,{memory:t.memory,outerWidth:t.outerWidth,outerHeight:t.outerHeight,isDominatedByLongLines:t.isDominatedByLongLines,lineHeight:t.fontInfo.lineHeight,viewLineCount:t.viewLineCount,lineNumbersDigitCount:t.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:t.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:t.fontInfo.maxDigitWidth,pixelRatio:t.pixelRatio,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const o=(i+e.viewLineCount+n)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:o,minimapLineCount:Math.floor(e.viewLineCount/o)}}static _computeMinimapLayout(t,i){const n=t.outerWidth,o=t.outerHeight,s=t.pixelRatio;if(!t.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*o),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:o};const r=i.stableMinimapLayoutInput,a=r&&t.outerHeight===r.outerHeight&&t.lineHeight===r.lineHeight&&t.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&t.pixelRatio===r.pixelRatio&&t.scrollBeyondLastLine===r.scrollBeyondLastLine&&t.paddingTop===r.paddingTop&&t.paddingBottom===r.paddingBottom&&t.minimap.enabled===r.minimap.enabled&&t.minimap.side===r.minimap.side&&t.minimap.size===r.minimap.size&&t.minimap.showSlider===r.minimap.showSlider&&t.minimap.renderCharacters===r.minimap.renderCharacters&&t.minimap.maxColumn===r.minimap.maxColumn&&t.minimap.scale===r.minimap.scale&&t.verticalScrollbarWidth===r.verticalScrollbarWidth&&t.isViewportWrapping===r.isViewportWrapping,l=t.lineHeight,d=t.typicalHalfwidthCharacterWidth,c=t.scrollBeyondLastLine,h=t.minimap.renderCharacters;let u=s>=2?Math.round(2*t.minimap.scale):t.minimap.scale;const g=t.minimap.maxColumn,p=t.minimap.size,m=t.minimap.side,f=t.verticalScrollbarWidth,_=t.viewLineCount,b=t.remainingWidth,v=t.isViewportWrapping,w=h?2:3;let C=Math.floor(s*o);const y=C/s;let S=!1,x=!1,k=w*u,L=u/s,D=1;if("fill"===p||"fit"===p){const{typicalViewportLineCount:n,extraLinesBeforeFirstLine:r,extraLinesBeyondLastLine:d,desiredRatio:h,minimapLineCount:g}=e.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:o,lineHeight:l,pixelRatio:s});if(_/g>1)S=!0,x=!0,u=1,k=1,L=u/s;else{let e=!1,o=u+1;if("fit"===p){const t=Math.ceil((r+_+d)*k);v&&a&&b<=i.stableFitRemainingWidth?(e=!0,o=i.stableFitMaxMinimapScale):e=t>C}if("fill"===p||e){S=!0;const e=u;k=Math.min(l*s,Math.max(1,Math.floor(1/h))),v&&a&&b<=i.stableFitRemainingWidth&&(o=i.stableFitMaxMinimapScale),u=Math.min(o,Math.max(1,Math.floor(k/w))),u>e&&(D=Math.min(2,u/e)),L=u/s/D,C=Math.ceil(Math.max(n,r+_+d)*k),v?(i.stableMinimapLayoutInput=t,i.stableFitRemainingWidth=b,i.stableFitMaxMinimapScale=u):(i.stableMinimapLayoutInput=null,i.stableFitRemainingWidth=0)}}}const I=Math.floor(g*L),N=Math.min(I,Math.max(0,Math.floor((b-f-2)*L/(d+L)))+8);let E=Math.floor(s*N);const M=E/s;return E=Math.floor(E*D),{renderMinimap:h?1:2,minimapLeft:"left"===m?0:n-N-f,minimapWidth:N,minimapHeightIsEditorHeight:S,minimapIsSampling:x,minimapScale:u,minimapLineHeight:k,minimapCanvasInnerWidth:E,minimapCanvasInnerHeight:C,minimapCanvasOuterWidth:M,minimapCanvasOuterHeight:y}}static computeLayout(t,i){const n=0|i.outerWidth,o=0|i.outerHeight,s=0|i.lineHeight,r=0|i.lineNumbersDigitCount,a=i.typicalHalfwidthCharacterWidth,l=i.maxDigitWidth,d=i.pixelRatio,c=i.viewLineCount,h=t.get(154),u="inherit"===h?t.get(153):h,g="inherit"===u?t.get(149):u,p=t.get(152),m=i.isDominatedByLongLines,f=t.get(66),_=0!==t.get(76).renderType,b=t.get(77),v=t.get(119),w=t.get(96),C=t.get(81),y=t.get(117),S=y.verticalScrollbarSize,x=y.verticalHasArrows,k=y.arrowSize,L=y.horizontalScrollbarSize,D=t.get(52),I="never"!==t.get(126);let N=t.get(74);D&&I&&(N+=16);let E=0;if(_){const e=Math.max(r,b);E=Math.round(e*l)}let M=0;f&&(M=s*i.glyphMarginDecorationLaneCount);let T=0,R=T+M,O=R+E,A=O+N;const P=n-M-E-N;let F=!1,W=!1,B=-1;2===t.get(2)&&"inherit"===u&&m?(F=!0,W=!0):"on"===g||"bounded"===g?W=!0:"wordWrapColumn"===g&&(B=p);const V=e._computeMinimapLayout({outerWidth:n,outerHeight:o,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:v,paddingTop:w.top,paddingBottom:w.bottom,minimap:C,verticalScrollbarWidth:S,viewLineCount:c,remainingWidth:P,isViewportWrapping:W},i.memory||new kd);0!==V.renderMinimap&&0===V.minimapLeft&&(T+=V.minimapWidth,R+=V.minimapWidth,O+=V.minimapWidth,A+=V.minimapWidth);const H=P-V.minimapWidth,z=Math.max(1,Math.floor((H-S-2)/a)),U=x?k:0;return W&&(B=Math.max(1,z),"bounded"===g&&(B=Math.min(B,p))),{width:n,height:o,glyphMarginLeft:T,glyphMarginWidth:M,glyphMarginDecorationLaneCount:i.glyphMarginDecorationLaneCount,lineNumbersLeft:R,lineNumbersWidth:E,decorationsLeft:O,decorationsWidth:N,contentLeft:A,contentWidth:H,minimap:V,viewportColumn:z,isWordWrapMinified:F,isViewportWrapping:W,wrappingColumn:B,verticalScrollbarWidth:S,horizontalScrollbarHeight:L,overviewRuler:{top:U,width:S,height:o-2*U,right:0}}}},Jd=class extends Ld{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[Vae(255,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),Vae(256,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:Vae(257,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Uge(e,"simple",["simple","advanced"])}compute(e,t,i){return 2===t.get(2)?"advanced":i}},function(e){e.Off="off",e.OnCode="onCode",e.On="on"}(ec||(ec={})),tc=class extends Ld{constructor(){const e={enabled:ec.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[ec.Off,ec.OnCode,ec.On],default:e.enabled,enumDescriptions:[Vae(258,"Disable the code action menu."),Vae(259,"Show the code action menu when the cursor is on lines with code."),Vae(260,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:Vae(261,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return e&&"object"==typeof e?{enabled:Uge(e.enabled,this.defaultValue.enabled,[ec.Off,ec.OnCode,ec.On])}:this.defaultValue}},ic=class extends Ld{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:Vae(262,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:Vae(263,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:Vae(264,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:Vae(265,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Vge(t.enabled,this.defaultValue.enabled),maxLineCount:Md.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Uge(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Vge(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},nc=class extends Ld{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:Vae(266,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[Vae(267,"Inlay hints are enabled"),Vae(268,"Inlay hints are showing by default and hide when holding {0}",F?"Ctrl+Option":"Ctrl+Alt"),Vae(269,"Inlay hints are hidden by default and show when holding {0}",F?"Ctrl+Option":"Ctrl+Alt"),Vae(270,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:Vae(271,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:Vae(272,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:Vae(273,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:Vae(274,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return"boolean"==typeof t.enabled&&(t.enabled=t.enabled?"on":"off"),{enabled:Uge(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:Md.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Rd.string(t.fontFamily,this.defaultValue.fontFamily),padding:Vge(t.padding,this.defaultValue.padding),maximumLength:Md.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}},oc=class extends Ld{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return"string"==typeof e&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):Md.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?Md.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}},sc=class extends Td{constructor(){super(75,"lineHeight",vd.lineHeight,e=>Td.clamp(e,0,150),{markdownDescription:Vae(275,"Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")},0,150)}compute(e,t,i){return e.fontInfo.lineHeight}},rc=class extends Ld{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(81,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:Vae(276,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"string",enum:["none","mouseover","scroll"],enumDescriptions:[Vae(277,"The minimap is always shown."),Vae(278,"The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap."),Vae(279,"The minimap is only shown when the editor is scrolled")],default:e.autohide,description:Vae(280,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[Vae(281,"The minimap has the same size as the editor contents (and might scroll)."),Vae(282,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),Vae(283,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:Vae(284,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:Vae(285,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:Vae(286,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:Vae(287,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:Vae(288,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:Vae(289,"Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:Vae(290,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:Vae(291,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.markSectionHeaderRegex":{type:"string",default:e.markSectionHeaderRegex,description:Vae(292,"Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:Vae(293,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:Vae(294,"Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;let i=this.defaultValue.markSectionHeaderRegex;const n=t.markSectionHeaderRegex;if("string"==typeof n)try{new RegExp(n,"d"),i=n}catch{}return{enabled:Vge(t.enabled,this.defaultValue.enabled),autohide:Uge(t.autohide,this.defaultValue.autohide,["none","mouseover","scroll"]),size:Uge(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Uge(t.side,this.defaultValue.side,["right","left"]),showSlider:Uge(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:Vge(t.renderCharacters,this.defaultValue.renderCharacters),scale:Md.clampedInt(t.scale,1,1,3),maxColumn:Md.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:Vge(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:Vge(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:i,sectionHeaderFontSize:Td.clamp(Td.float(t.sectionHeaderFontSize,this.defaultValue.sectionHeaderFontSize),4,32),sectionHeaderLetterSpacing:Td.clamp(Td.float(t.sectionHeaderLetterSpacing,this.defaultValue.sectionHeaderLetterSpacing),0,5)}}},ac=class extends Ld{constructor(){super(96,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:Vae(295,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:Vae(296,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:Md.clampedInt(t.top,0,0,1e3),bottom:Md.clampedInt(t.bottom,0,0,1e3)}}},lc=class extends Ld{constructor(){const e={enabled:!0,cycle:!0};super(98,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:Vae(297,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:Vae(298,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Vge(t.enabled,this.defaultValue.enabled),cycle:Vge(t.cycle,this.defaultValue.cycle)}}},dc=class extends Id{constructor(){super(163,1)}compute(e,t,i){return e.pixelRatio}},cc=class extends Ld{constructor(){super(100,"placeholder",void 0)}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?e:this.defaultValue}},hc=class extends Ld{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[Vae(299,"Quick suggestions show inside the suggest widget"),Vae(300,"Quick suggestions show as ghost text"),Vae(301,"Quick suggestions are disabled")]}];super(102,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:Vae(302,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:Vae(303,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:Vae(304,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:Vae(305,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.","`#editor.suggestOnTriggerCharacters#`")}),this.defaultValue=e}validate(e){if("boolean"==typeof e){const t=e?"on":"off";return{comments:t,strings:t,other:t}}if(!e||"object"!=typeof e)return this.defaultValue;const{other:t,comments:i,strings:n}=e,o=["on","inline","off"];let s,r,a;return s="boolean"==typeof t?t?"on":"off":Uge(t,this.defaultValue.other,o),r="boolean"==typeof i?i?"on":"off":Uge(i,this.defaultValue.comments,o),a="boolean"==typeof n?n?"on":"off":Uge(n,this.defaultValue.strings,o),{other:s,comments:r,strings:a}}},uc=class extends Ld{constructor(){super(76,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[Vae(306,"Line numbers are not rendered."),Vae(307,"Line numbers are rendered as absolute number."),Vae(308,"Line numbers are rendered as distance in lines to cursor position."),Vae(309,"Line numbers are rendered every 10 lines.")],default:"on",description:Vae(310,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}},gc=class extends Ld{constructor(){const e=[],t={type:"number",description:Vae(311,"Number of monospace characters at which this editor ruler will render.")};super(116,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:Vae(312,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:Vae(313,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if("number"==typeof i)t.push({column:Md.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:Md.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}},pc=class extends Ld{constructor(){super(105,"readOnlyMessage",void 0)}validate(e){return e&&"object"==typeof e?e:this.defaultValue}},mc=class extends Ld{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(117,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[Vae(314,"The vertical scrollbar will be visible only when necessary."),Vae(315,"The vertical scrollbar will always be visible."),Vae(316,"The vertical scrollbar will always be hidden.")],default:"auto",description:Vae(317,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[Vae(318,"The horizontal scrollbar will be visible only when necessary."),Vae(319,"The horizontal scrollbar will always be visible."),Vae(320,"The horizontal scrollbar will always be hidden.")],default:"auto",description:Vae(321,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:Vae(322,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:Vae(323,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:Vae(324,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:Vae(325,"When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=Md.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=Md.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Md.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Yge(t.vertical,this.defaultValue.vertical),horizontal:Yge(t.horizontal,this.defaultValue.horizontal),useShadows:Vge(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:Vge(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:Vge(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:Vge(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:Vge(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Md.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:Md.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:Vge(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:Vge(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}},fc="inUntrustedWorkspace",_c={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"},bc=class extends Ld{constructor(){const e={nonBasicASCII:fc,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:fc,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(142,"unicodeHighlight",e,{[_c.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,fc],default:e.nonBasicASCII,description:Vae(326,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[_c.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:Vae(327,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[_c.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:Vae(328,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[_c.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,fc],default:e.includeComments,description:Vae(329,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[_c.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,fc],default:e.includeStrings,description:Vae(330,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[_c.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:Vae(331,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[_c.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:Vae(332,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Uue(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(Uue(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new Dd(n.newValue,!0):n}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:Qge(t.nonBasicASCII,fc,[!0,!1,fc]),invisibleCharacters:Vge(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:Vge(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:Qge(t.includeComments,fc,[!0,!1,fc]),includeStrings:Qge(t.includeStrings,fc,[!0,!1,fc]),allowedCharacters:this.validateBooleanMap(t.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(t.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const i={};for(const[n,o]of Object.entries(e))!0===o&&(i[n]=!0);return i}},vc=class extends Ld{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default",syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!0,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:"auto",allowCodeShifting:"always"},triggerCommandOnProviderChange:!1,experimental:{suppressInlineSuggestions:"",showOnSuggestConflict:"never",emptyResponseInformation:!0}};super(71,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:Vae(333,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[Vae(334,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),Vae(335,"Show the inline suggestion toolbar when hovering over an inline suggestion."),Vae(336,"Never show the inline suggestion toolbar.")],description:Vae(337,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:"boolean",default:e.syntaxHighlightingEnabled,description:Vae(338,"Controls whether to show syntax highlighting for inline suggestions in the editor.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:Vae(339,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.suppressInSnippetMode":{type:"boolean",default:e.suppressInSnippetMode,description:Vae(340,"Controls whether inline suggestions are suppressed when in snippet mode.")},"editor.inlineSuggest.minShowDelay":{type:"number",default:0,minimum:0,maximum:1e4,description:Vae(341,"Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.")},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:"string",default:e.experimental.suppressInlineSuggestions,tags:["experimental"],description:Vae(342,"Suppresses inline completions for specified extension IDs -- comma separated."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:"boolean",default:e.experimental.emptyResponseInformation,tags:["experimental"],description:Vae(343,"Controls whether to send request information from the inline suggestion provider."),experiment:{mode:"auto"}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:"boolean",default:e.triggerCommandOnProviderChange,tags:["experimental"],description:Vae(344,"Controls whether to trigger a command when the inline suggestion provider changes."),experiment:{mode:"auto"}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:"string",default:e.experimental.showOnSuggestConflict,tags:["experimental"],enum:["always","never","whenSuggestListIsIncomplete"],description:Vae(345,"Controls whether to show inline suggestions when there is a suggest conflict."),experiment:{mode:"auto"}},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:Vae(346,"Controls the font family of the inline suggestions.")},"editor.inlineSuggest.edits.allowCodeShifting":{type:"string",default:e.edits.allowCodeShifting,description:Vae(347,"Controls whether showing a suggestion will shift the code to make space for the suggestion inline."),enum:["always","horizontal","never"],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.renderSideBySide":{type:"string",default:e.edits.renderSideBySide,description:Vae(348,"Controls whether larger suggestions can be shown side by side."),enum:["auto","never"],enumDescriptions:[Vae(349,"Larger suggestions will show side by side if there is enough space, otherwise they will be shown below."),Vae(350,"Larger suggestions are never shown side by side and will always be shown below.")],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showCollapsed":{type:"boolean",default:e.edits.showCollapsed,description:Vae(351,"Controls whether the suggestion will show as collapsed until jumping to it."),tags:["nextEditSuggestions"]}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Vge(t.enabled,this.defaultValue.enabled),mode:Uge(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Uge(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:Vge(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:Vge(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Rd.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:Vge(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:Md.clampedInt(t.minShowDelay,0,0,1e4),suppressInSnippetMode:Vge(t.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:this._validateEdits(t.edits),triggerCommandOnProviderChange:Vge(t.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:this._validateExperimental(t.experimental)}}_validateEdits(e){if(!e||"object"!=typeof e)return this.defaultValue.edits;const t=e;return{enabled:Vge(t.enabled,this.defaultValue.edits.enabled),showCollapsed:Vge(t.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:Uge(t.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,["always","horizontal","never"]),renderSideBySide:Uge(t.renderSideBySide,this.defaultValue.edits.renderSideBySide,["never","auto"])}}_validateExperimental(e){if(!e||"object"!=typeof e)return this.defaultValue.experimental;const t=e;return{suppressInlineSuggestions:Rd.string(t.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:Uge(t.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,["always","never","whenSuggestListIsIncomplete"]),emptyResponseInformation:Vge(t.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}},wc=class extends Ld{constructor(){const e={enabled:wd.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:wd.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(21,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:Vae(352,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:Vae(353,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Vge(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:Vge(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},Cc=class extends Ld{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(22,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[Vae(354,"Enables bracket pair guides."),Vae(355,"Enables bracket pair guides only for the active bracket pair."),Vae(356,"Disables bracket pair guides.")],default:e.bracketPairs,description:Vae(357,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[Vae(358,"Enables horizontal guides as addition to vertical bracket pair guides."),Vae(359,"Enables horizontal guides only for the active bracket pair."),Vae(360,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:Vae(361,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:Vae(362,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:Vae(363,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[Vae(364,"Highlights the active indent guide."),Vae(365,"Highlights the active indent guide even if bracket guides are highlighted."),Vae(366,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:Vae(367,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:Qge(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:Qge(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:Vge(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:Vge(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:Qge(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}},yc=class extends Ld{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(134,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[Vae(368,"Insert suggestion without overwriting text right of the cursor."),Vae(369,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:Vae(370,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:Vae(371,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:Vae(372,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:Vae(373,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[Vae(374,"Always select a suggestion when automatically triggering IntelliSense."),Vae(375,"Never select a suggestion when automatically triggering IntelliSense."),Vae(376,"Select a suggestion only when triggering IntelliSense from a trigger character."),Vae(377,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:Vae(378,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:Vae(379,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:Vae(380,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:Vae(381,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:Vae(382,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:Vae(383,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:Vae(384,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:Vae(385,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:Vae(386,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:Vae(387,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:Vae(388,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:Vae(389,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:Vae(390,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:Vae(391,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:Vae(392,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:Vae(393,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:Vae(394,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:Vae(395,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:Vae(396,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:Vae(397,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:Vae(398,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:Vae(399,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:Vae(400,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:Vae(401,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:Vae(402,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:Vae(403,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:Vae(404,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:Vae(405,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:Vae(406,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:Vae(407,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:Vae(408,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:Vae(409,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:Vae(410,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:Vae(411,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:Vae(412,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:Vae(413,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:Vae(414,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:Vae(415,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:Uge(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:Vge(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:Vge(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:Vge(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:Vge(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Uge(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:Vge(t.showIcons,this.defaultValue.showIcons),showStatusBar:Vge(t.showStatusBar,this.defaultValue.showStatusBar),preview:Vge(t.preview,this.defaultValue.preview),previewMode:Uge(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:Vge(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:Vge(t.showMethods,this.defaultValue.showMethods),showFunctions:Vge(t.showFunctions,this.defaultValue.showFunctions),showConstructors:Vge(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:Vge(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:Vge(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:Vge(t.showFields,this.defaultValue.showFields),showVariables:Vge(t.showVariables,this.defaultValue.showVariables),showClasses:Vge(t.showClasses,this.defaultValue.showClasses),showStructs:Vge(t.showStructs,this.defaultValue.showStructs),showInterfaces:Vge(t.showInterfaces,this.defaultValue.showInterfaces),showModules:Vge(t.showModules,this.defaultValue.showModules),showProperties:Vge(t.showProperties,this.defaultValue.showProperties),showEvents:Vge(t.showEvents,this.defaultValue.showEvents),showOperators:Vge(t.showOperators,this.defaultValue.showOperators),showUnits:Vge(t.showUnits,this.defaultValue.showUnits),showValues:Vge(t.showValues,this.defaultValue.showValues),showConstants:Vge(t.showConstants,this.defaultValue.showConstants),showEnums:Vge(t.showEnums,this.defaultValue.showEnums),showEnumMembers:Vge(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:Vge(t.showKeywords,this.defaultValue.showKeywords),showWords:Vge(t.showWords,this.defaultValue.showWords),showColors:Vge(t.showColors,this.defaultValue.showColors),showFiles:Vge(t.showFiles,this.defaultValue.showFiles),showReferences:Vge(t.showReferences,this.defaultValue.showReferences),showFolders:Vge(t.showFolders,this.defaultValue.showFolders),showTypeParameters:Vge(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:Vge(t.showSnippets,this.defaultValue.showSnippets),showUsers:Vge(t.showUsers,this.defaultValue.showUsers),showIssues:Vge(t.showIssues,this.defaultValue.showIssues)}}},Sc=class extends Ld{constructor(){super(129,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:Vae(416,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:Vae(417,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:Vge(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:Vge(e.selectSubwords,this.defaultValue.selectSubwords)}:this.defaultValue}},xc=class extends Ld{constructor(){const e=[];super(147,"wordSegmenterLocales",e,{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:Vae(418,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"},default:e})}validate(e){if("string"==typeof e&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if("string"==typeof i)try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}},kc=class extends Ld{constructor(){super(155,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[Vae(419,"No indentation. Wrapped lines begin at column 1."),Vae(420,"Wrapped lines get the same indentation as the parent."),Vae(421,"Wrapped lines get +1 indentation toward the parent."),Vae(422,"Wrapped lines get +2 indentation toward the parent.")],description:Vae(423,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return 2===t.get(2)?0:i}},Lc=class extends Id{constructor(){super(166,{isDominatedByLongLines:!1,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1})}compute(e,t,i){const n=t.get(165);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}},Dc=class extends Ld{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(43,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:Vae(424,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:Vae(425,"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[Vae(426,"Show the drop selector widget after a file is dropped into the editor."),Vae(427,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Vge(t.enabled,this.defaultValue.enabled),showDropSelector:Uge(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}},Ic=class extends Ld{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(97,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:Vae(428,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:Vae(429,"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[Vae(430,"Show the paste selector widget after content is pasted into the editor."),Vae(431,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:Vge(t.enabled,this.defaultValue.enabled),showPasteSelector:Uge(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}},Nc=[],Ec={acceptSuggestionOnCommitCharacter:Xge(new Ed(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:Vae(432,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Xge(new Od(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",Vae(433,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:Vae(434,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Xge(new Pd),accessibilityPageSize:Xge(new Md(3,"accessibilityPageSize",500,1,1073741824,{description:Vae(435,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),allowOverflow:Xge(new Ed(4,"allowOverflow",!0)),allowVariableLineHeights:Xge(new Ed(5,"allowVariableLineHeights",!0,{description:Vae(436,"Controls whether to allow using variable line heights in the editor.")})),allowVariableFonts:Xge(new Ed(6,"allowVariableFonts",!0,{description:Vae(437,"Controls whether to allow using variable fonts in the editor.")})),allowVariableFontsInAccessibilityMode:Xge(new Ed(7,"allowVariableFontsInAccessibilityMode",!1,{description:Vae(438,"Controls whether to allow using variable fonts in the editor in the accessibility mode."),tags:["accessibility"]})),ariaLabel:Xge(new Rd(8,"ariaLabel",Vae(439,"Editor content"))),ariaRequired:Xge(new Ed(9,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Xge(new Ed(12,"screenReaderAnnounceInlineSuggestion",!0,{description:Vae(440,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Xge(new Od(10,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",Vae(441,"Use language configurations to determine when to autoclose brackets."),Vae(442,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:Vae(443,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Xge(new Od(11,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",Vae(444,"Use language configurations to determine when to autoclose comments."),Vae(445,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:Vae(446,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Xge(new Od(13,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",Vae(447,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:Vae(448,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Xge(new Od(14,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",Vae(449,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:Vae(450,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Xge(new Od(15,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",Vae(451,"Use language configurations to determine when to autoclose quotes."),Vae(452,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:Vae(453,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Xge(new Ad(16,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Kge,{enumDescriptions:[Vae(454,"The editor will not insert indentation automatically."),Vae(455,"The editor will keep the current line's indentation."),Vae(456,"The editor will keep the current line's indentation and honor language defined brackets."),Vae(457,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),Vae(458,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:Vae(459,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),autoIndentOnPaste:Xge(new Ed(17,"autoIndentOnPaste",!1,{description:Vae(460,"Controls whether the editor should automatically auto-indent the pasted content.")})),autoIndentOnPasteWithinString:Xge(new Ed(18,"autoIndentOnPasteWithinString",!0,{description:Vae(461,"Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.")})),automaticLayout:Xge(new Ed(19,"automaticLayout",!1)),autoSurround:Xge(new Od(20,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[Vae(462,"Use language configurations to determine when to automatically surround selections."),Vae(463,"Surround with quotes but not brackets."),Vae(464,"Surround with brackets but not quotes."),""],description:Vae(465,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Xge(new wc),bracketPairGuides:Xge(new Cc),stickyTabStops:Xge(new Ed(132,"stickyTabStops",!1,{description:Vae(466,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Xge(new Ed(23,"codeLens",!0,{description:Vae(467,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Xge(new Rd(24,"codeLensFontFamily","",{description:Vae(468,"Controls the font family for CodeLens.")})),codeLensFontSize:Xge(new Md(25,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:Vae(469,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Xge(new Ed(26,"colorDecorators",!0,{description:Vae(470,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Xge(new Od(168,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[Vae(471,"Make the color picker appear both on click and hover of the color decorator"),Vae(472,"Make the color picker appear on hover of the color decorator"),Vae(473,"Make the color picker appear on click of the color decorator")],description:Vae(474,"Controls the condition to make a color picker appear from a color decorator.")})),colorDecoratorsLimit:Xge(new Md(27,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:Vae(475,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Xge(new Ed(28,"columnSelection",!1,{description:Vae(476,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:Xge(new Fd),contextmenu:Xge(new Ed(30,"contextmenu",!0)),copyWithSyntaxHighlighting:Xge(new Ed(31,"copyWithSyntaxHighlighting",!0,{description:Vae(477,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Xge(new Ad(32,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],qge,{description:Vae(478,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:Xge(new Od(33,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[Vae(479,"Smooth caret animation is disabled."),Vae(480,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),Vae(481,"Smooth caret animation is always enabled.")],description:Vae(482,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Xge(new Ad(34,"cursorStyle",Wd.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],jge,{description:Vae(483,"Controls the cursor style in insert input mode.")})),overtypeCursorStyle:Xge(new Ad(92,"overtypeCursorStyle",Wd.Block,"block",["line","block","underline","line-thin","block-outline","underline-thin"],jge,{description:Vae(484,"Controls the cursor style in overtype input mode.")})),cursorSurroundingLines:Xge(new Md(35,"cursorSurroundingLines",0,0,1073741824,{description:Vae(485,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Xge(new Od(36,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[Vae(486,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),Vae(487,"`cursorSurroundingLines` is enforced always.")],markdownDescription:Vae(488,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:Xge(new Md(37,"cursorWidth",0,0,1073741824,{markdownDescription:Vae(489,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),cursorHeight:Xge(new Md(38,"cursorHeight",0,0,1073741824,{markdownDescription:Vae(490,"Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.")})),disableLayerHinting:Xge(new Ed(39,"disableLayerHinting",!1)),disableMonospaceOptimizations:Xge(new Ed(40,"disableMonospaceOptimizations",!1)),domReadOnly:Xge(new Ed(41,"domReadOnly",!1)),dragAndDrop:Xge(new Ed(42,"dragAndDrop",!0,{description:Vae(491,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Xge(new Vd),dropIntoEditor:Xge(new Dc),editContext:Xge(new Ed(44,"editContext",!0,{description:Vae(492,"Sets whether the EditContext API should be used instead of the text area to power input in the editor."),included:J||ie||B})),renderRichScreenReaderContent:Xge(new Ed(107,"renderRichScreenReaderContent",!1,{markdownDescription:Vae(493,"Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.")})),stickyScroll:Xge(new ic),experimentalGpuAcceleration:Xge(new Od(46,"experimentalGpuAcceleration","off",["off","on"],{tags:["experimental"],enumDescriptions:[Vae(494,"Use regular DOM-based rendering."),Vae(495,"Use GPU acceleration.")],description:Vae(496,"Controls whether to use the experimental GPU acceleration to render the editor.")})),experimentalWhitespaceRendering:Xge(new Od(47,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[Vae(497,"Use a new rendering method with svgs."),Vae(498,"Use a new rendering method with font characters."),Vae(499,"Use the stable rendering method.")],description:Vae(500,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Xge(new Rd(48,"extraEditorClassName","")),fastScrollSensitivity:Xge(new Td(49,"fastScrollSensitivity",5,e=>e<=0?5:e,{markdownDescription:Vae(501,"Scrolling speed multiplier when pressing `Alt`.")})),find:Xge(new Hd),fixedOverflowWidgets:Xge(new Ed(51,"fixedOverflowWidgets",!1)),folding:Xge(new Ed(52,"folding",!0,{description:Vae(502,"Controls whether the editor has code folding enabled.")})),foldingStrategy:Xge(new Od(53,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[Vae(503,"Use a language-specific folding strategy if available, else the indentation-based one."),Vae(504,"Use the indentation-based folding strategy.")],description:Vae(505,"Controls the strategy for computing folding ranges.")})),foldingHighlight:Xge(new Ed(54,"foldingHighlight",!0,{description:Vae(506,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Xge(new Ed(55,"foldingImportsByDefault",!1,{description:Vae(507,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Xge(new Md(56,"foldingMaximumRegions",5e3,10,65e3,{description:Vae(508,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Xge(new Ed(57,"unfoldOnClickAfterEndOfLine",!1,{description:Vae(509,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Xge(new Rd(58,"fontFamily",vd.fontFamily,{description:Vae(510,"Controls the font family.")})),fontInfo:Xge(new Kd),fontLigatures2:Xge(new zd),fontSize:Xge(new Gd),fontWeight:Xge(new Zd),fontVariations:Xge(new Ud),formatOnPaste:Xge(new Ed(64,"formatOnPaste",!1,{description:Vae(511,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Xge(new Ed(65,"formatOnType",!1,{description:Vae(512,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Xge(new Ed(66,"glyphMargin",!0,{description:Vae(513,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Xge(new Yd),hideCursorInOverviewRuler:Xge(new Ed(68,"hideCursorInOverviewRuler",!1,{description:Vae(514,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:Xge(new Qd),inDiffEditor:Xge(new Ed(70,"inDiffEditor",!1)),inertialScroll:Xge(new Ed(158,"inertialScroll",!1,{description:Vae(515,"Make scrolling inertial - mostly useful with touchpad on linux.")})),letterSpacing:Xge(new Td(72,"letterSpacing",vd.letterSpacing,e=>Td.clamp(e,-5,20),{description:Vae(516,"Controls the letter spacing in pixels.")})),lightbulb:Xge(new tc),lineDecorationsWidth:Xge(new oc),lineHeight:Xge(new sc),lineNumbers:Xge(new uc),lineNumbersMinChars:Xge(new Md(77,"lineNumbersMinChars",5,1,300)),linkedEditing:Xge(new Ed(78,"linkedEditing",!1,{description:Vae(517,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Xge(new Ed(79,"links",!0,{description:Vae(518,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Xge(new Od(80,"matchBrackets","always",["always","near","never"],{description:Vae(519,"Highlight matching brackets.")})),minimap:Xge(new rc),mouseStyle:Xge(new Od(82,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Xge(new Td(83,"mouseWheelScrollSensitivity",1,e=>0===e?1:e,{markdownDescription:Vae(520,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Xge(new Ed(84,"mouseWheelZoom",!1,{markdownDescription:F?Vae(521,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):Vae(522,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Xge(new Ed(85,"multiCursorMergeOverlapping",!0,{description:Vae(523,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Xge(new Ad(86,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],$ge,{markdownEnumDescriptions:[Vae(524,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),Vae(525,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:Vae(526,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),mouseMiddleClickAction:Xge(new Od(87,"mouseMiddleClickAction","default",["default","openLink","ctrlLeftClick"],{description:Vae(527,"Controls what happens when middle mouse button is clicked in the editor.")})),multiCursorPaste:Xge(new Od(88,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[Vae(528,"Each cursor pastes a single line of the text."),Vae(529,"Each cursor pastes the full text.")],markdownDescription:Vae(530,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Xge(new Md(89,"multiCursorLimit",1e4,1,1e5,{markdownDescription:Vae(531,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Xge(new Od(90,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[Vae(532,"Does not highlight occurrences."),Vae(533,"Highlights occurrences only in the current file."),Vae(534,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:Vae(535,"Controls whether occurrences should be highlighted across open files.")})),occurrencesHighlightDelay:Xge(new Md(91,"occurrencesHighlightDelay",0,0,2e3,{description:Vae(536,"Controls the delay in milliseconds after which occurrences are highlighted."),tags:["preview"]})),overtypeOnPaste:Xge(new Ed(93,"overtypeOnPaste",!0,{description:Vae(537,"Controls whether pasting should overtype.")})),overviewRulerBorder:Xge(new Ed(94,"overviewRulerBorder",!0,{description:Vae(538,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Xge(new Md(95,"overviewRulerLanes",3,0,3)),padding:Xge(new ac),pasteAs:Xge(new Ic),parameterHints:Xge(new lc),peekWidgetDefaultFocus:Xge(new Od(99,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[Vae(539,"Focus the tree when opening peek"),Vae(540,"Focus the editor when opening peek")],description:Vae(541,"Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:Xge(new cc),definitionLinkOpensInPeek:Xge(new Ed(101,"definitionLinkOpensInPeek",!1,{description:Vae(542,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Xge(new hc),quickSuggestionsDelay:Xge(new Md(103,"quickSuggestionsDelay",10,0,1073741824,{description:Vae(543,"Controls the delay in milliseconds after which quick suggestions will show up."),experiment:{mode:"auto"}})),readOnly:Xge(new Ed(104,"readOnly",!1)),readOnlyMessage:Xge(new pc),renameOnType:Xge(new Ed(106,"renameOnType",!1,{description:Vae(544,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:Vae(545,"Deprecated, use `#editor.linkedEditing#` instead.")})),renderControlCharacters:Xge(new Ed(108,"renderControlCharacters",!0,{description:Vae(546,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Xge(new Od(109,"renderFinalNewline",W?"dimmed":"on",["off","on","dimmed"],{description:Vae(547,"Render last line number when the file ends with a newline.")})),renderLineHighlight:Xge(new Od(110,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",Vae(548,"Highlights both the gutter and the current line.")],description:Vae(549,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Xge(new Ed(111,"renderLineHighlightOnlyWhenFocus",!1,{description:Vae(550,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Xge(new Od(112,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Xge(new Od(113,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",Vae(551,"Render whitespace characters except for single spaces between words."),Vae(552,"Render whitespace characters only on selected text."),Vae(553,"Render only trailing whitespace characters."),""],description:Vae(554,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Xge(new Md(114,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Xge(new Ed(115,"roundedSelection",!0,{description:Vae(555,"Controls whether selections should have rounded corners.")})),rulers:Xge(new gc),scrollbar:Xge(new mc),scrollBeyondLastColumn:Xge(new Md(118,"scrollBeyondLastColumn",4,0,1073741824,{description:Vae(556,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Xge(new Ed(119,"scrollBeyondLastLine",!0,{description:Vae(557,"Controls whether the editor will scroll beyond the last line.")})),scrollOnMiddleClick:Xge(new Ed(171,"scrollOnMiddleClick",!1,{description:Vae(558,"Controls whether the editor will scroll when the middle button is pressed.")})),scrollPredominantAxis:Xge(new Ed(120,"scrollPredominantAxis",!0,{description:Vae(559,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Xge(new Ed(121,"selectionClipboard",!0,{description:Vae(560,"Controls whether the Linux primary clipboard should be supported."),included:W})),selectionHighlight:Xge(new Ed(122,"selectionHighlight",!0,{description:Vae(561,"Controls whether the editor should highlight matches similar to the selection.")})),selectionHighlightMaxLength:Xge(new Md(123,"selectionHighlightMaxLength",200,0,1073741824,{description:Vae(562,"Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.")})),selectionHighlightMultiline:Xge(new Ed(124,"selectionHighlightMultiline",!1,{description:Vae(563,"Controls whether the editor should highlight selection matches that span multiple lines.")})),selectOnLineNumbers:Xge(new Ed(125,"selectOnLineNumbers",!0)),showFoldingControls:Xge(new Od(126,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[Vae(564,"Always show the folding controls."),Vae(565,"Never show the folding controls and reduce the gutter size."),Vae(566,"Only show the folding controls when the mouse is over the gutter.")],description:Vae(567,"Controls when the folding controls on the gutter are shown.")})),showUnused:Xge(new Ed(127,"showUnused",!0,{description:Vae(568,"Controls fading out of unused code.")})),showDeprecated:Xge(new Ed(157,"showDeprecated",!0,{description:Vae(569,"Controls strikethrough deprecated variables.")})),inlayHints:Xge(new nc),snippetSuggestions:Xge(new Od(128,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[Vae(570,"Show snippet suggestions on top of other suggestions."),Vae(571,"Show snippet suggestions below other suggestions."),Vae(572,"Show snippets suggestions with other suggestions."),Vae(573,"Do not show snippet suggestions.")],description:Vae(574,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Xge(new Sc),smoothScrolling:Xge(new Ed(130,"smoothScrolling",!1,{description:Vae(575,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Xge(new Md(133,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Xge(new yc),inlineSuggest:Xge(new vc),inlineCompletionsAccessibilityVerbose:Xge(new Ed(169,"inlineCompletionsAccessibilityVerbose",!1,{description:Vae(576,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Xge(new Md(135,"suggestFontSize",0,0,1e3,{markdownDescription:Vae(577,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Xge(new Md(136,"suggestLineHeight",0,0,1e3,{markdownDescription:Vae(578,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Xge(new Ed(137,"suggestOnTriggerCharacters",!0,{description:Vae(579,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Xge(new Od(138,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[Vae(580,"Always select the first suggestion."),Vae(581,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),Vae(582,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:Vae(583,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Xge(new Od(139,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[Vae(584,"Tab complete will insert the best matching suggestion when pressing tab."),Vae(585,"Disable tab completions."),Vae(586,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:Vae(587,"Enables tab completions.")})),tabIndex:Xge(new Md(140,"tabIndex",0,-1,1073741824)),trimWhitespaceOnDelete:Xge(new Ed(141,"trimWhitespaceOnDelete",!1,{description:Vae(588,"Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.")})),unicodeHighlight:Xge(new bc),unusualLineTerminators:Xge(new Od(143,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[Vae(589,"Unusual line terminators are automatically removed."),Vae(590,"Unusual line terminators are ignored."),Vae(591,"Unusual line terminators prompt to be removed.")],description:Vae(592,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:Xge(new Ed(144,"useShadowDOM",!0)),useTabStops:Xge(new Ed(145,"useTabStops",!0,{description:Vae(593,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:Xge(new Od(146,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[Vae(594,"Use the default line break rule."),Vae(595,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:Vae(596,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:Xge(new xc),wordSeparators:Xge(new Rd(148,"wordSeparators",da,{description:Vae(597,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Xge(new Od(149,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[Vae(598,"Lines will never wrap."),Vae(599,"Lines will wrap at the viewport width."),Vae(600,"Lines will wrap at `#editor.wordWrapColumn#`."),Vae(601,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:Vae(602,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Xge(new Rd(150,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Xge(new Rd(151,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥+")),wordWrapColumn:Xge(new Md(152,"wordWrapColumn",80,1,1073741824,{markdownDescription:Vae(603,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Xge(new Od(153,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Xge(new Od(154,"wordWrapOverride2","inherit",["off","on","inherit"])),wrapOnEscapedLineFeeds:Xge(new Ed(160,"wrapOnEscapedLineFeeds",!1,{markdownDescription:Vae(604,'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n world"\n```')})),effectiveCursorStyle:Xge(new qd),editorClassName:Xge(new Bd),defaultColorDecorators:Xge(new Od(167,"defaultColorDecorators","auto",["auto","always","never"],{enumDescriptions:[Vae(605,"Show default color decorators only when no extension provides colors decorators."),Vae(606,"Always show default color decorators."),Vae(607,"Never show default color decorators.")],description:Vae(608,"Controls whether inline color decorations should be shown using the default document color provider.")})),pixelRatio:Xge(new dc),tabFocusMode:Xge(new Ed(164,"tabFocusMode",!1,{markdownDescription:Vae(609,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Xge(new Xd),wrappingInfo:Xge(new Lc),wrappingIndent:Xge(new kc),wrappingStrategy:Xge(new Jd),effectiveEditContextEnabled:Xge(new jd),effectiveAllowVariableFonts:Xge(new $d)},Mc=class extends Ie{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new je),this.onDidChange=this._onDidChange.event}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){const t=bn(e);let i=this._cache.get(t);return i||(i=new Tc,this._cache.set(t,i)),i}_writeToCache(e,t,i){this._ensureCache(e).put(t,i),i.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=e.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){const t=this._ensureCache(e),i=t.getValues();let n=!1;for(const o of i)o.isTrusted||(n=!0,t.remove(o));n&&this._onDidChange.fire()}readFontInfo(e,t){const i=this._ensureCache(e);if(!i.has(t)){let i=this._actualReadFontInfo(e,t);(i.typicalHalfwidthCharacterWidth<=2||i.typicalFullwidthCharacterWidth<=2||i.spaceWidth<=2||i.maxDigitWidth<=2)&&(i=new _d({pixelRatio:hd.getInstance(e).value,fontFamily:i.fontFamily,fontWeight:i.fontWeight,fontSize:i.fontSize,fontFeatureSettings:i.fontFeatureSettings,fontVariationSettings:i.fontVariationSettings,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,isMonospace:i.isMonospace,typicalHalfwidthCharacterWidth:Math.max(i.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(i.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:i.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(i.spaceWidth,5),middotWidth:Math.max(i.middotWidth,5),wsmiddotWidth:Math.max(i.wsmiddotWidth,5),maxDigitWidth:Math.max(i.maxDigitWidth,5)},!1)),this._writeToCache(e,t,i)}return i.get(t)}_createRequest(e,t,i,n){const o=new ud(e,t);return i.push(o),n?.push(o),o}_actualReadFontInfo(e,t){const i=[],n=[],o=this._createRequest("n",0,i,n),s=this._createRequest("",0,i,null),r=this._createRequest(" ",0,i,n),a=this._createRequest("0",0,i,n),l=this._createRequest("1",0,i,n),d=this._createRequest("2",0,i,n),c=this._createRequest("3",0,i,n),h=this._createRequest("4",0,i,n),u=this._createRequest("5",0,i,n),g=this._createRequest("6",0,i,n),p=this._createRequest("7",0,i,n),m=this._createRequest("8",0,i,n),f=this._createRequest("9",0,i,n),_=this._createRequest("→",0,i,n),b=this._createRequest("→",0,i,null),v=this._createRequest("·",0,i,n),w=this._createRequest(String.fromCharCode(11825),0,i,null),C="|/-_ilm%";for(let L=0,D=8;L<D;L++)this._createRequest(C.charAt(L),0,i,n),this._createRequest(C.charAt(L),1,i,n),this._createRequest(C.charAt(L),2,i,n);!function(e,t,i){new gd(t,i).read(e)}(e,t,i);const y=Math.max(a.width,l.width,d.width,c.width,h.width,u.width,g.width,p.width,m.width,f.width);let S=t.fontFeatureSettings===zd.OFF;const x=n[0].width;for(let L=1,D=n.length;S&&L<D;L++){const e=x-n[L].width;if(e<-.001||e>.001){S=!1;break}}let k=!0;return S&&b.width!==x&&(k=!1),b.width>_.width&&(k=!1),new _d({pixelRatio:hd.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:S,typicalHalfwidthCharacterWidth:o.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:r.width,middotWidth:v.width,wsmiddotWidth:w.width,maxDigitWidth:y},!0)}},Tc=class{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}},Rc=new Mc,(Oc=class e{constructor(e,t){this.key=e,this.migrate=t}apply(t){const i=e._read(t,this.key);this.migrate(i,i=>e._read(t,i),(i,n)=>e._write(t,i,n))}static _read(e,t){if(null==e)return;const i=t.indexOf(".");if(i>=0){const n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){const n=t.indexOf(".");if(n>=0){const o=t.substring(0,n);return e[o]=e[o]||{},void this._write(e[o],t.substring(n+1),i)}e[t]=i}}).items=[],epe("wordWrap",[[!0,"on"],[!1,"off"]]),epe("lineNumbers",[[!0,"on"],[!1,"off"]]),epe("cursorBlinking",[["visible","solid"]]),epe("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),epe("renderLineHighlight",[[!0,"line"],[!1,"none"]]),epe("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),epe("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),epe("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),epe("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),epe("autoIndent",[[!1,"advanced"],[!0,"full"]]),epe("matchBrackets",[[!0,"always"],[!1,"never"]]),epe("renderFinalNewline",[[!0,"on"],[!1,"off"]]),epe("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),epe("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]),epe("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]),epe("defaultColorDecorators",[[!0,"auto"],[!1,"never"]]),epe("minimap.autohide",[[!0,"mouseover"],[!1,"none"]]),Jge("autoClosingBrackets",(e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))}),Jge("renderIndentGuides",(e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))}),Jge("highlightActiveIndentGuide",(e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))}),Ac={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"},Jge("suggest.filteredTypes",(e,t,i)=>{if(e&&"object"==typeof e){for(const n of Object.entries(Ac))!1===e[n[0]]&&void 0===t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1);i("suggest.filteredTypes",void 0)}}),Jge("quickSuggestions",(e,t,i)=>{if("boolean"==typeof e){const t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}}),Jge("experimental.stickyScroll.enabled",(e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))}),Jge("experimental.stickyScroll.maxLineCount",(e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))}),Jge("editor.experimentalEditContextEnabled",(e,t,i)=>{"boolean"==typeof e&&(i("editor.experimentalEditContextEnabled",void 0),void 0===t("editor.editContext")&&i("editor.editContext",e))}),Jge("codeActionsOnSave",(e,t,i)=>{if(e&&"object"==typeof e){let t=!1;const n={};for(const i of Object.entries(e))"boolean"==typeof i[1]?(t=!0,n[i[0]]=i[1]?"explicit":"never"):n[i[0]]=i[1];t&&i("codeActionsOnSave",n)}}),Jge("codeActionWidget.includeNearbyQuickfixes",(e,t,i)=>{"boolean"==typeof e&&(i("codeActionWidget.includeNearbyQuickfixes",void 0),void 0===t("codeActionWidget.includeNearbyQuickFixes")&&i("codeActionWidget.includeNearbyQuickFixes",e))}),Jge("lightbulb.enabled",(e,t,i)=>{"boolean"==typeof e&&i("lightbulb.enabled",e?void 0:"off")}),Jge("inlineSuggest.edits.codeShifting",(e,t,i)=>{"boolean"==typeof e&&(i("inlineSuggest.edits.codeShifting",void 0),i("inlineSuggest.edits.allowCodeShifting",e?"always":"never"))}),Pc=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new je,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}},Fc=eue("accessibilityService"),Wc=new Jo("accessibilityModeEnabled",!1),Bc=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Vc=function(e,t){return function(i,n){t(i,n,e)}},Hc=class extends Ie{constructor(e,t,i,n,o){super(),this._accessibilityService=o,this._onDidChange=this._register(new je),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new je),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new kd,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new ld(n,i.dimension)),this._targetWindowId=pn(n).vscodeWindowId,this._rawOptions=ipe(i),this._validatedOptions=Kc.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(19)&&this._containerObserver.startObserving(),this._register(pd.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(Pc.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Rc.onDidChange(()=>this._recomputeOptions())),this._register(hd.getInstance(pn(n)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._register(vr.onDidChangeInputMode(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=Kc.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=function(e,t,i){const n=e.get(58),o=e.get(62),s=e.get(61),r=e.get(60),a=e.get(63),l=e.get(75),d=e.get(72);return fd._create(n,o,s,r,a,l,d,t,i)}(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:this._validatedOptions.get(164)||Pc.getTabFocusMode(),inputMode:vr.getInputMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount,editContextSupported:e.editContextSupported};return Kc.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:tpe(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:h||c,pixelRatio:hd.getInstance(vn(this._targetWindowId,!0).window).value,editContextSupported:"function"==typeof globalThis.EditContext,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Rc.readFontInfo(vn(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=ipe(e);Kc.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=Kc.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}},Hc=Bc([Vc(4,Fc)],Hc),zc=class{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}},Uc=class{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}},Kc=class e{static validateOptions(e){const t=new zc;for(const i of Nc){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new Uc;for(const n of Nc)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(t,i){if("object"!=typeof t||"object"!=typeof i||!t||!i)return t===i;if(Array.isArray(t)||Array.isArray(i))return!(!Array.isArray(t)||!Array.isArray(i))&&Zde(t,i);if(Object.keys(t).length!==Object.keys(i).length)return!1;for(const n in t)if(!e._deepEquals(t[n],i[n]))return!1;return!0}static checkEquals(t,i){const n=[];let o=!1;for(const s of Nc){const r=!e._deepEquals(t._read(s.id),i._read(s.id));n[s.id]=r,r&&(o=!0)}return o?new xd(n):null}static applyUpdate(e,t){let i=!1;for(const n of Nc)if(t.hasOwnProperty(n.name)){const o=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=o.newValue,i=i||o.didChange}return i}},function(e){const t={total:0,min:Number.MAX_VALUE,max:0},i={...t},n={...t},o={...t};let s=0;const r={keydown:0,input:0,render:0};function a(){1===r.keydown&&(performance.mark("keydown/end"),r.keydown=2)}function l(){performance.mark("input/start"),r.input=1,h()}function d(){1===r.input&&(performance.mark("input/end"),r.input=2)}function c(){1===r.render&&(performance.mark("render/end"),r.render=2)}function h(){setTimeout(u)}function u(){2===r.keydown&&2===r.input&&2===r.render&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),g("keydown",t),g("input",i),g("render",n),g("inputlatency",o),s++,performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0)}function g(e,t){const i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function p(e){return{average:e.total/s,max:e.max,min:e.min}}function m(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){u(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(a)},e.onBeforeInput=l,e.onInput=function(){0===r.input&&l(),queueMicrotask(d)},e.onKeyUp=function(){u()},e.onSelectionChange=function(){u()},e.onRenderStart=function(){2===r.keydown&&2===r.input&&0===r.render&&(performance.mark("render/start"),r.render=1,queueMicrotask(c),h())},e.getAndClearMeasurements=function(){if(0===s)return;const e={keydown:p(t),input:p(i),render:p(n),total:p(o),sampleCount:s};return m(t),m(i),m(n),m(o),s=0,e}}(qc||(qc={})),jc=new Map,$c=class{constructor(){this._currentCssStyle="",this._styleSheet=void 0}setStyle(e){e!==this._currentCssStyle&&(this._currentCssStyle=e,this._styleSheet?this._styleSheet.textContent=e:this._styleSheet=npe(r.document.head,t=>t.textContent=e))}dispose(){this._styleSheet&&(this._styleSheet.remove(),this._styleSheet=void 0)}},Gc=null,Zc=class{constructor(){this._hooks=new De,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(Dle(()=>{try{e.releasePointerCapture(t)}catch(i){}}))}catch(r){s=pn(e)}this._hooks.add(ehe(s,On.POINTER_MOVE,e=>{e.buttons===i?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)})),this._hooks.add(ehe(s,On.POINTER_UP,e=>this.stopMonitoring(!0)))}},Qc=class{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=hpe(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}},Xc=class e{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=hpe(Math.max(Math.min(1,t),0),3),this.l=hpe(Math.max(Math.min(1,i),0),3),this.a=hpe(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(t){const i=t.r/255,n=t.g/255,o=t.b/255,s=t.a,r=Math.max(i,n,o),a=Math.min(i,n,o);let l=0,d=0;const c=(a+r)/2,h=r-a;if(h>0){switch(d=Math.min(c<=.5?h/(2*c):h/(2-2*c),1),r){case i:l=(n-o)/h+(n<o?6:0);break;case n:l=(o-i)/h+2;break;case o:l=(i-n)/h+4}l*=60,l=Math.round(l)}return new e(l,d,c,s)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(t){const i=t.h/360,{s:n,l:o,a:s}=t;let r,a,l;if(0===n)r=a=l=o;else{const t=o<.5?o*(1+n):o+n-o*n,s=2*o-t;r=e._hue2rgb(s,t,i+1/3),a=e._hue2rgb(s,t,i),l=e._hue2rgb(s,t,i-1/3)}return new Qc(Math.round(255*r),Math.round(255*a),Math.round(255*l),s)}},Jc=class e{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=hpe(Math.max(Math.min(1,t),0),3),this.v=hpe(Math.max(Math.min(1,i),0),3),this.a=hpe(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(t){const i=t.r/255,n=t.g/255,o=t.b/255,s=Math.max(i,n,o),r=s-Math.min(i,n,o),a=0===s?0:r/s;let l;return l=0===r?0:s===i?((n-o)/r%6+6)%6:s===n?(o-i)/r+2:(i-n)/r+4,new e(Math.round(60*l),a,s,t.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,s=n*i,r=s*(1-Math.abs(t/60%2-1)),a=n-s;let[l,d,c]=[0,0,0];return t<60?(l=s,d=r):t<120?(l=r,d=s):t<180?(d=s,c=r):t<240?(d=r,c=s):t<300?(l=r,c=s):t<=360&&(l=s,c=r),l=Math.round(255*(l+a)),d=Math.round(255*(d+a)),c=Math.round(255*(c+a)),new Qc(l,d,c,o)}},eh=class e{static fromHex(t){return e.Format.CSS.parseHex(t)||e.red}static equals(e,t){return!e&&!t||!(!e||!t)&&e.equals(t)}get hsla(){return this._hsla?this._hsla:Xc.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Jc.fromRGBA(this.rgba)}constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof Qc)this.rgba=e;else if(e instanceof Xc)this._hsla=e,this.rgba=Xc.toRGBA(e);else{if(!(e instanceof Jc))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=Jc.toRGBA(e)}}equals(e){return!!e&&Qc.equals(this.rgba,e.rgba)&&Xc.equals(this.hsla,e.hsla)&&Jc.equals(this.hsva,e.hsva)}getRelativeLuminance(){return hpe(.2126*e._relativeLuminanceForComponent(this.rgba.r)+.7152*e._relativeLuminanceForComponent(this.rgba.g)+.0722*e._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(t){return new e(new Xc(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*t,this.hsla.a))}darken(t){return new e(new Xc(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*t,this.hsla.a))}transparent(t){const{r:i,g:n,b:o,a:s}=this.rgba;return new e(new Qc(i,n,o,s*t))}isTransparent(){return 0===this.rgba.a}isOpaque(){return 1===this.rgba.a}opposite(){return new e(new Qc(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}mix(t,i=.5){const n=Math.min(Math.max(i,0),1),o=this.rgba,s=t.rgba,r=o.r+(s.r-o.r)*n,a=o.g+(s.g-o.g)*n,l=o.b+(s.b-o.b)*n,d=o.a+(s.a-o.a)*n;return new e(new Qc(r,a,l,d))}makeOpaque(t){if(this.isOpaque()||1!==t.rgba.a)return this;const{r:i,g:n,b:o,a:s}=this.rgba;return new e(new Qc(t.rgba.r-s*(t.rgba.r-i),t.rgba.g-s*(t.rgba.g-n),t.rgba.b-s*(t.rgba.b-o),1))}toString(){return this._toString||(this._toString=e.Format.CSS.format(this)),this._toString}toNumber32Bit(){return this._toNumber32Bit||(this._toNumber32Bit=(this.rgba.r<<24|this.rgba.g<<16|this.rgba.b<<8|255*this.rgba.a)>>>0),this._toNumber32Bit}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const n=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-n)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const n=e.getRelativeLuminance();return i=i*(n-t.getRelativeLuminance())/n,e.darken(i)}},(Yc=eh).white=new Yc(new Qc(255,255,255,1)),Yc.black=new Yc(new Qc(0,0,0,1)),Yc.red=new Yc(new Qc(255,0,0,1)),Yc.blue=new Yc(new Qc(0,0,255,1)),Yc.green=new Yc(new Qc(0,255,0,1)),Yc.cyan=new Yc(new Qc(0,255,255,1)),Yc.lightgrey=new Yc(new Qc(211,211,211,1)),Yc.transparent=new Yc(new Qc(0,0,0,0)),function(e){var t;!function(t){function i(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function n(t){const i=t.length;if(0===i)return null;if(35!==t.charCodeAt(0))return null;if(7===i)return new e(new Qc(16*o(t.charCodeAt(1))+o(t.charCodeAt(2)),16*o(t.charCodeAt(3))+o(t.charCodeAt(4)),16*o(t.charCodeAt(5))+o(t.charCodeAt(6)),1));if(9===i)return new e(new Qc(16*o(t.charCodeAt(1))+o(t.charCodeAt(2)),16*o(t.charCodeAt(3))+o(t.charCodeAt(4)),16*o(t.charCodeAt(5))+o(t.charCodeAt(6)),(16*o(t.charCodeAt(7))+o(t.charCodeAt(8)))/255));if(4===i){const i=o(t.charCodeAt(1)),n=o(t.charCodeAt(2)),s=o(t.charCodeAt(3));return new e(new Qc(16*i+i,16*n+n,16*s+s))}if(5===i){const i=o(t.charCodeAt(1)),n=o(t.charCodeAt(2)),s=o(t.charCodeAt(3)),r=o(t.charCodeAt(4));return new e(new Qc(16*i+i,16*n+n,16*s+s,(16*r+r)/255))}return null}function o(e){switch(e){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:case 65:return 10;case 98:case 66:return 11;case 99:case 67:return 12;case 100:case 68:return 13;case 101:case 69:return 14;case 102:case 70:return 15}return 0}t.formatRGB=function(t){return 1===t.rgba.a?`rgb(${t.rgba.r}, ${t.rgba.g}, ${t.rgba.b})`:e.Format.CSS.formatRGBA(t)},t.formatRGBA=function(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`},t.formatHSL=function(t){return 1===t.hsla.a?`hsl(${t.hsla.h}, ${Math.round(100*t.hsla.s)}%, ${Math.round(100*t.hsla.l)}%)`:e.Format.CSS.formatHSLA(t)},t.formatHSLA=function(e){return`hsla(${e.hsla.h}, ${Math.round(100*e.hsla.s)}%, ${Math.round(100*e.hsla.l)}%, ${e.hsla.a.toFixed(2)})`},t.formatHex=function(e){return`#${i(e.rgba.r)}${i(e.rgba.g)}${i(e.rgba.b)}`},t.formatHexA=function(t,n=!1){return n&&1===t.rgba.a?e.Format.CSS.formatHex(t):`#${i(t.rgba.r)}${i(t.rgba.g)}${i(t.rgba.b)}${i(Math.round(255*t.rgba.a))}`},t.format=function(t){return t.isOpaque()?e.Format.CSS.formatHex(t):e.Format.CSS.formatRGBA(t)},t.parse=function(t){if("transparent"===t)return e.transparent;if(t.startsWith("#"))return n(t);if(t.startsWith("rgba(")){const i=t.match(/rgba\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+), *(?<a>(?:\+|-)?\d+(\.\d+)?)\)/);if(!i)throw new Error("Invalid color format "+t);return new e(new Qc(parseInt(i.groups?.r??"0"),parseInt(i.groups?.g??"0"),parseInt(i.groups?.b??"0"),parseFloat(i.groups?.a??"0")))}if(t.startsWith("rgb(")){const i=t.match(/rgb\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+)\)/);if(!i)throw new Error("Invalid color format "+t);return new e(new Qc(parseInt(i.groups?.r??"0"),parseInt(i.groups?.g??"0"),parseInt(i.groups?.b??"0")))}return function(t){switch(t){case"aliceblue":return new e(new Qc(240,248,255,1));case"antiquewhite":return new e(new Qc(250,235,215,1));case"aqua":case"cyan":return new e(new Qc(0,255,255,1));case"aquamarine":return new e(new Qc(127,255,212,1));case"azure":return new e(new Qc(240,255,255,1));case"beige":return new e(new Qc(245,245,220,1));case"bisque":return new e(new Qc(255,228,196,1));case"black":return new e(new Qc(0,0,0,1));case"blanchedalmond":return new e(new Qc(255,235,205,1));case"blue":return new e(new Qc(0,0,255,1));case"blueviolet":return new e(new Qc(138,43,226,1));case"brown":return new e(new Qc(165,42,42,1));case"burlywood":return new e(new Qc(222,184,135,1));case"cadetblue":return new e(new Qc(95,158,160,1));case"chartreuse":return new e(new Qc(127,255,0,1));case"chocolate":return new e(new Qc(210,105,30,1));case"coral":return new e(new Qc(255,127,80,1));case"cornflowerblue":return new e(new Qc(100,149,237,1));case"cornsilk":return new e(new Qc(255,248,220,1));case"crimson":return new e(new Qc(220,20,60,1));case"darkblue":return new e(new Qc(0,0,139,1));case"darkcyan":return new e(new Qc(0,139,139,1));case"darkgoldenrod":return new e(new Qc(184,134,11,1));case"darkgray":case"darkgrey":return new e(new Qc(169,169,169,1));case"darkgreen":return new e(new Qc(0,100,0,1));case"darkkhaki":return new e(new Qc(189,183,107,1));case"darkmagenta":return new e(new Qc(139,0,139,1));case"darkolivegreen":return new e(new Qc(85,107,47,1));case"darkorange":return new e(new Qc(255,140,0,1));case"darkorchid":return new e(new Qc(153,50,204,1));case"darkred":return new e(new Qc(139,0,0,1));case"darksalmon":return new e(new Qc(233,150,122,1));case"darkseagreen":return new e(new Qc(143,188,143,1));case"darkslateblue":return new e(new Qc(72,61,139,1));case"darkslategray":case"darkslategrey":return new e(new Qc(47,79,79,1));case"darkturquoise":return new e(new Qc(0,206,209,1));case"darkviolet":return new e(new Qc(148,0,211,1));case"deeppink":return new e(new Qc(255,20,147,1));case"deepskyblue":return new e(new Qc(0,191,255,1));case"dimgray":case"dimgrey":return new e(new Qc(105,105,105,1));case"dodgerblue":return new e(new Qc(30,144,255,1));case"firebrick":return new e(new Qc(178,34,34,1));case"floralwhite":return new e(new Qc(255,250,240,1));case"forestgreen":return new e(new Qc(34,139,34,1));case"fuchsia":case"magenta":return new e(new Qc(255,0,255,1));case"gainsboro":return new e(new Qc(220,220,220,1));case"ghostwhite":return new e(new Qc(248,248,255,1));case"gold":return new e(new Qc(255,215,0,1));case"goldenrod":return new e(new Qc(218,165,32,1));case"gray":case"grey":return new e(new Qc(128,128,128,1));case"green":return new e(new Qc(0,128,0,1));case"greenyellow":return new e(new Qc(173,255,47,1));case"honeydew":return new e(new Qc(240,255,240,1));case"hotpink":return new e(new Qc(255,105,180,1));case"indianred":return new e(new Qc(205,92,92,1));case"indigo":return new e(new Qc(75,0,130,1));case"ivory":return new e(new Qc(255,255,240,1));case"khaki":return new e(new Qc(240,230,140,1));case"lavender":return new e(new Qc(230,230,250,1));case"lavenderblush":return new e(new Qc(255,240,245,1));case"lawngreen":return new e(new Qc(124,252,0,1));case"lemonchiffon":return new e(new Qc(255,250,205,1));case"lightblue":return new e(new Qc(173,216,230,1));case"lightcoral":return new e(new Qc(240,128,128,1));case"lightcyan":return new e(new Qc(224,255,255,1));case"lightgoldenrodyellow":return new e(new Qc(250,250,210,1));case"lightgray":case"lightgrey":return new e(new Qc(211,211,211,1));case"lightgreen":return new e(new Qc(144,238,144,1));case"lightpink":return new e(new Qc(255,182,193,1));case"lightsalmon":return new e(new Qc(255,160,122,1));case"lightseagreen":return new e(new Qc(32,178,170,1));case"lightskyblue":return new e(new Qc(135,206,250,1));case"lightslategray":case"lightslategrey":return new e(new Qc(119,136,153,1));case"lightsteelblue":return new e(new Qc(176,196,222,1));case"lightyellow":return new e(new Qc(255,255,224,1));case"lime":return new e(new Qc(0,255,0,1));case"limegreen":return new e(new Qc(50,205,50,1));case"linen":return new e(new Qc(250,240,230,1));case"maroon":return new e(new Qc(128,0,0,1));case"mediumaquamarine":return new e(new Qc(102,205,170,1));case"mediumblue":return new e(new Qc(0,0,205,1));case"mediumorchid":return new e(new Qc(186,85,211,1));case"mediumpurple":return new e(new Qc(147,112,219,1));case"mediumseagreen":return new e(new Qc(60,179,113,1));case"mediumslateblue":return new e(new Qc(123,104,238,1));case"mediumspringgreen":return new e(new Qc(0,250,154,1));case"mediumturquoise":return new e(new Qc(72,209,204,1));case"mediumvioletred":return new e(new Qc(199,21,133,1));case"midnightblue":return new e(new Qc(25,25,112,1));case"mintcream":return new e(new Qc(245,255,250,1));case"mistyrose":return new e(new Qc(255,228,225,1));case"moccasin":return new e(new Qc(255,228,181,1));case"navajowhite":return new e(new Qc(255,222,173,1));case"navy":return new e(new Qc(0,0,128,1));case"oldlace":return new e(new Qc(253,245,230,1));case"olive":return new e(new Qc(128,128,0,1));case"olivedrab":return new e(new Qc(107,142,35,1));case"orange":return new e(new Qc(255,165,0,1));case"orangered":return new e(new Qc(255,69,0,1));case"orchid":return new e(new Qc(218,112,214,1));case"palegoldenrod":return new e(new Qc(238,232,170,1));case"palegreen":return new e(new Qc(152,251,152,1));case"paleturquoise":return new e(new Qc(175,238,238,1));case"palevioletred":return new e(new Qc(219,112,147,1));case"papayawhip":return new e(new Qc(255,239,213,1));case"peachpuff":return new e(new Qc(255,218,185,1));case"peru":return new e(new Qc(205,133,63,1));case"pink":return new e(new Qc(255,192,203,1));case"plum":return new e(new Qc(221,160,221,1));case"powderblue":return new e(new Qc(176,224,230,1));case"purple":return new e(new Qc(128,0,128,1));case"rebeccapurple":return new e(new Qc(102,51,153,1));case"red":return new e(new Qc(255,0,0,1));case"rosybrown":return new e(new Qc(188,143,143,1));case"royalblue":return new e(new Qc(65,105,225,1));case"saddlebrown":return new e(new Qc(139,69,19,1));case"salmon":return new e(new Qc(250,128,114,1));case"sandybrown":return new e(new Qc(244,164,96,1));case"seagreen":return new e(new Qc(46,139,87,1));case"seashell":return new e(new Qc(255,245,238,1));case"sienna":return new e(new Qc(160,82,45,1));case"silver":return new e(new Qc(192,192,192,1));case"skyblue":return new e(new Qc(135,206,235,1));case"slateblue":return new e(new Qc(106,90,205,1));case"slategray":case"slategrey":return new e(new Qc(112,128,144,1));case"snow":return new e(new Qc(255,250,250,1));case"springgreen":return new e(new Qc(0,255,127,1));case"steelblue":return new e(new Qc(70,130,180,1));case"tan":return new e(new Qc(210,180,140,1));case"teal":return new e(new Qc(0,128,128,1));case"thistle":return new e(new Qc(216,191,216,1));case"tomato":return new e(new Qc(255,99,71,1));case"turquoise":return new e(new Qc(64,224,208,1));case"violet":return new e(new Qc(238,130,238,1));case"wheat":return new e(new Qc(245,222,179,1));case"white":return new e(new Qc(255,255,255,1));case"whitesmoke":return new e(new Qc(245,245,245,1));case"yellow":return new e(new Qc(255,255,0,1));case"yellowgreen":return new e(new Qc(154,205,50,1));default:return null}}(t)},t.parseHex=n}((t=e.Format||(e.Format={})).CSS||(t.CSS={}))}(eh||(eh={})),th={ColorContribution:"base.contributions.colors"},ih=new class extends Ie{constructor(){super(),this._onDidChangeSchema=this._register(new je),this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,o){const s={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:o};this.colorsById[e]=s;const r={type:"string",format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(r.deprecationMessage=o),n&&(r.pattern="^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",r.patternErrorMessage=Vae(2022,"This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={description:i,oneOf:[r,{type:"string",const:"default",description:Vae(2023,"Use the default color.")}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i?.defaults)return Cpe(null!==(n=i.defaults)&&"object"==typeof n&&"light"in n&&"dark"in n?i.defaults[t.type]:i.defaults,t);var n}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort((e,t)=>{const i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)}).map(e=>`- \`${e}\`: ${this.colorsById[e].description}`).join("\n")}},ts.add(th.ColorContribution,ih),nh="vscode://schemas/workbench-colors",(oh=ts.as(Ea.JSONContribution)).registerSchema(nh,ih.getColorSchema()),sh=new ft(()=>oh.notifySchemaChanged(nh),200),ih.onDidChangeSchema(()=>{sh.isScheduled()||sh.schedule()}),rh=mpe("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},Vae(1773,"Overall foreground color. This color is only used if not overridden by a component.")),mpe("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},Vae(1774,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),mpe("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},Vae(1775,"Overall foreground color for error messages. This color is only used if not overridden by a component.")),ah=mpe("descriptionForeground",{light:"#717171",dark:bpe(rh,.7),hcDark:bpe(rh,.7),hcLight:bpe(rh,.7)},Vae(1776,"Foreground color for description text providing additional information, for example for a label.")),lh=mpe("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},Vae(1777,"The default color for icons in the workbench.")),dh=mpe("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},Vae(1778,"Overall border color for focused elements. This color is only used if not overridden by a component.")),ch=mpe("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},Vae(1779,"An extra border around elements to separate them from others for greater contrast.")),hh=mpe("contrastActiveBorder",{light:null,dark:null,hcDark:dh,hcLight:dh},Vae(1780,"An extra border around active elements to separate them from others for greater contrast.")),mpe("selection.background",null,Vae(1781,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")),uh=mpe("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},Vae(1782,"Foreground color for links in text.")),mpe("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},Vae(1783,"Foreground color for links in text when clicked on and on mouse hover.")),mpe("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:eh.black,hcLight:"#292929"},Vae(1784,"Color for text separators.")),mpe("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},Vae(1785,"Foreground color for preformatted text segments.")),mpe("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"},Vae(1786,"Background color for preformatted text segments.")),mpe("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},Vae(1787,"Background color for block quotes in text.")),mpe("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:eh.white,hcLight:"#292929"},Vae(1788,"Border color for block quotes in text.")),mpe("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:eh.black,hcLight:"#F2F2F2"},Vae(1789,"Background color for code blocks in text.")),mpe("sash.hoverBorder",dh,Vae(1994,"Border color of active sashes.")),gh=mpe("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:eh.black,hcLight:"#0F4A85"},Vae(1995,"Badge background color. Badges are small information labels, e.g. for search results count.")),ph=mpe("badge.foreground",{dark:eh.white,light:"#333",hcDark:eh.white,hcLight:eh.white},Vae(1996,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),mpe("activityWarningBadge.foreground",{dark:eh.black.lighten(.2),light:eh.white,hcDark:null,hcLight:eh.black.lighten(.2)},Vae(1997,"Foreground color of the warning activity badge")),mpe("activityWarningBadge.background",{dark:"#CCA700",light:"#BF8803",hcDark:null,hcLight:"#CCA700"},Vae(1998,"Background color of the warning activity badge")),mpe("activityErrorBadge.foreground",{dark:eh.black.lighten(.2),light:eh.white,hcDark:null,hcLight:eh.black.lighten(.2)},Vae(1999,"Foreground color of the error activity badge")),mpe("activityErrorBadge.background",{dark:"#F14C4C",light:"#E51400",hcDark:null,hcLight:"#F14C4C"},Vae(2e3,"Background color of the error activity badge")),mh=mpe("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},Vae(2001,"Scrollbar shadow to indicate that the view is scrolled.")),fh=mpe("scrollbarSlider.background",{dark:eh.fromHex("#797979").transparent(.4),light:eh.fromHex("#646464").transparent(.4),hcDark:bpe(ch,.6),hcLight:bpe(ch,.4)},Vae(2002,"Scrollbar slider background color.")),_h=mpe("scrollbarSlider.hoverBackground",{dark:eh.fromHex("#646464").transparent(.7),light:eh.fromHex("#646464").transparent(.7),hcDark:bpe(ch,.8),hcLight:bpe(ch,.8)},Vae(2003,"Scrollbar slider background color when hovering.")),bh=mpe("scrollbarSlider.activeBackground",{dark:eh.fromHex("#BFBFBF").transparent(.4),light:eh.fromHex("#000000").transparent(.6),hcDark:ch,hcLight:ch},Vae(2004,"Scrollbar slider background color when clicked on.")),mpe("scrollbar.background",null,Vae(2005,"Scrollbar track background color.")),vh=mpe("progressBar.background",{dark:eh.fromHex("#0E70C0"),light:eh.fromHex("#0E70C0"),hcDark:ch,hcLight:ch},Vae(2006,"Background color of the progress bar that can show for long running operations.")),mpe("chart.line",{dark:"#236B8E",light:"#236B8E",hcDark:"#236B8E",hcLight:"#236B8E"},Vae(2007,"Line color for the chart.")),mpe("chart.axis",{dark:eh.fromHex("#BFBFBF").transparent(.4),light:eh.fromHex("#000000").transparent(.6),hcDark:ch,hcLight:ch},Vae(2008,"Axis color for the chart.")),mpe("chart.guide",{dark:eh.fromHex("#BFBFBF").transparent(.2),light:eh.fromHex("#000000").transparent(.2),hcDark:ch,hcLight:ch},Vae(2009,"Guide line for the chart.")),wh=mpe("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:eh.black,hcLight:eh.white},Vae(1798,"Editor background color.")),Ch=mpe("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:eh.white,hcLight:rh},Vae(1799,"Editor default foreground color.")),mpe("editorStickyScroll.background",wh,Vae(1800,"Background color of sticky scroll in the editor")),mpe("editorStickyScrollGutter.background",wh,Vae(1801,"Background color of the gutter part of sticky scroll in the editor")),mpe("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:eh.fromHex("#0F4A85").transparent(.1)},Vae(1802,"Background color of sticky scroll on hover in the editor")),mpe("editorStickyScroll.border",{dark:null,light:null,hcDark:ch,hcLight:ch},Vae(1803,"Border color of sticky scroll in the editor")),mpe("editorStickyScroll.shadow",mh,Vae(1804," Shadow color of sticky scroll in the editor")),yh=mpe("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:eh.white},Vae(1805,"Background color of editor widgets, such as find/replace.")),Sh=mpe("editorWidget.foreground",rh,Vae(1806,"Foreground color of editor widgets, such as find/replace.")),xh=mpe("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:ch,hcLight:ch},Vae(1807,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),mpe("editorWidget.resizeBorder",null,Vae(1808,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),mpe("editorError.background",null,Vae(1809,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),kh=mpe("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},Vae(1810,"Foreground color of error squigglies in the editor.")),Lh=mpe("editorError.border",{dark:null,light:null,hcDark:eh.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},Vae(1811,"If set, color of double underlines for errors in the editor.")),Dh=mpe("editorWarning.background",null,Vae(1812,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Ih=mpe("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},Vae(1813,"Foreground color of warning squigglies in the editor.")),Nh=mpe("editorWarning.border",{dark:null,light:null,hcDark:eh.fromHex("#FFCC00").transparent(.8),hcLight:eh.fromHex("#FFCC00").transparent(.8)},Vae(1814,"If set, color of double underlines for warnings in the editor.")),mpe("editorInfo.background",null,Vae(1815,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Eh=mpe("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},Vae(1816,"Foreground color of info squigglies in the editor.")),Mh=mpe("editorInfo.border",{dark:null,light:null,hcDark:eh.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},Vae(1817,"If set, color of double underlines for infos in the editor.")),Th=mpe("editorHint.foreground",{dark:eh.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},Vae(1818,"Foreground color of hint squigglies in the editor.")),mpe("editorHint.border",{dark:null,light:null,hcDark:eh.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},Vae(1819,"If set, color of double underlines for hints in the editor.")),Rh=mpe("editorLink.activeForeground",{dark:"#4E94CE",light:eh.blue,hcDark:eh.cyan,hcLight:"#292929"},Vae(1820,"Color of active links.")),Oh=mpe("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},Vae(1821,"Color of the editor selection.")),Ah=mpe("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:eh.white},Vae(1822,"Color of the selected text for high contrast.")),Ph=mpe("editor.inactiveSelectionBackground",{light:bpe(Oh,.5),dark:bpe(Oh,.5),hcDark:bpe(Oh,.7),hcLight:bpe(Oh,.5)},Vae(1823,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Fh=mpe("editor.selectionHighlightBackground",{light:wpe(Oh,wh,.3,.6),dark:wpe(Oh,wh,.3,.6),hcDark:null,hcLight:null},Vae(1824,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:hh,hcLight:hh},Vae(1825,"Border color for regions with the same content as the selection.")),mpe("editor.compositionBorder",{light:"#000000",dark:"#ffffff",hcLight:"#000000",hcDark:"#ffffff"},Vae(1826,"The border color for an IME composition.")),mpe("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},Vae(1827,"Color of the current search match.")),Wh=mpe("editor.findMatchForeground",null,Vae(1828,"Text color of the current search match.")),Bh=mpe("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},Vae(1829,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Vh=mpe("editor.findMatchHighlightForeground",null,Vae(1830,"Foreground color of the other search matches."),!0),mpe("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},Vae(1831,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("editor.findMatchBorder",{light:null,dark:null,hcDark:hh,hcLight:hh},Vae(1832,"Border color of the current search match.")),Hh=mpe("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:hh,hcLight:hh},Vae(1833,"Border color of the other search matches.")),zh=mpe("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:bpe(hh,.4),hcLight:bpe(hh,.4)},Vae(1834,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},Vae(1835,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),Uh=mpe("editorHoverWidget.background",yh,Vae(1836,"Background color of the editor hover.")),Kh=mpe("editorHoverWidget.foreground",Sh,Vae(1837,"Foreground color of the editor hover.")),qh=mpe("editorHoverWidget.border",xh,Vae(1838,"Border color of the editor hover.")),mpe("editorHoverWidget.statusBarBackground",{dark:_pe(Uh,.2),light:fpe(Uh,.05),hcDark:yh,hcLight:yh},Vae(1839,"Background color of the editor hover status bar.")),jh=mpe("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:eh.white,hcLight:eh.black},Vae(1840,"Foreground color of inline hints")),$h=mpe("editorInlayHint.background",{dark:bpe(gh,.1),light:bpe(gh,.1),hcDark:bpe(eh.white,.1),hcLight:bpe(gh,.1)},Vae(1841,"Background color of inline hints")),Gh=mpe("editorInlayHint.typeForeground",jh,Vae(1842,"Foreground color of inline hints for types")),Zh=mpe("editorInlayHint.typeBackground",$h,Vae(1843,"Background color of inline hints for types")),Yh=mpe("editorInlayHint.parameterForeground",jh,Vae(1844,"Foreground color of inline hints for parameters")),Qh=mpe("editorInlayHint.parameterBackground",$h,Vae(1845,"Background color of inline hints for parameters")),Xh=mpe("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},Vae(1846,"The color used for the lightbulb actions icon.")),mpe("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},Vae(1847,"The color used for the lightbulb auto fix actions icon.")),mpe("editorLightBulbAi.foreground",Xh,Vae(1848,"The color used for the lightbulb AI icon.")),mpe("editor.snippetTabstopHighlightBackground",{dark:new eh(new Qc(124,124,124,.3)),light:new eh(new Qc(10,50,100,.2)),hcDark:new eh(new Qc(124,124,124,.3)),hcLight:new eh(new Qc(10,50,100,.2))},Vae(1849,"Highlight background color of a snippet tabstop.")),mpe("editor.snippetTabstopHighlightBorder",null,Vae(1850,"Highlight border color of a snippet tabstop.")),mpe("editor.snippetFinalTabstopHighlightBackground",null,Vae(1851,"Highlight background color of the final tabstop of a snippet.")),mpe("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new eh(new Qc(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},Vae(1852,"Highlight border color of the final tabstop of a snippet.")),Jh=new eh(new Qc(155,185,85,.2)),eu=new eh(new Qc(255,0,0,.2)),tu=mpe("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},Vae(1853,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),iu=mpe("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},Vae(1854,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),nu=mpe("diffEditor.insertedLineBackground",{dark:Jh,light:Jh,hcDark:null,hcLight:null},Vae(1855,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("diffEditor.removedLineBackground",{dark:eu,light:eu,hcDark:null,hcLight:null},Vae(1856,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("diffEditorGutter.insertedLineBackground",null,Vae(1857,"Background color for the margin where lines got inserted.")),mpe("diffEditorGutter.removedLineBackground",null,Vae(1858,"Background color for the margin where lines got removed.")),ou=mpe("diffEditorOverview.insertedForeground",null,Vae(1859,"Diff overview ruler foreground for inserted content.")),su=mpe("diffEditorOverview.removedForeground",null,Vae(1860,"Diff overview ruler foreground for removed content.")),mpe("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},Vae(1861,"Outline color for the text that got inserted.")),mpe("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},Vae(1862,"Outline color for text that got removed.")),mpe("diffEditor.border",{dark:null,light:null,hcDark:ch,hcLight:ch},Vae(1863,"Border color between the two text editors.")),mpe("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},Vae(1864,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),mpe("diffEditor.unchangedRegionBackground","sideBar.background",Vae(1865,"The background color of unchanged blocks in the diff editor.")),mpe("diffEditor.unchangedRegionForeground","foreground",Vae(1866,"The foreground color of unchanged blocks in the diff editor.")),mpe("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},Vae(1867,"The background color of unchanged code in the diff editor.")),ru=mpe("widget.shadow",{dark:bpe(eh.black,.36),light:bpe(eh.black,.16),hcDark:null,hcLight:null},Vae(1868,"Shadow color of widgets such as find/replace inside the editor.")),au=mpe("widget.border",{dark:null,light:null,hcDark:ch,hcLight:ch},Vae(1869,"Border color of widgets such as find/replace inside the editor.")),lu=mpe("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},Vae(1870,"Toolbar background when hovering over actions using the mouse")),mpe("toolbar.hoverOutline",{dark:null,light:null,hcDark:hh,hcLight:hh},Vae(1871,"Toolbar outline when hovering over actions using the mouse")),mpe("toolbar.activeBackground",{dark:_pe(lu,.1),light:fpe(lu,.1),hcDark:null,hcLight:null},Vae(1872,"Toolbar background when holding the mouse over actions")),du=mpe("breadcrumb.foreground",bpe(rh,.8),Vae(1873,"Color of focused breadcrumb items.")),cu=mpe("breadcrumb.background",wh,Vae(1874,"Background color of breadcrumb items.")),hu=mpe("breadcrumb.focusForeground",{light:fpe(rh,.2),dark:_pe(rh,.1),hcDark:_pe(rh,.1),hcLight:_pe(rh,.1)},Vae(1875,"Color of focused breadcrumb items.")),uu=mpe("breadcrumb.activeSelectionForeground",{light:fpe(rh,.2),dark:_pe(rh,.1),hcDark:_pe(rh,.1),hcLight:_pe(rh,.1)},Vae(1876,"Color of selected breadcrumb items.")),mpe("breadcrumbPicker.background",yh,Vae(1877,"Background color of breadcrumb item picker.")),gu=eh.fromHex("#40C8AE").transparent(.5),pu=eh.fromHex("#40A6FF").transparent(.5),mu=eh.fromHex("#606060").transparent(.4),fu=mpe("merge.currentHeaderBackground",{dark:gu,light:gu,hcDark:null,hcLight:null},Vae(1878,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("merge.currentContentBackground",bpe(fu,.4),Vae(1879,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),_u=mpe("merge.incomingHeaderBackground",{dark:pu,light:pu,hcDark:null,hcLight:null},Vae(1880,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("merge.incomingContentBackground",bpe(_u,.4),Vae(1881,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),bu=mpe("merge.commonHeaderBackground",{dark:mu,light:mu,hcDark:null,hcLight:null},Vae(1882,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("merge.commonContentBackground",bpe(bu,.4),Vae(1883,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),vu=mpe("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},Vae(1884,"Border color on headers and the splitter in inline merge-conflicts.")),mpe("editorOverviewRuler.currentContentForeground",{dark:bpe(fu,1),light:bpe(fu,1),hcDark:vu,hcLight:vu},Vae(1885,"Current overview ruler foreground for inline merge-conflicts.")),mpe("editorOverviewRuler.incomingContentForeground",{dark:bpe(_u,1),light:bpe(_u,1),hcDark:vu,hcLight:vu},Vae(1886,"Incoming overview ruler foreground for inline merge-conflicts.")),mpe("editorOverviewRuler.commonContentForeground",{dark:bpe(bu,1),light:bpe(bu,1),hcDark:vu,hcLight:vu},Vae(1887,"Common ancestor overview ruler foreground for inline merge-conflicts.")),wu=mpe("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},Vae(1888,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),Cu=mpe("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",Vae(1889,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),yu=mpe("problemsErrorIcon.foreground",kh,Vae(1890,"The color used for the problems error icon.")),Su=mpe("problemsWarningIcon.foreground",Ih,Vae(1891,"The color used for the problems warning icon.")),xu=mpe("problemsInfoIcon.foreground",Eh,Vae(1892,"The color used for the problems info icon.")),ku=mpe("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},Vae(1983,"Minimap marker color for find matches."),!0),Lu=mpe("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},Vae(1984,"Minimap marker color for repeating editor selections."),!0),Du=mpe("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},Vae(1985,"Minimap marker color for the editor selection."),!0),Iu=mpe("minimap.infoHighlight",{dark:Eh,light:Eh,hcDark:Mh,hcLight:Mh},Vae(1986,"Minimap marker color for infos.")),Nu=mpe("minimap.warningHighlight",{dark:Ih,light:Ih,hcDark:Nh,hcLight:Nh},Vae(1987,"Minimap marker color for warnings.")),Eu=mpe("minimap.errorHighlight",{dark:new eh(new Qc(255,18,18,.7)),light:new eh(new Qc(255,18,18,.7)),hcDark:new eh(new Qc(255,50,50,1)),hcLight:"#B5200D"},Vae(1988,"Minimap marker color for errors.")),Mu=mpe("minimap.background",null,Vae(1989,"Minimap background color.")),Tu=mpe("minimap.foregroundOpacity",eh.fromHex("#000f"),Vae(1990,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),mpe("minimapSlider.background",bpe(fh,.5),Vae(1991,"Minimap slider background color.")),mpe("minimapSlider.hoverBackground",bpe(_h,.5),Vae(1992,"Minimap slider background color when hovering.")),mpe("minimapSlider.activeBackground",bpe(bh,.5),Vae(1993,"Minimap slider background color when clicked on.")),mpe("charts.foreground",rh,Vae(1790,"The foreground color used in charts.")),mpe("charts.lines",bpe(rh,.5),Vae(1791,"The color used for horizontal lines in charts.")),mpe("charts.red",kh,Vae(1792,"The red color used in chart visualizations.")),mpe("charts.blue",Eh,Vae(1793,"The blue color used in chart visualizations.")),mpe("charts.yellow",Ih,Vae(1794,"The yellow color used in chart visualizations.")),mpe("charts.orange",ku,Vae(1795,"The orange color used in chart visualizations.")),mpe("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},Vae(1796,"The green color used in chart visualizations.")),mpe("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},Vae(1797,"The purple color used in chart visualizations.")),Ru=mpe("input.background",{dark:"#3C3C3C",light:eh.white,hcDark:eh.black,hcLight:eh.white},Vae(1893,"Input box background.")),Ou=mpe("input.foreground",rh,Vae(1894,"Input box foreground.")),Au=mpe("input.border",{dark:null,light:null,hcDark:ch,hcLight:ch},Vae(1895,"Input box border.")),Pu=mpe("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:ch,hcLight:ch},Vae(1896,"Border color of activated options in input fields.")),Fu=mpe("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},Vae(1897,"Background color of activated options in input fields.")),Wu=mpe("inputOption.activeBackground",{dark:bpe(dh,.4),light:bpe(dh,.2),hcDark:eh.transparent,hcLight:eh.transparent},Vae(1898,"Background hover color of options in input fields.")),Bu=mpe("inputOption.activeForeground",{dark:eh.white,light:eh.black,hcDark:rh,hcLight:rh},Vae(1899,"Foreground color of activated options in input fields.")),mpe("input.placeholderForeground",{light:bpe(rh,.5),dark:bpe(rh,.5),hcDark:bpe(rh,.7),hcLight:bpe(rh,.7)},Vae(1900,"Input box foreground color for placeholder text.")),Vu=mpe("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:eh.black,hcLight:eh.white},Vae(1901,"Input validation background color for information severity.")),Hu=mpe("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:rh},Vae(1902,"Input validation foreground color for information severity.")),zu=mpe("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:ch,hcLight:ch},Vae(1903,"Input validation border color for information severity.")),Uu=mpe("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:eh.black,hcLight:eh.white},Vae(1904,"Input validation background color for warning severity.")),Ku=mpe("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:rh},Vae(1905,"Input validation foreground color for warning severity.")),qu=mpe("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:ch,hcLight:ch},Vae(1906,"Input validation border color for warning severity.")),ju=mpe("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:eh.black,hcLight:eh.white},Vae(1907,"Input validation background color for error severity.")),$u=mpe("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:rh},Vae(1908,"Input validation foreground color for error severity.")),Gu=mpe("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:ch,hcLight:ch},Vae(1909,"Input validation border color for error severity.")),Zu=mpe("dropdown.background",{dark:"#3C3C3C",light:eh.white,hcDark:eh.black,hcLight:eh.white},Vae(1910,"Dropdown background.")),Yu=mpe("dropdown.listBackground",{dark:null,light:null,hcDark:eh.black,hcLight:eh.white},Vae(1911,"Dropdown list background.")),Qu=mpe("dropdown.foreground",{dark:"#F0F0F0",light:rh,hcDark:eh.white,hcLight:rh},Vae(1912,"Dropdown foreground.")),Xu=mpe("dropdown.border",{dark:Zu,light:"#CECECE",hcDark:ch,hcLight:ch},Vae(1913,"Dropdown border.")),Ju=mpe("button.foreground",eh.white,Vae(1914,"Button foreground color.")),eg=mpe("button.separator",bpe(Ju,.4),Vae(1915,"Button separator color.")),tg=mpe("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:eh.black,hcLight:"#0F4A85"},Vae(1916,"Button background color.")),ig=mpe("button.hoverBackground",{dark:_pe(tg,.2),light:fpe(tg,.2),hcDark:tg,hcLight:tg},Vae(1917,"Button background color when hovering.")),ng=mpe("button.border",ch,Vae(1918,"Button border color.")),og=mpe("button.secondaryForeground",{dark:eh.white,light:eh.white,hcDark:eh.white,hcLight:rh},Vae(1919,"Secondary button foreground color.")),sg=mpe("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:eh.white},Vae(1920,"Secondary button background color.")),rg=mpe("button.secondaryHoverBackground",{dark:_pe(sg,.2),light:fpe(sg,.2),hcDark:null,hcLight:null},Vae(1921,"Secondary button background color when hovering.")),ag=mpe("radio.activeForeground",Bu,Vae(1922,"Foreground color of active radio option.")),lg=mpe("radio.activeBackground",Wu,Vae(1923,"Background color of active radio option.")),dg=mpe("radio.activeBorder",Pu,Vae(1924,"Border color of the active radio option.")),cg=mpe("radio.inactiveForeground",null,Vae(1925,"Foreground color of inactive radio option.")),hg=mpe("radio.inactiveBackground",null,Vae(1926,"Background color of inactive radio option.")),ug=mpe("radio.inactiveBorder",{light:bpe(ag,.2),dark:bpe(ag,.2),hcDark:bpe(ag,.4),hcLight:bpe(ag,.2)},Vae(1927,"Border color of the inactive radio option.")),gg=mpe("radio.inactiveHoverBackground",Fu,Vae(1928,"Background color of inactive active radio option when hovering.")),pg=mpe("checkbox.background",Zu,Vae(1929,"Background color of checkbox widget.")),mpe("checkbox.selectBackground",yh,Vae(1930,"Background color of checkbox widget when the element it's in is selected.")),mg=mpe("checkbox.foreground",Qu,Vae(1931,"Foreground color of checkbox widget.")),fg=mpe("checkbox.border",Xu,Vae(1932,"Border color of checkbox widget.")),mpe("checkbox.selectBorder",lh,Vae(1933,"Border color of checkbox widget when the element it's in is selected.")),_g=mpe("checkbox.disabled.background",{op:7,color:pg,with:mg,ratio:.33},Vae(1934,"Background of a disabled checkbox.")),bg=mpe("checkbox.disabled.foreground",{op:7,color:mg,with:pg,ratio:.33},Vae(1935,"Foreground of a disabled checkbox.")),vg=mpe("keybindingLabel.background",{dark:new eh(new Qc(128,128,128,.17)),light:new eh(new Qc(221,221,221,.4)),hcDark:eh.transparent,hcLight:eh.transparent},Vae(1936,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),wg=mpe("keybindingLabel.foreground",{dark:eh.fromHex("#CCCCCC"),light:eh.fromHex("#555555"),hcDark:eh.white,hcLight:rh},Vae(1937,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Cg=mpe("keybindingLabel.border",{dark:new eh(new Qc(51,51,51,.6)),light:new eh(new Qc(204,204,204,.4)),hcDark:new eh(new Qc(111,195,223)),hcLight:ch},Vae(1938,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),yg=mpe("keybindingLabel.bottomBorder",{dark:new eh(new Qc(68,68,68,.6)),light:new eh(new Qc(187,187,187,.4)),hcDark:new eh(new Qc(111,195,223)),hcLight:rh},Vae(1939,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Sg=mpe("list.focusBackground",null,Vae(1940,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),xg=mpe("list.focusForeground",null,Vae(1941,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),kg=mpe("list.focusOutline",{dark:dh,light:dh,hcDark:hh,hcLight:hh},Vae(1942,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Lg=mpe("list.focusAndSelectionOutline",null,Vae(1943,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),Dg=mpe("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:eh.fromHex("#0F4A85").transparent(.1)},Vae(1944,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Ig=mpe("list.activeSelectionForeground",{dark:eh.white,light:eh.white,hcDark:null,hcLight:null},Vae(1945,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Ng=mpe("list.activeSelectionIconForeground",null,Vae(1946,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Eg=mpe("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:eh.fromHex("#0F4A85").transparent(.1)},Vae(1947,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Mg=mpe("list.inactiveSelectionForeground",null,Vae(1948,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Tg=mpe("list.inactiveSelectionIconForeground",null,Vae(1949,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Rg=mpe("list.inactiveFocusBackground",null,Vae(1950,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Og=mpe("list.inactiveFocusOutline",null,Vae(1951,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Ag=mpe("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:eh.white.transparent(.1),hcLight:eh.fromHex("#0F4A85").transparent(.1)},Vae(1952,"List/Tree background when hovering over items using the mouse.")),Pg=mpe("list.hoverForeground",null,Vae(1953,"List/Tree foreground when hovering over items using the mouse.")),Fg=mpe("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},Vae(1954,"List/Tree drag and drop background when moving items over other items when using the mouse.")),Wg=mpe("list.dropBetweenBackground",{dark:lh,light:lh,hcDark:null,hcLight:null},Vae(1955,"List/Tree drag and drop border color when moving items between items when using the mouse.")),Bg=mpe("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:dh,hcLight:dh},Vae(1956,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Vg=mpe("list.focusHighlightForeground",{dark:Bg,light:($n=Dg,Gn=Bg,Zn="#BBE7FF",{op:6,if:$n,then:Gn,else:Zn}),hcDark:Bg,hcLight:Bg},Vae(1957,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),mpe("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},Vae(1958,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),mpe("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},Vae(1959,"Foreground color of list items containing errors.")),mpe("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},Vae(1960,"Foreground color of list items containing warnings.")),Hg=mpe("listFilterWidget.background",{light:fpe(yh,0),dark:_pe(yh,0),hcDark:yh,hcLight:yh},Vae(1961,"Background color of the type filter widget in lists and trees.")),zg=mpe("listFilterWidget.outline",{dark:eh.transparent,light:eh.transparent,hcDark:"#f38518",hcLight:"#007ACC"},Vae(1962,"Outline color of the type filter widget in lists and trees.")),Ug=mpe("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:ch,hcLight:ch},Vae(1963,"Outline color of the type filter widget in lists and trees, when there are no matches.")),Kg=mpe("listFilterWidget.shadow",ru,Vae(1964,"Shadow color of the type filter widget in lists and trees.")),mpe("list.filterMatchBackground",{dark:Bh,light:Bh,hcDark:null,hcLight:null},Vae(1965,"Background color of the filtered match.")),mpe("list.filterMatchBorder",{dark:Hh,light:Hh,hcDark:ch,hcLight:hh},Vae(1966,"Border color of the filtered match.")),mpe("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},Vae(1967,"List/Tree foreground color for items that are deemphasized.")),qg=mpe("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},Vae(1968,"Tree stroke color for the indentation guides.")),jg=mpe("tree.inactiveIndentGuidesStroke",bpe(qg,.4),Vae(1969,"Tree stroke color for the indentation guides that are not active.")),$g=mpe("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},Vae(1970,"Table border color between columns.")),Gg=mpe("tree.tableOddRowsBackground",{dark:bpe(rh,.04),light:bpe(rh,.04),hcDark:null,hcLight:null},Vae(1971,"Background color for odd table rows.")),mpe("editorActionList.background",yh,Vae(1972,"Action List background color.")),Zg=mpe("editorActionList.foreground",Sh,Vae(1973,"Action List foreground color.")),mpe("editorActionList.focusForeground",Ig,Vae(1974,"Action List foreground color for the focused item.")),mpe("editorActionList.focusBackground",Dg,Vae(1975,"Action List background color for the focused item.")),Yg=mpe("menu.border",{dark:null,light:null,hcDark:ch,hcLight:ch},Vae(1976,"Border color of menus.")),Qg=mpe("menu.foreground",Qu,Vae(1977,"Foreground color of menu items.")),Xg=mpe("menu.background",Zu,Vae(1978,"Background color of menu items.")),Jg=mpe("menu.selectionForeground",Ig,Vae(1979,"Foreground color of the selected menu item in menus.")),ep=mpe("menu.selectionBackground",Dg,Vae(1980,"Background color of the selected menu item in menus.")),tp=mpe("menu.selectionBorder",{dark:null,light:null,hcDark:hh,hcLight:hh},Vae(1981,"Border color of the selected menu item in menus.")),ip=mpe("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:ch,hcLight:ch},Vae(1982,"Color of a separator menu item in menus.")),np=mpe("quickInput.background",yh,Vae(2010,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),op=mpe("quickInput.foreground",Sh,Vae(2011,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),sp=mpe("quickInputTitle.background",{dark:new eh(new Qc(255,255,255,.105)),light:new eh(new Qc(0,0,0,.06)),hcDark:"#000000",hcLight:eh.white},Vae(2012,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),rp=mpe("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:eh.white,hcLight:"#0F4A85"},Vae(2013,"Quick picker color for grouping labels.")),ap=mpe("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:eh.white,hcLight:"#0F4A85"},Vae(2014,"Quick picker color for grouping borders.")),lp=mpe("quickInput.list.focusBackground",null,"",void 0,Vae(2015,"Please use quickInputList.focusBackground instead")),dp=mpe("quickInputList.focusForeground",Ig,Vae(2016,"Quick picker foreground color for the focused item.")),cp=mpe("quickInputList.focusIconForeground",Ng,Vae(2017,"Quick picker icon foreground color for the focused item.")),hp=mpe("quickInputList.focusBackground",{dark:vpe(lp,Dg),light:vpe(lp,Dg),hcDark:null,hcLight:null},Vae(2018,"Quick picker background color for the focused item.")),mpe("search.resultsInfoForeground",{light:rh,dark:bpe(rh,.65),hcDark:rh,hcLight:rh},Vae(2019,"Color of the text in the search viewlet's completion message.")),mpe("searchEditor.findMatchBackground",{light:bpe(Bh,.66),dark:bpe(Bh,.66),hcDark:Bh,hcLight:Bh},Vae(2020,"Color of the Search Editor query matches.")),mpe("searchEditor.findMatchBorder",{light:bpe(Hh,.66),dark:bpe(Hh,.66),hcDark:Hh,hcLight:Hh},Vae(2021,"Border color of the Search Editor query matches.")),up=class{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new gp(this.x-e.scrollX,this.y-e.scrollY)}},gp=class{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new up(this.clientX+e.scrollX,this.clientY+e.scrollY)}},pp=class{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}},mp=class{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}},fp=class extends Se{constructor(e,t,i){super(pn(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new up(this.posx,this.posy),this.editorPos=ype(i),this.relativePos=Spe(i,this.editorPos,this.pos)}},_p=class{constructor(e){this._editorViewDomNode=e}_create(e){return new fp(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return ehe(e,On.CONTEXT_MENU,e=>{t(this._create(e))})}onMouseUp(e,t){return ehe(e,On.MOUSE_UP,e=>{t(this._create(e))})}onMouseDown(e,t){return ehe(e,On.MOUSE_DOWN,e=>{t(this._create(e))})}onPointerDown(e,t){return ehe(e,On.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onMouseLeave(e,t){return ehe(e,On.MOUSE_LEAVE,e=>{t(this._create(e))})}onMouseMove(e,t){return ehe(e,On.MOUSE_MOVE,e=>t(this._create(e)))}},bp=class{constructor(e){this._editorViewDomNode=e}_create(e){return new fp(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return ehe(e,"pointerup",e=>{t(this._create(e))})}onPointerDown(e,t){return ehe(e,On.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onPointerLeave(e,t){return ehe(e,On.POINTER_LEAVE,e=>{t(this._create(e))})}onPointerMove(e,t){return ehe(e,"pointermove",e=>t(this._create(e)))}},vp=class extends Ie{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new Zc),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=xn(e.ownerDocument,"keydown",e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,e=>{n(new fp(e,!0,this._editorViewDomNode))},e=>{this._keydownListener.dispose(),o(e)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}},wp=class e{constructor(t){this._editor=t,this._instanceId=++e._idPool,this._counter=0,this._rules=new Te,this._garbageCollectionScheduler=new ft(()=>this.garbageCollect(),1e3)}dispose(){this._rules.dispose(),this._garbageCollectionScheduler.dispose()}createClassNameRef(e){const t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){const t=this.computeUniqueKey(e);let i=this._rules.get(t);if(!i){const n=this._counter++;i=new Cp(t,`dyn-rule-${this._instanceId}-${n}`,_he(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||this._rules.deleteAndDispose(e.key)}},wp._idPool=0,Cp=class{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new De,this._styleElement=npe(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const e=t[n];let o;o="object"==typeof e?gpe(e.id):e,i+=`\n\t${xpe(n)}: ${o};`}return i+="\n}",i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}},yp=class extends Ie{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const n=e[i];switch(n.type){case 0:this.onCompositionStart(n)&&(t=!0);break;case 1:this.onCompositionEnd(n)&&(t=!0);break;case 2:this.onConfigurationChanged(n)&&(t=!0);break;case 3:this.onCursorStateChanged(n)&&(t=!0);break;case 4:this.onDecorationsChanged(n)&&(t=!0);break;case 5:this.onFlushed(n)&&(t=!0);break;case 6:this.onFocusChanged(n)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(n)&&(t=!0);break;case 8:this.onLineMappingChanged(n)&&(t=!0);break;case 9:this.onLinesChanged(n)&&(t=!0);break;case 10:this.onLinesDeleted(n)&&(t=!0);break;case 11:this.onLinesInserted(n)&&(t=!0);break;case 12:this.onRevealRangeRequest(n)&&(t=!0);break;case 13:this.onScrollChanged(n)&&(t=!0);break;case 15:this.onTokensChanged(n)&&(t=!0);break;case 14:this.onThemeChanged(n)&&(t=!0);break;case 16:this.onTokensColorsChanged(n)&&(t=!0);break;case 17:this.onZonesChanged(n)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(n)}}t&&(this._shouldRender=!0)}},Sp=class extends yp{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}},xp=class{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return null===t?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(n);for(let s=0;s<n;s++)o[s]=i[n-s-1];return o}},kp=class{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._viewLayout.getLineHeightForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}},Lp=class extends kp{constructor(e,t,i,n){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i,this._viewLinesGpu=n}linesVisibleRangesForRange(e,t){const i=this._viewLines.linesVisibleRangesForRange(e,t);if(!this._viewLinesGpu)return i??null;const n=this._viewLinesGpu.linesVisibleRangesForRange(e,t);return i?n?i.concat(n).sort((e,t)=>e.lineNumber-t.lineNumber):i:n}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)??this._viewLinesGpu?.visibleRangeForPosition(e)??null}},Dp=class{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}},Ip=class e{static from(t){const i=new Array(t.length);for(let n=0,o=t.length;n<o;n++){const o=t[n];i[n]=new e(o.left,o.width)}return i}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}},Np=class{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}},Ep=class{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}},Mp=class{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}},Tp=class{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,n),s.getClientRects()}catch(Fae){return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(Np.compare);const t=[];let i=0,n=e[0];for(let o=1,s=e.length;o<s;o++){const s=e[o];n.left+n.width+.9>=s.left?n.width=Math.max(n.width,s.left+s.width-n.left):(t[i++]=n,n=s)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let o=0,s=e.length;o<s;o++){const s=e[o];n[o]=new Np(Math.max(0,(s.left-t)/i),s.width/i)}return this._mergeAdjacentRanges(n)}static readHorizontalRanges(e,t,i,n,o,s){const r=e.children.length-1;if(0>r)return null;if((t=Math.min(r,Math.max(0,t)))===(n=Math.min(r,Math.max(0,n)))&&i===o&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(i,s.clientRectDeltaLeft,s.clientRectScale)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let a=e.children[t].firstChild,l=e.children[n].firstChild;if(a&&l||(!a&&0===i&&t>0&&(a=e.children[t-1].firstChild,i=1073741824),!l&&0===o&&n>0&&(l=e.children[n-1].firstChild,o=1073741824)),!a||!l)return null;i=Math.min(a.textContent.length,Math.max(0,i)),o=Math.min(l.textContent.length,Math.max(0,o));const d=this._readClientRects(a,i,l,o,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}},Rp=class e{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(t,i){const n=t.length;if(n!==i.length)return!1;for(let o=0;o<n;o++)if(!e._equals(t[o],i[o]))return!1;return!0}static extractWrapped(t,i,n){if(0===t.length)return t;const o=i+1,s=n+1,r=n-i,a=[];let l=0;for(const d of t)d.endColumn<=o||d.startColumn>=s||(a[l++]=new e(Math.max(1,d.startColumn-o+1),Math.min(r+1,d.endColumn-o+1),d.className,d.type));return a}static filter(t,i,n,o){if(0===t.length)return[];const s=[];let r=0;for(let a=0,l=t.length;a<l;a++){const l=t[a],d=l.range;if(d.endLineNumber<i||d.startLineNumber>i)continue;if(d.isEmpty()&&(0===l.type||3===l.type))continue;const c=d.startLineNumber===i?d.startColumn:n,h=d.endLineNumber===i?d.endColumn:o;s[r++]=new e(c,h,l.inlineClassName,l.type)}return s}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(t,i){if(t.startColumn!==i.startColumn)return t.startColumn-i.startColumn;if(t.endColumn!==i.endColumn)return t.endColumn-i.endColumn;const n=e._typeCompare(t.type,i.type);return 0!==n?n:t.className!==i.className?t.className<i.className?-1:1:0}},Op=class{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}},Ap=class e{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i<n;i++)t|=e[i];return t}consumeLowerThan(t,i,n){for(;this.count>0&&this.stopOffsets[0]<t;){let t=0;for(;t+1<this.count&&this.stopOffsets[t]===this.stopOffsets[t+1];)t++;n.push(new Op(i,this.stopOffsets[t],this.classNames.join(" "),e._metadata(this.metadata))),i=this.stopOffsets[t]+1,this.stopOffsets.splice(0,t+1),this.classNames.splice(0,t+1),this.metadata.splice(0,t+1),this.count-=t+1}return this.count>0&&i<t&&(n.push(new Op(i,t-1,this.classNames.join(" "),e._metadata(this.metadata))),i=t),i}insert(e,t,i){if(0===this.count||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let n=0;n<this.count;n++)if(this.stopOffsets[n]>=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}},Pp=class{static normalize(e,t){if(0===t.length)return[];const i=[],n=new Ap;let o=0;for(let s=0,r=t.length;s<r;s++){const r=t[s];let a=r.startColumn,l=r.endColumn;const d=r.className,c=1===r.type?2:2===r.type?4:0;a>1&&ade(e.charCodeAt(a-2))&&a--,l>1&&ade(e.charCodeAt(l-2))&&l--;const h=a-1,u=l-2;o=n.consumeLowerThan(h,o,i),0===n.count&&(o=h),n.insert(u,d,c)}return n.consumeLowerThan(1073741824,o,i),i}},Fp=class{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}},Wp=class{get isLTR(){return!this.containsRTL&&this.textDirection!==Qr.RTL}constructor(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_,b,v,w,C=!1){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(Rp.compare),this.tabSize=d,this.startVisibleColumn=c,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=f,this.fontLigatures=_,this.selectionsOnLine=b&&b.sort((e,t)=>e.start<t.start?-1:1),this.renderNewLineWhenEmpty=C,this.textDirection=v,this.verticalScrollbarSize=w,Math.abs(g-h)<Math.abs(u-h)?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=u,this.renderSpaceCharCode=183)}sameSelection(e){if(null===this.selectionsOnLine)return null===e;if(null===e)return!1;if(e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&Rp.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)&&this.textDirection===e.textDirection&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.renderNewLineWhenEmpty===e.renderNewLineWhenEmpty}},Bp=class{constructor(e,t){this.partIndex=e,this.charIndex=t}},Vp=class e{static getPartIndex(e){return(4294901760&e)>>>16}static getCharIndex(e){return(65535&e)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const o=(t<<16|i)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(t){const i=this.charOffsetToPartData(t-1);return new Bp(e.getPartIndex(i),e.getCharIndex(i))}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(t,i,n){if(0===this.length)return 0;const o=(t<<16|n)>>>0;let s=0,r=this.length-1;for(;s+1<r;){const e=s+r>>>1,t=this._data[e];if(t===o)return e;t>o?r=e:s=e}if(s===r)return s;const a=this._data[s],l=this._data[r];if(a===o)return s;if(l===o)return r;const d=e.getPartIndex(a),c=e.getCharIndex(a);let h;return h=d!==e.getPartIndex(l)?i:e.getCharIndex(l),n-c<=h-n?s:r}},Hp=class{constructor(e,t){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsForeignElements=t}},zp=class{constructor(e,t,i){this.characterMapping=e,this.html=t,this.containsForeignElements=i}},Up=class{constructor(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=r,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=d,this.startVisibleColumn=c,this.spaceWidth=h,this.renderSpaceCharCode=u,this.renderWhitespace=g,this.renderControlCharacters=p}},function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST_DARK="hcDark",e.HIGH_CONTRAST_LIGHT="hcLight"}(Kp||(Kp={})),function(e){e.VS="vs",e.VS_DARK="vs-dark",e.HC_BLACK="hc-black",e.HC_LIGHT="hc-light"}(qp||(qp={})),jp=!!B||!(W||c||g),$p=!0,(Gp=class e{constructor(e,t){this._viewGpuContext=e,this._options=t,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(!this._renderedViewLine)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=Fge(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!Npe(this._options.themeType)&&2!==this._renderedViewLine?.input.renderWhitespace||(this._isMaybeInvalid=!0,0))}renderLine(t,i,n,o,s){if(this._options.useGpu&&this._viewGpuContext?.canRender(this._options,o,t))return this._renderedViewLine?.domNode?.domNode.remove(),this._renderedViewLine=null,!1;if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const r=o.getViewLineRenderingData(t),a=this._options,l=Rp.filter(r.inlineDecorations,t,r.minColumn,r.maxColumn),d=r.hasVariableFonts||"off"===a.experimentalWhitespaceRendering?a.renderWhitespace:"none",c=!r.hasVariableFonts;let h=null;if(Npe(a.themeType)||"selection"===d){const e=o.selections;for(const i of e){if(i.endLineNumber<t||i.startLineNumber>t)continue;const e=i.startLineNumber===t?i.startColumn:r.minColumn,n=i.endLineNumber===t?i.endColumn:r.maxColumn;e<n&&(Npe(a.themeType)&&l.push(new Rp(e,n,"inline-selected-text",0)),"selection"===d&&(h||(h=[]),h.push(new hl(e-1,n-1))))}}const u=new Wp(a.useMonospaceOptimizations,a.canUseHalfwidthRightwardsArrow,r.content,r.continuesWithWrappedLine,r.isBasicASCII,r.containsRTL,r.minColumn-1,r.tokens,l,r.tabSize,r.startVisibleColumn,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,a.stopRenderingLineAfter,d,a.renderControlCharacters,a.fontLigatures!==zd.OFF,h,r.textDirection,a.verticalScrollbarSize);if(this._renderedViewLine&&this._renderedViewLine.input.equals(u))return!1;s.appendString("<div "),r.textDirection===Qr.RTL?s.appendString('dir="rtl" '):r.containsRTL&&s.appendString('dir="ltr" '),s.appendString('style="top:'),s.appendString(String(i)),s.appendString("px;height:"),s.appendString(String(n)),s.appendString("px;line-height:"),s.appendString(String(n)),r.textDirection===Qr.RTL&&(s.appendString("px;padding-right:"),s.appendString(String(a.verticalScrollbarSize))),s.appendString('px;" class="'),s.appendString(e.CLASS_NAME),s.appendString('">');const g=kpe(u,s);s.appendString("</div>");let p=null;return c&&$p&&jp&&r.isBasicASCII&&u.isLTR&&a.useMonospaceOptimizations&&0===g.containsForeignElements&&(p=new Zp(this._renderedViewLine?this._renderedViewLine.domNode:null,u,g.characterMapping)),p||(p=Xp(this._renderedViewLine?this._renderedViewLine.domNode:null,u,g.characterMapping,g.containsForeignElements)),this._renderedViewLine=p,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i),this._renderedViewLine.domNode.setLineHeight(i))}isRenderedRTL(){return!!this._renderedViewLine&&this._renderedViewLine.input.textDirection===Qr.RTL}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof Zp}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Zp?this._renderedViewLine.monospaceAssumptionsAreValid():$p}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Zp&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==o&&t>o+1&&i>o+1)return new Mp(!0,[new Np(this.getWidth(n),0)]);-1!==o&&t>o+1&&(t=o+1),-1!==o&&i>o+1&&(i=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return s&&s.length>0?new Mp(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}).CLASS_NAME="view-line",Zp=class{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let e=0;e<n;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){const e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||-1!==this._cachedWidth}monospaceAssumptionsAreValid(){if(!this.domNode)return $p;if(this.input.lineContent.length<300){const e=this.getWidth(null),t=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),$p=!1)}return $p}toSlowRenderedLine(){return Xp(this.domNode,this.input,this._characterMapping,0)}getVisibleRangesForRange(e,t,i,n){const o=this._getColumnPixelOffset(e,t,n);return[new Np(o,this._getColumnPixelOffset(e,i,n)-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const n=Math.floor((t-1)/300)-1,o=300*(n+1)+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[n],-1===s&&(s=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[n]=s)),-1===s){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const r=this._characterMapping.getHorizontalOffset(o),a=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(a-r)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),o=Tp.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return o&&0!==o.length?o[0].left:-1}getColumnOfNodeOffset(e,t){return Rpe(this._characterMapping,e,t)}},Yp=class{constructor(e,t,i,n){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=n,this._cachedWidth=-1,this._pixelOffsetCache=null,t.isLTR){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const o=this._readPixelOffset(this.domNode,e,t,n);if(-1===o)return null;const s=this._readPixelOffset(this.domNode,e,i,n);return-1===s?null:[new Np(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,o){if(i===n){const n=this._readPixelOffset(e,t,i,o);return-1===n?null:[new Np(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,o)}_readPixelOffset(e,t,i,n){if(this.input.isLTR&&0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth(n);const t=this._getReadingTarget(e);return t.firstChild?(n.markDidDomLayout(),t.firstChild.offsetWidth):0}if(null!==this._pixelOffsetCache){const o=this._pixelOffsetCache[i];if(-1!==o)return o;const s=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=Tp.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return t&&0!==t.length?t[0].left:-1}if(this.input.isLTR&&i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth(n);const o=this._characterMapping.getDomPosition(i),s=Tp.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,n);if(!s||0===s.length)return-1;const r=s[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(this.input.isLTR&&1===t&&i===this._characterMapping.length)return[new Np(0,this.getWidth(n))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return Tp.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,n)}getColumnOfNodeOffset(e,t){return Rpe(this._characterMapping,e,t)}},Qp=class extends Yp{_readVisibleRangesForRange(e,t,i,n,o){const s=super._readVisibleRangesForRange(e,t,i,n,o);if(!s||0===s.length||i===n||1===i&&n===this._characterMapping.length)return s;if(this.input.isLTR){const i=this._readPixelOffset(e,t,n,o);if(-1!==i){const e=s[s.length-1];e.left<i&&(e.width=i-e.left)}}return s}},Xp=h?Mpe:Tpe,Jp=class{constructor(e=null){this.hitTarget=e,this.type=0}},em=class{get hitTarget(){return this.spanNode}constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}},function(e){e.createFromDOMInfo=function(e,t,i){const n=e.getPositionFromDOMInfo(t,i);return n?new em(n,t,null):new Jp(t)}}(tm||(tm={})),im=class{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}},nm=class{static _deduceRage(e,t=null){return!t&&e?new mr(e.lineNumber,e.column,e.lineNumber,e.column):t??null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,n,o,s){return{type:e,element:t,mouseColumn:i,position:n,range:o,detail:s}}static createViewZone(e,t,i,n,o){return{type:e,element:t,mouseColumn:i,position:n,range:this._deduceRage(n),detail:o}}static createContentText(e,t,i,n,o){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,n),detail:o}}static createContentEmpty(e,t,i,n){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:n}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,n){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:n}}static _typeToString(e){return 1===e?"TEXTAREA":2===e?"GUTTER_GLYPH_MARGIN":3===e?"GUTTER_LINE_NUMBERS":4===e?"GUTTER_LINE_DECORATIONS":5===e?"GUTTER_VIEW_ZONE":6===e?"CONTENT_TEXT":7===e?"CONTENT_EMPTY":8===e?"CONTENT_VIEW_ZONE":9===e?"CONTENT_WIDGET":10===e?"OVERVIEW_RULER":11===e?"SCROLLBAR":12===e?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}},om=class{static isTextArea(e){return 2===e.length&&3===e[0]&&7===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&8===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&8===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&6===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&9===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowGuard(e){return e.length>=1&&3===e[0]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&5===e[0]}},sm=class e{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(165),this.viewDomNode=t.viewDomNode,this.viewLinesGpu=t.viewLinesGpu,this.lineHeight=n.get(75),this.stickyTabStops=n.get(132),this.typicalHalfwidthCharacterWidth=n.get(59).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(t){return e.getZoneAtCoord(this._context,t)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let s,r=null,a=null;return i.afterLineNumber!==o&&(a=new to(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new to(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),s=null===a?r:null===r?a:t<n?r:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:r,positionAfter:a,position:s}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new mr(e,t,e,t),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e);return{range:new mr(t,1,t,this._context.viewModel.getLineMaxColumn(t)),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(t,i){return e._findAttribute(t,i,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)return null;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}isRtl(e){return this.viewModel.getTextDirection(e)===Qr.RTL}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}},rm=class{constructor(e,t,i,n){this.editorPos=t,this.pos=i,this.relativePos=n,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,dm._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}},am=class extends rm{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=xp.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,n,o){super(e,t,i,n),this.hitTestResult=new Nt(()=>dm.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=o,this._useHitTestTarget=!Boolean(this._eventTarget)}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}\n\ttarget: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&null!==this.hitTestResult.value.hitTarget&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?br.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return nm.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return nm.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return nm.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return nm.createViewZone(e,this.target,this._getMouseColumn(),t,i)}fulfillContentText(e,t,i){return nm.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return nm.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return nm.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return nm.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return nm.createOverlayWidget(this.target,this._getMouseColumn(),e)}},lm={isAfterLines:!0},dm=class e{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=xp.collect(t,this._viewHelper.viewDomNode);return!!(om.isChildOfContentWidgets(i)||om.isChildOfOverflowingContentWidgets(i)||om.isChildOfOverlayWidgets(i)||om.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(t,i,n,o,s){const r=new sm(this._context,this._viewHelper,t),a=new am(r,i,n,o,s);try{const t=e._createMouseTarget(r,a);if(6===t.type&&r.stickyTabStops&&null!==t.position){const i=e._snapToSoftTabBoundary(t.position,r.viewModel),n=mr.fromPositions(i,i).plusRange(t.range);return a.fulfillContentText(i,n,t.detail)}return t}catch(l){return a.fulfillUnknown()}}static _createMouseTarget(t,i){if(null===i.target)return i.fulfillUnknown();const n=i;let o=null;return om.isChildOfOverflowGuard(i.targetPath)||om.isChildOfOverflowingContentWidgets(i.targetPath)||om.isChildOfOverflowingOverlayWidgets(i.targetPath)||(o=o||i.fulfillUnknown()),o=o||e._hitTestContentWidget(t,n),o=o||e._hitTestOverlayWidget(t,n),o=o||e._hitTestMinimap(t,n),o=o||e._hitTestScrollbarSlider(t,n),o=o||e._hitTestViewZone(t,n),o=o||e._hitTestMargin(t,n),o=o||e._hitTestViewCursor(t,n),o=o||e._hitTestTextArea(t,n),o=o||e._hitTestViewLines(t,n),o=o||e._hitTestScrollbar(t,n),o||i.fulfillUnknown()}static _hitTestContentWidget(e,t){if(om.isChildOfContentWidgets(t.targetPath)||om.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(om.isChildOfOverlayWidgets(t.targetPath)||om.isChildOfOverflowingOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const e of i)if(t.target===e.domNode)return t.fulfillContentText(e.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const s of i){if(n<s.contentLeft)continue;if(n>s.contentLeft+s.width)continue;const i=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(i<=o&&o<=i+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return om.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};if(o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth){const r=e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition());return s.glyphMarginLane=e.viewModel.glyphLanes.getLanesAtLine(r.lineNumber)[Math.floor(o/e.lineHeight)],t.fulfillMargin(2,n,i.range,s)}return o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,s))}return null}static _hitTestViewLines(t,i){if(!om.isChildOfViewLines(i.targetPath))return null;if(t.isInTopPadding(i.mouseVerticalOffset))return i.fulfillContentEmpty(new to(1,1),lm);if(t.isAfterLines(i.mouseVerticalOffset)||t.isInBottomPadding(i.mouseVerticalOffset)){const e=t.viewModel.getLineCount(),n=t.viewModel.getLineMaxColumn(e);return i.fulfillContentEmpty(new to(e,n),lm)}if(om.isStrictChildOfViewLines(i.targetPath)){const e=t.getLineNumberAtVerticalOffset(i.mouseVerticalOffset),n=t.viewModel.getLineLength(e),o=t.getLineWidth(e);if(0===n){const t=Ope(i.mouseContentHorizontalOffset-o);return i.fulfillContentEmpty(new to(e,1),t)}if(t.isRtl(e)){if(i.mouseContentHorizontalOffset+o<=t.layoutInfo.contentWidth-t.layoutInfo.verticalScrollbarWidth){const n=Ope(i.mouseContentHorizontalOffset-o),s=new to(e,t.viewModel.getLineMaxColumn(e));return i.fulfillContentEmpty(s,n)}}else if(i.mouseContentHorizontalOffset>=o){const n=Ope(i.mouseContentHorizontalOffset-o),s=new to(e,t.viewModel.getLineMaxColumn(e));return i.fulfillContentEmpty(s,n)}}else if(t.viewLinesGpu){const e=t.getLineNumberAtVerticalOffset(i.mouseVerticalOffset);if(0===t.viewModel.getLineLength(e)){const n=t.getLineWidth(e),o=Ope(i.mouseContentHorizontalOffset-n);return i.fulfillContentEmpty(new to(e,1),o)}const n=t.getLineWidth(e);if(t.isRtl(e)){if(i.mouseContentHorizontalOffset+n<=t.layoutInfo.contentWidth-t.layoutInfo.verticalScrollbarWidth){const o=Ope(i.mouseContentHorizontalOffset-n),s=new to(e,t.viewModel.getLineMaxColumn(e));return i.fulfillContentEmpty(s,o)}}else if(i.mouseContentHorizontalOffset>=n){const o=Ope(i.mouseContentHorizontalOffset-n),s=new to(e,t.viewModel.getLineMaxColumn(e));return i.fulfillContentEmpty(s,o)}const o=t.viewLinesGpu.getPositionAtCoordinate(e,i.mouseContentHorizontalOffset);if(o)return i.fulfillContentText(o,mr.fromPositions(o,o),{injectedText:null,mightBeForeignElement:!1})}const n=i.hitTestResult.value;return 1===n.type?e.createMouseTargetFromHitTestPosition(t,i,n.spanNode,n.position,n.injectedText):i.wouldBenefitFromHitTestTargetSwitch?(i.switchToHitTestTarget(),this._createMouseTarget(t,i)):i.fulfillUnknown()}static _hitTestMinimap(e,t){if(om.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new to(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(om.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new to(i,n))}}return null}static _hitTestScrollbar(e,t){if(om.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new to(i,n))}return null}getMouseColumn(t){const i=this._context.configuration.options,n=i.get(165),o=this._context.viewLayout.getCurrentScrollLeft()+t.x-n.contentLeft;return e._getMouseColumn(o,i.get(59).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,o){const s=n.lineNumber,r=n.column,a=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>a){const e=Ope(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(s,r);if(!l)return t.fulfillUnknown(n);const d=l.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!o,injectedText:o});const c=[];if(c.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(s,r-1);t&&c.push({offset:t.left,column:r-1})}if(r<e.viewModel.getLineMaxColumn(s)){const t=e.visibleRangeForPosition(s,r+1);t&&c.push({offset:t.left,column:r+1})}c.sort((e,t)=>e.offset-t.offset);const h=t.pos.toClientCoordinates(pn(e.viewDomNode)),u=i.getBoundingClientRect(),g=u.left<=h.clientX&&h.clientX<=u.right;let p=null;for(let m=1;m<c.length;m++){const e=c[m-1],i=c[m];if(e.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=i.offset){p=new mr(s,e.column,s,i.column),n=Math.abs(e.offset-t.mouseContentHorizontalOffset)<Math.abs(i.offset-t.mouseContentHorizontalOffset)?new to(s,e.column):new to(s,i.column);break}}return t.fulfillContentText(n,p,{mightBeForeignElement:!g||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i),o=n+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>o)){const i=Math.floor((n+o)/2);let s=t.pos.y+(i-t.mouseVerticalOffset);s<=t.editorPos.y&&(s=t.editorPos.y+1),s>=t.editorPos.y+t.editorPos.height&&(s=t.editorPos.y+t.editorPos.height-1);const r=new up(t.pos.x,s),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates(pn(e.viewDomNode)));if(1===a.type)return a}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(pn(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=bhe(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(o?.hasChildNodes()){for(;o&&o.firstChild&&o.firstChild.nodeType!==o.firstChild.TEXT_NODE&&o.lastChild&&o.lastChild.firstChild;)o=o.lastChild;const e=o.getBoundingClientRect(),i=pn(o),s=`${i.getComputedStyle(o,null).getPropertyValue("font-style")} ${i.getComputedStyle(o,null).getPropertyValue("font-variant")} ${i.getComputedStyle(o,null).getPropertyValue("font-weight")} ${i.getComputedStyle(o,null).getPropertyValue("font-size")}/${i.getComputedStyle(o,null).getPropertyValue("line-height")} ${i.getComputedStyle(o,null).getPropertyValue("font-family")}`,r=o.innerText;let a,l=e.left,d=0;if(t>e.left+e.width)d=r.length;else{const e=cm.getInstance();for(let i=0;i<r.length+1;i++){if(a=e.getCharWidth(r.charAt(i),s)/2,l+=a,t<l){d=i;break}l+=a}}n.setStart(o.firstChild,d),n.setEnd(o.firstChild,d)}return n}(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return new Jp;const o=n.startContainer;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,s=i?i.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===Gp.CLASS_NAME?tm.createFromDOMInfo(e,t,n.startOffset):new Jp(o.parentNode)}if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===Gp.CLASS_NAME?tm.createFromDOMInfo(e,o,o.textContent.length):new Jp(o)}return new Jp}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null;return(o&&o.nodeType===o.ELEMENT_NODE?o.className:null)===Gp.CLASS_NAME?tm.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Jp(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===Gp.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return tm.createFromDOMInfo(e,t,0)}else if(s===Gp.CLASS_NAME)return tm.createFromDOMInfo(e,i.offsetNode,0)}return new Jp(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),o=Fr.atomicPosition(i,e.column-1,n,2);return-1!==o?new to(e.lineNumber,o+1):e}static doHitTest(e,t){let i=new Jp;if("function"==typeof e.viewDomNode.ownerDocument.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(pn(e.viewDomNode)))),1===i.type){const t=e.viewModel.getInjectedTextAt(i.position),n=e.viewModel.normalizePosition(i.position,2);!t&&n.equals(i.position)||(i=new em(n,i.spanNode,t))}return i}},cm=class e{static getInstance(){return e._INSTANCE||(e._INSTANCE=new e),e._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const n=this._canvas.getContext("2d");n.font=t;const o=n.measureText(e).width;return this._cache[i]=o,o}},cm._INSTANCE=null,um=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}(gm||(gm={})),pm=class e extends Ie{constructor(){super(),this.dispatched=!1,this.targets=new Ae,this.ignoreTargets=new Ae,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Be.runAndSubscribe(wn,({window:e,disposables:t})=>{t.add(ehe(e.document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),t.add(ehe(e.document,"touchend",t=>this.onTouchEnd(e,t))),t.add(ehe(e.document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))},{window:r,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||(e.INSTANCE=new e),Dle(e.INSTANCE.targets.push(t))):Ie.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||(e.INSTANCE=new e),Dle(e.INSTANCE.ignoreTargets.push(t))):Ie.None}static isTouchDevice(){return"ontouchstart"in r||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){const n=e.targetTouches.item(i);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:t,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[t],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};const o=this.newGestureEvent(gm.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){const n=Date.now(),o=Object.keys(this.activeTouches).length;for(let s=0,r=i.changedTouches.length;s<r;s++){const r=i.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("move of an UNKNOWN touch",r);continue}const a=this.activeTouches[r.identifier],l=Date.now()-a.initialTimeStamp;if(l<e.HOLD_DELAY&&Math.abs(a.initialPageX-a.rollingPageX.at(-1))<30&&Math.abs(a.initialPageY-a.rollingPageY.at(-1))<30){const e=this.newGestureEvent(gm.Tap,a.initialTarget);e.pageX=a.rollingPageX.at(-1),e.pageY=a.rollingPageY.at(-1),this.dispatchEvent(e)}else if(l>=e.HOLD_DELAY&&Math.abs(a.initialPageX-a.rollingPageX.at(-1))<30&&Math.abs(a.initialPageY-a.rollingPageY.at(-1))<30){const e=this.newGestureEvent(gm.Contextmenu,a.initialTarget);e.pageX=a.rollingPageX.at(-1),e.pageY=a.rollingPageY.at(-1),this.dispatchEvent(e)}else if(1===o){const e=a.rollingPageX.at(-1),i=a.rollingPageY.at(-1),o=a.rollingTimestamps.at(-1)-a.rollingTimestamps[0],s=e-a.rollingPageX[0],r=i-a.rollingPageY[0],l=[...this.targets].filter(e=>a.initialTarget instanceof Node&&e.contains(a.initialTarget));this.inertia(t,l,n,Math.abs(s)/o,s>0?1:-1,e,Math.abs(r)/o,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent(gm.End,a.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(t){if(t.type===gm.Tap){const i=(new Date).getTime();let n=0;n=i-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=i,t.tapCount=n}else t.type!==gm.Change&&t.type!==gm.Contextmenu||(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(const i of this.ignoreTargets)if(i.contains(t.initialTarget))return;const e=[];for(const i of this.targets)if(i.contains(t.initialTarget)){let n=0,o=t.initialTarget;for(;o&&o!==i;)n++,o=o.parentElement;e.push([n,i])}e.sort((e,t)=>e[0]-t[0]);for(const[i,n]of e)n.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,n,o,s,r,a,l,d){this.handle=In(t,()=>{const c=Date.now(),h=c-n;let u=0,g=0,p=!0;o+=e.SCROLL_FRICTION*h,a+=e.SCROLL_FRICTION*h,o>0&&(p=!1,u=s*o*h),a>0&&(p=!1,g=l*a*h);const m=this.newGestureEvent(gm.Change);m.translationX=u,m.translationY=g,i.forEach(e=>e.dispatchEvent(m)),p||this.inertia(t,i,c,o,s,r+u,a,l,d+g)})}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){const n=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}const o=this.activeTouches[n.identifier],s=this.newGestureEvent(gm.Change,o.initialTarget);s.translationX=n.pageX-o.rollingPageX.at(-1),s.translationY=n.pageY-o.rollingPageY.at(-1),s.pageX=n.pageX,s.pageY=n.pageY,this.dispatchEvent(s),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}},(hm=pm).SCROLL_FRICTION=-.005,hm.HOLD_DELAY=700,hm.CLEAR_TAP_COUNT_TIME=400,um([Ape],pm,"isTouchDevice",null),mm=class extends Ie{onclick(e,t){this._register(ehe(e,On.CLICK,i=>t(new Se(pn(e),i))))}onmousedown(e,t){this._register(ehe(e,On.MOUSE_DOWN,i=>t(new Se(pn(e),i))))}onmouseover(e,t){this._register(ehe(e,On.MOUSE_OVER,i=>t(new Se(pn(e),i))))}onmouseleave(e,t){this._register(ehe(e,On.MOUSE_LEAVE,i=>t(new Se(pn(e),i))))}onkeydown(e,t){this._register(ehe(e,On.KEY_DOWN,e=>t(new we(e))))}onkeyup(e,t){this._register(ehe(e,On.KEY_UP,e=>t(new we(e))))}oninput(e,t){this._register(ehe(e,On.INPUT,t))}onblur(e,t){this._register(ehe(e,On.BLUR,t))}onfocus(e,t){this._register(ehe(e,On.FOCUS,t))}ignoreGesture(e){return pm.ignoreTarget(e)}},fm=class extends mm{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...mo.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Zc),this._register(xn(this.bgDomNode,On.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(xn(this.domNode,On.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new Nn),this._pointerdownScheduleRepeatTimer=this._register(new pt)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,pn(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},_m=class extends Ie{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new pt)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||this._rawShouldBeVisible)}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},bm=class extends mm{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new _m(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Zc),this._shouldRender=!0,this.domNode=Fge(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(ehe(this.domNode.domNode,On.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){const t=this._register(new fm(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Fge(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ehe(this.slider.domNode,On.POINTER_DOWN,e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{const n=lhe(this.domNode.domNode);t=e.pageX-n.left,i=e.pageY-n.top}const n="mouse"===e.pointerType,o=0===e.button;if(o||!n){const e=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(e):this._scrollbarState.getDesiredScrollPositionFromOffset(e))}o&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{const o=this._sliderOrthogonalPointerPosition(e),s=Math.abs(o-i);if(P&&s>140)return void this._setDesiredScrollPositionNow(n.getScrollPosition());const r=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(r))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},vm=class e{constructor(e,t,i,n,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,o){const s=Math.max(0,i-e),r=Math.max(0,s-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),d=(r-l)/(n-i),c=o*d;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(c)}}_refreshComputedValues(){const t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},wm=class extends bm{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new vm(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,n.width,n.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const e=(t.arrowSize-11)/2,i=(t.horizontalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:go.scrollbarButtonLeft,top:i,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new xe(null,1,0))}),this._createArrow({className:"scra",icon:go.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new xe(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},Cm=class extends bm{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new vm(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-11)/2,i=(t.verticalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:go.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new xe(null,0,1))}),this._createArrow({className:"scra",icon:go.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new xe(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},ym=class e{constructor(e,t,i,n,o,s,r){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,o|=0,s|=0,r|=0),this.rawScrollLeft=n,this.rawScrollTop=r,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),o<0&&(o=0),r+o>s&&(r=s-o),r<0&&(r=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=o,this.scrollHeight=s,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,i){return new e(this._forceIntegerValues,void 0!==t.width?t.width:this.width,void 0!==t.scrollWidth?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,void 0!==t.height?t.height:this.height,void 0!==t.scrollHeight?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==t.scrollLeft?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==t.scrollTop?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:r,scrollTopChanged:a}}},Sm=class extends Ie{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new je),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new ym(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){const i=this._state.withScrollDimensions(e,t);this._setState(i,Boolean(this._smoothScrolling)),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new km(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=km.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return Boolean(this._smoothScrolling)}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},xm=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}},km=class e{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,a;return e<t?(r=e+.75*i,a=t-.75*i):(r=e-.75*i,a=t+.75*i),n=Ppe(e,r),o=Ppe(a,t),s=.33,function(e){return e<s?n(e/s):o((e-s)/(1-s))}}var n,o,s;return Ppe(e,t)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){const t=(e-this.startTime)/this.duration;return t<1?new xm(this.scrollLeft(t),this.scrollTop(t),!1):new xm(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,n){return e.start(t,i,n)}static start(t,i,n){return n+=10,new e(t,i,Date.now()-10,n)}},Dm=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},Im=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,n=this._rear;for(;;){const o=n===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[n].score*o,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}return t<=.5}acceptStandardWheelEvent(e){if(u){const t=Kae(pn(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let n=null;const o=new Dm(e,t,i);-1===this._front&&-1===this._rear?(this._memory[0]=o,this._front=0,this._rear=0):(n=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,n)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if(this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(i+=.25),t){const n=Math.abs(e.deltaX),o=Math.abs(e.deltaY),s=Math.abs(t.deltaX),r=Math.abs(t.deltaY),a=Math.max(Math.min(n,s),1),l=Math.max(Math.min(o,r),1),d=Math.max(n,s),c=Math.max(o,r);d%a===0&&c%l===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){const t=100*Number.EPSILON;return Math.abs(Math.round(e)-e)<.01+t}},(Lm=Im).INSTANCE=new Lm,Nm=class extends mm{get onScroll(){return this._onScroll.event}get options(){return this._options}constructor(e,t,i){super(),this._inertialTimeout=null,this._inertialSpeed={X:0,Y:0},this._onScroll=this._register(new je),this._onWillScroll=this._register(new je),e.style.overflow="hidden",this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,inertialScroll:void 0!==e.inertialScroll&&e.inertialScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,F&&(t.className+=" mac"),t}(t),this._scrollable=i,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Cm(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new wm(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Fge(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Fge(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Fge(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new pt),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=kle(this._mouseWheelToDispose),this._inertialTimeout&&(this._inertialTimeout.dispose(),this._inertialTimeout=null),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,F&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new xe(e))}async _periodicSync(){let e=!1;0===this._inertialSpeed.X&&0===this._inertialSpeed.Y||(this._scrollable.setScrollPositionNow({scrollTop:this._scrollable.getCurrentScrollPosition().scrollTop-100*this._inertialSpeed.Y,scrollLeft:this._scrollable.getCurrentScrollPosition().scrollLeft-100*this._inertialSpeed.X}),this._inertialSpeed.X*=.9,this._inertialSpeed.Y*=.9,Math.abs(this._inertialSpeed.X)<.01&&(this._inertialSpeed.X=0),Math.abs(this._inertialSpeed.Y)<.01&&(this._inertialSpeed.Y=0),e=0!==this._inertialSpeed.X||0!==this._inertialSpeed.Y),e?(this._inertialTimeout||(this._inertialTimeout=new pt),this._inertialTimeout.cancelAndSet(()=>this._periodicSync(),1e3/60)):(this._inertialTimeout?.dispose(),this._inertialTimeout=null)}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=kle(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new xe(e))};this._mouseWheelToDispose.push(ehe(this._listenOnDomNode,On.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;const t=Im.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+n===0?o=n=0:Math.abs(n)>=Math.abs(o)?o=0:n=0),this._options.flipAxes&&([n,o]=[o,n]);const s=!F&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!s||o||(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(n){const e=50*n,t=r.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,t)}if(o){const e=50*o,t=r.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}if(a=this._scrollable.validateScrollPosition(a),this._options.inertialScroll&&(o||n)&&!t.isPhysicalMouseWheel()){let e=!1;0===this._inertialSpeed.X&&0===this._inertialSpeed.Y&&(e=!0),this._inertialSpeed.Y=(n<0?-1:1)*Math.abs(n)**1.02,this._inertialSpeed.X=(o<0?-1:1)*Math.abs(o)**1.02,e&&this._periodicSync()}r.scrollLeft===a.scrollLeft&&r.scrollTop===a.scrollTop||(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",o=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet(()=>this._hide(),500)}},Em=class extends Nm{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new Sm({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>In(pn(e),t)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}},Mm=class extends Nm{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},Tm=class extends Nm{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new Sm({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>In(pn(e),t)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}},Rm=class extends Ie{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=this._createDragScrollingOperation(e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}},Om=class extends Ie{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=In(pn(s.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}},Am=class extends Rm{_createDragScrollingOperation(e,t){return new Pm(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}},Pm=class extends Om{_getScrollSpeed(){const e=this._context.configuration.options.get(75),t=this._context.configuration.options.get(165).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(75),t=this._getScrollSpeed()*(this._tick()/1e3)*e,i="above"===this._position.outsidePosition?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,i),this._viewHelper.renderNow();const n=this._context.viewLayout.getLinesViewportData(),o="above"===this._position.outsidePosition?n.startLineNumber:n.endLineNumber;let s;{const e=ype(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(165).horizontalScrollbarHeight,i=new up(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=Spe(this._viewHelper.viewDomNode,e,i);s=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}s.position&&s.position.lineNumber===o||(s="above"===this._position.outsidePosition?nm.createOutsideEditor(this._position.mouseColumn,new to(o,1),"above",this._position.outsideDistance):nm.createOutsideEditor(this._position.mouseColumn,new to(o,this._context.viewModel.getLineMaxColumn(o)),"below",this._position.outsideDistance)),this._dispatchMouse(s,!0,2),this._animationFrameDisposable=In(pn(s.element),()=>this._execute())}},Fm=class extends Rm{_createDragScrollingOperation(e,t){return new Wm(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}},Wm=class extends Om{_getScrollSpeed(){const e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._context.configuration.options.get(165).contentWidth/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._getScrollSpeed()*(this._tick()/1e3)*e*.5,i="left"===this._position.outsidePosition?-t:t;if(this._context.viewModel.viewLayout.deltaScrollNow(i,0),this._viewHelper.renderNow(),!this._position.position)return;const n=this._position.position.lineNumber;let o;{const e=ype(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(165).horizontalScrollbarHeight,i=new up(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=Spe(this._viewHelper.viewDomNode,e,i);o=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}o="left"===this._position.outsidePosition?nm.createOutsideEditor(o.mouseColumn,new to(n,o.mouseColumn),"left",this._position.outsideDistance):nm.createOutsideEditor(o.mouseColumn,new to(n,o.mouseColumn),"right",this._position.outsideDistance),this._dispatchMouse(o,!0,2),this._animationFrameDisposable=In(pn(o.element),()=>this._execute())}},Bm=class extends yp{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new dm(this._context,i),this._mouseDownOperation=this._register(new Vm(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(e,t)=>this._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(165).height;const n=new _p(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,e=>this._onContextMenu(e,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=ehe(this.viewHelper.viewDomNode.ownerDocument,"mousemove",e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new fp(e,!1,this.viewHelper.viewDomNode))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e)));let o=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>{o=t})),this._register(ehe(this.viewHelper.viewDomNode,On.POINTER_UP,e=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=Im.INSTANCE;let t=0,i=pd.getZoomLevel(),n=!1,o=0;function s(e){return F?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register(ehe(this.viewHelper.viewDomNode,On.MOUSE_WHEEL,r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(84))return;const a=new xe(r);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(s(r)){const e=pd.getZoomLevel(),t=a.deltaY>0?1:-1;pd.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=pd.getZoomLevel(),n=s(r),o=0),t=Date.now(),o+=a.deltaY,n&&(pd.setZoomLevel(i+o/5),a.preventDefault(),a.stopPropagation())},{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(165)){const e=this._context.configuration.options.get(165).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const i=new gp(e,t).toPageCoordinates(pn(this.viewHelper.viewDomNode)),n=ype(this.viewHelper.viewDomNode);if(i.y<n.y||i.y>n.y+n.height||i.x<n.x||i.x>n.x+n.width)return null;const o=Spe(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,o,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=bhe(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find(e=>this.viewHelper.viewDomNode.contains(e))??null)}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=(new Date).getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){const i=this._createMouseTarget(e,!0),n=6===i.type||7===i.type,o=2===i.type||3===i.type||4===i.type,s=3===i.type,r=this._context.configuration.options.get(125),a=8===i.type||5===i.type,l=9===i.type;let d=e.leftButton||e.middleButton;F&&e.leftButton&&e.ctrlKey&&(d=!1);const c=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(n||s&&r))c(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(a){const n=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(c(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(c(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}},Vm=class extends Ie{constructor(e,t,i,n,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new vp(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new Am(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,i)=>this._dispatchMouse(e,t,i))),this._leftRightDragScrolling=this._register(new Fm(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,i)=>this._dispatchMouse(e,t,i))),this._mouseState=new Hm,this._currentSelection=new fr(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):13===t.type?"above"===t.outsidePosition||"below"===t.outsidePosition?(this._topBottomDragScrolling.start(t,e),this._leftRightDragScrolling.stop()):(this._leftRightDragScrolling.start(t,e),this._topBottomDragScrolling.stop()):(this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(104)&&o.get(42)&&!o.get(28)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),e=>{const t=this._findMousePosition(this._lastMouseEvent,!1);Ihe(e)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const i=t.y-e.posy,s=Math.max(n.getCurrentScrollTop()-i,0),r=sm.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return nm.createOutsideEditor(o,e,"above",i)}const a=n.getLineNumberAtVerticalOffset(s);return nm.createOutsideEditor(o,new to(a,1),"above",i)}if(e.posy>t.y+t.height){const s=e.posy-t.y-t.height,r=n.getCurrentScrollTop()+e.relativePos.y,a=sm.getZoneAtCoord(this._context,r);if(a){const e=this._helpPositionJumpOverViewZone(a);if(e)return nm.createOutsideEditor(o,e,"below",s)}const l=n.getLineNumberAtVerticalOffset(r);return nm.createOutsideEditor(o,new to(l,i.getLineMaxColumn(l)),"below",s)}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y),r=this._context.configuration.options.get(165),a=r.contentLeft;if(e.relativePos.x<=a){const t=a-e.relativePos.x;return nm.createOutsideEditor(o,new to(s,1),"left",t)}const l=0===r.minimap.minimapLeft?r.width-r.verticalScrollbarWidth:r.minimap.minimapLeft;if(e.relativePos.x>=l){const t=e.relativePos.x-l;return nm.createOutsideEditor(o,new to(s,i.getLineMaxColumn(s)),"right",t)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return nm.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new to(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:6===e.type&&null!==e.detail.injectedText})}},(Hm=class e{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(t,i){const n=(new Date).getTime();n-this._lastSetMouseDownCountTime>e.CLEAR_MOUSE_DOWN_COUNT_TIME&&(t=1),this._lastSetMouseDownCountTime=n,t>this._lastMouseDownCount+1&&(t=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(i)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=i,this._lastMouseDownCount=Math.min(t,this._lastMouseDownPositionEqualCount)}}).CLEAR_MOUSE_DOWN_COUNT_TIME=400,zm=class{get event(){return this.emitter.event}constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new je({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}},(Um=Km=class{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}).INSTANCE=new Um,qm={forceCopyWithSyntaxHighlighting:!1},jm={getTextData(e){const t=e.getData(Na.text);let i=null;const n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(o){}return 0===t.length&&null===i&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map(e=>e.name).join("\n"),null]:[t,i]},setTextData(e,t,i,n){e.setData(Na.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}},($m=Gm=class e{constructor(e,t,i,n,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(t,i){const n=t.getValue(),o=t.getSelectionStart(),s=t.getSelectionEnd();let r;return i&&n.substring(0,o)===i.value.substring(0,i.selectionStart)&&(r=i.newlineCountBeforeSelection),new e(n,o,s,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new e(this.value,this.value.length,this.value.length,null,void 0)}isWrittenToTextArea(e,t){const i=this.value===e.getValue();return t?this.selectionStart===e.getSelectionStart()&&this.selectionEnd===e.getSelectionEnd()&&i:i}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){const t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,t,1)}const t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);const i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,o=-1;for(;-1!==(o=t.indexOf("\n",o+1));)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(sde(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(rde(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);const s=t.value.substring(n,t.value.length-o),r=e.selectionStart-n,a=e.selectionEnd-n;return t.selectionStart-n===t.selectionEnd-n?{text:s,replacePrevCharCnt:e.selectionStart-n,replaceNextCharCnt:0,positionDelta:0}:{text:s,replacePrevCharCnt:a-r,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(sde(e.value,t.value),e.selectionEnd),n=Math.min(rde(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),s=t.value.substring(i,t.value.length-n);e.selectionStart;const r=e.selectionEnd-i;t.selectionStart;const a=t.selectionEnd-i;return{text:s,replacePrevCharCnt:r,replaceNextCharCnt:o.length-r,positionDelta:a-s.length}}static fromScreenReaderContentState(t){return new e(t.value,t.selectionStart,t.selectionEnd,t.selection,t.newlineCountBeforeSelection)}}).EMPTY=new $m("",0,0,null,void 0),Zm=function(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID.bind(crypto);const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;let i=0,n="";return n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+="-",n+=t[e[i++]],n+=t[e[i++]],n+="-",n+=t[e[i++]],n+=t[e[i++]],n+="-",n+=t[e[i++]],n+=t[e[i++]],n+="-",n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n+=t[e[i++]],n}}(),Ym=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Qm=function(e,t){return function(i,n){t(i,n,e)}},function(e){e.Tap="-monaco-textarea-synthetic-tap"}(Xm||(Xm={})),Jm=class{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}},ef=class extends Ie{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,s){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=o,this._logService=s,this._onFocus=this._register(new je),this.onFocus=this._onFocus.event,this._onBlur=this._register(new je),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new je),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new je),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new je),this.onCut=this._onCut.event,this._onPaste=this._register(new je),this.onPaste=this._onPaste.event,this._onType=this._register(new je),this.onType=this._onType.event,this._onCompositionStart=this._register(new je),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new je),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new je),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new je),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new Ne),this._asyncTriggerCut=this._register(new ft(()=>this._onCut.fire(),0)),this._textAreaState=Gm.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(Be.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new ft(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()})),this._hasFocus=!1,this._currentComposition=null;let r=null;this._register(this._textArea.onKeyDown(e=>{const t=new we(e);(114===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),r=t,this._onKeyDown.fire(t)})),this._register(this._textArea.onKeyUp(e=>{const t=new we(e);this._onKeyUp.fire(t)})),this._register(this._textArea.onCompositionStart(e=>{const t=new Jm;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&r&&r.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===r.code||"ArrowLeft"===r.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}})),this._register(this._textArea.onCompositionUpdate(e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=Gm.readFromTextArea(this._textArea,this._textAreaState),i=Gm.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=Gm.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)})),this._register(this._textArea.onCompositionEnd(e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=Gm.readFromTextArea(this._textArea,this._textAreaState),t=Gm.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=Gm.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=Gm.readFromTextArea(this._textArea,this._textAreaState),i=Gm.deduceInput(this._textAreaState,t,2===this._OS);(0!==i.replacePrevCharCnt||1!==i.text.length||!ade(i.text.charCodeAt(0))&&127!==i.text.charCodeAt(0))&&(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||("insertFromPaste"===e.inputType?this._onPaste.fire({text:i.text,metadata:Km.INSTANCE.get(i.text)}):this._onType.fire(i)))})),this._register(this._textArea.onCut(e=>{this._logService.trace("TextAreaInput#onCut",e),this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(e=>{this._logService.trace("TextAreaInput#onCopy",e),this._ensureClipboardGetsEditorSelection(e)})),this._register(this._textArea.onPaste(e=>{if(this._logService.trace("TextAreaInput#onPaste",e),this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=jm.getTextData(e.clipboardData);this._logService.trace("TextAreaInput#onPaste with id : ",i?.id," with text.length: ",t.length),t&&(i=i||Km.INSTANCE.get(t),this._logService.trace("TextAreaInput#onPaste (before onPaste)"),this._onPaste.fire({text:t,metadata:i}))})),this._register(this._textArea.onFocus(()=>{const e=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!e&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new ft(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return ehe(this._textArea.ownerDocument,"selectionchange",t=>{if(qc.onSelectionChange(),!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100)return;if(!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),d=this._host.deduceModelPosition(l[0],l[1],l[2]),c=this._textAreaState.deduceEditorPosition(a),h=this._host.deduceModelPosition(c[0],c[1],c[2]),u=new fr(d.lineNumber,d.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(u)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.isWrittenToTextArea(this._textArea,this._hasFocus)||this._logService.trace(`writeTextAreaState(reason: ${e})`),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){!this._accessibilityService.isScreenReaderOptimized()&&"render"===e||this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy();let i;this._logService.getLevel()===js.Trace&&(i=Zm());const n={version:1,id:i,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};Km.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,n),e.preventDefault(),e.clipboardData&&jm.setTextData(e.clipboardData,t.text,t.html,n),this._logService.trace("TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ",i," with text.length: ",t.text.length)}},ef=Ym([Qm(4,Fc),Qm(5,Ks)],ef),tf=class extends Ie{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new je),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new zm(this._actual,"keydown")).event,this.onKeyPress=this._register(new zm(this._actual,"keypress")).event,this.onKeyUp=this._register(new zm(this._actual,"keyup")).event,this.onCompositionStart=this._register(new zm(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new zm(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new zm(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new zm(this._actual,"beforeinput")).event,this.onInput=this._register(new zm(this._actual,"input")).event,this.onCut=this._register(new zm(this._actual,"cut")).event,this.onCopy=this._register(new zm(this._actual,"copy")).event,this.onPaste=this._register(new zm(this._actual,"paste")).event,this.onFocus=this._register(new zm(this._actual,"focus")).event,this.onBlur=this._register(new zm(this._actual,"blur")).event,this._register(this.onKeyDown(()=>qc.onKeyDown())),this._register(this.onBeforeInput(()=>qc.onBeforeInput())),this._register(this.onInput(()=>qc.onInput())),this._register(this.onKeyUp(()=>qc.onKeyUp())),this._register(ehe(this._actual,Xm.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=bhe(this._actual);return e?e.activeElement===this._actual:!!this._actual.isConnected&&vhe()===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const s=bhe(n);o=s?s.activeElement:vhe();const r=pn(o),a=o===n,l=n.selectionStart,d=n.selectionEnd;if(a&&l===t&&d===i)c&&r.parent!==r&&n.focus();else{if(a)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(c&&r.parent!==r&&n.focus());try{const e=function(e){const t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(Fae){}}}},nf=class extends Bm{constructor(e,t,i){super(e,t,i),this._register(pm.addTarget(this.viewHelper.linesContentDomNode)),this._register(ehe(this.viewHelper.linesContentDomNode,gm.Tap,e=>this.onTap(e))),this._register(ehe(this.viewHelper.linesContentDomNode,gm.Change,e=>this.onChange(e))),this._register(ehe(this.viewHelper.linesContentDomNode,gm.Contextmenu,e=>this._onContextMenu(new fp(e,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(ehe(this.viewHelper.linesContentDomNode,"pointerdown",e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"}));const n=new bp(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,e=>this._onMouseMove(e))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>this._onMouseDown(e,t)))}onTap(e){e.initialTarget&&this.viewHelper.linesContentDomNode.contains(e.initialTarget)&&(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),"pen"===this._lastPointerType&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){const i=this._createMouseTarget(new fp(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===i.type&&null!==i.detail.injectedText})}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}},of=class extends Bm{constructor(e,t,i){super(e,t,i),this._register(pm.addTarget(this.viewHelper.linesContentDomNode)),this._register(ehe(this.viewHelper.linesContentDomNode,gm.Tap,e=>this.onTap(e))),this._register(ehe(this.viewHelper.linesContentDomNode,gm.Change,e=>this.onChange(e))),this._register(ehe(this.viewHelper.linesContentDomNode,gm.Contextmenu,e=>this._onContextMenu(new fp(e,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new fp(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent(Xm.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}},sf=class extends Ie{constructor(e,t,i){super(),(U||ne&&K)&&oe.pointerEvents?this.handler=this._register(new nf(e,t,i)):r.TouchEvent?this.handler=this._register(new of(e,t,i)):this.handler=this._register(new Bm(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}},rf=class{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Xl.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new to(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(86)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(86)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){const t=this.configuration.options,i=W&&t.get(121),n=t.get(28),o=t.get(171);e.middleButton&&!i?o||this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey||n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Xl.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Xl.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Xl.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Xl.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Xl.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Xl.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Xl.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Xl.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Xl.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Xl.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Xl.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Xl.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Xl.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}},lf=class{constructor(e){this._lineFactory=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new y("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i){const i=t-e+1;return this._rendLineNumberStart-=i,null}if(e>n)return null;let o=0,s=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===s?(o=i,s=1):s++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}return this._lines.splice(o,s)}onLinesChanged(e,t){const i=e+t-1;if(0===this.getCount())return!1;const n=this.getStartLineNumber(),o=this.getEndLineNumber();let s=!1;for(let r=e;r<=i;r++)r>=n&&r<=o&&(this._lines[r-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let c=0;c<i;c++)s[c]=this._lineFactory.createLine();const r=e-this._rendLineNumberStart,a=this._lines.slice(0,r),l=this._lines.slice(r,this._lines.length-i),d=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(s).concat(l),d}onTokensChanged(e){if(0===this.getCount())return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let n=!1;for(let o=0,s=e.length;o<s;o++){const s=e[o];if(s.toLineNumber<t||s.fromLineNumber>i)continue;const r=Math.max(t,s.fromLineNumber),a=Math.min(i,s.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}},df=class{constructor(e,t){this._viewContext=e,this._lineFactory=t,this.domNode=this._createDomNode(),this._linesCollection=new lf(this._lineFactory)}_createDomNode(){const e=Fge(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(165)}onFlushed(e,t){if(t){const e=this._linesCollection.getStartLineNumber(),t=this._linesCollection.getEndLineNumber();for(let i=e;i<=t;i++)this._linesCollection.getLine(i).getDomNode()?.remove()}return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;i<n;i++)t[i].getDomNode()?.remove();return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,n=t.length;i<n;i++)t[i].getDomNode()?.remove();return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){const t=this._linesCollection._get(),i=new cf(this.domNode.domNode,this._lineFactory,e,this._viewContext),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}},cf=class e{constructor(e,t,i,n){this._domNode=e,this._lineFactory=t,this._viewportData=i,this._viewContext=n}render(e,t,i,n){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let e=t;e<=i;e++)o.lines[e-t]=this._lineFactory.createLine();return this._finishRendering(o,!0,n),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),n,t),o.rendLineNumberStart>t){const e=t,s=Math.min(i,o.rendLineNumberStart-1);e<=s&&(this._insertLinesBefore(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart<t){const e=Math.min(o.linesLength,t-o.rendLineNumberStart);e>0&&(this._removeLinesBefore(o,e),o.linesLength-=e)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const e=o.rendLineNumberStart+o.linesLength,s=i;e<=s&&(this._insertLinesAfter(o,e,s,n,t),o.linesLength+=s-e+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const e=Math.max(0,i-o.rendLineNumberStart+1),t=o.linesLength-1-e+1;t>0&&(this._removeLinesAfter(o,t),o.linesLength-=t)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let a=t;a<=i;a++){const e=s+a;r[a].layoutLine(e,n[e-o],this._lineHeightForLineNumber(e))}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let a=t;a<=i;a++)s[r++]=this._lineFactory.createLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++)e.lines[i].getDomNode()?.remove();e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,o){const s=[];let r=0;for(let a=t;a<=i;a++)s[r++]=this._lineFactory.createLine();e.lines=e.lines.concat(s)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let n=0;n<t;n++)e.lines[i+n].getDomNode()?.remove();e.lines.splice(i,t)}_finishRenderingNewLines(t,i,n,o){e._ttPolicy&&(n=e._ttPolicy.createHTML(n));const s=this._domNode.lastChild;i||!s?this._domNode.innerHTML=n:s.insertAdjacentHTML("afterend",n);let r=this._domNode.lastChild;for(let e=t.linesLength-1;e>=0;e--){const i=t.lines[e];o[e]&&(i.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(t,i,n){const o=document.createElement("div");e._ttPolicy&&(i=e._ttPolicy.createHTML(i)),o.innerHTML=i;for(let e=0;e<t.linesLength;e++){const i=t.lines[e];if(n[e]){const e=o.firstChild;i.getDomNode().replaceWith(e),i.setDomNode(e)}}}_finishRendering(t,i,n){const o=e._sb,s=t.linesLength,r=t.lines,a=t.rendLineNumberStart,l=[];{o.reset();let e=!1;for(let t=0;t<s;t++){const i=r[t];if(l[t]=!1,i.getDomNode())continue;const s=t+a;i.renderLine(s,n[t],this._lineHeightForLineNumber(s),this._viewportData,o)&&(l[t]=!0,e=!0)}e&&this._finishRenderingNewLines(t,i,o.build(),l)}{o.reset();let e=!1;const i=[];for(let t=0;t<s;t++){const s=r[t];if(i[t]=!1,l[t])continue;const d=t+a;s.renderLine(d,n[t],this._lineHeightForLineNumber(d),this._viewportData,o)&&(i[t]=!0,e=!0)}e&&this._finishRenderingInvalidLines(t,o.build(),i)}}_lineHeightForLineNumber(e){return this._viewContext.viewLayout.getLineHeightForLineNumber(e)}},(af=cf)._ttPolicy=Bpe("editorViewLayer",{createHTML:e=>e}),af._sb=new _a(1e5),hf=class extends Sp{constructor(e){super(e),this._dynamicOverlays=[],this._isFocused=!1,this._visibleLines=new df(this._context,{createLine:()=>new uf(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;const t=this._context.configuration.options.get(59);Wge(this.domNode,t),this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._context.configuration.options.get(59);return Wge(this.domNode,t),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){const t=this._dynamicOverlays.filter(e=>e.shouldRender());for(let i=0,n=t.length;i<n;i++){const n=t[i];n.prepareRender(e),n.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}},uf=class{constructor(e){this._dynamicOverlays=e,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=Fge(e)}onContentChanged(){}onTokensChanged(){}renderLine(e,t,i,n,o){let s="";for(let r=0,a=this._dynamicOverlays.length;r<a;r++)s+=this._dynamicOverlays[r].render(n.startLineNumber,e);return this._renderedContent!==s&&(this._renderedContent=s,o.appendString('<div style="top:'),o.appendString(String(t)),o.appendString("px;height:"),o.appendString(String(i)),o.appendString("px;line-height:"),o.appendString(String(i)),o.appendString('px;">'),o.appendString(s),o.appendString("</div>"),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i),this._domNode.setLineHeight(i))}},gf=class extends hf{constructor(e){super(e),this._contentWidth=this._context.configuration.options.get(165).contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){return this._contentWidth=this._context.configuration.options.get(165).contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}},pf=class extends hf{constructor(e){super(e);const t=this._context.configuration.options;this._contentLeft=t.get(165).contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Wge(this.domNode,t.get(59))}onConfigurationChanged(e){const t=this._context.configuration.options;return Wge(this.domNode,t.get(59)),this._contentLeft=t.get(165).contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}},mf=class e{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(t){return e.convertViewToModelMouseTarget(t,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),5!==i.type&&8!==i.type||(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new to(e.afterLineNumber,1)).lineNumber}}},ff=class extends Sp{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=Fge(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const t=this._context.configuration.options.get(165),i=t.contentWidth-t.verticalScrollbarWidth;this.contentWidth!==i&&(this.contentWidth=i,e=!0);const n=t.contentLeft;return this.contentLeft!==n&&(this.contentLeft=n,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;const i=e.getDecorationsInViewport();for(const n of i){if(!n.options.blockClassName)continue;let i,o,s=this.blocks[t];s||(s=this.blocks[t]=Fge(document.createElement("div")),this.domNode.appendChild(s)),n.options.blockIsAfterEnd?(i=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!1),o=e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0)):(i=e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!0),o=n.range.isEmpty()&&!n.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(n.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(n.range.endLineNumber,!0));const[r,a,l,d]=n.options.blockPadding??[0,0,0,0];s.setClassName("blockDecorations-block "+n.options.blockClassName),s.setLeft(this.contentLeft-d),s.setWidth(this.contentWidth+d+a),s.setTop(i-e.scrollTop-r),s.setHeight(o-i+r+l),t++}for(let n=t;n<this.blocks.length;n++)this.blocks[n].domNode.remove();this.blocks.length=t}},_f=class extends Sp{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Fge(document.createElement("div")),xp.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Fge(document.createElement("div")),xp.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new bf(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,o){this._widgets[e.getId()].setPosition(t,i,n,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.remove(),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}},bf=class{constructor(e,t,i){this._primaryAnchor=new vf(null,null),this._secondaryAnchor=new vf(null,null),this._context=e,this._viewDomNode=t,this._actual=i;const n=this._context.configuration.options,o=n.get(165),s=n.get(4);this.domNode=Fge(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=!!this._actual.allowEditorOverflow&&s,this.suppressMouseDown=this._actual.suppressMouseDown||!1,this._fixedOverflowWidgets=n.get(51),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(e.hasChanged(165)){const e=t.get(165);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new vf(null,null);const n=t.model.validatePosition(e);return t.coordinatesConverter.modelPositionIsVisible(n)?new vf(e,t.coordinatesConverter.convertModelPositionToViewPosition(n,i??void 0)):new vf(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?t?.innerWidth||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const o=e.top,s=o,r=e.top+e.height,a=o-i,l=s>=i,d=r,c=n.viewportHeight-r>=i;let h=e.left;return h+t>n.scrollLeft+n.viewportWidth&&(h=n.scrollLeft+n.viewportWidth-t),h<n.scrollLeft&&(h=n.scrollLeft),{fitsAbove:l,aboveTop:a,fitsBelow:c,belowTop:d,left:h}}_layoutHorizontalSegmentInPage(e,t,i,n){const o=Math.max(15,t.left-n),s=Math.min(t.left+t.width+n,e.width-15),r=this._viewDomNode.domNode.ownerDocument.defaultView;let a=t.left+i-(r?.scrollX??0);if(a+n>s){const e=a-(s-n);a-=e,i-=e}if(a<o){const e=a-o;a-=e,i-=e}return[i,a]}_layoutBoxInPage(e,t,i,n){const o=e.top-i,s=e.top+e.height,r=lhe(this._viewDomNode.domNode),a=this._viewDomNode.domNode.ownerDocument,l=a.defaultView,d=r.top+o-(l?.scrollY??0),c=r.top+s-(l?.scrollY??0),h=rhe(a.body),[u,g]=this._layoutHorizontalSegmentInPage(h,r,e.left-n.scrollLeft+this._contentLeft,t),p=d>=22,m=c+i<=h.height-22;return this._fixedOverflowWidgets?{fitsAbove:p,aboveTop:Math.max(d,22),fitsBelow:m,belowTop:c,left:g}:{fitsAbove:p,aboveTop:o,fitsBelow:m,belowTop:s,left:u}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new wf(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){return{primary:t(this._primaryAnchor.viewPosition,this._affinity),secondary:t(this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,this._affinity)};function t(t,i){if(!t)return null;const n=e.visibleRangeForPosition(t);if(!n)return null;const o=1===t.column&&3===i?0:n.left;return new Cf(e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop,o,e.getLineHeightForLineNumber(t.lineNumber))}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(59);let o=t.left;return o=o<e.left?Math.max(o,e.left-i+n.typicalFullwidthCharacterWidth):Math.min(o,e.left+i-n.typicalFullwidthCharacterWidth),new Cf(e.top,o,e.height)}_prepareRenderWidget(e){if(!this._preference||0===this._preference.length)return null;const{primary:t,secondary:i}=this._getAnchorsCoordinates(e);if(!t)return{kind:"offViewport",preserveFocus:this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)};if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"==typeof this._actual.beforeRender&&(e=Vpe(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{const e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}const n=this._reduceAnchorCoordinates(t,i,this._cachedDomNodeOffsetWidth);let o;o=this.allowEditorOverflow?this._layoutBoxInPage(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(n,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let s=1;s<=2;s++)for(const e of this._preference)if(1===e){if(!o)return null;if(2===s||o.fitsAbove)return{kind:"inViewport",coordinate:new wf(o.aboveTop,o.left),position:1}}else{if(2!==e)return this.allowEditorOverflow?{kind:"inViewport",coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new wf(n.top,n.left)),position:0}:{kind:"inViewport",coordinate:new wf(n.top,n.left),position:0};if(!o)return null;if(2===s||o.fitsBelow)return{kind:"inViewport",coordinate:new wf(o.belowTop,o.left),position:2}}return null}onBeforeRender(e){this._primaryAnchor.viewPosition&&this._preference&&(this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||"offViewport"===this._renderData.kind)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,"offViewport"===this._renderData?.kind&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&Vpe(this._actual.afterRender,this._actual,null,null));this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&Vpe(this._actual.afterRender,this._actual,this._renderData.position,this._renderData.coordinate)}},vf=class{constructor(e,t){this.modelPosition=e,this.viewPosition=t}},wf=class{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}},Cf=class{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}},yf=class extends yp{},Sf=eue("themeService"),xf={ThemingContribution:"base.contributions.theming"},kf=new class extends Ie{constructor(){super(),this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=this._register(new je)}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Dle(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}},ts.add(xf.ThemingContribution,kf),Lf=class extends Ie{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(e=>this.onThemeChange(e)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}},Df=mpe("editor.lineHighlightBackground",null,Vae(610,"Background color for the highlight of line at the cursor position.")),If=mpe("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ch},Vae(611,"Background color for the border around the line at the cursor position.")),mpe("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},Vae(612,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:hh,hcLight:hh},Vae(613,"Background color of the border around highlighted ranges.")),mpe("editor.symbolHighlightBackground",{dark:Bh,light:Bh,hcDark:null,hcLight:null},Vae(614,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:hh,hcLight:hh},Vae(615,"Background color of the border around highlighted symbols.")),Nf=mpe("editorCursor.foreground",{dark:"#AEAFAD",light:eh.black,hcDark:eh.white,hcLight:"#0F4A85"},Vae(616,"Color of the editor cursor.")),Ef=mpe("editorCursor.background",null,Vae(617,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Mf=mpe("editorMultiCursor.primary.foreground",Nf,Vae(618,"Color of the primary editor cursor when multiple cursors are present.")),Tf=mpe("editorMultiCursor.primary.background",Ef,Vae(619,"The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),Rf=mpe("editorMultiCursor.secondary.foreground",Nf,Vae(620,"Color of secondary editor cursors when multiple cursors are present.")),Of=mpe("editorMultiCursor.secondary.background",Ef,Vae(621,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),Af=mpe("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},Vae(622,"Color of whitespace characters in the editor.")),Pf=mpe("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:eh.white,hcLight:"#292929"},Vae(623,"Color of editor line numbers.")),Ff=mpe("editorIndentGuide.background",Af,Vae(624,"Color of the editor indentation guides."),!1,Vae(625,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Wf=mpe("editorIndentGuide.activeBackground",Af,Vae(626,"Color of the active editor indentation guides."),!1,Vae(627,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),Bf=mpe("editorIndentGuide.background1",Ff,Vae(628,"Color of the editor indentation guides (1).")),Vf=mpe("editorIndentGuide.background2","#00000000",Vae(629,"Color of the editor indentation guides (2).")),Hf=mpe("editorIndentGuide.background3","#00000000",Vae(630,"Color of the editor indentation guides (3).")),zf=mpe("editorIndentGuide.background4","#00000000",Vae(631,"Color of the editor indentation guides (4).")),Uf=mpe("editorIndentGuide.background5","#00000000",Vae(632,"Color of the editor indentation guides (5).")),Kf=mpe("editorIndentGuide.background6","#00000000",Vae(633,"Color of the editor indentation guides (6).")),qf=mpe("editorIndentGuide.activeBackground1",Wf,Vae(634,"Color of the active editor indentation guides (1).")),jf=mpe("editorIndentGuide.activeBackground2","#00000000",Vae(635,"Color of the active editor indentation guides (2).")),$f=mpe("editorIndentGuide.activeBackground3","#00000000",Vae(636,"Color of the active editor indentation guides (3).")),Gf=mpe("editorIndentGuide.activeBackground4","#00000000",Vae(637,"Color of the active editor indentation guides (4).")),Zf=mpe("editorIndentGuide.activeBackground5","#00000000",Vae(638,"Color of the active editor indentation guides (5).")),Yf=mpe("editorIndentGuide.activeBackground6","#00000000",Vae(639,"Color of the active editor indentation guides (6).")),mpe("editorLineNumber.activeForeground",mpe("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:hh,hcLight:hh},Vae(640,"Color of editor active line number"),!1,Vae(641,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),Vae(642,"Color of editor active line number")),Qf=mpe("editorLineNumber.dimmedForeground",null,Vae(643,"Color of the final editor line when editor.renderFinalNewline is set to dimmed.")),Xf=mpe("editorRuler.foreground",{dark:"#5A5A5A",light:eh.lightgrey,hcDark:eh.white,hcLight:"#292929"},Vae(644,"Color of the editor rulers.")),mpe("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},Vae(645,"Foreground color of editor CodeLens")),mpe("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},Vae(646,"Background color behind matching brackets")),mpe("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ch,hcLight:ch},Vae(647,"Color for matching brackets boxes")),Jf=mpe("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},Vae(648,"Color of the overview ruler border.")),e_=mpe("editorOverviewRuler.background",null,Vae(649,"Background color of the editor overview ruler.")),mpe("editorGutter.background",wh,Vae(650,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),mpe("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:eh.fromHex("#fff").transparent(.8),hcLight:ch},Vae(651,"Border color of unnecessary (unused) source code in the editor.")),t_=mpe("editorUnnecessaryCode.opacity",{dark:eh.fromHex("#000a"),light:eh.fromHex("#0007"),hcDark:null,hcLight:null},Vae(652,"Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.")),mpe("editorGhostText.border",{dark:null,light:null,hcDark:eh.fromHex("#fff").transparent(.8),hcLight:eh.fromHex("#292929").transparent(.8)},Vae(653,"Border color of ghost text in the editor.")),i_=mpe("editorGhostText.foreground",{dark:eh.fromHex("#ffffff56"),light:eh.fromHex("#0007"),hcDark:null,hcLight:null},Vae(654,"Foreground color of the ghost text in the editor.")),mpe("editorGhostText.background",null,Vae(655,"Background color of the ghost text in the editor.")),n_=mpe("editorOverviewRuler.rangeHighlightForeground",new eh(new Qc(0,122,204,.6)),Vae(656,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),o_=mpe("editorOverviewRuler.errorForeground",{dark:new eh(new Qc(255,18,18,.7)),light:new eh(new Qc(255,18,18,.7)),hcDark:new eh(new Qc(255,50,50,1)),hcLight:"#B5200D"},Vae(657,"Overview ruler marker color for errors.")),s_=mpe("editorOverviewRuler.warningForeground",{dark:Ih,light:Ih,hcDark:Nh,hcLight:Nh},Vae(658,"Overview ruler marker color for warnings.")),r_=mpe("editorOverviewRuler.infoForeground",{dark:Eh,light:Eh,hcDark:Mh,hcLight:Mh},Vae(659,"Overview ruler marker color for infos.")),a_=mpe("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},Vae(660,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),l_=mpe("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},Vae(661,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),d_=mpe("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},Vae(662,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),c_=mpe("editorBracketHighlight.foreground4","#00000000",Vae(663,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),h_=mpe("editorBracketHighlight.foreground5","#00000000",Vae(664,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),u_=mpe("editorBracketHighlight.foreground6","#00000000",Vae(665,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),g_=mpe("editorBracketHighlight.unexpectedBracket.foreground",{dark:new eh(new Qc(255,18,18,.8)),light:new eh(new Qc(255,18,18,.8)),hcDark:new eh(new Qc(255,50,50,1)),hcLight:"#B5200D"},Vae(666,"Foreground color of unexpected brackets.")),p_=mpe("editorBracketPairGuide.background1","#00000000",Vae(667,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),m_=mpe("editorBracketPairGuide.background2","#00000000",Vae(668,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),f_=mpe("editorBracketPairGuide.background3","#00000000",Vae(669,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),__=mpe("editorBracketPairGuide.background4","#00000000",Vae(670,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),b_=mpe("editorBracketPairGuide.background5","#00000000",Vae(671,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),v_=mpe("editorBracketPairGuide.background6","#00000000",Vae(672,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),w_=mpe("editorBracketPairGuide.activeBackground1","#00000000",Vae(673,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),C_=mpe("editorBracketPairGuide.activeBackground2","#00000000",Vae(674,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),y_=mpe("editorBracketPairGuide.activeBackground3","#00000000",Vae(675,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),S_=mpe("editorBracketPairGuide.activeBackground4","#00000000",Vae(676,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),x_=mpe("editorBracketPairGuide.activeBackground5","#00000000",Vae(677,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),k_=mpe("editorBracketPairGuide.activeBackground6","#00000000",Vae(678,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides.")),mpe("editorUnicodeHighlight.border",Ih,Vae(679,"Border color used to highlight unicode characters.")),mpe("editorUnicodeHighlight.background",Dh,Vae(680,"Background color used to highlight unicode characters.")),Upe((e,t)=>{const i=e.getColor(wh),n=e.getColor(Df),o=n&&!n.isTransparent()?n:i;o&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${o}; }`)}),L_=class extends yf{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(165);this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new fr(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=new Set;for(const o of this._selections)t.add(o.positionLineNumber);const i=Array.from(t);i.sort((e,t)=>e-t),Zde(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);const n=this._selections.every(e=>e.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=[];for(let s=t;s<=i;s++)n[s-t]="";if(this._wordWrap){const o=this._renderOne(e,!1);for(const e of this._cursorLineNumbers){const s=this._context.viewModel.coordinatesConverter,r=s.convertViewPositionToModelPosition(new to(e,1)).lineNumber,a=s.convertModelPositionToViewPosition(new to(r,1)).lineNumber,l=s.convertModelPositionToViewPosition(new to(r,this._context.viewModel.model.getLineMaxColumn(r))).lineNumber,d=Math.max(a,t),c=Math.min(l,i);for(let e=d;e<=c;e++)n[e-t]=o}}const o=this._renderOne(e,!0);for(const s of this._cursorLineNumbers)s<t||s>i||(n[s-t]=o);this._renderData=n}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}},D_=class extends L_{_renderOne(e,t){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-both":"")+(t?" current-line-exact":"")}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}},I_=class extends L_{_renderOne(e,t){return`<div class="${"current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")+(this._shouldRenderInMargin()&&t?" current-line-exact-margin":"")}" style="width:${this._contentLeft}px"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}},Upe((e,t)=>{const i=e.getColor(Df);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(If)){const i=e.getColor(If);i&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),Npe(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}}),N_=class extends yf{constructor(e){super(),this._context=e,this._typicalHalfwidthCharacterWidth=this._context.configuration.options.get(59).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._typicalHalfwidthCharacterWidth=this._context.configuration.options.get(59).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],n=0;for(let a=0,l=t.length;a<l;a++){const e=t[a];e.options.className&&(i[n++]=e)}i=i.sort((e,t)=>{if(e.options.zIndex<t.options.zIndex)return-1;if(e.options.zIndex>t.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return i<n?-1:i>n?1:mr.compareRangesUsingStarts(e.range,t.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let a=o;a<=s;a++)r[a-o]="";this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let s=0,r=t.length;s<r;s++){const e=t[s];if(!e.options.isWholeLine)continue;const r='<div class="cdr '+e.options.className+'" style="left:0;width:100%;"></div>',a=Math.max(e.range.startLineNumber,n),l=Math.min(e.range.endLineNumber,o);for(let t=a;t<=l;t++)i[t-n]+=r}}_renderNormalDecorations(e,t,i){const n=e.visibleRange.startLineNumber;let o=null,s=!1,r=null,a=!1;for(let l=0,d=t.length;l<d;l++){const d=t[l];if(d.options.isWholeLine)continue;const c=d.options.className,h=Boolean(d.options.showIfCollapsed);let u=d.range;h&&1===u.endColumn&&u.endLineNumber!==u.startLineNumber&&(u=new mr(u.startLineNumber,u.startColumn,u.endLineNumber-1,this._context.viewModel.getLineMaxColumn(u.endLineNumber-1))),o===c&&s===h&&mr.areIntersectingOrTouching(r,u)?r=mr.plusRange(r,u):(null!==o&&this._renderNormalDecoration(e,r,o,a,s,n,i),o=c,s=h,r=u,a=d.options.shouldFillLineOnLineBreak??!1)}null!==o&&this._renderNormalDecoration(e,r,o,a,s,n,i)}_renderNormalDecoration(e,t,i,n,o,s,r){const a=e.linesVisibleRangesForRange(t,"findMatch"===i);if(a)for(let l=0,d=a.length;l<d;l++){const e=a[l];if(e.outsideRenderedLine)continue;const t=e.lineNumber-s;if(o&&1===e.ranges.length){const t=e.ranges[0];if(t.width<this._typicalHalfwidthCharacterWidth){const i=Math.round(t.left+t.width/2),n=Math.max(0,Math.round(i-this._typicalHalfwidthCharacterWidth/2));e.ranges[0]=new Ip(n,this._typicalHalfwidthCharacterWidth)}}for(let o=0,s=e.ranges.length;o<s;o++){const a=n&&e.continuesOnNextLine&&1===s,l=e.ranges[o],d='<div class="cdr '+i+'" style="left:'+String(l.left)+"px;width:"+(a?"100%;":String(l.width)+"px;")+'"></div>';r[t]+=d}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}},E_=class extends Sp{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(117),r=o.get(83),a=o.get(49),l=o.get(120),d=o.get(158),c={listenOnDomNode:i.domNode,className:"editor-scrollable "+zpe(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:s.scrollByPage,inertialScroll:d};this.scrollbar=this._register(new Mm(t.domNode,c,this._context.viewLayout.getScrollable())),xp.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=Fge(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const h=(e,t,i)=>{const n={};{const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(ehe(i.domNode,"scroll",e=>h(i.domNode,0,!0))),this._register(ehe(t.domNode,"scroll",e=>h(t.domNode,0,!1))),this._register(ehe(n.domNode,"scroll",e=>h(n.domNode,0,!1))),this._register(ehe(this.scrollbarDomNode.domNode,"scroll",e=>h(this.scrollbarDomNode.domNode,0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(165);this.scrollbarDomNode.setLeft(t.contentLeft),"right"===e.get(81).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(117)||e.hasChanged(83)||e.hasChanged(49)){const e=this._context.configuration.options,t=e.get(117),i=e.get(83),n=e.get(49),o=e.get(120),s={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(165)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+zpe(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}},M_=class{constructor(e,t,i,n,o){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=o??0}},T_=class{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}},R_=class{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}},O_=class extends yf{_render(e,t,i){const n=[];for(let r=e;r<=t;r++)n[r-e]=new R_;if(0===i.length)return n;i.sort((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1);let o=null,s=0;for(let r=0,a=i.length;r<a;r++){const a=i[r],l=a.className,d=a.zIndex;let c=Math.max(a.startLineNumber,e)-e;const h=Math.min(a.endLineNumber,t)-e;o===l?(c=Math.max(s+1,c),s=Math.max(s,h)):(o=l,s=h);for(let e=c;e<=s;e++)n[e].add(new T_(l,d,a.tooltip))}return n}},A_=class extends Sp{constructor(e){super(e),this._widgets={},this._context=e;const t=this._context.configuration.options,i=t.get(165);this.domNode=Fge(document.createElement("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}addWidget(e){const t=Fge(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:t,renderInfo:null},t.setPosition("absolute"),t.setDisplay("none"),t.setAttribute("widgetId",e.getId()),this.domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return!(i.preference.lane===t.lane&&i.preference.zIndex===t.zIndex&&mr.equalsRange(i.preference.range,t.range)||(i.preference=t,this.setShouldRender(),0))}removeWidget(e){const t=e.getId();if(this._widgets[t]){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){const i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o=e.getDecorationsInViewport();for(const s of o){const e=s.options.glyphMarginClassName;if(!e)continue;const o=Math.max(s.range.startLineNumber,i),r=Math.min(s.range.endLineNumber,n),a=s.options.glyphMargin?.position??Yr.Center,l=s.options.zIndex??0;for(let i=o;i<=r;i++){const n=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new to(i,0)),o=this._context.viewModel.glyphLanes.getLanesAtLine(n.lineNumber).indexOf(a);t.push(new P_(i,o,l,e))}}}_collectWidgetBasedGlyphRenderRequest(e,t){const i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(const o of Object.values(this._widgets)){const e=o.preference.range,{startLineNumber:s,endLineNumber:r}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(mr.lift(e));if(!s||!r||r<i||s>n)continue;const a=Math.max(s,i),l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new to(a,0)),d=this._context.viewModel.glyphLanes.getLanesAtLine(l.lineNumber).indexOf(o.preference.lane);t.push(new F_(a,d,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((e,t)=>e.lineNumber===t.lineNumber?e.laneIndex===t.laneIndex?e.zIndex===t.zIndex?t.type===e.type?0===e.type&&0===t.type?e.className<t.className?-1:1:0:t.type-e.type:t.zIndex-e.zIndex:e.laneIndex-t.laneIndex:e.lineNumber-t.lineNumber),t}prepareRender(e){if(!this._glyphMargin)return void(this._decorationGlyphsToRender=[]);for(const n of Object.values(this._widgets))n.renderInfo=null;const t=new Pi(this._collectSortedGlyphRenderRequests(e)),i=[];for(;t.length>0;){const e=t.peek();if(!e)break;const n=t.takeWhile(t=>t.lineNumber===e.lineNumber&&t.laneIndex===e.laneIndex);if(!n||0===n.length)break;const o=n[0];if(0===o.type){const e=[];for(const t of n){if(t.zIndex!==o.zIndex||t.type!==o.type)break;0!==e.length&&e[e.length-1]===t.className||e.push(t.className)}i.push(o.accept(e.join(" ")))}else o.widget.renderInfo={lineNumber:o.lineNumber,laneIndex:o.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const e of Object.values(this._widgets))e.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;)this._managedDomNodes.pop()?.domNode.remove();return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(i.renderInfo){const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}else i.domNode.setDisplay("none");for(let i=0;i<this._decorationGlyphsToRender.length;i++){const n=this._decorationGlyphsToRender[i],o=n.lineNumber,s=e.viewportData.relativeVerticalOffset[o-e.viewportData.startLineNumber],r=this._glyphMarginLeft+n.laneIndex*this._lineHeight;let a;i<this._managedDomNodes.length?a=this._managedDomNodes[i]:(a=Fge(document.createElement("div")),this._managedDomNodes.push(a),this.domNode.appendChild(a));const l=this._context.viewLayout.getLineHeightForLineNumber(o);a.setClassName("cgmr codicon "+n.combinedClassName),a.setPosition("absolute"),a.setTop(s),a.setLeft(r),a.setWidth(t),a.setHeight(l)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;)this._managedDomNodes.pop()?.domNode.remove()}},P_=class{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new W_(this.lineNumber,this.laneIndex,e)}},F_=class{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=1}},W_=class{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}},(B_=class e{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(e.assertInvariants){if(this._prevFindLastPredicate)for(const e of this._array)if(this._prevFindLastPredicate(e)&&!t(e))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");this._prevFindLastPredicate=t}const i=jpe(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,-1===i?void 0:this._array[i]}}).assertInvariants=!1,V_=class extends Ie{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}},function(e){e[e.Disabled=0]="Disabled",e[e.EnabledForActive=1]="EnabledForActive",e[e.Enabled=2]="Enabled"}(H_||(H_={})),z_=class{constructor(e,t,i,n,o,s){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=s,-1!==e==(-1!==t))throw new Error}},U_=class{constructor(e,t){this.top=e,this.endColumn=t}},K_=class extends V_{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return Xpe(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new y("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,d=-1;const c=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,d=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){l=t,d=e;break}}}};let h=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===h){h=-1,u=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){h=t,u=e;break}}}if(-1!==g&&(-2===g||g<e-1)){g=-1,p=-1;for(let t=e;t<n;t++){const e=this._computeIndentLevel(t);if(e>=0){g=t,p=e;break}}}};let f=0,_=!0,b=0,v=!0,w=0,C=0;for(let y=0;_||v;y++){const o=e-y,r=e+y;y>1&&(o<1||o<t)&&(_=!1),y>1&&(r>n||r>i)&&(v=!1),y>5e4&&(_=!1,v=!1);let g=-1;if(_&&o>=1){const e=this._computeIndentLevel(o-1);e>=0?(l=o-1,d=e,g=Math.ceil(e/this.textModel.getOptions().indentSize)):(c(o),g=this._getIndentLevelForWhitespaceLine(s,a,d))}let S=-1;if(v&&r<=n){const e=this._computeIndentLevel(r-1);e>=0?(h=r-1,u=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(m(r),S=this._getIndentLevelForWhitespaceLine(s,u,p))}if(0!==y){if(1===y){if(r<=n&&S>=0&&C+1===S){_=!1,f=r,b=r,w=S;continue}if(o>=1&&g>=0&&g-1===C){v=!1,f=o,b=o,w=g;continue}if(f=e,b=e,w=C,0===w)return{startLineNumber:f,endLineNumber:b,indent:w}}_&&(g>=w?f=o:_=!1),v&&(S>=w?b=r:v=!1)}else C=g}return{startLineNumber:f,endLineNumber:b,indent:w}}getLinesBracketGuides(e,t,i,n){const o=[];for(let d=e;d<=t;d++)o.push([]);const s=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new mr(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let r;i&&s.length>0&&(r=Kpe((e<=i.lineNumber&&i.lineNumber<=t?s:this.textModel.bracketPairs.getBracketPairsInRange(mr.fromPositions(i)).toArray()).filter(e=>mr.strictContainsPosition(e.range,i)),e=>!0)?.range);const a=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,l=new q_;for(const d of s){if(!d.closingBracketRange)continue;const i=r&&d.range.equalsRange(r);if(!i&&!n.includeInactive)continue;const s=l.getInlineClassName(d.nestingLevel,d.nestingLevelOfEqualBracketType,a)+(n.highlightActive&&i?" "+l.activeClassName:""),c=d.openingBracketRange.getStartPosition(),h=d.closingBracketRange.getStartPosition(),u=n.horizontalGuides===H_.Enabled||n.horizontalGuides===H_.EnabledForActive&&i;if(d.range.startLineNumber===d.range.endLineNumber){u&&o[d.range.startLineNumber-e].push(new z_(-1,d.openingBracketRange.getEndPosition().column,s,new U_(!1,h.column),-1,-1));continue}const g=this.getVisibleColumnFromPosition(h),p=this.getVisibleColumnFromPosition(d.openingBracketRange.getStartPosition()),m=Math.min(p,g,d.minVisibleColumnIndentation+1);let f=!1;jle(this.textModel.getLineContent(d.closingBracketRange.startLineNumber))<d.closingBracketRange.startColumn-1&&(f=!0);const _=Math.max(c.lineNumber,e),b=Math.min(h.lineNumber,t),v=f?1:0;for(let t=_;t<b+v;t++)o[t-e].push(new z_(m,-1,s,null,t===c.lineNumber?c.column:-1,t===h.lineNumber?h.column:-1));u&&(c.lineNumber>=e&&p>m&&o[c.lineNumber-e].push(new z_(m,-1,s,new U_(!1,c.column),-1,-1)),h.lineNumber<=t&&g>m&&o[h.lineNumber-e].push(new z_(m,-1,s,new U_(!f,h.column),-1,-1)))}for(const d of o)d.sort((e,t)=>e.visibleColumn-t.visibleColumn);return o}getVisibleColumnFromPosition(e){return br.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const n=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=Boolean(o&&o.offSide),r=new Array(t-e+1);let a=-2,l=-1,d=-2,c=-1;for(let h=e;h<=t;h++){const t=h-e,o=this._computeIndentLevel(h-1);if(o>=0)a=h-1,l=o,r[t]=Math.ceil(o/n.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=h-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==d&&(-2===d||d<h-1)){d=-1,c=-1;for(let e=h;e<i;e++){const t=this._computeIndentLevel(e);if(t>=0){d=e,c=t;break}}}r[t]=this._getIndentLevelForWhitespaceLine(s,l,c)}}return r}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return-1===t||-1===i?0:t<i?1+Math.floor(t/n.indentSize):t===i||e?Math.ceil(i/n.indentSize):1+Math.floor(i/n.indentSize)}},q_=class{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return"bracket-indent-guide lvl-"+e%30}},j_=class extends yf{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(166),n=t.get(59);this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(166),n=t.get(59);return this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();return!this._primaryPosition?.equals(t)&&(this._primaryPosition=t,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.scrollWidth,o=this._primaryPosition,s=this.getGuidesByLine(t,Math.min(i+1,this._context.viewModel.getLineCount()),o),r=[];for(let a=t;a<=i;a++){const i=a-t,o=s[i];let l="";const d=e.visibleRangeForPosition(new to(a,1))?.left??0;for(const t of o){const i=-1===t.column?d+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new to(a,t.column)).left;if(i>n||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const o=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",s=t.horizontalLine?(e.visibleRangeForPosition(new to(a,t.horizontalLine.endColumn))?.left??i+this._spaceWidth)-i:this._spaceWidth;l+=`<div class="core-guide ${t.className} ${o}" style="left:${i}px;width:${s}px"></div>`}r[i]=l}this._renderResult=r}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?H_.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?H_.EnabledForActive:H_.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,r=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);s=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),d=[];for(let c=e;c<=t;c++){const t=new Array;d.push(t);const i=n?n[c-e]:[],h=new Pi(i),u=o?o[c-e]:0;for(let e=1;e<=u;e++){const n=(e-1)*l+1,o=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===i.length)&&s<=c&&c<=r&&e===a;t.push(...h.takeWhile(e=>e.visibleColumn<n)||[]);const d=h.peek();d&&d.visibleColumn===n&&!d.horizontalLine||t.push(new z_(n,-1,"core-guide-indent lvl-"+(e-1)%30+(o?" indent-active":""),null,-1,-1))}t.push(...h.takeWhile(e=>!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}},Upe((e,t)=>{const i=[{bracketColor:a_,guideColor:p_,guideColorActive:w_},{bracketColor:l_,guideColor:m_,guideColorActive:C_},{bracketColor:d_,guideColor:f_,guideColorActive:y_},{bracketColor:c_,guideColor:__,guideColorActive:S_},{bracketColor:h_,guideColor:b_,guideColorActive:x_},{bracketColor:u_,guideColor:v_,guideColorActive:k_}],n=new q_,o=[{indentColor:Bf,indentColorActive:qf},{indentColor:Vf,indentColorActive:jf},{indentColor:Hf,indentColorActive:$f},{indentColor:zf,indentColorActive:Gf},{indentColor:Uf,indentColorActive:Zf},{indentColor:Kf,indentColorActive:Yf}],s=i.map(t=>{const i=e.getColor(t.bracketColor),n=e.getColor(t.guideColor),o=e.getColor(t.guideColorActive),s=Jpe(Jpe(n)??i?.transparent(.3)),r=Jpe(Jpe(o)??i);if(s&&r)return{guideColor:s,guideColorActive:r}}).filter(ule),r=o.map(t=>{const i=e.getColor(t.indentColor),n=e.getColor(t.indentColorActive),o=Jpe(i),s=Jpe(n);if(o&&s)return{indentColor:o,indentColorActive:s}}).filter(ule);if(s.length>0){for(let e=0;e<30;e++){const i=s[e%s.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let e=0;e<30;e++){const i=r[e%r.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${i.indentColor}; --indent-color-active: ${i.indentColorActive}; }`)}t.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),t.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}}),$_=class e extends yf{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new to(1,1),this._renderResult=null,this._activeModelLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(75);const t=e.get(76);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(109);const i=e.get(165);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeModelLineNumber!==this._lastCursorModelPosition.lineNumber&&(this._activeModelLineNumber=this._lastCursorModelPosition.lineNumber,i=!0),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new to(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?'<span class="relative-current-line-number">'+i+"</span>":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0||i===this._context.viewModel.getLineCount()?String(i):"":String(i)}prepareRender(t){if(0===this._renderLineNumbers)return void(this._renderResult=null);const i=W?this._lineHeight%2==0?" lh-even":" lh-odd":"",n=t.visibleRange.startLineNumber,o=t.visibleRange.endLineNumber,s=this._context.viewModel.getDecorationsInViewport(t.visibleRange).filter(e=>!!e.options.lineNumberClassName);s.sort((e,t)=>mr.compareRangesUsingEnds(e.range,t.range));let r=0;const a=this._context.viewModel.getLineCount(),l=[];for(let d=n;d<=o;d++){const t=d-n,o=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new to(d,1)).lineNumber;let c=this._getLineRenderLineNumber(d),h="";for(;r<s.length&&s[r].range.endLineNumber<d;)r++;for(let e=r;e<s.length;e++){const{range:t,options:i}=s[e];t.startLineNumber<=d&&(h+=" "+i.lineNumberClassName)}c||h?(d===a&&0===this._context.viewModel.getLineLength(d)&&("off"===this._renderFinalNewline&&(c=""),"dimmed"===this._renderFinalNewline&&(h+=" dimmed-line-number")),o===this._activeModelLineNumber&&(h+=" active-line-number"),l[t]=`<div class="${e.CLASS_NAME}${i}${h}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${c}</div>`):l[t]=""}this._renderResult=l}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}},$_.CLASS_NAME="line-numbers",Upe((e,t)=>{const i=e.getColor(Pf),n=e.getColor(Qf);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)}),G_="monaco-mouse-cursor-text",Z_=class{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}},Y_=class{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(59);this.renderWhitespace=i.get(113),this.experimentalWhitespaceRendering=i.get(47),this.renderControlCharacters=i.get(108),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(40),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(75),this.stopRenderingLineAfter=i.get(133),this.fontLigatures=i.get(60),this.verticalScrollbarSize=i.get(117).verticalScrollbarSize,this.useGpu="on"===i.get(46)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.experimentalWhitespaceRendering===e.experimentalWhitespaceRendering&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.useGpu===e.useGpu}},Q_=class{constructor(){this._currentVisibleRange=new mr(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}},X_=class{constructor(e,t,i,n,o,s,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}},J_=class{constructor(e,t,i,n,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,r=t[0].endLineNumber;for(let a=1,l=t.length;a<l;a++){const e=t[a];s=Math.min(s,e.startLineNumber),r=Math.max(r,e.endLineNumber)}this.minLineNumber=s,this.maxLineNumber=r}},eb=class e extends Sp{constructor(e,t,i){super(e);const n=this._context.configuration,o=this._context.configuration.options,s=o.get(59),r=o.get(166);this._lineHeight=o.get(75),this._typicalHalfwidthCharacterWidth=s.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=o.get(114),this._cursorSurroundingLines=o.get(35),this._cursorSurroundingLinesStyle=o.get(36),this._canUseLayerHinting=!o.get(39),this._viewLineOptions=new Y_(n,this._context.theme.type),this._linesContent=i,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new df(this._context,{createLine:()=>new Gp(t,this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,xp.write(this.domNode,8),this.domNode.setClassName(`view-lines ${G_}`),Wge(this.domNode,s),this._maxLineWidth=0,this._asyncUpdateLineWidths=new ft(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new ft(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new Q_,this._horizontalRevealRequest=null,this._stickyScrollEnabled=o.get(131).enabled,this._maxNumberStickyLines=o.get(131).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(166)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(59),n=t.get(166);return this._lineHeight=t.get(75),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(114),this._cursorSurroundingLines=t.get(35),this._cursorSurroundingLinesStyle=t.get(36),this._canUseLayerHinting=!t.get(39),this._stickyScrollEnabled=t.get(131).enabled,this._maxNumberStickyLines=t.get(131).maxLineCount,Wge(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(165)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Y_(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++)this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e,this._viewLineOptions.useGpu);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new X_(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new J_(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new to(n,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(n<o||n>s)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const a=this._context.viewModel.getLineMinColumn(n);return r<a&&(r=a),new to(n,r)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===Gp.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)if(e===this._visibleLines.getVisibleLine(n).getDomNode())return n;return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();if(e<t||e>i)return-1;const n=new Z_(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=mr.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const o=[];let s=0;const r=new Z_(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new to(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let c=n.startLineNumber;c<=n.endLineNumber;c++){if(c<l||c>d)continue;const e=c===n.startLineNumber?n.startColumn:1,h=c!==i,u=h?this._context.viewModel.getLineMaxColumn(c):n.endColumn,g=this._visibleLines.getVisibleLine(c).getVisibleRangesForRange(c,e,u,r);if(g){if(t&&c<i){const e=a;if(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new to(c+1,1)).lineNumber,e!==a){const t=g.ranges[g.ranges.length-1];t.width+=this._typicalHalfwidthCharacterWidth,this._context.viewModel.getTextDirection(e)===Qr.RTL&&(t.left-=this._typicalHalfwidthCharacterWidth)}}o[s++]=new Dp(g.outsideRenderedLine,c,Ip.from(g.ranges),h)}}return this._updateLineWidthsSlowIfDomDidLayout(r),0===s?null:o}_visibleRangesForLineRange(e,t,i){if(this.shouldRender())return null;if(e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;const n=new Z_(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),o}_lineIsRenderedRTL(e){return!(e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())&&this._visibleLines.getVisibleLine(e).isRenderedRTL()}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Ep(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=1,o=!0;for(let s=t;s<=i;s++){const t=this._visibleLines.getVisibleLine(s);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth(null)):o=!1}return o&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let o=i;o<=n;o++){const i=this._visibleLines.getVisibleLine(o);if(i.needsMonospaceFontCheck()){const n=i.getWidth(null);n>t&&(t=n,e=o)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=n;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||e.hasRTL||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),W&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,o,s){const r=e.top,a=e.height,l=r+a;let d,c,h;if(o&&o.length>0){let e=o[0].startLineNumber,t=o[0].endLineNumber;for(let i=1,n=o.length;i<n;i++){const n=o[i];e=Math.min(e,n.startLineNumber),t=Math.max(t,n.endLineNumber)}d=!1,c=this._context.viewLayout.getVerticalOffsetForLineNumber(e),h=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!n)return-1;d=!0,c=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),h=this._context.viewLayout.getVerticalOffsetForLineNumber(n.endLineNumber)+this._lineHeight}let u,g=0,p=0;if("mouse"!==t&&!i||"default"!==this._cursorSurroundingLinesStyle){const e=a/this._lineHeight,t=Math.max(this._cursorSurroundingLines,this._stickyScrollEnabled?this._maxNumberStickyLines:0),i=Math.min(e/2,t);g=i*this._lineHeight,p=Math.max(0,i-1)*this._lineHeight}else i||(g=this._lineHeight);if(i||0!==s&&4!==s||(p+=this._lineHeight),c-=g,h+=p,h-c>a){if(!d)return-1;u=c}else if(5===s||6===s)if(6===s&&r<=c&&h<=l)u=r;else{const e=c-Math.max(5*this._lineHeight,.2*a),t=h-a;u=Math.max(t,e)}else if(1===s||2===s)if(2===s&&r<=c&&h<=l)u=r;else{const e=(c+h)/2;u=Math.max(0,e-a/2)}else u=this._computeMinimumScrolling(r,l,c,h,3===s,4===s);return u}_computeScrollLeftToReveal(t){const i=this._context.viewLayout.getCurrentViewport(),n=this._context.configuration.options.get(165),o=i.left,s=o+i.width-n.verticalScrollbarWidth;let r=1073741824,a=0,l=!1;if("range"===t.type){l=this._lineIsRenderedRTL(t.lineNumber);const e=this._visibleRangesForLineRange(t.lineNumber,t.startColumn,t.endColumn);if(!e)return null;for(const t of e.ranges)r=Math.min(r,Math.round(t.left)),a=Math.max(a,Math.round(t.left+t.width))}else for(const e of t.selections){if(e.startLineNumber!==e.endLineNumber)return null;const t=this._visibleRangesForLineRange(e.startLineNumber,e.startColumn,e.endColumn);if(l||(l=this._lineIsRenderedRTL(e.startLineNumber)),!t)return null;for(const e of t.ranges)r=Math.min(r,Math.round(e.left)),a=Math.max(a,Math.round(e.left+e.width))}return t.minimalReveal||(r=Math.max(0,r-e.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),"selections"===t.type&&a-r>i.width?null:{scrollLeft:this._computeMinimumScrolling(o,s,r,a),maxHorizontalOffset:a,hasRTL:l}}_computeMinimumScrolling(e,t,i,n,o,s){o=!!o,s=!!s;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)<r?o?i:s?Math.max(0,n-r):i<e?i:n>t?Math.max(0,n-r):e:i}},eb.HORIZONTAL_EXTRA_PX=30,tb=class extends O_{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(165);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options.get(165);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let o=0,s=t.length;o<s;o++){const e=t[o],s=e.options.linesDecorationsClassName,r=e.options.zIndex;s&&(i[n++]=new M_(e.range.startLineNumber,e.range.endLineNumber,s,e.options.linesDecorationsTooltip??null,r));const a=e.options.firstLineDecorationClassName;a&&(i[n++]=new M_(e.range.startLineNumber,e.range.startLineNumber,a,e.options.linesDecorationsTooltip??null,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',s=[];for(let r=t;r<=i;r++){const e=r-t,i=n[e].getDecorations();let a="";for(const t of i){let e='<div class="cldr '+t.className;null!==t.tooltip&&(e+='" title="'+t.tooltip),e+=o,a+=e}s[e]=a}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}},(ib=nb=class e extends Sp{constructor(t){super(t);const i=this._context.configuration.options,n=i.get(165);this._canUseLayerHinting=!i.get(39),this._contentLeft=n.contentLeft,this._glyphMarginLeft=n.glyphMarginLeft,this._glyphMarginWidth=n.glyphMarginWidth,this._domNode=Fge(document.createElement("div")),this._domNode.setClassName(e.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Fge(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(e.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._canUseLayerHinting=!t.get(39),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}).CLASS_NAME="glyph-margin",ib.OUTER_CLASS_NAME="margin",ob=class extends O_{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let o=0,s=t.length;o<s;o++){const e=t[o],s=e.options.marginClassName,r=e.options.zIndex;s&&(i[n++]=new M_(e.range.startLineNumber,e.range.endLineNumber,s,null,r))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=[];for(let s=t;s<=i;s++){const e=s-t,i=n[e].getDecorations();let r="";for(const t of i)r+='<div class="cmdr '+t.className+'" style=""></div>';o[e]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}},(sb=rb=class e{constructor(t,i,n,o){this._rgba8Brand=void 0,this.r=e._clamp(t),this.g=e._clamp(i),this.b=e._clamp(n),this.a=e._clamp(o)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}).Empty=new sb(0,0,0,0),ab=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new je,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),Dle(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();const i=new lb(this,e,t);return this._factories.set(e,i),Dle(()=>{const t=this._factories.get(e);t&&t===i&&(this._factories.delete(e),t.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const t=this._factories.get(e);return!(t&&!t.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}},lb=class extends Ie{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}},cb=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}},hb=class{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}},ub=class{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}},function(e){e[e.Increase=0]="Increase",e[e.Decrease=1]="Decrease"}(gb||(gb={})),function(e){const t=new Map;t.set(0,go.symbolMethod),t.set(1,go.symbolFunction),t.set(2,go.symbolConstructor),t.set(3,go.symbolField),t.set(4,go.symbolVariable),t.set(5,go.symbolClass),t.set(6,go.symbolStruct),t.set(7,go.symbolInterface),t.set(8,go.symbolModule),t.set(9,go.symbolProperty),t.set(10,go.symbolEvent),t.set(11,go.symbolOperator),t.set(12,go.symbolUnit),t.set(13,go.symbolValue),t.set(15,go.symbolEnum),t.set(14,go.symbolConstant),t.set(15,go.symbolEnum),t.set(16,go.symbolEnumMember),t.set(17,go.symbolKeyword),t.set(28,go.symbolSnippet),t.set(18,go.symbolText),t.set(19,go.symbolColor),t.set(20,go.symbolFile),t.set(21,go.symbolReference),t.set(22,go.symbolCustomColor),t.set(23,go.symbolFolder),t.set(24,go.symbolTypeParameter),t.set(25,go.account),t.set(26,go.issues),t.set(27,go.tools),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for CompletionItemKind "+e),i=go.symbolProperty),i},e.toLabel=function(e){switch(e){case 0:return Vae(728,"Method");case 1:return Vae(729,"Function");case 2:return Vae(730,"Constructor");case 3:return Vae(731,"Field");case 4:return Vae(732,"Variable");case 5:return Vae(733,"Class");case 6:return Vae(734,"Struct");case 7:return Vae(735,"Interface");case 8:return Vae(736,"Module");case 9:return Vae(737,"Property");case 10:return Vae(738,"Event");case 11:return Vae(739,"Operator");case 12:return Vae(740,"Unit");case 13:return Vae(741,"Value");case 14:return Vae(742,"Constant");case 15:return Vae(743,"Enum");case 16:return Vae(744,"Enum Member");case 17:return Vae(745,"Keyword");case 18:return Vae(746,"Text");case 19:return Vae(747,"Color");case 20:return Vae(748,"File");case 21:return Vae(749,"Reference");case 22:return Vae(750,"Custom Color");case 23:return Vae(751,"Folder");case 24:return Vae(752,"Type Parameter");case 25:return Vae(753,"User");case 26:return Vae(754,"Issue");case 27:return Vae(755,"Tool");case 28:return Vae(756,"Snippet");default:return""}};const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",28),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),i.set("tool",27),e.fromString=function(e,t){let n=i.get(e);return void 0!==n||t||(n=9),n}}(pb||(pb={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(mb||(mb={})),fb=class{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return mr.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}},function(e){e[e.Code=1]="Code",e[e.Label=2]="Label"}(_b||(_b={})),bb=class e{static fromExtensionId(t){return new e(t,void 0,void 0)}constructor(e,t,i){this.extensionId=e,this.extensionVersion=t,this.providerId=i}toString(){let e="";return this.extensionId&&(e+=this.extensionId),this.extensionVersion&&(e+=`@${this.extensionVersion}`),this.providerId&&(e+=`:${this.providerId}`),0===e.length&&(e="unknown"),e}toStringWithoutVersion(){let e="";return this.extensionId&&(e+=this.extensionId),this.providerId&&(e+=`:${this.providerId}`),e}},function(e){e[e.Accepted=0]="Accepted",e[e.Rejected=1]="Rejected",e[e.Ignored=2]="Ignored"}(vb||(vb={})),function(e){e[e.Automatic=0]="Automatic",e[e.PasteAs=1]="PasteAs"}(wb||(wb={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(Cb||(Cb={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(yb||(yb={})),Sb={17:Vae(757,"array"),16:Vae(758,"boolean"),4:Vae(759,"class"),13:Vae(760,"constant"),8:Vae(761,"constructor"),9:Vae(762,"enumeration"),21:Vae(763,"enumeration member"),23:Vae(764,"event"),7:Vae(765,"field"),0:Vae(766,"file"),11:Vae(767,"function"),10:Vae(768,"interface"),19:Vae(769,"key"),5:Vae(770,"method"),1:Vae(771,"module"),2:Vae(772,"namespace"),20:Vae(773,"null"),15:Vae(774,"number"),18:Vae(775,"object"),24:Vae(776,"operator"),3:Vae(777,"package"),6:Vae(778,"property"),14:Vae(779,"string"),22:Vae(780,"struct"),25:Vae(781,"type parameter"),12:Vae(782,"variable")},function(e){const t=new Map;t.set(0,go.symbolFile),t.set(1,go.symbolModule),t.set(2,go.symbolNamespace),t.set(3,go.symbolPackage),t.set(4,go.symbolClass),t.set(5,go.symbolMethod),t.set(6,go.symbolProperty),t.set(7,go.symbolField),t.set(8,go.symbolConstructor),t.set(9,go.symbolEnum),t.set(10,go.symbolInterface),t.set(11,go.symbolFunction),t.set(12,go.symbolVariable),t.set(13,go.symbolConstant),t.set(14,go.symbolString),t.set(15,go.symbolNumber),t.set(16,go.symbolBoolean),t.set(17,go.symbolArray),t.set(18,go.symbolObject),t.set(19,go.symbolKey),t.set(20,go.symbolNull),t.set(21,go.symbolEnumMember),t.set(22,go.symbolStruct),t.set(23,go.symbolEvent),t.set(24,go.symbolOperator),t.set(25,go.symbolTypeParameter),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for SymbolKind "+e),i=go.symbolProperty),i};const i=new Map;i.set(0,20),i.set(1,8),i.set(2,8),i.set(3,8),i.set(4,5),i.set(5,0),i.set(6,9),i.set(7,3),i.set(8,2),i.set(9,15),i.set(10,7),i.set(11,1),i.set(12,4),i.set(13,14),i.set(14,18),i.set(15,13),i.set(16,13),i.set(17,13),i.set(18,13),i.set(19,17),i.set(20,13),i.set(21,16),i.set(22,6),i.set(23,10),i.set(24,11),i.set(25,24),e.toCompletionKind=function(e){let t=i.get(e);return void 0===t&&(console.info("No completion kind found for SymbolKind "+e),t=20),t}}(xb||(xb={})),(db=kb=class e{static fromValue(t){switch(t){case"comment":return e.Comment;case"imports":return e.Imports;case"region":return e.Region}return new e(t)}constructor(e){this.value=e}}).Comment=new db("comment"),db.Imports=new db("imports"),db.Region=new db("region"),function(e){e[e.AIGenerated=1]="AIGenerated"}(Lb||(Lb={})),function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(Db||(Db={})),function(e){e.is=function(e){return!(!e||"object"!=typeof e)&&"string"==typeof e.id&&"string"==typeof e.title}}(Ib||(Ib={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(Nb||(Nb={})),Eb=class{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}},Mb=new ab,(Tb=class e extends Ie{static getInstance(){return this._INSTANCE||(this._INSTANCE=new e),this._INSTANCE}constructor(){super(),this._onDidChange=new je,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Mb.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Mb.getColorMap();if(!e)return this._colors=[rb.Empty],void(this._backgroundIsLight=!0);this._colors=[rb.Empty];for(let t=1;t<e.length;t++){const i=e[t].rgba;this._colors[t]=new rb(i.r,i.g,i.b,Math.round(255*i.a))}this._backgroundIsLight=e[2].getRelativeLuminance()>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}})._INSTANCE=null,Rb=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})(),Ob=(e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e,Ab=class e{constructor(t,i){this.scale=i,this._minimapCharRendererBrand=void 0,this.charDataNormal=e.soften(t,.8),this.charDataLight=e.soften(t,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=Aue(e[n]*t);return i}renderChar(e,t,i,n,o,s,r,a,l,d,c){const h=1*this.scale,u=2*this.scale,g=c?1:u;if(t+h>e.width||i+g>e.height)return void console.warn("bad render request outside image data");const p=d?this.charDataLight:this.charDataNormal,m=Ob(n,l),f=4*e.width,_=r.r,b=r.g,v=r.b,w=o.r-_,C=o.g-b,y=o.b-v,S=Math.max(s,a),x=e.data;let k=m*h*u,L=i*f+4*t;for(let D=0;D<g;D++){let e=L;for(let t=0;t<h;t++){const t=p[k++]/255*(s/255);x[e++]=_+w*t,x[e++]=b+C*t,x[e++]=v+y*t,x[e++]=S}L+=f}}blockRenderChar(e,t,i,n,o,s,r,a){const l=1*this.scale,d=2*this.scale,c=a?1:d;if(t+l>e.width||i+c>e.height)return void console.warn("bad render request outside image data");const h=4*e.width,u=o/255*.5,g=s.r,p=s.g,m=s.b,f=g+(n.r-g)*u,_=p+(n.g-p)*u,b=m+(n.b-m)*u,v=Math.max(o,r),w=e.data;let C=i*h+4*t;for(let y=0;y<c;y++){let e=C;for(let t=0;t<l;t++)w[e++]=f,w[e++]=_,w[e++]=b,w[e++]=v;C+=h}}},Pb={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},Fb=e=>{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=Pb[e[i]]<<4|15&Pb[e[i+1]];return t},Wb={1:Sle(()=>Fb("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:Sle(()=>Fb("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))},Bb=class e{static create(t,i){if(this.lastCreated&&t===this.lastCreated.scale&&i===this.lastFontFamily)return this.lastCreated;let n;return n=Wb[t]?new Ab(Wb[t](),t):e.createFromSampleData(e.createSampleData(i).data,t),this.lastFontFamily=i,this.lastCreated=n,n}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const o of Rb)i.fillText(String.fromCharCode(o),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(t,i){if(61440!==t.length)throw new Error("Unexpected source in MinimapCharRenderer");return new Ab(e._downsample(t,i),i)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let d=0;d<r;d++){const n=d/r*16,o=(d+1)/r*16;for(let r=0;r<s;r++){const d=r/s*10,c=(r+1)/s*10;let h=0,u=0;for(let i=n;i<o;i++){const n=t+3840*Math.floor(i),o=1-(i-Math.floor(i));for(let t=d;t<c;t++){const i=1-(t-Math.floor(t)),s=n+4*Math.floor(t),r=i*o;u+=r,h+=e[s]*e[s+3]/255*r}}const g=h/u;l=Math.max(l,g),i[a++]=Aue(g)}}return l}static _downsample(e,t){const i=2*t*1*t,n=96*i,o=new Uint8ClampedArray(n);let s=0,r=0,a=0;for(let l=0;l<96;l++)a=Math.max(a,this._downsampleChar(e,r,o,s,t)),s+=i,r+=40;if(a>0){const e=255/a;for(let t=0;t<n;t++)o[t]*=e}return o}},Vb=P?'"Segoe WPC", "Segoe UI", sans-serif':F?"-apple-system, BlinkMacSystemFont, sans-serif":'system-ui, "Ubuntu", "Droid Sans", sans-serif',Hb=class{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}},Ub=class e{constructor(t,i,n){const o=t.options,s=o.get(163),r=o.get(165),a=r.minimap,l=o.get(59),d=o.get(81);this.renderMinimap=a.renderMinimap,this.size=d.size,this.minimapHeightIsEditorHeight=a.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=o.get(119),this.paddingTop=o.get(96).top,this.paddingBottom=o.get(96).bottom,this.showSlider=d.showSlider,this.autohide=d.autohide,this.pixelRatio=s,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.lineHeight=o.get(75),this.minimapLeft=a.minimapLeft,this.minimapWidth=a.minimapWidth,this.minimapHeight=r.height,this.canvasInnerWidth=a.minimapCanvasInnerWidth,this.canvasInnerHeight=a.minimapCanvasInnerHeight,this.canvasOuterWidth=a.minimapCanvasOuterWidth,this.canvasOuterHeight=a.minimapCanvasOuterHeight,this.isSampling=a.minimapIsSampling,this.editorHeight=r.height,this.fontScale=a.minimapScale,this.minimapLineHeight=a.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.sectionHeaderFontFamily=Vb,this.sectionHeaderFontSize=d.sectionHeaderFontSize*s,this.sectionHeaderLetterSpacing=d.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=e._getSectionHeaderColor(i,n.getColor(1)),this.charRenderer=Sle(()=>Bb.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=n.getColor(2),this.backgroundColor=e._getMinimapBackground(i,this.defaultBackgroundColor),this.foregroundAlpha=e._getMinimapForegroundOpacity(i)}static _getMinimapBackground(e,t){const i=e.getColor(Mu);return i?new rb(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Tu);return t?rb._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){const i=e.getColor(Ch);return i?new rb(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}},Kb=class e{constructor(e,t,i,n,o,s,r,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=r,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(t,i,n,o,s,r,a,l,d,c,h){const u=t.pixelRatio,g=t.minimapLineHeight,p=Math.floor(t.canvasInnerHeight/g),m=t.lineHeight;if(t.minimapHeightIsEditorHeight){let i=l*t.lineHeight+t.paddingTop+t.paddingBottom;t.scrollBeyondLastLine&&(i+=Math.max(0,s-t.lineHeight-t.paddingBottom));const n=Math.max(1,Math.floor(s*s/i)),o=Math.max(0,t.minimapHeight-n),r=o/(c-s),h=d*r,u=o>0,g=Math.floor(t.canvasInnerHeight/t.minimapLineHeight);return new e(d,c,u,r,h,n,Math.floor(t.paddingTop/t.lineHeight),1,Math.min(a,g))}let f;if(r&&n!==a){const e=n-i+1;f=Math.floor(e*g/u)}else{const e=s/m;f=Math.floor(e*g/u)}const _=Math.floor(t.paddingTop/m);let b,v=Math.floor(t.paddingBottom/m);if(t.scrollBeyondLastLine){const e=s/m;v=Math.max(v,e-1)}b=v>0?(_+a+v-s/m-1)*g/u:Math.max(0,(_+a)*g/u-f),b=Math.min(t.minimapHeight-f,b);const w=b/(c-s),C=d*w;if(p>=_+a+v)return new e(d,c,b>0,w,C,f,_,1,a);{let n,s;n=i>1?i+_:Math.max(1,d/m);let r=Math.max(1,Math.floor(n-C*u/g));r<_?(s=_-r+1,r=1):(s=0,r=Math.max(1,r-_)),h&&h.scrollHeight===c&&(h.scrollTop>d&&(r=Math.min(r,h.startLineNumber),s=Math.max(s,h.topPaddingLineCount)),h.scrollTop<d&&(r=Math.max(r,h.startLineNumber),s=Math.min(s,h.topPaddingLineCount)));const l=Math.min(a,r-s+p-1),b=(d-o)/m;let v;return v=d>=t.paddingTop?(i-r+s+b)*g/u:d/t.paddingTop*(s+b)*g/u,new e(d,c,!0,w,v,f,s,r,l)}}},(zb=qb=class{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}).INVALID=new zb(-1),jb=class{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new lf({createLine:()=>qb.INVALID}),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let i=0,n=t.length;i<n;i++)if(-1===t[i].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){const e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}},$b=class e{constructor(t,i,n,o){this._backgroundFillData=e._createBackgroundFillData(i,n,o),this._buffers=[t.createImageData(i,n),t.createImageData(i,n)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;const e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){const n=i.r,o=i.g,s=i.b,r=i.a,a=new Uint8ClampedArray(e*t*4);let l=0;for(let d=0;d<t;d++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=o,a[l+2]=s,a[l+3]=r,l+=4;return a}},Gb=class e{static compute(t,i,n){if(0===t.renderMinimap||!t.isSampling)return[null,[]];const{minimapLineCount:o}=Xd.computeContainedMinimapLineCount({viewLineCount:i,scrollBeyondLastLine:t.scrollBeyondLastLine,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:t.editorHeight,lineHeight:t.lineHeight,pixelRatio:t.pixelRatio}),s=i/o,r=s/2;if(!n||0===n.minimapLines.length){const t=[];if(t[0]=1,o>1){for(let e=0,i=o-1;e<i;e++)t[e]=Math.round(e*s+r);t[o-1]=i}return[new e(s,t),[]]}const a=n.minimapLines,l=a.length,d=[];let c=0,h=0,u=1,g=[],p=null;for(let e=0;e<o;e++){const t=Math.max(u,Math.round(e*s)),n=Math.max(t,Math.round((e+1)*s));for(;c<l&&a[c]<t;){if(g.length<10){const e=c+1+h;p&&"deleted"===p.type&&p._oldIndex===c-1?p.deleteToLineNumber++:(p={type:"deleted",_oldIndex:c,deleteFromLineNumber:e,deleteToLineNumber:e},g.push(p)),h--}c++}let m;if(c<l&&a[c]<=n)m=a[c],c++;else if(m=0===e?1:e+1===o?i:Math.round(e*s+r),g.length<10){const t=c+1+h;p&&"inserted"===p.type&&p._i===e-1?p.insertToLineNumber++:(p={type:"inserted",_i:e,insertFromLineNumber:t,insertToLineNumber:t},g.push(p)),h++}d[e]=m,u=m}if(g.length<10)for(;c<l;){const e=c+1+h;p&&"deleted"===p.type&&p._oldIndex===c-1?p.deleteToLineNumber++:(p={type:"deleted",_oldIndex:c,deleteFromLineNumber:e,deleteToLineNumber:e},g.push(p)),h--,c++}else g=[{type:"flush"}];return[new e(s,d),g]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){const n=this.minimapLines[i];if(n<e||n>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,n=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]<e.fromLineNumber);o--)this.minimapLines[o]<=e.toLineNumber?(this.minimapLines[o]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,o),n=Math.max(n,o)):this.minimapLines[o]-=t;return[i,n]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}},Zb=class extends Sp{constructor(e){super(e),this._sectionHeaderCache=new Ls(10,1.5),this.tokensColorTracker=Tb.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new Ub(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=Gb.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new Yb(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new Ub(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return!!t&&this._actual.onLinesChanged(t[0],t[1]-t[0]+1)}return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber)}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged(e)}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(this._samplingState){const t=[];for(const i of e.ranges){const e=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}return this._actual.onTokensChanged(e.ranges)}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;const e=Boolean(this._samplingState),[t,i]=Gb.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const n=[];for(let o=0,s=t-e+1;o<s;o++)i[o]?n[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):n[o]=null;return n}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(null===this._minimapSelections)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new fr(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){return this._getMinimapDecorationsInViewport(e,t).filter(e=>!e.options.minimap?.sectionHeaderStyle)}getSectionHeaderDecorationsInViewport(e,t){const i=this.options.sectionHeaderFontSize/this.options.minimapLineHeight;return e=Math.floor(Math.max(1,e-i)),this._getMinimapDecorationsInViewport(e,t).filter(e=>!!e.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const n=this._samplingState.minimapLines[e-1],o=this._samplingState.minimapLines[t-1];i=new mr(n,1,o,this._context.viewModel.getLineMaxColumn(o))}else i=new mr(e,1,t,this._context.viewModel.getLineMaxColumn(t));const n=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){const e=[];for(const t of n){if(!t.options.minimap)continue;const i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),o=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new Hb(new mr(n,i.startColumn,o,i.endColumn),t.options))}return e}return n}getSectionHeaderText(e,t){const i=e.options.minimap?.sectionHeaderText;if(!i)return null;const n=this._sectionHeaderCache.get(i);if(n)return n;const o=t(i);return this._sectionHeaderCache.set(i,o),o}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new mr(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}},Yb=class e extends Ie{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._isMouseOverMinimap=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(Du),this._domNode=Fge(document.createElement("div")),xp.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=Fge(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=Fge(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=Fge(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=Fge(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=Fge(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._hideDelayedScheduler=this._register(new ft(()=>this._hideImmediatelyIfMouseIsOutside(),500)),this._register(xn(this._domNode.domNode,On.MOUSE_OVER,()=>{this._isMouseOverMinimap=!0})),this._register(xn(this._domNode.domNode,On.MOUSE_LEAVE,()=>{this._isMouseOverMinimap=!1})),this._pointerDownListener=xn(this._domNode.domNode,On.POINTER_DOWN,e=>{e.preventDefault();const t="mouse"===e.pointerType,i=0===e.button;if(0!==this._model.options.renderMinimap&&this._lastRenderData)if("proportional"===this._model.options.size){if(i||!t){const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)}}else if(i&&this._lastRenderData){const t=lhe(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}}),this._sliderPointerMoveMonitor=new Zc,this._sliderPointerDownListener=xn(this._slider.domNode,On.POINTER_DOWN,e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=pm.addTarget(this._domNode.domNode),this._sliderTouchStartListener=ehe(this._domNode.domNode,gm.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=ehe(this._domNode.domNode,gm.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=xn(this._domNode.domNode,gm.End,e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_hideSoon(){this._hideDelayedScheduler.cancel(),this._hideDelayedScheduler.schedule()}_hideImmediatelyIfMouseIsOutside(){this._isMouseOverMinimap?this._hideSoon():this._domNode.toggleClassName("active",!1)}_startSliderDragging(e,t,i){if(!(e.target&&e.target instanceof Element))return;const n=e.pageX;this._slider.toggleClassName("active",!0);const o=(e,o)=>{const s=lhe(this._domNode.domNode),r=Math.min(Math.abs(o-n),Math.abs(o-s.left),Math.abs(o-s.left-s.width));if(P&&r>140)return void this._model.setScrollTop(i.scrollTop);const a=e-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(a))};e.pageY!==t&&o(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>o(e.pageY,e.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return"always"===this._model.options.showSlider?e.push("slider-always"):e.push("slider-mouseover"),"mouseover"===this._model.options.autohide?e.push("minimap-autohide-mouseover"):"scroll"===this._model.options.autohide&&e.push("minimap-autohide-scroll"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new $b(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(e){return"scroll"===this._model.options.autohide&&(e.scrollTopChanged||e.scrollHeightChanged)&&(this._domNode.toggleClassName("active",!0),this._hideSoon()),this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(Du),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=Kb.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(mr.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0));const{canvasInnerWidth:n,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,o);const d=new Qb(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,d,e,s),this._renderDecorationsLineHighlights(l,i,d,e,s);const c=new Qb(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,c,e,s,a,r,n),this._renderDecorationsHighlights(l,i,c,e,s,a,r,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,r=0;for(const a of t){const t=n.intersectWithViewport(a);if(!t)continue;const[l,d]=t;for(let e=l;e<=d;e++)i.set(e,!0);const c=n.getYForLineNumber(l,o),h=n.getYForLineNumber(d,o);r>=c||(r>s&&e.fillRect(8,s,e.canvas.width,r-s),s=c),r=h}r>s&&e.fillRect(8,s,e.canvas.width,r-s)}_renderDecorationsLineHighlights(e,t,i,n,o){const s=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||1!==l.position)continue;const d=n.intersectWithViewport(a.range);if(!d)continue;const[c,h]=d,u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let g=s.get(u.toString());g||(g=u.transparent(.5).toString(),s.set(u.toString(),g)),e.fillStyle=g;for(let t=c;t<=h;t++){if(i.has(t))continue;i.set(t,!0);const s=n.getYForLineNumber(c,o);e.fillRect(8,s,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,n,o,s,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=n.intersectWithViewport(l);if(!t)continue;const[d,c]=t;for(let h=d;h<=c;h++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,h,o,o,s,r,a)}}_renderDecorationsHighlights(e,t,i,n,o,s,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const d=n.intersectWithViewport(l.range);if(!d)continue;const[c,h]=d,u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let g=c;g<=h;g++)switch(t.position){case 1:this.renderDecorationOnLine(e,i,l.range,u,n,g,o,o,s,r,a);continue;case 2:{const t=n.getYForLineNumber(g,o);this.renderDecoration(e,u,2,t,2,o);continue}}}}renderDecorationOnLine(e,t,i,n,o,s,r,a,l,d,c){const h=o.getYForLineNumber(s,a);if(h+r<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,p=u===s?i.startColumn:1,m=g===s?i.endColumn:this._model.getLineMaxColumn(s),f=this.getXOffsetForPosition(t,s,p,l,d,c),_=this.getXOffsetForPosition(t,s,m,l,d,c);this.renderDecoration(e,n,f,h,_-f,r)}getXOffsetForPosition(e,t,i,n,o,s){if(1===i)return 8;if((i-1)*o>=s)return s;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[8];let a=8;for(let e=1;e<i.length+1;e++){const t=i.charCodeAt(e-1),l=a+(9===t?n*o:fde(t)?2*o:o);if(l>=s){r[e]=s;break}r[e]=l,a=l}e.set(t,r)}return i-1<r.length?r[i-1]:s}renderDecoration(e,t,i,n,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,o,s)}_renderSectionHeaders(t){const i=this._model.options.minimapLineHeight,n=this._model.options.sectionHeaderFontSize,o=this._model.options.sectionHeaderLetterSpacing,s=1.5*n,{canvasInnerWidth:r}=this._model.options,a=this._model.options.backgroundColor,l=`rgb(${a.r} ${a.g} ${a.b} / .7)`,d=this._model.options.sectionHeaderFontColor,c=`rgb(${d.r} ${d.g} ${d.b})`,h=c,u=this._decorationsCanvas.domNode.getContext("2d");u.letterSpacing=o+"px",u.font="500 "+n+"px "+this._model.options.sectionHeaderFontFamily,u.strokeStyle=h,u.lineWidth=.4;const g=this._model.getSectionHeaderDecorationsInViewport(t.startLineNumber,t.endLineNumber);g.sort((e,t)=>e.range.startLineNumber-t.range.startLineNumber);const p=e._fitSectionHeader.bind(null,u,r-8);for(const m of g){const o=t.getYForLineNumber(m.range.startLineNumber,i)+n,a=o-n,d=a+2,h=this._model.getSectionHeaderText(m,p);e._renderSectionLabel(u,h,2===m.options.minimap?.sectionHeaderStyle,l,c,r,a,s,o,d)}}static _fitSectionHeader(e,t,i){if(!i)return i;const n=e.measureText(i).width,o=e.measureText("…").width;if(n<=t||n<=o)return i;const s=i.length,r=n/i.length,a=Math.floor((t-o)/r)-1;let l=Math.ceil(a/2);for(;l>0&&/\s/.test(i[l-1]);)--l;return i.substring(0,l)+"…"+i.substring(s-(a-l))}static _renderSectionLabel(e,t,i,n,o,s,r,a,l,d){t&&(e.fillStyle=n,e.fillRect(0,r,s,a),e.fillStyle=o,e.fillText(t,8,l)),i&&(e.beginPath(),e.moveTo(0,d),e.lineTo(s,d),e.closePath(),e.stroke())}renderLines(t){const i=t.startLineNumber,n=t.endLineNumber,o=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(t)){const e=this._lastRenderData._get();return new jb(t,e.imageData,e.lines)}const s=this._getBuffer();if(!s)return null;const[r,a,l]=e._renderUntouchedLines(s,t.topPaddingLineCount,i,n,o,this._lastRenderData),d=this._model.getMinimapLinesRenderingData(i,n,l),c=this._model.getOptions().tabSize,h=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,g=this._model.options.foregroundAlpha,p=this._model.tokensColorTracker,m=p.backgroundIsLight(),f=this._model.options.renderMinimap,_=this._model.options.charRenderer(),b=this._model.options.fontScale,v=this._model.options.minimapCharWidth,w=(1===f?2:3)*b,C=o>w?Math.floor((o-w)/2):0,y=u.a/255,S=new rb(Math.round((u.r-h.r)*y+h.r),Math.round((u.g-h.g)*y+h.g),Math.round((u.b-h.b)*y+h.b),255);let x=t.topPaddingLineCount*o;const k=[];for(let I=0,N=n-i+1;I<N;I++)l[I]&&e._renderLine(s,S,u.a,m,f,v,p,g,_,x,C,c,d[I],b,o),k[I]=new qb(x),x+=o;const L=-1===r?0:r,D=(-1===a?s.height:a)-L;return this._canvas.domNode.getContext("2d").putImageData(s,0,0,0,L,s.width,D),new jb(t,s,k)}static _renderUntouchedLines(e,t,i,n,o,s){const r=[];if(!s){for(let e=0,t=n-i+1;e<t;e++)r[e]=!0;return[-1,-1,r]}const a=s._get(),l=a.imageData.data,d=a.rendLineNumberStart,c=a.lines,h=c.length,u=e.width,g=e.data,p=(n-i+1)*o*u*4;let m=-1,f=-1,_=-1,b=-1,v=-1,w=-1,C=t*o;for(let y=i;y<=n;y++){const e=y-i,t=y-d,n=t>=0&&t<h?c[t].dy:-1;if(-1===n){r[e]=!0,C+=o;continue}const s=n*u*4,a=(n+o)*u*4,S=C*u*4,x=(C+o)*u*4;b===s&&w===S?(b=a,w=x):(-1!==_&&(g.set(l.subarray(_,b),v),-1===m&&0===_&&_===v&&(m=b),-1===f&&b===p&&_===v&&(f=_)),_=s,b=a,v=S,w=x),r[e]=!1,C+=o}return-1!==_&&(g.set(l.subarray(_,b),v),-1===m&&0===_&&_===v&&(m=b),-1===f&&b===p&&_===v&&(f=_)),[-1===m?-1:m/(4*u),-1===f?-1:f/(4*u),r]}static _renderLine(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p){const m=u.content,f=u.tokens,_=e.width-s,b=1===p;let v=8,w=0,C=0;for(let y=0,S=f.getCount();y<S;y++){const u=f.getEndOffset(y),p=f.getForeground(y),S=r.getColor(p);for(;w<u;w++){if(v>_)return;const r=m.charCodeAt(w);if(9===r){const e=h-(w+C)%h;C+=e-1,v+=e*s}else if(32===r)v+=s;else{const h=fde(r)?2:1;for(let u=0;u<h;u++)if(2===o?l.blockRenderChar(e,v,d+c,S,a,t,i,b):l.renderChar(e,v,d+c,r,S,a,t,i,g,n,b),v+=s,v>_)return}}}}},Qb=class{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,o=this._endLineNumber-this._startLineNumber+1;n<o;n++)this._values[n]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}},Xb=class extends Sp{constructor(e,t){super(e),this._viewDomNode=t;const i=this._context.configuration.options.get(165);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=Fge(document.createElement("div")),xp.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=Fge(document.createElement("div")),xp.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(165);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}_widgetCanOverflow(e){const t=this._context.configuration.options.get(4);return!!e.allowEditorOverflow&&t}addWidget(e){const t=Fge(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._widgetCanOverflow(e)?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()],n=t?t.preference:null,o=t?.stackOridinal;return i.preference===n&&i.stack===o?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=o,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0;const t=Object.keys(this._widgets);for(let i=0,n=t.length;i<n;i++){const n=t[i],o=this._widgets[n].widget.getMinContentWidthInPx?.();void 0!==o&&(e=Math.max(e,o))}this._context.viewLayout.setOverlayWidgetsMinWidth(e)}_renderWidget(e,t){const i=e.domNode;if(null===e.preference)return void i.setTop("");const n=2*this._verticalScrollbarWidth+this._minimapWidth;if(0===e.preference||1===e.preference){if(1===e.preference){const e=i.domNode.clientHeight;i.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight)}else i.setTop(0);void 0!==e.stack?(i.setTop(t[e.preference]),t[e.preference]+=i.domNode.clientWidth):i.setRight(n)}else if(2===e.preference)i.domNode.style.right="50%",void 0!==e.stack?(i.setTop(t[2]),t[2]+=i.domNode.clientHeight):i.setTop(0);else{const{top:t,left:n}=e.preference;if(this._context.configuration.options.get(51)&&this._widgetCanOverflow(e.widget)){const e=this._viewDomNodeRect;i.setTop(t+e.top),i.setLeft(n+e.left),i.setPosition("fixed")}else i.setTop(t),i.setLeft(n),i.setPosition("absolute")}}prepareRender(e){this._viewDomNodeRect=lhe(this._viewDomNode.domNode)}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets),i=Array.from({length:3},()=>0);t.sort((e,t)=>(this._widgets[e].stack||0)-(this._widgets[t].stack||0));for(let n=0,o=t.length;n<o;n++){const e=t[n];this._renderWidget(this._widgets[e],i)}}},Jb=class{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}},ev=class{constructor(e,t){this.tabSize=e,this.data=t}},tv=class{constructor(e,t,i,n,o,s,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=r}},iv=class e{constructor(t,i,n,o,s,r,a,l,d,c,h,u){this.minColumn=t,this.maxColumn=i,this.content=n,this.continuesWithWrappedLine=o,this.isBasicASCII=e.isBasicASCII(n,r),this.containsRTL=e.containsRTL(n,this.isBasicASCII,s),this.tokens=a,this.inlineDecorations=l,this.tabSize=d,this.startVisibleColumn=c,this.textDirection=h,this.hasVariableFonts=u}static isBasicASCII(e,t){return!t||pde(e)}static containsRTL(e,t,i){return!(t||!i)&&gde(e)}},nv=class e{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Zde(e.data,t.data)}static equalsArr(t,i){return Zde(t,i,e.equals)}},ov=class{constructor(e,t){const i=e.options;this.lineHeight=i.get(75),this.pixelRatio=i.get(163),this.overviewRulerLanes=i.get(95),this.renderBorder=i.get(94);const n=t.getColor(Jf);this.borderColor=n?n.toString():null,this.hideCursor=i.get(68);const o=t.getColor(Nf);this.cursorColorSingle=o?o.transparent(.7).toString():null;const s=t.getColor(Mf);this.cursorColorPrimary=s?s.transparent(.7).toString():null;const r=t.getColor(Rf);this.cursorColorSecondary=r?r.transparent(.7).toString():null,this.themeType=t.type;const a=i.get(81),l=a.enabled,d=a.side,c=t.getColor(e_),h=Mb.getDefaultBackground();this.backgroundColor=c||(l&&"right"===d?h:null);const u=i.get(165).overviewRuler;this.top=u.top,this.right=u.right,this.domWidth=u.width,this.domHeight=u.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[g,p]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=g,this.w=p}_initLanes(e,t,i){const n=t-e;if(i>=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e+t;return[[0,e,s,e,e+t+o,e,s,e],[0,t,o,t+o,i,t+o+i,o+i,t+o+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.cursorColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&eh.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}},sv=class extends Sp{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Fge(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=Mb.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new to(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new ov(this._context.configuration,this._context.theme);return!(this._settings&&this._settings.equals(t)||(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),0))}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++){let n=this._settings.cursorColorSingle;i>1&&(n=0===t?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}return this._cursorPositions.sort((e,t)=>to.compare(e.position,t.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return!!e.affectsOverviewRuler&&this._markRenderingIsMaybeNeeded()}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return!!e.scrollHeightChanged&&this._markRenderingIsNeeded()}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(0===this._settings.overviewRulerLanes)return this._domNode.setBackgroundColor(e?eh.Format.CSS.formatHexA(e):""),void this._domNode.setDisplay("none");const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(nv.compareByRenderingProps),1!==this._actualShouldRender||nv.equalsArr(this._renderedDecorations,t)||(this._actualShouldRender=2),1!==this._actualShouldRender||Zde(this._renderedCursorPositions,this._cursorPositions,(e,t)=>e.position.lineNumber===t.position.lineNumber&&e.color===t.color)||(this._actualShouldRender=2),1===this._actualShouldRender)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,o=this._settings.lineHeight,s=this._context.viewLayout,r=n/this._context.viewLayout.getScrollHeight(),a=6*this._settings.pixelRatio|0,l=a/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=eh.Format.CSS.formatHexA(e),d.fillRect(0,0,i,n)):(d.clearRect(0,0,i,n),d.fillStyle=eh.Format.CSS.formatHexA(e),d.fillRect(0,0,i,n)):d.clearRect(0,0,i,n);const c=this._settings.x,h=this._settings.w;for(const u of t){const e=u.color,t=u.data;d.fillStyle=e;let i=0,g=0,p=0;for(let u=0,m=t.length/3;u<m;u++){const e=t[3*u],m=t[3*u+1],f=t[3*u+2];let _=s.getVerticalOffsetForLineNumber(m)*r|0,b=(s.getVerticalOffsetForLineNumber(f)+o)*r|0;if(b-_<a){let e=(_+b)/2|0;e<l?e=l:e+l>n&&(e=n-l),_=e-l,b=e+l}_>p+1||e!==i?(0!==u&&d.fillRect(c[i],g,h[i],p-g),i=e,g=_,p=b):b>p&&(p=b)}d.fillRect(c[i],g,h[i],p-g)}if(!this._settings.hideCursor){const e=2*this._settings.pixelRatio|0,t=e/2|0,i=this._settings.x[7],o=this._settings.w[7];let a=-100,l=-100,c=null;for(let h=0,u=this._cursorPositions.length;h<u;h++){const u=this._cursorPositions[h].color;if(!u)continue;const g=this._cursorPositions[h].position;let p=s.getVerticalOffsetForLineNumber(g.lineNumber)*r|0;p<t?p=t:p+t>n&&(p=n-t);const m=p-t,f=m+e;m>l+1||u!==c?(0!==h&&c&&d.fillRect(i,a,o,l-a),a=m,l=f):f>l&&(l=f),c=u,d.fillStyle=u}c&&d.fillRect(i,a,o,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,n),d.moveTo(1,0),d.lineTo(i,0),d.stroke())}},rv=class{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}},av=class{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}},lv=class{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(av.compare)}setLineHeight(e){return this._lineHeight!==e&&(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth!==e&&(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight!==e&&(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight!==e&&(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),n=i/Math.floor(this._outerHeight),o=Math.floor(4*this._pixelRatio/2),s=[];for(let r=0,a=this._zones.length;r<a;r++){const a=this._zones[r];if(!e){const e=a.getColorZones();if(e){s.push(e);continue}}const l=this._getVerticalOffsetForLine(a.startLineNumber),d=0===a.heightInLines?this._getVerticalOffsetForLine(a.endLineNumber)+t:l+a.heightInLines*t,c=Math.floor(n*l),h=Math.floor(n*d);let u=Math.floor((c+h)/2),g=h-u;g<o&&(g=o),u-g<0&&(u=g),u+g>i&&(u=i-g);const p=a.color;let m=this._color2Id[p];m||(m=++this._lastAssignedId,this._color2Id[p]=m,this._id2Color[m]=p);const f=new rv(u-g,u+g,m);a.setColorZone(f),s.push(f)}return this._colorZonesInvalid=!1,s.sort(rv.compare),s}},dv=class extends yp{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Fge(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new lv(e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(75)),this._zoneManager.setPixelRatio(i.get(163)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(75)&&(this._zoneManager.setLineHeight(t.get(75)),this._render()),e.hasChanged(163)&&(this._zoneManager.setPixelRatio(t.get(163)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,n,e),!0}_renderOneLane(e,t,i,n){let o=0,s=0,r=0;for(const a of t){const t=a.colorId,l=a.from,d=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=d):r>=l?r=Math.max(r,d):(e.fillRect(0,s,n,r-s),s=l,r=d)}e.fillRect(0,s,n,r-s)}},cv=class extends Sp{constructor(e){super(e),this.domNode=Fge(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){const{tabSize:i}=this._context.viewModel.model.getOptions(),n=i;let o=t-e;for(;o>0;){const e=Fge(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const i=this._renderedRulers[t],n=this._rulers[t];i.setBoxShadow(n.color?`1px 0 0 0 ${n.color} inset`:""),i.setHeight(Math.min(e.scrollHeight,1e6)),i.setLeft(n.column*this._typicalHalfwidthCharacterWidth)}}},hv=class extends Sp{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1,this._useShadows=this._context.configuration.options.get(117).useShadows,this._domNode=Fge(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){const e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(165);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){return this._useShadows=this._context.configuration.options.get(117).useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}},gv=class{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}},pv=class{constructor(e,t){this.lineNumber=e,this.ranges=t}},mv=class e extends yf{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const n=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!o&&e<i.length;e++)i[e].lineNumber===n&&(o=i[e].ranges[0]);const r=t[t.length-1].lineNumber;if(r===e.endLineNumber)for(let e=i.length-1;!s&&e>=0;e--)i[e].lineNumber===r&&(s=i[e].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let r=0,a=t.length;r<a;r++){const e=t[r].ranges[0],i=e.left,l=e.left+e.width,d={top:0,bottom:0},c={top:0,bottom:0};if(r>0){const e=t[r-1].ranges[0].left,o=t[r-1].ranges[0].left+t[r-1].ranges[0].width;ame(i-e)<n?d.top=2:i>e&&(d.top=1),ame(l-o)<n?c.top=2:e<l&&l<o&&(c.top=1)}else o&&(d.top=o.startStyle.top,c.top=o.endStyle.top);if(r+1<a){const e=t[r+1].ranges[0].left,o=t[r+1].ranges[0].left+t[r+1].ranges[0].width;ame(i-e)<n?d.bottom=2:e<i&&i<o&&(d.bottom=1),ame(l-o)<n?c.bottom=2:l<o&&(c.bottom=1)}else s&&(d.bottom=s.startStyle.bottom,c.bottom=s.endStyle.bottom);e.startStyle=d,e.endStyle=c}}_getVisibleRangesWithStyle(e,t,i){const n=(t.linesVisibleRangesForRange(e,!0)||[]).map(rme);return!this._visibleRangesHaveGaps(n)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,n,i),n}_createSelectionPiece(e,t,i,n,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;bottom:"+t.toString()+"px;left:"+n.toString()+"px;width:"+o.toString()+'px;"></div>'}_actualRenderOneSelection(t,i,n,o){if(0===o.length)return;const s=!!o[0].ranges[0].startStyle,r=o[0].lineNumber,a=o[o.length-1].lineNumber;for(let l=0,d=o.length;l<d;l++){const d=o[l],c=d.lineNumber,h=c-i,u=n&&c===r?1:0,g=n&&c!==r&&c===a?1:0;let p="",m="";for(let t=0,i=d.ranges.length;t<i;t++){const i=d.ranges[t];if(s){const t=i.startStyle,n=i.endStyle;if(1===t.top||1===t.bottom){p+=this._createSelectionPiece(u,g,e.SELECTION_CLASS_NAME,i.left-e.ROUNDED_PIECE_WIDTH,e.ROUNDED_PIECE_WIDTH);let n=e.EDITOR_BACKGROUND_CLASS_NAME;1===t.top&&(n+=" "+e.SELECTION_TOP_RIGHT),1===t.bottom&&(n+=" "+e.SELECTION_BOTTOM_RIGHT),p+=this._createSelectionPiece(u,g,n,i.left-e.ROUNDED_PIECE_WIDTH,e.ROUNDED_PIECE_WIDTH)}if(1===n.top||1===n.bottom){p+=this._createSelectionPiece(u,g,e.SELECTION_CLASS_NAME,i.left+i.width,e.ROUNDED_PIECE_WIDTH);let t=e.EDITOR_BACKGROUND_CLASS_NAME;1===n.top&&(t+=" "+e.SELECTION_TOP_LEFT),1===n.bottom&&(t+=" "+e.SELECTION_BOTTOM_LEFT),p+=this._createSelectionPiece(u,g,t,i.left+i.width,e.ROUNDED_PIECE_WIDTH)}}let n=e.SELECTION_CLASS_NAME;if(s){const t=i.startStyle,o=i.endStyle;0===t.top&&(n+=" "+e.SELECTION_TOP_LEFT),0===t.bottom&&(n+=" "+e.SELECTION_BOTTOM_LEFT),0===o.top&&(n+=" "+e.SELECTION_TOP_RIGHT),0===o.bottom&&(n+=" "+e.SELECTION_BOTTOM_RIGHT)}m+=this._createSelectionPiece(u,g,n,i.left,i.width)}t[h][0]+=p,t[h][1]+=m}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let s=i;s<=n;s++)t[s-i]=["",""];const o=[];for(let s=0,r=this._selections.length;s<r;s++){const n=this._selections[s];if(n.isEmpty()){o[s]=null;continue}const r=this._getVisibleRangesWithStyle(n,e,this._previousFrameVisibleRangesWithStyle[s]);o[s]=r,this._actualRenderOneSelection(t,i,this._selections.length>1,r)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([e,t])=>e+t)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}},(uv=mv).SELECTION_CLASS_NAME="selected-text",uv.SELECTION_TOP_LEFT="top-left-radius",uv.SELECTION_BOTTOM_LEFT="bottom-left-radius",uv.SELECTION_TOP_RIGHT="top-right-radius",uv.SELECTION_BOTTOM_RIGHT="bottom-right-radius",uv.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",uv.ROUNDED_PIECE_WIDTH=10,Upe((e,t)=>{const i=e.getColor(Ah);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)}),fv=class{constructor(e,t,i,n,o,s,r){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=o,this.textContent=s,this.textContentClassName=r}},function(e){e[e.Single=0]="Single",e[e.MultiPrimary=1]="MultiPrimary",e[e.MultiSecondary=2]="MultiSecondary"}(_v||(_v={})),bv=class{constructor(e,t){this._context=e;const i=this._context.configuration.options,n=i.get(59);this._cursorStyle=i.get(161),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=i.get(38),this._isVisible=!0,this._domNode=Fge(document.createElement("div")),this._domNode.setClassName(`cursor ${G_}`),this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)),this._domNode.setTop(0),this._domNode.setLeft(0),Wge(this._domNode,n),this._domNode.setDisplay("none"),this._position=new to(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case _v.Single:this._pluralityClass="";break;case _v.MultiPrimary:this._pluralityClass="cursor-primary";break;case _v.MultiSecondary:this._pluralityClass="cursor-secondary"}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(59);return this._cursorStyle=t.get(161),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=t.get(38),Wge(this._domNode,i),!0}onCursorPositionChanged(e,t){return this._domNode.domNode.style.transitionProperty=t?"none":"",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,o]=function(e,t){t>0&&lde(e.charCodeAt(t))&&t--;const i=t+hde(e,t);return[i-ude(e,i),i]}(i,t-1);return[new to(e,n+1),i.substring(n,o)]}_prepareRender(e){let t="",i="";const[n,o]=this._getGraphemeAwarePosition(),s=this._context.viewLayout.getLineHeightForLineNumber(n.lineNumber),r=0===this._lineCursorHeight?s:Math.min(s,this._lineCursorHeight),a=(s-r)/2;if(this._cursorStyle===Wd.Line||this._cursorStyle===Wd.LineThin){const s=e.visibleRangeForPosition(n);if(!s||s.outsideRenderedLine)return null;const l=pn(this._domNode.domNode);let d;this._cursorStyle===Wd.Line?(d=Whe(l,this._lineCursorWidth>0?this._lineCursorWidth:2),d>2&&(t=o,i=this._getTokenClassName(n))):d=Whe(l,1);let c=s.left,h=0;return d>=2&&c>=1&&(h=1,c-=h),new fv(e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta+a,c,h,d,r,t,i)}const l=e.linesVisibleRangesForRange(new mr(n.lineNumber,n.column,n.lineNumber,n.column+o.length),!1);if(!l||0===l.length)return null;const d=l[0];if(d.outsideRenderedLine||0===d.ranges.length)return null;const c=d.ranges[0],h="\t"===o||c.width<1?this._typicalHalfwidthCharacterWidth:c.width;this._cursorStyle===Wd.Block&&(t=o,i=this._getTokenClassName(n));let u=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,g=s;return this._cursorStyle!==Wd.Underline&&this._cursorStyle!==Wd.UnderlineThin||(u+=s-2,g=2),new fv(u,c.left,0,h,g,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${G_} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}},vv=class e extends Sp{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new bv(this._context,_v.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=Fge(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new pt,this._cursorFlatBlinkInterval=new Nn,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;i<n;i++)this._secondaryCursors[i].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){const n=this._secondaryCursors.length!==t.length||"explicit"===this._cursorSmoothCaretAnimation&&3!==i;if(this._primaryCursor.setPlurality(t.length?_v.MultiPrimary:_v.Single),this._primaryCursor.onCursorPositionChanged(e,n),this._updateBlinking(),this._secondaryCursors.length<t.length){const e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){const e=new bv(this._context,_v.MultiSecondary);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let o=0;o<t.length;o++)this._secondaryCursors[o].onCursorPositionChanged(t[o],n)}onCursorStateChanged(e){const t=[];for(let n=0,o=e.selections.length;n<o;n++)t[n]=e.selections[n].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){const t=t=>{for(let i=0,n=e.ranges.length;i<n;i++)if(e.ranges[i].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[i].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const i of this._secondaryCursors)if(t(i.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput&&!this._editContextEnabled?0:this._editorHasFocus?this._readOnly?5:this._cursorBlinking:0}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const t=this._getCursorBlinking(),i=0===t,n=5===t;i?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),i||n||(1===t?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},e.BLINK_INTERVAL,pn(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},e.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Wd.Line:e+=" cursor-line-style";break;case Wd.Block:e+=" cursor-block-style";break;case Wd.Underline:e+=" cursor-underline-style";break;case Wd.LineThin:e+=" cursor-line-thin-style";break;case Wd.BlockOutline:e+=" cursor-block-outline-style";break;case Wd.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return"on"!==this._cursorSmoothCaretAnimation&&"explicit"!==this._cursorSmoothCaretAnimation||(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let i=0;const n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let o=0,s=this._secondaryCursors.length;o<s;o++){const n=this._secondaryCursors[o].render(e);n&&(t[i++]=n)}this._renderData=t}getLastRenderData(){return this._renderData}},vv.BLINK_INTERVAL=500,Upe((e,t)=>{const i=[{class:".cursor",foreground:Nf,background:Ef},{class:".cursor-primary",foreground:Mf,background:Tf},{class:".cursor-secondary",foreground:Rf,background:Of}];for(const n of i){const i=e.getColor(n.foreground);if(i){let o=e.getColor(n.background);o||(o=i.opposite()),t.addRule(`.monaco-editor .cursors-layer ${n.class} { background-color: ${i}; border-color: ${i}; color: ${o}; }`),Npe(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection ${n.class} { border-left: 1px solid ${o}; border-right: 1px solid ${o}; }`)}}}),wv=()=>{throw new Error("Invalid change accessor")},Cv=class extends Sp{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(165);this._lineHeight=t.get(75),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Fge(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=Fge(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const n of e)t.set(n.id,n);let i=!1;return this._context.viewModel.changeWhitespace(e=>{const n=Object.keys(this._zones);for(let o=0,s=n.length;o<s;o++){const s=n[o],r=this._zones[s],a=this._computeWhitespaceProps(r.delegate);r.isInHiddenArea=a.isInHiddenArea;const l=t.get(s);!l||l.afterLineNumber===a.afterViewLineNumber&&l.height===a.heightInPx||(e.changeOneWhitespace(s,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(r.delegate,a.heightInPx),i=!0)}}),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);return this._lineHeight=t.get(75),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(75)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return e.ordinal??e.afterColumn??1e4}_computeWhitespaceProps(e){if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t,i;if(void 0!==e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const i=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new to(i,this._context.viewModel.model.getLineMaxColumn(i))}i=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),o=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:n.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(i=>{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{return e(t)}catch(Fae){return void $ae(Fae)}}(e,n),n.addZone=wv,n.removeZone=wv,n.layoutZone=wv}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:Fge(t.domNode),marginDomNode:t.marginDomNode?Fge(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(Fae){$ae(Fae)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(Fae){$ae(Fae)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(i[s.id]=s,n=!0);const o=Object.keys(this._zones);for(let s=0,r=o.length;s<r;s++){const t=o[s],n=this._zones[t];let r=0,a=0,l="none";i.hasOwnProperty(t)?(r=i[t].verticalOffset-e.bigNumbersDelta,a=i[t].height,l="block",n.isVisible||(n.domNode.setAttribute("monaco-visible-view-zone","true"),n.isVisible=!0),this._safeCallOnDomNodeTop(n.delegate,e.getScrolledTopFromAbsoluteTop(i[t].verticalOffset))):(n.isVisible&&(n.domNode.removeAttribute("monaco-visible-view-zone"),n.isVisible=!1),this._safeCallOnDomNodeTop(n.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),n.domNode.setTop(r),n.domNode.setHeight(a),n.domNode.setDisplay(l),n.marginDomNode&&(n.marginDomNode.setTop(r),n.marginDomNode.setHeight(a),n.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}},yv=class extends yf{constructor(e){super(),this._context=e,this._options=new Sv(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=new Sv(this._context.configuration);return this._options.equals(t)?e.hasChanged(165):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,"selection"===this._options.renderWhitespace}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if("none"===this._options.renderWhitespace)return void(this._renderResult=null);const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber-t+1,n=new Array(i);for(let o=0;o<i;o++)n[o]=!0;this._renderResult=[];for(let o=e.viewportData.startLineNumber;o<=e.viewportData.endLineNumber;o++){const t=o-e.viewportData.startLineNumber,i=this._context.viewModel.getViewLineRenderingData(o);let n=null;if("selection"===this._options.renderWhitespace){const e=this._selection;for(const t of e){if(t.endLineNumber<o||t.startLineNumber>o)continue;const e=t.startLineNumber===o?t.startColumn:i.minColumn,s=t.endLineNumber===o?t.endColumn:i.maxColumn;e<s&&(n||(n=[]),n.push(new hl(e-1,s-1)))}}this._renderResult[t]=this._applyRenderWhitespace(e,o,n,i)}}_applyRenderWhitespace(e,t,i,n){if(n.hasVariableFonts)return"";if("selection"===this._options.renderWhitespace&&!i)return"";if("trailing"===this._options.renderWhitespace&&n.continuesWithWrappedLine)return"";const o=this._context.theme.getColor(Af),s=this._options.renderWithSVG,r=n.content,a=-1===this._options.stopRenderingLineAfter?r.length:Math.min(this._options.stopRenderingLineAfter,r.length),l=n.continuesWithWrappedLine,d=n.minColumn-1,c="boundary"===this._options.renderWhitespace,h="trailing"===this._options.renderWhitespace,u=e.getLineHeightForLineNumber(t),g=this._options.middotWidth,p=this._options.wsmiddotWidth,m=this._options.spaceWidth,f=Math.abs(p-m)<Math.abs(g-m)?11825:183,_=this._options.canUseHalfwidthRightwardsArrow;let b,v="",w=!1,C=jle(r);-1===C?(w=!0,C=a,b=a):b=Gle(r);let y=0,S=i&&i[y],x=0;for(let k=d;k<a;k++){const n=r.charCodeAt(k);if(S&&S.endExclusive<=k&&(y++,S=i&&i[y]),9!==n&&32!==n)continue;if(h&&!w&&k<=b)continue;if(c&&k>=C&&k<=b&&32===n){const e=k-1>=0?r.charCodeAt(k-1):0,t=k+1<a?r.charCodeAt(k+1):0;if(32!==e&&32!==t)continue}if(c&&l&&k===a-1){const e=k-1>=0?r.charCodeAt(k-1):0;if(32===n&&32!==e&&9!==e)continue}if(i&&!(S&&S.start<=k&&k<S.endExclusive))continue;const o=e.visibleRangeForPosition(new to(t,k+1));o&&(s?(x=Math.max(x,o.left),v+=9===n?this._renderArrow(u,m,o.left):`<circle cx="${(o.left+m/2).toFixed(2)}" cy="${(u/2).toFixed(2)}" r="${(m/7).toFixed(2)}" />`):v+=9===n?`<div class="mwh" style="left:${o.left}px;height:${u}px;">${_?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:`<div class="mwh" style="left:${o.left}px;height:${u}px;">${String.fromCharCode(f)}</div>`)}return s?(x=Math.round(x+m),`<svg style="bottom:0;position:absolute;width:${x}px;height:${u}px" viewBox="0 0 ${x} ${u}" xmlns="http://www.w3.org/2000/svg" fill="${o}">`+v+"</svg>"):v}_renderArrow(e,t,i){const n=e/2,o=i,s={x:0,y:t/7/2},r={x:.8*t,y:s.y},a={x:r.x-.2*r.x,y:r.y+.2*r.x},l={x:a.x+.1*r.x,y:a.y+.1*r.x},d={x:l.x+.35*r.x,y:l.y-.35*r.x};return`<path d="M ${[s,r,a,l,d,{x:d.x,y:-d.y},{x:l.x,y:-l.y},{x:a.x,y:-a.y},{x:r.x,y:-r.y},{x:s.x,y:-s.y}].map(e=>`${(o+e.x).toFixed(2)} ${(n+e.y).toFixed(2)}`).join(" L ")}" />`}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}},Sv=class{constructor(e){const t=e.options,i=t.get(59),n=t.get(47);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(113),this.renderWithSVG=!0):(this.renderWhitespace=t.get(113),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(75),this.stopRenderingLineAfter=t.get(133)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}},xv=class{constructor(e,t,i,n){this.selections=e,this.startLineNumber=0|t.startLineNumber,this.endLineNumber=0|t.endLineNumber,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=0|t.bigNumbersDelta,this.lineHeight=0|t.lineHeight,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new mr(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}},kv=class{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}},Lv=class{constructor(e,t,i){this.configuration=e,this.theme=new kv(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}},Dv=new Float32Array([1,0,1,1,0,1,0,0,0,1,1,0]),Iv=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Nv=0,Ev=class extends Ie{get cacheKey(){return`${this.fontFamily}_${this.fontSize}px`}constructor(e,t,i,n){super(),this.fontSize=e,this.fontFamily=t,this.devicePixelRatio=i,this._decorationStyleCache=n,this.id=Nv++,this._workGlyph={source:null,boundingBox:{left:0,bottom:0,right:0,top:0},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0},this._workGlyphConfig={chars:void 0,tokenMetadata:0,decorationStyleSetId:0},this._antiAliasing=F?"greyscale":"subpixel";const o=Math.ceil(this.fontSize*i);this._canvas=new OffscreenCanvas(3*o,3*o),this._ctx=lme(this._canvas.getContext("2d",{willReadFrequently:!0,alpha:"greyscale"===this._antiAliasing})),this._ctx.textBaseline="top",this._ctx.fillStyle="#FFFFFF",this._ctx.font=`${o}px ${this.fontFamily}`,this._textMetrics=this._ctx.measureText("A")}rasterizeGlyph(e,t,i,n){return""===e?{source:this._canvas,boundingBox:{top:0,left:0,bottom:-1,right:-1},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0}:this._workGlyphConfig.chars===e&&this._workGlyphConfig.tokenMetadata===t&&this._workGlyphConfig.decorationStyleSetId===i?this._workGlyph:(this._workGlyphConfig.chars=e,this._workGlyphConfig.tokenMetadata=t,this._workGlyphConfig.decorationStyleSetId=i,this._rasterizeGlyph(e,t,i,n))}_rasterizeGlyph(e,t,i,n){const o=Math.ceil(this.fontSize*this.devicePixelRatio),s=3*o;this._canvas.width!==s&&(this._canvas.width=s,this._canvas.height=s),this._ctx.save();const r=(15&t)/10,a=n[cl.getBackground(t)],l=this._decorationStyleCache.getStyleSet(i);"subpixel"===this._antiAliasing?(this._ctx.fillStyle=a,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height);const d=new _a(200),c=cl.getFontStyle(t);1&c&&d.appendString("italic "),void 0!==l?.bold?l.bold&&d.appendString("bold "):2&c&&d.appendString("bold "),d.appendString(`${o}px ${this.fontFamily}`),this._ctx.font=d.build();const h=o,u=o;this._ctx.fillStyle=void 0!==l?.color?`#${l.color.toString(16).padStart(8,"0")}`:n[cl.getForeground(t)],this._ctx.textBaseline="top",void 0!==l?.opacity&&(this._ctx.globalAlpha=l.opacity),this._ctx.fillText(e,h+r,u),this._ctx.restore();const g=this._ctx.getImageData(0,0,this._canvas.width,this._canvas.height);if("subpixel"===this._antiAliasing){const e=parseInt(a.substring(1,3),16),t=parseInt(a.substring(3,5),16),i=parseInt(a.substring(5,7),16);this._clearColor(g,e,t,i),this._ctx.putImageData(g,0,0)}return this._findGlyphBoundingBox(g,this._workGlyph.boundingBox),this._workGlyph.source=this._canvas,this._workGlyph.originOffset.x=this._workGlyph.boundingBox.left-h,this._workGlyph.originOffset.y=this._workGlyph.boundingBox.top-u,this._workGlyph.fontBoundingBoxAscent=this._textMetrics.fontBoundingBoxAscent,this._workGlyph.fontBoundingBoxDescent=this._textMetrics.fontBoundingBoxDescent,this._workGlyph}_clearColor(e,t,i,n){for(let o=0;o<e.data.length;o+=4)e.data[o]===t&&e.data[o+1]===i&&e.data[o+2]===n&&(e.data[o+3]=0)}_findGlyphBoundingBox(e,t){const i=this._canvas.height,n=this._canvas.width;let o=!1;for(let s=0;s<i;s++){for(let i=0;i<n;i++){const r=s*n*4+4*i+3;if(0!==e.data[r]){t.top=s,o=!0;break}}if(o)break}t.left=0,o=!1;for(let s=0;s<n;s++){for(let r=0;r<i;r++){const i=r*n*4+4*s+3;if(0!==e.data[i]){t.left=s,o=!0;break}}if(o)break}t.right=n,o=!1;for(let s=n-1;s>=t.left;s--){for(let r=0;r<i;r++){const i=r*n*4+4*s+3;if(0!==e.data[i]){t.right=s,o=!0;break}}if(o)break}t.bottom=t.top,o=!1;for(let s=i-1;s>=0;s--){for(let i=0;i<n;i++){const r=s*n*4+4*i+3;if(0!==e.data[r]){t.bottom=s,o=!0;break}}if(o)break}}getTextMetrics(e){return this._ctx.measureText(e)}},Iv([Ape],Ev.prototype,"cacheKey",null),Mv=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Tv=function(e,t){return function(i,n){t(i,n,e)}},Rv=class extends Ie{constructor(e){super(),this._logService=e,this._tasks=[],this._i=0,this._register(Dle(()=>this.clear()))}enqueue(e){this._tasks.push(e),this._start()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,n=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),i=Math.max(t,i),o=e.timeRemaining(),1.5*i>o)return n-t<-20&&this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),void this._start();n=o}this.clear()}},Rv=Mv([Tv(0,Ks)],Rv),Ov=class extends Rv{_requestCallback(e){return She().setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){She().clearTimeout(e)}_createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}},Av=class extends Rv{_requestCallback(e){return She().requestIdleCallback(e)}_cancelCallback(e){She().cancelIdleCallback(e)}},Pv="requestIdleCallback"in She()?Av:Ov,Fv=class{constructor(e,t){this._canvas=e,this._textureIndex=t,this._currentRow={x:0,y:0,h:0},this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=lme(this._canvas.getContext("2d",{willReadFrequently:!0}))}allocate(e){const t=e.boundingBox.right-e.boundingBox.left+1,i=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||i>this._canvas.height)throw new y("Glyph is too large for the atlas page");if(e.boundingBox.right-e.boundingBox.left+1>this._canvas.width-this._currentRow.x&&(this._currentRow.x=0,this._currentRow.y+=this._currentRow.h,this._currentRow.h=1),this._currentRow.y+e.boundingBox.bottom-e.boundingBox.top+1>this._canvas.height)return;this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,this._currentRow.x,this._currentRow.y,t,i);const n={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:this._currentRow.x,y:this._currentRow.y,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._currentRow.x+=t,this._currentRow.h=Math.max(this._currentRow.h,i),this._allocatedGlyphs.add(n),n}getUsagePreview(){const e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=lme(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);const o=new Map,s=new Map;for(const r of this._allocatedGlyphs)o.set(r.y,Math.max(o.get(r.y)??0,r.h)),s.set(r.y,Math.max(s.get(r.y)??0,r.x+r.w));for(const r of this._allocatedGlyphs)n.fillStyle="#4040FF",n.fillRect(r.x,r.y,r.w,r.h),n.fillStyle="#FF0000",n.fillRect(r.x,r.y+r.h,r.w,o.get(r.y)-r.h);for(const[r,a]of s.entries())r!==this._currentRow.y&&(n.fillStyle="#FF0000",n.fillRect(a,r,e-a,o.get(r)));return i.convertToBlob()}getStats(){const e=this._canvas.width,t=this._canvas.height;let i=0,n=0;const o=e*t,s=new Map,r=new Map;for(const a of this._allocatedGlyphs)s.set(a.y,Math.max(s.get(a.y)??0,a.h)),r.set(a.y,Math.max(r.get(a.y)??0,a.x+a.w));for(const a of this._allocatedGlyphs)i+=a.w*a.h,n+=a.w*(s.get(a.y)-a.h);for(const[a,l]of r.entries())a!==this._currentRow.y&&(n+=(e-l)*s.get(a));return[`page${this._textureIndex}:`,` Total: ${o} (${e}x${t})`,` Used: ${i} (${(i/o*100).toPrecision(2)}%)`,` Wasted: ${n} (${(n/o*100).toPrecision(2)}%)`,`Efficiency: ${(i/(i+n)*100).toPrecision(2)}%`].join("\n")}},Wv=class{constructor(e,t,i){this._canvas=e,this._textureIndex=t,this._slabs=[],this._activeSlabsByDims=new Ns,this._unusedRects=[],this._openRegionsByHeight=new Map,this._openRegionsByWidth=new Map,this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=lme(this._canvas.getContext("2d",{willReadFrequently:!0})),this._slabW=Math.min(i?.slabW??64<<Math.max(Math.floor(She().devicePixelRatio)-1,0),this._canvas.width),this._slabH=Math.min(i?.slabH??this._slabW,this._canvas.height),this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}allocate(e){const t=e.boundingBox.right-e.boundingBox.left+1,i=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||i>this._canvas.height)throw new y("Glyph is too large for the atlas page");if(t>this._slabW||i>this._slabH){if(this._allocatedGlyphs.size>0)return;let e=this._canvas.width;for(;t<e/2&&i<e/2;)e/=2;this._slabW=e,this._slabH=e,this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}const n={w:t,h:i};let o,s,r=this._activeSlabsByDims.get(n.w,n.h);if(r){const e=Math.floor(this._slabW/r.entryW)*Math.floor(this._slabH/r.entryH);r.count>=e&&(r=void 0)}if(!r)if(t<i){const e=this._openRegionsByWidth.get(t);if(e?.length)for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.w>=t&&r.h>=i){o=r.x,s=r.y,t<r.w&&this._unusedRects.push({x:r.x+t,y:r.y,w:r.w-t,h:i}),r.y+=i,r.h-=i,0===r.h&&(n===e.length-1?e.pop():this._unusedRects.splice(n,1));break}}}else{const e=this._openRegionsByHeight.get(i);if(e?.length)for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.w>=t&&r.h>=i){o=r.x,s=r.y,i<r.h&&this._unusedRects.push({x:r.x,y:r.y+i,w:t,h:r.h-i}),r.x+=t,r.w-=t,0===r.h&&(n===e.length-1?e.pop():this._unusedRects.splice(n,1));break}}}if(void 0===o||void 0===s){if(!r){if(this._slabs.length>=this._slabsPerRow*this._slabsPerColumn)return;r={x:Math.floor(this._slabs.length%this._slabsPerRow)*this._slabW,y:Math.floor(this._slabs.length/this._slabsPerRow)*this._slabH,entryW:n.w,entryH:n.h,count:0};const e=this._slabW%r.entryW,t=this._slabH%r.entryH;e&&cme(this._openRegionsByWidth,e,{x:r.x+this._slabW-e,w:e,y:r.y,h:this._slabH-(t??0)}),t&&cme(this._openRegionsByHeight,t,{x:r.x,w:this._slabW,y:r.y+this._slabH-t,h:t}),this._slabs.push(r),this._activeSlabsByDims.set(r,n.w,n.h)}const e=Math.floor(this._slabW/r.entryW);o=r.x+Math.floor(r.count%e)*r.entryW,s=r.y+Math.floor(r.count/e)*r.entryH,r.count++}this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,o,s,t,i);const a={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:o,y:s,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._allocatedGlyphs.add(a),a}getUsagePreview(){const e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=lme(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);let o=0,s=0,r=0;const a=64<<Math.floor(She().devicePixelRatio)-1,l=a;for(const c of this._slabs){let e=0,t=0;for(let i=0;i<c.count;i++)e+c.entryW>a&&(e=0,t+=c.entryH),n.fillStyle="#FF0000",n.fillRect(c.x+e,c.y+t,c.entryW,c.entryH),o+=c.entryW*c.entryH,e+=c.entryW;Math.floor(a/c.entryW),Math.floor(l/c.entryH),c.entryW,c.entryH}for(const c of this._allocatedGlyphs)s+=c.w*c.h,n.fillStyle="#4040FF",n.fillRect(c.x,c.y,c.w,c.h);const d=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(const c of d)n.fillStyle="#FF000088",n.fillRect(c.x,c.y,c.w,c.h),r+=c.w*c.h;return n.globalAlpha=.5,n.drawImage(this._canvas,0,0),n.globalAlpha=1,i.convertToBlob()}getStats(){const e=this._canvas.width,t=this._canvas.height;let i=0,n=0,o=0,s=0,r=0;const a=e*t,l=64<<Math.floor(She().devicePixelRatio)-1,d=l;for(const u of this._slabs){let e=0,t=0;for(let o=0;o<u.count;o++)e+u.entryW>l&&(e=0,t+=u.entryH),i+=u.entryW*u.entryH,e+=u.entryW;const n=Math.floor(l/u.entryW),s=Math.floor(d/u.entryH);o+=l*d-u.entryW*n*u.entryH*s}for(const u of this._allocatedGlyphs)n+=u.w*u.h;const c=Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());for(const u of c)r+=u.w*u.h;s=i-(n-(o-r));const h=n/(n+s+r);return[`page[${this._textureIndex}]:`,` Total: ${a}px (${e}x${t})`,` Used: ${n}px (${(n/a*100).toFixed(2)}%)`,` Wasted: ${s}px (${(s/a*100).toFixed(2)}%)`,`Restricted: ${r}px (${(r/a*100).toFixed(2)}%) (hard to allocate)`,`Efficiency: ${1===h?"100":(100*h).toFixed(2)}%`,` Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width/l)*Math.floor(this._canvas.height/d)}`].join("\n")}},Vv=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Hv=function(e,t){return function(i,n){t(i,n,e)}},zv=Bv=class extends Ie{get version(){return this._version}get usedArea(){return this._usedArea}get source(){return this._canvas}get glyphs(){return this._glyphInOrderSet.values()}constructor(e,t,i,n,o){switch(super(),this._logService=n,this._version=0,this._usedArea={left:0,top:0,right:0,bottom:0},this._glyphMap=new Ns,this._glyphInOrderSet=new Set,this._canvas=new OffscreenCanvas(t,t),this._colorMap=o.getColorTheme().tokenColorMap,i){case"shelf":this._allocator=new Fv(this._canvas,e);break;case"slab":this._allocator=new Wv(this._canvas,e);break;default:this._allocator=i(this._canvas,e)}this._register(Dle(()=>{this._canvas.width=1,this._canvas.height=1}))}getGlyph(e,t,i,n){return this._glyphMap.get(t,i,n,e.cacheKey)??this._createGlyph(e,t,i,n)}_createGlyph(e,t,i,n){if(this._glyphInOrderSet.size>=zv.maximumGlyphCount)return;const o=e.rasterizeGlyph(t,i,n,this._colorMap),s=this._allocator.allocate(o);return void 0!==s?(this._glyphMap.set(s,t,i,n,e.cacheKey),this._glyphInOrderSet.add(s),this._version++,this._usedArea.right=Math.max(this._usedArea.right,s.x+s.w-1),this._usedArea.bottom=Math.max(this._usedArea.bottom,s.y+s.h-1),this._logService.getLevel()===js.Trace&&this._logService.trace("New glyph",{chars:t,tokenMetadata:i,decorationStyleSetId:n,rasterizedGlyph:o,glyph:s}),s):void 0}getUsagePreview(){return this._allocator.getUsagePreview()}getStats(){return this._allocator.getStats()}},Bv.maximumGlyphCount=5e3,Uv=Bv,Uv=zv=Vv([Hv(3,Ks),Hv(4,Sf)],Uv),qv=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jv=function(e,t){return function(i,n){t(i,n,e)}},$v=Kv=class extends Ie{get pages(){return this._pages}constructor(e,t,i,n,o){super(),this._maxTextureSize=e,this._decorationStyleCache=i,this._themeService=n,this._instantiationService=o,this._warmUpTask=this._register(new Ne),this._warmedUpRasterizers=new Set,this._pages=[],this._glyphPageIndex=new Ns,this._onDidDeleteGlyphs=this._register(new je),this.onDidDeleteGlyphs=this._onDidDeleteGlyphs.event,this._allocatorType=t?.allocatorType??"slab",this._register(Be.runAndSubscribe(this._themeService.onDidColorThemeChange,()=>{this._colorMap&&this.clear(),this._colorMap=this._themeService.getColorTheme().tokenColorMap}));const s=Math.max(1,Math.floor(She().devicePixelRatio));this.pageSize=Math.min(1024*s,this._maxTextureSize),this._initFirstPage(),this._register(Dle(()=>kle(this._pages)))}_initFirstPage(){const e=this._instantiationService.createInstance(Uv,0,this.pageSize,this._allocatorType);this._pages.push(e);const t=new Ev(1,"",1,this._decorationStyleCache);e.getGlyph(t,"",0,0),t.dispose()}clear(){for(const e of this._pages)e.dispose();this._pages.length=0,this._glyphPageIndex.clear(),this._warmedUpRasterizers.clear(),this._warmUpTask.clear(),this._initFirstPage(),this._onDidDeleteGlyphs.fire()}getGlyph(e,t,i,n,o){return i&=-2048,i|=Math.floor(o%1*10),this._warmedUpRasterizers.has(e.id)||(this._warmUpAtlas(e),this._warmedUpRasterizers.add(e.id)),this._tryGetGlyph(this._glyphPageIndex.get(t,i,n,e.cacheKey)??0,e,t,i,n)}_tryGetGlyph(e,t,i,n,o){return this._glyphPageIndex.set(e,i,n,o,t.cacheKey),this._pages[e].getGlyph(t,i,n,o)??(e+1<this._pages.length?this._tryGetGlyph(e+1,t,i,n,o):void 0)??this._getGlyphFromNewPage(t,i,n,o)}_getGlyphFromNewPage(e,t,i,n){if(this._pages.length>=$v.maximumPageCount)throw new Error(`Attempt to create a texture atlas page past the limit ${$v.maximumPageCount}`);return this._pages.push(this._instantiationService.createInstance(Uv,this._pages.length,this.pageSize,this._allocatorType)),this._glyphPageIndex.set(this._pages.length-1,t,i,n,e.cacheKey),this._pages[this._pages.length-1].getGlyph(e,t,i,n)}getStats(){return this._pages.map(e=>e.getStats())}_warmUpAtlas(e){const t=this._colorMap;if(!t)throw new y("Cannot warm atlas without color map");this._warmUpTask.value?.clear();const i=this._warmUpTask.value=this._instantiationService.createInstance(Pv);for(let n=65;n<=90;n++)for(const o of t.keys())i.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),o<<15&16744448,0,t)});for(let n=97;n<=122;n++)for(const o of t.keys())i.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),o<<15&16744448,0,t)});for(let n=33;n<=126;n++)for(const o of t.keys())i.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),o<<15&16744448,0,t)})}},Kv.maximumPageCount=16,Gv=Kv,Gv=$v=qv([jv(3,Sf),jv(4,Jn)],Gv),function(e){e[e.Ignore=0]="Ignore",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(Zv||(Zv={})),function(e){const t="error",i="warning",n="info";e.fromValue=function(o){return o?ide(t,o)?e.Error:ide(i,o)||ide("warn",o)?e.Warning:ide(n,o)?e.Info:e.Ignore:e.Ignore},e.toString=function(o){switch(o){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(Zv||(Zv={})),Qv=Yv=Zv,Xv=eue("notificationService"),Jv=class{},function(e){e.requestDevice=async function(e){try{if(!navigator.gpu)throw new Error("This browser does not support WebGPU");const e=await navigator.gpu.requestAdapter();if(!e)throw new Error("This browser supports WebGPU but it appears to be disabled");return hme(await e.requestDevice())}catch(Fae){throw e&&e(Fae.message),Fae}},e.createBuffer=function(e,t,i){const n=e.createBuffer(t);return i&&e.queue.writeBuffer(n,0,fle(i)?i():i),hme(n)},e.createTexture=function(e,t){return hme(e.createTexture(t))}}(ew||(ew={})),tw=class{get dataOffset(){return this._startIndex}get dirtySize(){if(void 0!==this._startIndex&&void 0!==this._endIndex)return this._endIndex-this._startIndex+1}get isDirty(){return void 0!==this._startIndex}flag(e,t=1){return this._flag(e),t>1&&this._flag(e+t-1),e}_flag(e){(void 0===this._startIndex||e<this._startIndex)&&(this._startIndex=e),(void 0===this._endIndex||e>this._endIndex)&&(this._endIndex=e)}clear(){this._startIndex=void 0,this._endIndex=void 0}},iw=class extends Ie{get entryCount(){return this._entries.size}get dirtyTracker(){return this._dirtyTracker}constructor(e,t){super(),this.propertySpecs=e,this.capacity=t,this._dirtyTracker=new tw,this._propertySpecsMap=new Map,this._entries=new Ae,this._onDidChange=this._register(new je),this._onDidChangeBuffer=this._register(new je),this.onDidChangeBuffer=this._onDidChangeBuffer.event,this.view=new Float32Array(t*e.length),this.buffer=this.view.buffer,this._entrySize=e.length;for(let i=0;i<e.length;i++){const t={offset:i,...e[i]};this._propertySpecsMap.set(t.name,t)}this._register(Dle(()=>kle(this._entries)))}createEntry(e){this._entries.size===this.capacity&&(this._expandBuffer(),this._onDidChangeBuffer.fire());const t=new nw(this.view,this._propertySpecsMap,this._dirtyTracker,this._entries.size,e),i=this._entries.push(t),n=[];return n.push(Be.forward(t.onDidChange,this._onDidChange)),n.push(t.onWillDispose(()=>{const e=t.i;i(),this.view.set(this.view.subarray(e*this._entrySize+2,this._entries.size*this._entrySize+2),e*this._entrySize);for(const t of this._entries)t.i>e&&t.i--;this._dirtyTracker.flag(e,(this._entries.size-e)*this._entrySize),kle(n)})),t}_expandBuffer(){this.capacity*=2;const e=new Float32Array(this.capacity*this._entrySize);e.set(this.view),this.view=e,this.buffer=this.view.buffer}},nw=class extends Ie{constructor(e,t,i,n,o){super(),this._view=e,this._propertySpecsMap=t,this._dirtyTracker=i,this.i=n,this._onDidChange=this._register(new je),this.onDidChange=this._onDidChange.event,this._onWillDispose=this._register(new je),this.onWillDispose=this._onWillDispose.event;for(const s of this._propertySpecsMap.values())this._view[this.i*this._propertySpecsMap.size+s.offset]=o[s.name];this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}dispose(){this._onWillDispose.fire(),super.dispose()}setRaw(e){if(e.length!==this._propertySpecsMap.size)throw new Error(`Data length ${e.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);this._view.set(e,this.i*this._propertySpecsMap.size),this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}},ow=class extends yp{constructor(e,t,i,n,o,s){super(),this._context=e,this._contentLeft=t,this._devicePixelRatio=i,this._canvas=n,this._ctx=o,this._shapeBindBuffer=this._register(new Ne),this._initialized=!1,this._shapeCollection=this._register(new iw([{name:"x"},{name:"y"},{name:"width"},{name:"height"},{name:"red"},{name:"green"},{name:"blue"},{name:"alpha"}],32)),this._context.addEventHandler(this),this._initWebgpu(s)}async _initWebgpu(e){if(this._device=await e,this._store.isDisposed)return;const t=navigator.gpu.getPreferredCanvasFormat();let i;this._ctx.configure({device:this._device,format:t,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco rectangle renderer render pass",colorAttachments:[this._renderPassColorAttachment]};{const e=new Float32Array(6),t=(t=this._canvas.width,i=this._canvas.height)=>(e[0]=t,e[1]=i,e[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*She().devicePixelRatio),e[3]=0,e[4]=e[0]-e[2],e[5]=e[1]-e[3],e);i=this._register(ew.createBuffer(this._device,{label:"Monaco rectangle renderer uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>t())).object,this._register(dme(this._canvas,She(),(e,n)=>{this._device.queue.writeBuffer(i,0,t(e,n))}))}this._scrollOffsetBindBuffer=this._register(ew.createBuffer(this._device,{label:"Monaco rectangle renderer scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2);const n=()=>ew.createBuffer(this._device,{label:"Monaco rectangle renderer shape buffer",size:this._shapeCollection.buffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});this._shapeBindBuffer.value=n(),this._register(Be.runAndSubscribe(this._shapeCollection.onDidChangeBuffer,()=>{this._shapeBindBuffer.value=n(),this._pipeline&&this._updateBindGroup(this._pipeline,i)})),this._vertexBuffer=this._register(ew.createBuffer(this._device,{label:"Monaco rectangle renderer vertex buffer",size:Dv.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},Dv)).object;const o=this._device.createShaderModule({label:"Monaco rectangle renderer shader module",code:"\n\nstruct Vertex {\n\t@location(0) position: vec2f,\n};\n\nstruct LayoutInfo {\n\tcanvasDims: vec2f,\n\tviewportOffset: vec2f,\n\tviewportDims: vec2f,\n}\n\nstruct ScrollOffset {\n\toffset: vec2f,\n}\n\nstruct Shape {\n\tposition: vec2f,\n\tsize: vec2f,\n\tcolor: vec4f,\n};\n\nstruct VSOutput {\n\t@builtin(position) position: vec4f,\n\t@location(1) color: vec4f,\n};\n\n// Uniforms\n@group(0) @binding(1) var<uniform> layoutInfo: LayoutInfo;\n\n// Storage buffers\n@group(0) @binding(0) var<storage, read> shapes: array<Shape>;\n@group(0) @binding(2) var<uniform> scrollOffset: ScrollOffset;\n\n@vertex fn vs(\n\tvert: Vertex,\n\t@builtin(instance_index) instanceIndex: u32,\n\t@builtin(vertex_index) vertexIndex : u32\n) -> VSOutput {\n\tlet shape = shapes[instanceIndex];\n\n\tvar vsOut: VSOutput;\n\tvsOut.position = vec4f(\n\t\t(\n\t\t\t// Top left corner\n\t\t\tvec2f(-1, 1) +\n\t\t\t// Convert pixel position to clipspace\n\t\t\tvec2f( 2, -2) / layoutInfo.canvasDims *\n\t\t\t// Shape position and size\n\t\t\t(layoutInfo.viewportOffset - scrollOffset.offset + shape.position + vert.position * shape.size)\n\t\t),\n\t\t0.0,\n\t\t1.0\n\t);\n\tvsOut.color = shape.color;\n\treturn vsOut;\n}\n\n@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {\n\treturn vsOut.color;\n}\n"});this._pipeline=this._device.createRenderPipeline({label:"Monaco rectangle renderer render pipeline",layout:"auto",vertex:{module:o,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:o,targets:[{format:t,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._updateBindGroup(this._pipeline,i),this._initialized=!0}_updateBindGroup(e,t){this._bindGroup=this._device.createBindGroup({label:"Monaco rectangle renderer bind group",layout:e.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._shapeBindBuffer.value.object}},{binding:1,resource:{buffer:t}},{binding:2,resource:{buffer:this._scrollOffsetBindBuffer}}]})}register(e,t,i,n,o,s,r,a){return this._shapeCollection.createEntry({x:e,y:t,width:i,height:n,red:o,green:s,blue:r,alpha:a})}onScrollChanged(e){if(this._device){const e=She().devicePixelRatio;this._scrollOffsetValueBuffer[0]=this._context.viewLayout.getCurrentScrollLeft()*e,this._scrollOffsetValueBuffer[1]=this._context.viewLayout.getCurrentScrollTop()*e,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer)}return!0}_update(){if(!this._device)return;const e=this._shapeCollection;e.dirtyTracker.isDirty&&(this._device.queue.writeBuffer(this._shapeBindBuffer.value.object,0,e.buffer,e.dirtyTracker.dataOffset,e.dirtyTracker.dirtySize*e.view.BYTES_PER_ELEMENT),e.dirtyTracker.clear())}draw(e){if(!this._initialized)return;this._update();const t=this._device.createCommandEncoder({label:"Monaco rectangle renderer command encoder"});this._renderPassColorAttachment.view=this._ctx.getCurrentTexture().createView();const i=t.beginRenderPass(this._renderPassDescriptor);i.setPipeline(this._pipeline),i.setVertexBuffer(0,this._vertexBuffer),i.setBindGroup(0,this._bindGroup);const n=Math.ceil(this._contentLeft.get()*this._devicePixelRatio.get());i.setScissorRect(n,0,this._canvas.width-n,this._canvas.height),i.draw(Dv.length/2,this._shapeCollection.entryCount),i.end();const o=t.finish();this._device.queue.submit([o])}},sw=class extends Ie{constructor(){super(),this._ruleCache=new Map,this._container=Ahe("div.monaco-decoration-css-rule-extractor"),this._dummyElement=Ahe("span"),this._container.appendChild(this._dummyElement),this._register(Dle(()=>this._container.remove()))}getStyleRules(e,t){const i=this._ruleCache.get(t);if(i)return i;this._dummyElement.className=t,e.appendChild(this._container);const n=this._getStyleRules(t);return this._ruleCache.set(t,n),e.removeChild(this._container),n}_getStyleRules(e){const t=[],i=[...yhe().styleSheets];for(let n=0;n<i.length;n++){const o=i[n];for(const n of o.cssRules)if(n instanceof CSSImportRule)n.styleSheet&&i.push(n.styleSheet);else if(n instanceof CSSStyleRule){const i=`.${e}`,o=n.selectorText.indexOf(i);if(-1!==o){const e=o+i.length;(n.selectorText.length===e||n.selectorText.substring(e,e+1).match(/[ :]/))&&t.push(n)}}}return t}},rw=class{constructor(){this._nextId=1,this._cacheById=new Map,this._cacheByStyle=new Ns}getOrCreateEntry(e,t,i){if(void 0===e&&void 0===t&&void 0===i)return 0;const n=this._cacheByStyle.get(e??0,t?1:0,void 0===i?"":i.toFixed(2));if(n)return n.id;const o=this._nextId++,s={id:o,color:e,bold:t,opacity:i};return this._cacheById.set(o,s),this._cacheByStyle.set(s,e??0,t?1:0,void 0===i?"":i.toFixed(2)),o}getStyleSet(e){if(0!==e)return this._cacheById.get(e)}},lw=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},dw=function(e,t){return function(i,n){t(i,n,e)}},aw=class extends Ie{static get decorationCssRuleExtractor(){return cw._decorationCssRuleExtractor}static get decorationStyleCache(){return cw._decorationStyleCache}static get atlas(){if(!cw._atlas)throw new y("Cannot call ViewGpuContext.textureAtlas before device is resolved");return cw._atlas}get atlas(){return cw.atlas}constructor(e,t,i,n){super(),this._instantiationService=t,this._notificationService=i,this.configurationService=n,this.maxGpuCols=2e3,this.canvas=Fge(document.createElement("canvas")),this.canvas.setClassName("editorCanvas"),this._register(Be.runAndSubscribe(n.onDidChangeConfiguration,e=>{if(!e||e.affectsConfiguration("editor.scrollbar.verticalScrollbarSize")){const e=n.getValue("editor").scrollbar?.verticalScrollbarSize??14;this.canvas.domNode.style.boxSizing="border-box",this.canvas.domNode.style.paddingRight=`${e}px`}})),this.ctx=lme(this.canvas.domNode.getContext("webgpu")),cw.device||(cw.device=ew.requestDevice(e=>{const t=[{label:Vae(78,"Use DOM-based rendering"),run:()=>this.configurationService.updateValue("editor.experimentalGpuAcceleration","off")}];this._notificationService.prompt(Qv.Warning,e,t)}).then(e=>(cw.deviceSync=e.object,cw._atlas||(cw._atlas=this._instantiationService.createInstance(Gv,e.object.limits.maxTextureDimension2D,void 0,cw.decorationStyleCache)),e.object)));const o=Qce(this,She().devicePixelRatio);this._register(ehe(She(),"resize",()=>{o.set(She().devicePixelRatio,void 0)})),this.devicePixelRatio=o,this._register(ume(this.devicePixelRatio,()=>cw.atlas?.clear()));const s=Qce(this,{width:this.canvas.domNode.width,height:this.canvas.domNode.height});this._register(dme(this.canvas.domNode,She(),(e,t)=>{this.canvas.domNode.width=e,this.canvas.domNode.height=t,s.set({width:e,height:t},void 0)})),this.canvasDevicePixelDimensions=s;const r=Qce(this,0);this._register(this.configurationService.onDidChangeConfiguration(t=>{r.set(e.configuration.options.get(165).contentLeft,void 0)})),this.contentLeft=r,this.rectangleRenderer=this._instantiationService.createInstance(ow,e,this.contentLeft,this.devicePixelRatio,this.canvas.domNode,this.ctx,cw.device)}canRender(e,t,i){const n=t.getViewLineRenderingData(i);if(n.containsRTL||n.maxColumn>this.maxGpuCols)return!1;if(n.inlineDecorations.length>0){let e=!0;for(const t of n.inlineDecorations){if(0!==t.type){e=!1;break}const i=cw._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,t.inlineClassName);if(e&&(e=i.every(e=>{if(e.selectorText.includes(":"))return!1;for(const t of e.style)if(!pme(t,e.style))return!1;return!0})),!e)break}return e}return!0}canRenderDetailed(e,t,i){const n=t.getViewLineRenderingData(i),o=[];if(n.containsRTL&&o.push("containsRTL"),n.maxColumn>this.maxGpuCols&&o.push("maxColumn > maxGpuCols"),n.inlineDecorations.length>0){let e=!0;const t=[],i=[],s=[];for(const o of n.inlineDecorations){if(0!==o.type){t.push(o.type),e=!1;continue}const n=cw._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,o.inlineClassName);e&&(e=n.every(e=>{if(e.selectorText.includes(":"))return i.push(e.selectorText),!1;for(const t of e.style)if(!pme(t,e.style))return s.push(`${t}: ${e.style[t]}`),!1;return!0}))}t.length>0&&o.push(`inlineDecorations with unsupported types (${t.map(e=>`\`${e}\``).join(", ")})`),s.length>0&&o.push(`inlineDecorations with unsupported CSS rules (${s.map(e=>`\`${e}\``).join(", ")})`),i.length>0&&o.push(`inlineDecorations with unsupported CSS selectors (${i.map(e=>`\`${e}\``).join(", ")})`)}return o}},cw=aw,aw._decorationCssRuleExtractor=new sw,aw._decorationStyleCache=new rw,hw=aw,hw=cw=lw([dw(1,Jn),dw(2,Xv),dw(3,ka)],hw),uw=["color","font-weight","opacity"],gw=class{constructor(e){this._content=e.content}getSegmentAtIndex(e){return this._content[e]}},pw=class{constructor(e){this._segments=[];const t=e.content,i=Hr.Segmenter(void 0,{granularity:"grapheme"}).value,n=Array.from(i.segment(t));let o=0;for(let s=0;s<t.length;s++){const e=n[o];if(!e)break;e.index===s?(o++,this._segments.push(e)):this._segments.push(void 0)}}getSegmentAtIndex(e){return this._segments[e]?.segment}},mw=class extends yp{get glyphRasterizer(){return this._glyphRasterizer.value}constructor(e,t,i,n){super(),this._context=e,this._viewGpuContext=t,this._device=i,this._glyphRasterizer=n,this._context.addEventHandler(this)}},fw=`\nstruct GlyphInfo {\n\tposition: vec2f,\n\tsize: vec2f,\n\torigin: vec2f,\n};\n\nstruct Vertex {\n\t@location(0) position: vec2f,\n};\n\nstruct Cell {\n\tposition: vec2f,\n\tunused1: vec2f,\n\tglyphIndex: f32,\n\ttextureIndex: f32\n};\n\nstruct LayoutInfo {\n\tcanvasDims: vec2f,\n\tviewportOffset: vec2f,\n\tviewportDims: vec2f,\n}\n\nstruct ScrollOffset {\n\toffset: vec2f\n}\n\nstruct VSOutput {\n\t@builtin(position) position: vec4f,\n\t@location(1) layerIndex: f32,\n\t@location(0) texcoord: vec2f,\n};\n\n// Uniforms\n@group(0) @binding(4) var<uniform> layoutInfo: LayoutInfo;\n@group(0) @binding(5) var<uniform> atlasDims: vec2f;\n@group(0) @binding(6) var<uniform> scrollOffset: ScrollOffset;\n\n// Storage buffers\n@group(0) @binding(0) var<storage, read> glyphInfo: array<array<GlyphInfo, ${Uv.maximumGlyphCount}>, ${Gv.maximumPageCount}>;\n@group(0) @binding(1) var<storage, read> cells: array<Cell>;\n\n@vertex fn vs(\n\tvert: Vertex,\n\t@builtin(instance_index) instanceIndex: u32,\n\t@builtin(vertex_index) vertexIndex : u32\n) -> VSOutput {\n\tlet cell = cells[instanceIndex];\n\tvar glyph = glyphInfo[u32(cell.textureIndex)][u32(cell.glyphIndex)];\n\n\tvar vsOut: VSOutput;\n\t// Multiple vert.position by 2,-2 to get it into clipspace which ranged from -1 to 1\n\tvsOut.position = vec4f(\n\t\t// Make everything relative to top left instead of center\n\t\tvec2f(-1, 1) +\n\t\t((vert.position * vec2f(2, -2)) / layoutInfo.canvasDims) * glyph.size +\n\t\t((cell.position * vec2f(2, -2)) / layoutInfo.canvasDims) +\n\t\t((glyph.origin * vec2f(2, -2)) / layoutInfo.canvasDims) +\n\t\t(((layoutInfo.viewportOffset - scrollOffset.offset * vec2(1, -1)) * 2) / layoutInfo.canvasDims),\n\t\t0.0,\n\t\t1.0\n\t);\n\n\tvsOut.layerIndex = cell.textureIndex;\n\t// Textures are flipped from natural direction on the y-axis, so flip it back\n\tvsOut.texcoord = vert.position;\n\tvsOut.texcoord = (\n\t\t// Glyph offset (0-1)\n\t\t(glyph.position / atlasDims) +\n\t\t// Glyph coordinate (0-1)\n\t\t(vsOut.texcoord * (glyph.size / atlasDims))\n\t);\n\n\treturn vsOut;\n}\n\n@group(0) @binding(2) var ourSampler: sampler;\n@group(0) @binding(3) var ourTexture: texture_2d_array<f32>;\n\n@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {\n\treturn textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex));\n}\n`,_w=class e extends mw{get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="viewport",this.wgsl=fw,this._cellBindBufferLineCapacity=63,this._activeDoubleBufferIndex=0,this._visibleObjectCount=0,this._scrollInitialized=!1,this._onDidChangeBindGroupEntries=this._register(new je),this.onDidChangeBindGroupEntries=this._onDidChangeBindGroupEntries.event,this._rebuildCellBuffer(this._cellBindBufferLineCapacity),this._scrollOffsetBindBuffer=this._register(ew.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2)}_rebuildCellBuffer(t){this._cellBindBuffer?.destroy();const i=32*(Math.floor(t/32)+1),n=i*e.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(ew.createBuffer(this._device,{label:"Monaco full file cell buffer",size:n,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(n),new ArrayBuffer(n)],this._cellBindBufferLineCapacity=i,this._onDidChangeBindGroupEntries.fire()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onTokensChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLinesChanged(e){return!0}onScrollChanged(e){const t=She().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return!0}onLineMappingChanged(e){return!0}onZonesChanged(e){return!0}reset(){for(const e of[0,1]){const t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}}update(t,i){let n,o,s,r,a,l,d,c,h="",u=0,g=0,p=0,m=0,f=0,_=0,b=0,v=0,w=0,C=0,S=0,x=0;const k=She().devicePixelRatio;let L;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0),this._cellBindBufferLineCapacity<t.endLineNumber-t.startLineNumber+1&&this._rebuildCellBuffer(t.endLineNumber-t.startLineNumber+1);const D=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);D.fill(0);const I=6*e.maxSupportedColumns;for(g=t.startLineNumber;g<=t.endLineNumber;g++)if(this._viewGpuContext.canRender(i,t,g)){l=t.getViewLineRenderingData(g),_=0,L=mme(l,i),u=i.spaceWidth*k,m=0,c=l.tokens,v=l.minColumn-1,w=0;for(let S=0,x=c.getCount();S<x;S++)if(w=c.getEndOffset(S),!(w<=v)){for(C=c.getMetadata(S),p=v;p<w&&!(p>e.maxSupportedColumns);p++){if(n=L.getSegmentAtIndex(p),void 0===n)continue;for(d of(h=n,l.isBasicASCII&&i.useMonospaceOptimizations||(u=this.glyphRasterizer.getTextMetrics(h).width),r=void 0,s=void 0,a=void 0,l.inlineDecorations)){if(g<d.range.startLineNumber||g>d.range.endLineNumber||g===d.range.startLineNumber&&p<d.range.startColumn-1||g===d.range.endLineNumber&&p>=d.range.endColumn-1)continue;const e=hw.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,d.inlineClassName);for(const t of e)for(const e of t.style){const i=t.styleMap.get(e)?.toString()??"";switch(e){case"color":{const e=eh.Format.CSS.parse(i);if(!e)throw new y("Invalid color format "+i);r=e.toNumber32Bit();break}case"font-weight":s=fme(i)>=400;break;case"opacity":a=_me(i);break;default:throw new y("Unexpected inline decoration style")}}}if(" "===h||"\t"===h){if(b=6*((g-1)*e.maxSupportedColumns+p),D.fill(0,b,b+6),"\t"===h){const e=p+_;_=br.nextRenderTabStop(p+_,l.tabSize),m+=u*(_-e),_-=p+1}else m+=u;continue}const c=hw.decorationStyleCache.getOrCreateEntry(r,s,a);o=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,h,C,c,m),f=Math.round(t.relativeVerticalOffset[g-t.startLineNumber]*k+Math.floor((t.lineHeight*k-(o.fontBoundingBoxAscent+o.fontBoundingBoxDescent))/2)+o.fontBoundingBoxAscent),b=6*((g-t.startLineNumber)*e.maxSupportedColumns+p),D[b+0]=Math.floor(m),D[b+1]=f,D[b+4]=o.glyphIndex,D[b+5]=o.pageIndex,m+=u}v=w}S=6*((g-t.startLineNumber)*e.maxSupportedColumns+w),x=(g-t.startLineNumber)*e.maxSupportedColumns*6,D.fill(0,S,x)}const N=(t.endLineNumber-t.startLineNumber+1)*I;return this._device.queue.writeBuffer(this._cellBindBuffer,0,D.buffer,0,(t.endLineNumber-t.startLineNumber)*I*Float32Array.BYTES_PER_ELEMENT),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=N,N}draw(e,t){if(this._visibleObjectCount<=0)throw new y("Attempt to draw 0 objects");e.draw(Dv.length/2,this._visibleObjectCount)}},_w.maxSupportedColumns=2e3,vw=class e extends mw{get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(t,i,n,o){super(t,i,n,o),this.type="fullfile",this.wgsl=fw,this._activeDoubleBufferIndex=0,this._upToDateLines=[new Set,new Set],this._visibleObjectCount=0,this._finalRenderedLine=0,this._scrollInitialized=!1,this._queuedBufferUpdates=[[],[]];const s=e.maxSupportedLines*e.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(ew.createBuffer(this._device,{label:"Monaco full file cell buffer",size:s,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(s),new ArrayBuffer(s)],this._scrollOffsetBindBuffer=this._register(ew.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2)}onConfigurationChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onDecorationsChanged(e){return this._invalidateAllLines(),!0}onTokensChanged(e){for(const t of e.ranges)this._invalidateLineRange(t.fromLineNumber,t.toLineNumber);return!0}onLinesDeleted(e){return this._invalidateLinesFrom(e.fromLineNumber),this._queueBufferUpdate(e),!0}onLinesInserted(e){return this._invalidateLinesFrom(e.fromLineNumber),!0}onLinesChanged(e){return this._invalidateLineRange(e.fromLineNumber,e.fromLineNumber+e.count),!0}onScrollChanged(e){const t=She().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return this._invalidateAllLines(),!0}onLineMappingChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onZonesChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}_invalidateAllLines(){this._upToDateLines[0].clear(),this._upToDateLines[1].clear()}_invalidateLinesFrom(e){for(const t of[0,1]){const i=this._upToDateLines[t];for(const t of i)t>=e&&i.delete(t)}}_invalidateLineRange(e,t){for(let i=e;i<=t;i++)this._upToDateLines[0].delete(i),this._upToDateLines[1].delete(i)}reset(){this._invalidateAllLines();for(const e of[0,1]){const t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}this._finalRenderedLine=0}update(t,i){let n,o,s,r,a,l,d,c,h="",u=0,g=0,p=0,m=0,f=0,_=0,b=0,v=0,w=0,C=0,S=0,x=0;const k=She().devicePixelRatio;let L;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0);const D=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]),I=6*e.maxSupportedColumns,N=this._upToDateLines[this._activeDoubleBufferIndex];let E=3e3,M=0;const T=this._queuedBufferUpdates[this._activeDoubleBufferIndex];for(;T.length;){const t=T.shift();switch(t.type){case 2:case 8:case 17:D.fill(0),E=1,M=Math.max(M,this._finalRenderedLine),this._finalRenderedLine=0;break;case 10:{const i=(t.fromLineNumber-1)*e.maxSupportedColumns*6,n=t.toLineNumber*e.maxSupportedColumns*6,o=(this._finalRenderedLine-(t.toLineNumber-t.fromLineNumber+1))*e.maxSupportedColumns*6;D.set(D.subarray(n),i),D.fill(0,o),E=Math.min(E,t.fromLineNumber),M=Math.max(M,this._finalRenderedLine),this._finalRenderedLine-=t.toLineNumber-t.fromLineNumber+1;break}}}for(g=t.startLineNumber;g<=t.endLineNumber;g++)if(this._viewGpuContext.canRender(i,t,g)){if(!N.has(g)){E=Math.min(E,g),M=Math.max(M,g),l=t.getViewLineRenderingData(g),_=0,L=mme(l,i),u=i.spaceWidth*k,m=0,c=l.tokens,v=l.minColumn-1,w=0;for(let S=0,x=c.getCount();S<x;S++)if(w=c.getEndOffset(S),!(w<=v)){for(C=c.getMetadata(S),p=v;p<w&&!(p>e.maxSupportedColumns);p++){if(n=L.getSegmentAtIndex(p),void 0===n)continue;for(d of(h=n,l.isBasicASCII&&i.useMonospaceOptimizations||(u=this.glyphRasterizer.getTextMetrics(h).width),r=void 0,s=void 0,a=void 0,l.inlineDecorations)){if(g<d.range.startLineNumber||g>d.range.endLineNumber||g===d.range.startLineNumber&&p<d.range.startColumn-1||g===d.range.endLineNumber&&p>=d.range.endColumn-1)continue;const e=hw.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,d.inlineClassName);for(const t of e)for(const e of t.style){const i=t.styleMap.get(e)?.toString()??"";switch(e){case"color":{const e=eh.Format.CSS.parse(i);if(!e)throw new y("Invalid color format "+i);r=e.toNumber32Bit();break}case"font-weight":s=bme(i)>=400;break;case"opacity":a=vme(i);break;default:throw new y("Unexpected inline decoration style")}}}if(" "===h||"\t"===h){if(b=6*((g-1)*e.maxSupportedColumns+p),D.fill(0,b,b+6),"\t"===h){const e=p+_;_=br.nextRenderTabStop(p+_,l.tabSize),m+=u*(_-e),_-=p+1}else m+=u;continue}const c=hw.decorationStyleCache.getOrCreateEntry(r,s,a);o=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,h,C,c,m),f=Math.round(t.relativeVerticalOffset[g-t.startLineNumber]*k+Math.floor((t.lineHeight*k-(o.fontBoundingBoxAscent+o.fontBoundingBoxDescent))/2)+o.fontBoundingBoxAscent),b=6*((g-1)*e.maxSupportedColumns+p),D[b+0]=Math.floor(m),D[b+1]=f,D[b+4]=o.glyphIndex,D[b+5]=o.pageIndex,m+=u}v=w}S=6*((g-1)*e.maxSupportedColumns+w),x=g*e.maxSupportedColumns*6,D.fill(0,S,x),N.add(g)}}else S=(g-1)*e.maxSupportedColumns*6,x=g*e.maxSupportedColumns*6,D.fill(0,S,x),E=Math.min(E,g),M=Math.max(M,g);const R=(t.endLineNumber-t.startLineNumber+1)*I;return E=Math.min(E,e.maxSupportedLines),M=Math.min(M,e.maxSupportedLines),E<=M&&this._device.queue.writeBuffer(this._cellBindBuffer,(E-1)*I*Float32Array.BYTES_PER_ELEMENT,D.buffer,(E-1)*I*Float32Array.BYTES_PER_ELEMENT,(M-E+1)*I*Float32Array.BYTES_PER_ELEMENT),this._finalRenderedLine=Math.max(this._finalRenderedLine,M),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=R,R}draw(t,i){if(this._visibleObjectCount<=0)throw new y("Attempt to draw 0 objects");t.draw(Dv.length/2,this._visibleObjectCount,void 0,(i.startLineNumber-1)*e.maxSupportedColumns)}_queueBufferUpdate(e){this._queuedBufferUpdates[0].push(e),this._queuedBufferUpdates[1].push(e)}},(bw=vw).maxSupportedLines=3e3,bw.maxSupportedColumns=200,ww=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Cw=function(e,t){return function(i,n){t(i,n,e)}},yw=class extends Sp{constructor(e,t,i,n){super(e),this._viewGpuContext=t,this._instantiationService=i,this._logService=n,this._atlasGpuTextureVersions=[],this._initialized=!1,this._glyphRasterizer=this._register(new Ne),this._renderStrategy=this._register(new Ne),this.canvas=this._viewGpuContext.canvas.domNode,this._register(Rce(e=>{this._viewGpuContext.canvasDevicePixelDimensions.read(e);const t=this._lastViewportData;t&&setTimeout(()=>{t===this._lastViewportData&&this.renderText(t)})})),this.initWebgpu()}async initWebgpu(){if(this._device=hw.deviceSync||await hw.device,this._store.isDisposed)return;const e=hw.atlas;this._register(e.onDidDeleteGlyphs(()=>{this._atlasGpuTextureVersions.length=0,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._renderStrategy.value.reset()}));const t=navigator.gpu.getPreferredCanvasFormat();let i,n;this._viewGpuContext.ctx.configure({device:this._device,format:t,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco render pass",colorAttachments:[this._renderPassColorAttachment]};{const e=new Float32Array(6),t=(t=this.canvas.width,i=this.canvas.height)=>(e[0]=t,e[1]=i,e[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*She().devicePixelRatio),e[3]=0,e[4]=e[0]-e[2],e[5]=e[1]-e[3],e);i=this._register(ew.createBuffer(this._device,{label:"Monaco uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>t())).object,this._register(ume(this._viewGpuContext.canvasDevicePixelDimensions,({width:e,height:n})=>{this._device.queue.writeBuffer(i,0,t(e,n))})),this._register(ume(this._viewGpuContext.contentLeft,()=>{this._device.queue.writeBuffer(i,0,t())}))}n=this._register(ew.createBuffer(this._device,{label:"Monaco atlas info uniform buffer",size:8,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>{const t=new Float32Array(2);return t[0]=e.pageSize,t[1]=e.pageSize,t})).object;const o=this._context.configuration.options.get(58),s=this._context.configuration.options.get(61);this._glyphRasterizer.value=this._register(new Ev(s,o,this._viewGpuContext.devicePixelRatio.get(),hw.decorationStyleCache)),this._register(ume(this._viewGpuContext.devicePixelRatio,()=>{this._refreshGlyphRasterizer()})),this._renderStrategy.value=this._instantiationService.createInstance(vw,this._context,this._viewGpuContext,this._device,this._glyphRasterizer),this._glyphStorageBuffer=this._register(ew.createBuffer(this._device,{label:"Monaco glyph storage buffer",size:Gv.maximumPageCount*(24*Uv.maximumGlyphCount),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._atlasGpuTexture=this._register(ew.createTexture(this._device,{label:"Monaco atlas texture",format:"rgba8unorm",size:{width:e.pageSize,height:e.pageSize,depthOrArrayLayers:Gv.maximumPageCount},dimension:"2d",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT})).object,this._updateAtlasStorageBufferAndTexture(),this._vertexBuffer=this._register(ew.createBuffer(this._device,{label:"Monaco vertex buffer",size:Dv.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},Dv)).object;const r=this._device.createShaderModule({label:"Monaco shader module",code:this._renderStrategy.value.wgsl});if(this._pipeline=this._device.createRenderPipeline({label:"Monaco render pipeline",layout:"auto",vertex:{module:r,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:r,targets:[{format:t,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._rebuildBindGroup=()=>{this._bindGroup=this._device.createBindGroup({label:"Monaco bind group",layout:this._pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._glyphStorageBuffer}},{binding:2,resource:this._device.createSampler({label:"Monaco atlas sampler",magFilter:"nearest",minFilter:"nearest"})},{binding:3,resource:this._atlasGpuTexture.createView()},{binding:4,resource:{buffer:i}},{binding:5,resource:{buffer:n}},...this._renderStrategy.value.bindGroupEntries]})},this._rebuildBindGroup(),this._initialized=!0,this._initViewportData){for(const e of this._initViewportData)this.renderText(e);this._initViewportData=void 0}}_refreshRenderStrategy(e){if("viewport"===this._renderStrategy.value?.type)return;if(e.endLineNumber<vw.maxSupportedLines&&this._viewportMaxColumn(e)<vw.maxSupportedColumns)return;this._logService.trace(`File is larger than ${vw.maxSupportedLines} lines or ${vw.maxSupportedColumns} columns, switching to viewport render strategy`);const t=this._instantiationService.createInstance(_w,this._context,this._viewGpuContext,this._device,this._glyphRasterizer);this._renderStrategy.value=t,this._register(t.onDidChangeBindGroupEntries(()=>this._rebuildBindGroup?.())),this._rebuildBindGroup?.()}_viewportMaxColumn(e){let t,i=0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++)t=e.getViewLineRenderingData(n),i=Math.max(i,t.maxColumn);return i}_updateAtlasStorageBufferAndTexture(){for(const[e,t]of hw.atlas.pages.entries()){if(e>=Gv.maximumPageCount){console.log(`Attempt to upload atlas page [${e}], only ${Gv.maximumPageCount} are supported currently`);continue}if(t.version===this._atlasGpuTextureVersions[e])continue;this._logService.trace("Updating atlas page[",e,"] from version ",this._atlasGpuTextureVersions[e]," to version ",t.version);const i=6*Uv.maximumGlyphCount,n=new Float32Array(i);let o=0;for(const e of t.glyphs)n[o+0]=e.x,n[o+0+1]=e.y,n[o+2]=e.w,n[o+2+1]=e.h,n[o+4]=e.originOffsetX,n[o+4+1]=e.originOffsetY,o+=6;if(o/6>Uv.maximumGlyphCount)throw new Error(`Attempting to write more glyphs (${o/6}) than the GPUBuffer can hold (${Uv.maximumGlyphCount})`);this._device.queue.writeBuffer(this._glyphStorageBuffer,6*e*Uv.maximumGlyphCount*Float32Array.BYTES_PER_ELEMENT,n,0,6*Uv.maximumGlyphCount),t.usedArea.right-t.usedArea.left>0&&t.usedArea.bottom-t.usedArea.top>0&&this._device.queue.copyExternalImageToTexture({source:t.source},{texture:this._atlasGpuTexture,origin:{x:t.usedArea.left,y:t.usedArea.top,z:e}},{width:t.usedArea.right-t.usedArea.left+1,height:t.usedArea.bottom-t.usedArea.top+1}),this._atlasGpuTextureVersions[e]=t.version}}prepareRender(e){throw new y("Should not be called")}render(e){throw new y("Should not be called")}onConfigurationChanged(e){return this._refreshGlyphRasterizer(),!0}onCursorStateChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLineMappingChanged(e){return!0}onRevealRangeRequest(e){return!0}onScrollChanged(e){return!0}onThemeChanged(e){return!0}onZonesChanged(e){return!0}_refreshGlyphRasterizer(){const e=this._glyphRasterizer.value;if(!e)return;const t=this._context.configuration.options.get(58),i=this._context.configuration.options.get(61),n=this._viewGpuContext.devicePixelRatio.get();e.fontFamily===t&&e.fontSize===i&&e.devicePixelRatio===n||(this._glyphRasterizer.value=new Ev(i,t,n,hw.decorationStyleCache))}renderText(e){if(this._initialized)return this._refreshRenderStrategy(e),this._renderText(e);this._initViewportData=this._initViewportData??[],this._initViewportData.push(e)}_renderText(e){this._viewGpuContext.rectangleRenderer.draw(e);const t=new Y_(this._context.configuration,this._context.theme.type);this._renderStrategy.value.update(e,t),this._updateAtlasStorageBufferAndTexture();const i=this._device.createCommandEncoder({label:"Monaco command encoder"});this._renderPassColorAttachment.view=this._viewGpuContext.ctx.getCurrentTexture().createView({label:"Monaco canvas texture view"});const n=i.beginRenderPass(this._renderPassDescriptor);n.setPipeline(this._pipeline),n.setVertexBuffer(0,this._vertexBuffer);const o=Math.ceil(this._viewGpuContext.contentLeft.get()*this._viewGpuContext.devicePixelRatio.get());n.setScissorRect(o,0,this.canvas.width-o,this.canvas.height),n.setBindGroup(0,this._bindGroup),this._renderStrategy.value.draw(n,e),n.end();const s=i.finish();this._device.queue.submit([s]),this._lastViewportData=e,this._lastViewLineOptions=t}linesVisibleRangesForRange(e,t){if(!this._lastViewportData)return null;const i=e.endLineNumber,n=mr.intersectRanges(e,this._lastViewportData.visibleRange);if(!n)return null;const o=this._lastViewportData.startLineNumber,s=this._lastViewportData.endLineNumber,r=this._lastViewportData,a=this._lastViewLineOptions;if(!r||!a)return null;const l=[];let d=0;t&&(d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new to(n.startLineNumber,1)).lineNumber);for(let c=n.startLineNumber;c<=n.endLineNumber;c++){if(c<o||c>s)continue;const e=c===n.startLineNumber?n.startColumn:1,r=c!==i,h=r?this._context.viewModel.getLineMaxColumn(c):n.endColumn,u=this._visibleRangesForLineRange(c,e,h);if(u){if(t&&c<i){const e=d;d=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new to(c+1,1)).lineNumber,e!==d&&(u.ranges[u.ranges.length-1].width+=a.spaceWidth)}l.push(new Dp(u.outsideRenderedLine,c,Ip.from(u.ranges),r))}}return 0===l.length?null:l}_visibleRangesForLineRange(e,t,i){if(this.shouldRender())return null;const n=this._lastViewportData,o=this._lastViewLineOptions;if(!n||!o||e<n.startLineNumber||e>n.endLineNumber)return null;const s=n.getViewLineRenderingData(e),r=s.content;let a;s.isBasicASCII&&o.useMonospaceOptimizations||(a=mme(s,o));let l="",d=0,c=0;for(let g=0;g<t-1;g++){if(s.isBasicASCII&&o.useMonospaceOptimizations)l=r.charAt(g);else{if(l=a.getSegmentAtIndex(g),void 0===l)continue;c+=this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width/She().devicePixelRatio-o.spaceWidth}"\t"===l?d=br.nextRenderTabStop(d,s.tabSize):d++}let h=d,u=0;for(let g=t-1;g<i-1;g++){if(s.isBasicASCII&&o.useMonospaceOptimizations)l=r.charAt(g);else{if(l=a.getSegmentAtIndex(g),void 0===l)continue;u+=this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width/She().devicePixelRatio-o.spaceWidth}"\t"===l?h=br.nextRenderTabStop(h,s.tabSize):h++}return new Mp(!1,[new Np(d*o.spaceWidth+c,(h-d)*o.spaceWidth+u)])}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Ep(t.outsideRenderedLine,t.ranges[0].left):null}getLineWidth(e){if(!this._lastViewportData||!this._lastViewLineOptions)return;if(!this._viewGpuContext.canRender(this._lastViewLineOptions,this._lastViewportData,e))return;const t=this._lastViewportData.getViewLineRenderingData(e),i=this._visibleRangesForLineRange(e,1,t.maxColumn)?.ranges.at(-1);return i?i.width:void 0}getPositionAtCoordinate(e,t){if(!this._lastViewportData||!this._lastViewLineOptions)return;if(!this._viewGpuContext.canRender(this._lastViewLineOptions,this._lastViewportData,e))return;const i=this._lastViewportData.getViewLineRenderingData(e),n=i.content,o=She().devicePixelRatio,s=t*o,r=this._lastViewLineOptions.spaceWidth*o,a=mme(i,this._lastViewLineOptions);let l=0,d=0,c=0,h=0;for(let u=0;u<n.length;u++){const e=a.getSegmentAtIndex(u);if(void 0!==e){if("\t"===e){const e=u+c;c=br.nextRenderTabStop(u+c,i.tabSize),d=r*(c-e),c-=u+1}else d=i.isBasicASCII&&this._lastViewLineOptions.useMonospaceOptimizations?r:this._renderStrategy.value.glyphRasterizer.getTextMetrics(e).width;if(s<l+d/2)break;l+=d,h++}else h++}return new to(e,h+1)}},yw=ww([Cw(2,Jn),Cw(3,Ks)],yw),Sw=new class{constructor(){this._onDidChange=new je,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}},xw=eue("keybindingService"),kw=class extends Sp{},Lw=class{_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t){const i=e*t;return new mr(i+1,1,i+t+1,1)}fromEditorSelection(e,t,i,n){const o=500,s=this._getPageOfLine(t.startLineNumber,i),r=this._getRangeForPage(s,i),a=this._getPageOfLine(t.endLineNumber,i),l=this._getRangeForPage(a,i);let d=r.intersectRanges(new mr(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,1)>o){const t=e.modifyPosition(d.getEndPosition(),-500);d=mr.fromPositions(t,d.getEndPosition())}const c=e.getValueInRange(d,1),h=e.getLineCount(),u=e.getLineMaxColumn(h);let g=l.intersectRanges(new mr(t.endLineNumber,t.endColumn,h,u));if(n&&e.getValueLengthInRange(g,1)>o){const t=e.modifyPosition(g.getStartPosition(),o);g=mr.fromPositions(g.getStartPosition(),t)}const p=e.getValueInRange(g,1);let m,f,_;if(s===a||s+1===a)m=e.getValueInRange(t,1);else{const i=r.intersectRanges(t),n=l.intersectRanges(t);m=e.getValueInRange(i,1)+String.fromCharCode(8230)+e.getValueInRange(n,1)}return n&&m.length>1e3&&(m=m.substring(0,o)+String.fromCharCode(8230)+m.substring(m.length-o,m.length)),0===t.getDirection()?(f=c.length,_=c.length+m.length):(_=c.length,f=c.length+m.length),{value:c+m+p,selection:t,selectionStart:f,selectionEnd:_,startPositionWithinEditor:d.getStartPosition(),newlineCountBeforeSelection:d.endLineNumber-d.startLineNumber}}},Dw=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Iw=function(e,t){return function(i,n){t(i,n,e)}},Nw=class{constructor(e,t,i,n,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new to(this.modelLineNumber,this.distanceToModelLineStart+1),i=new to(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}},Ew=c,Mw=class extends kw{constructor(e,t,i,n,o,s){super(e),this._keybindingService=o,this._instantiationService=s,this._primaryCursorPosition=new to(1,1),this._primaryCursorVisibleRange=null,this._viewController=i,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;const r=this._context.configuration.options,a=r.get(165);this._setAccessibilityOptions(r),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=r.get(59),this._emptySelectionClipboard=r.get(45),this._copyWithSyntaxHighlighting=r.get(31),this._visibleTextArea=null,this._selections=[new fr(1,1,1,1)],this._modelSelections=[new fr(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Fge(document.createElement("textarea")),xp.write(this.textArea,7),this.textArea.setClassName(`inputarea ${G_}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=l*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",wme(r,this._keybindingService)),this.textArea.setAttribute("aria-required",r.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(r.get(140))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",Vae(65,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",r.get(104)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Fge(document.createElement("div")),this.textAreaCover.setPosition("absolute"),t.appendChild(this.textArea),t.appendChild(this.textAreaCover);const d=new Lw,h={getDataToCopy:()=>Fpe(this._context.viewModel,this._modelSelections,this._emptySelectionClipboard,this._copyWithSyntaxHighlighting),getScreenReaderContent:()=>{if(1===this._accessibilitySupport){const e=this._selections[0];if(F&&e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new Gm(i,i.length,i.length,mr.fromPositions(t),0)}if(F&&!e.isEmpty()&&this._context.viewModel.getValueLengthInRange(e,0)<500){const t=this._context.viewModel.getValueInRange(e,0);return new Gm(t,0,t.length,e,0)}return g&&!e.isEmpty()?new Gm("vscode-placeholder",0,18,null,void 0):Gm.EMPTY}if(m){const e=this._selections[0];if(e.isEmpty()){const t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new Gm(i,n,n,mr.fromPositions(t),0)}return Gm.EMPTY}const e=d.fromEditorSelection(this._context.viewModel,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport);return Gm.fromScreenReaderContentState(e)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},p=this._register(new tf(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(ef,h,p,Y,{isAndroid:m,isChrome:u,isFirefox:c,isSafari:g})),this._register(this._textAreaInput.onKeyDown(e=>{this._viewController.emitKeyDown(e)})),this._register(this._textAreaInput.onKeyUp(e=>{this._viewController.emitKeyUp(e)})),this._register(this._textAreaInput.onPaste(e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(e=>{this._viewController.setSelection(e)})),this._register(this._textAreaInput.onCompositionStart(e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:o}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),o=e.substring(n+1),s=o.lastIndexOf("\t"),r=o.length-s-1,a=i.getStartPosition(),l=Math.min(a.column-1,r),d=a.column-1-l,c=o.substring(0,o.length-l),{tabSize:h}=this._context.viewModel.model.getOptions();return{distanceToModelLineStart:d,widthOfHiddenTextBefore:yme(this.textArea.domNode.ownerDocument,c,this._fontInfo,h)}})(),{distanceToModelLineEnd:s}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),o=-1===n?e:e.substring(0,n),s=o.indexOf("\t"),r=-1===s?o.length:o.length-s-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,mr.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Nw(this._context,i.startLineNumber,n,o,s),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${G_} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${G_}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(Sw.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}get domNode(){return this.textArea}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose(),this.textArea.domNode.remove(),this.textAreaCover.domNode.remove()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Fue('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',[]);let n=!0,o=e.column,s=!0,r=e.column,a=0;for(;a<50&&(n||s);){if(n&&o<=1&&(n=!1),n){const e=t.charCodeAt(o-2);0!==i.get(e)?n=!1:o--}if(s&&r>t.length&&(s=!1),s){const e=t.charCodeAt(r-1);0!==i.get(e)?s=!1:r++}a++}return[t.substring(o-1,r-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Fue(this._context.configuration.options.get(148),[]);let n=e.column,o=0;for(;n>1;){const s=t.charCodeAt(n-2);if(0!==i.get(s)||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!ade(t.charCodeAt(0)))return t}return""}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===Ec.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const i=e.get(165).wrappingColumn;if(-1!==i&&1!==this._accessibilitySupport){const t=e.get(59);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=Ew?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(165);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(59),this._emptySelectionClipboard=t.get(45),this._copyWithSyntaxHighlighting=t.get(31),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=n*this._fontInfo.spaceWidth+"px",this.textArea.setAttribute("aria-label",wme(t,this._keybindingService)),this.textArea.setAttribute("aria-required",t.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(140))),(e.hasChanged(41)||e.hasChanged(104))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focus(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!Sw.enabled||e.get(41)&&e.get(104)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new to(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const o=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,s=Cme(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){const e=this._contentLeft-a;a+=e,r+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);const d=this._context.viewLayout.getLineHeightForLineNumber(i.lineNumber),c=this._context.viewModel.getFontSizeAtPosition(this._primaryCursorPosition),h=this._context.viewModel.getViewLineData(i.lineNumber),u=h.tokens.findTokenIndexAtOffset(i.column-1),g=u===h.tokens.findTokenIndexAtOffset(n.column-1),p=this._visibleTextArea.definePresentation(g?h.tokens.getPresentation(u):null);this.textArea.domNode.scrollTop=s*d,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:o,left:a,width:l,height:d,useCover:!1,color:(Mb.getColorMap()||[])[p.foreground],italic:p.italic,bold:p.bold,underline:p.underline,strikethrough:p.strikethrough,fontSize:c})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight)this._renderAtTopLeft();else{if(F||2===this._accessibilitySupport){const i=this._primaryCursorPosition.lineNumber,n=this._context.viewLayout.getLineHeightForLineNumber(i);this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:n,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const o=this._textAreaInput.textAreaState.newlineCountBeforeSelection??Cme(this.textArea.domNode.value.substring(0,this.textArea.domNode.selectionStart));return void(this.textArea.domNode.scrollTop=o*n)}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:Ew?0:1,useCover:!1})}}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:Ew?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Wge(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setLineHeight(e.height),t.setFontSize(e.fontSize??this._fontInfo.fontSize),t.setColor(e.color?eh.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(66)?i.setClassName("monaco-editor-background textAreaCover "+nb.OUTER_CLASS_NAME):0!==n.get(76).renderType?i.setClassName("monaco-editor-background textAreaCover "+$_.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}},Mw=Dw([Iw(4,xw),Iw(5,Jn)],Mw),Tw=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Rw=function(e,t){return function(i,n){t(i,n,e)}},Ow=class extends Ie{constructor(e,t,i){super(),this._domNode=t,this._onFocusChange=i,this._isFocused=!1,this._isPaused=!1,this._register(ehe(this._domNode,"focus",()=>{e.trace("NativeEditContext.focus"),this._isPaused||this.refreshFocusState()})),this._register(ehe(this._domNode,"blur",()=>{e.trace("NativeEditContext.blur"),this._isPaused||this._handleFocusedChanged(!1)}))}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this.refreshFocusState()}_handleFocusedChanged(e){this._isFocused!==e&&(this._isFocused=e,this._onFocusChange(this._isFocused))}focus(){this._domNode.focus(),this.refreshFocusState()}refreshFocusState(){const e=bhe(this._domNode),t=e?e.activeElement:vhe(),i=this._domNode===t;this._handleFocusedChanged(i)}get isFocused(){return this._isFocused}},Ow=Tw([Rw(0,Ks)],Ow),Aw=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Pw=function(e,t){return function(i,n){t(i,n,e)}},Fw=Bpe("richScreenReaderContent",{createHTML:e=>e}),Ww="data-line-number",Bw=class extends Ie{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new Ne),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._state=zw.NULL,this._strategy=new Uw,this._renderedLines=new Map,this._renderedSelection=new fr(1,1,1,1),this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=She().document.activeElement;if(t&&t===this._domNode.domNode)if(this._accessibilityService.isScreenReaderOptimized()){const t=this._getScreenReaderContentLineIntervals(e);this._state.equals(t)||(this._state=t,this._renderedLines=this._renderScreenReaderContent(t)),this._renderedSelection.equalsSelection(e)||(this._renderedSelection=e,this._setSelectionOnScreenReaderContent(this._context,this._renderedLines,e))}else this._state=zw.NULL,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){const t=this._state.intervals;if(!t.length)return;const i=this._context.viewModel.viewLayout,n=t[0].startLine,o=i.getVerticalOffsetForLineNumber(n),s=i.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=s-o}onFocusChange(e){this._selectionChangeListener.value=e?this._setSelectionChangeListener():void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return ehe(this._domNode.domNode.ownerDocument,"selectionchange",()=>{if(She().document.activeElement!==this._domNode.domNode)return;if(!this._accessibilityService.isScreenReaderOptimized()||!Sw.enabled)return;const t=Date.now(),i=t-e;if(e=t,i<5)return;const n=t-this._ignoreSelectionChangeTime;if(this._ignoreSelectionChangeTime=0,n<100)return;const o=this._getEditorSelectionFromDomRange();o&&this._viewController.setSelection(o)})}_renderScreenReaderContent(e){const t=[],i=new Map;for(const n of e.intervals)for(let e=n.startLine;e<=n.endLine;e++){const n=this._renderLine(e);i.set(e,n),t.push(n.domNode)}return this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.replaceChildren(...t),i}_renderLine(e){const t=this._context.viewModel,i=t.getViewLineRenderingData(e),n=this._context.configuration.options,o=n.get(59),s=n.get(133),r=n.get(108),a=n.get(60),l=n.get(40),d=Rp.filter(i.inlineDecorations,e,i.minColumn,i.maxColumn),c=o.isMonospace&&!l,h=a!==zd.OFF;let u;u="off"===n.get(47)?n.get(113):"none";const g=new Wp(c,o.canUseHalfwidthRightwardsArrow,i.content,i.continuesWithWrappedLine,i.isBasicASCII,i.containsRTL,i.minColumn-1,i.tokens,d,i.tabSize,i.startVisibleColumn,o.spaceWidth,o.middotWidth,o.wsmiddotWidth,s,u,r,h,null,null,0,!0),p=new _a(1e4),m=kpe(g,p),f=p.build(),_=Fw?.createHTML(f)??f,b=t.viewLayout.getLineHeightForLineNumber(e)+"px",v=document.createElement("div");return v.innerHTML=_,v.style.lineHeight=b,v.style.height=b,v.setAttribute(Ww,e.toString()),new Vw(v,m.characterMapping)}_setSelectionOnScreenReaderContent(e,t,i){const n=She().document.getSelection();if(!n)return;const o=i.startLineNumber,s=i.endLineNumber,r=t.get(o),a=t.get(s);if(!r||!a)return;const l=e.viewModel,d=l.model,c=l.coordinatesConverter,h=new mr(o,1,o,i.selectionStartColumn),u=c.convertViewRangeToModelRange(h),g=d.getCharacterCountInRange(u),p=new mr(s,1,s,i.positionColumn),m=c.convertViewRangeToModelRange(p),f=d.getCharacterCountInRange(m),_=r.characterMapping.getDomPosition(g),b=a.characterMapping.getDomPosition(f),v=r.domNode.firstChild,w=a.domNode.firstChild,C=v.childNodes,y=w.childNodes,S=C.item(_.partIndex),x=y.item(b.partIndex);S.firstChild&&x.firstChild&&(this._setIgnoreSelectionChangeTime("setRange"),n.setBaseAndExtent(S.firstChild,1===i.startColumn?0:_.charIndex+1,x.firstChild,1===i.endColumn?0:b.charIndex+1))}_getScreenReaderContentLineIntervals(e){return this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize)}_getEditorSelectionFromDomRange(){if(!this._renderedLines)return;const e=She().document.getSelection();if(!e)return;if(0===e.rangeCount)return;const t=e.getRangeAt(0),i=t.startContainer,n=t.endContainer,o=i.parentElement,s=n.parentElement;if(!(o&&xhe(o)&&s&&xhe(s)))return;const r=o.parentElement?.parentElement,a=s.parentElement?.parentElement;if(!r||!a)return;const l=r.getAttribute(Ww),d=a.getAttribute(Ww);if(!l||!d)return;const c=parseInt(l),h=parseInt(d),u=this._renderedLines.get(c)?.characterMapping,g=this._renderedLines.get(h)?.characterMapping;if(!u||!g)return;const p=Rpe(u,o,t.startOffset),m=Rpe(g,s,t.endOffset);return"forward"===e.direction?new fr(c,p,h,m):new fr(h,m,c,p)}},Bw=Aw([Pw(3,Fc)],Bw),Vw=class{constructor(e,t){this.domNode=e,this.characterMapping=t}},Hw=class{constructor(e,t){this.startLine=e,this.endLine=t}},zw=class e{constructor(e,t){this.intervals=t;let i="";for(const n of t)for(let t=n.startLine;t<=n.endLine;t++)i+=e.getLineContent(t)+"\n";this.value=i}equals(e){return this.value===e.value}static get NULL(){return new e({getLineContent:()=>"",getLineCount:()=>1,getLineMaxColumn:()=>1,getValueInRange:()=>"",getValueLengthInRange:()=>0,modifyPosition:(e,t)=>e},[])}},Uw=class{constructor(){}_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t,i){const n=t*i;return new Hw(n+1,Math.min(n+i,e.getLineCount()))}fromEditorSelection(e,t,i){const n=this._getPageOfLine(t.startLineNumber,i),o=this._getRangeForPage(e,n,i),s=this._getPageOfLine(t.endLineNumber,i),r=this._getRangeForPage(e,s,i),a=[{startLine:o.startLine,endLine:o.endLine}];return n+1<s&&a.push({startLine:r.startLine,endLine:r.endLine}),new zw(e,a)}},Kw=class{constructor(e){this.replacements=e;let t=-1;for(const i of e){if(!(i.replaceRange.start>=t))throw new y(`Edits must be disjoint and sorted. Found ${i} after ${t}`);t=i.replaceRange.endExclusive}}toString(){return`[${this.replacements.map(e=>e.toString()).join(", ")}]`}normalize(){const e=[];let t;for(const i of this.replacements)if(0!==i.getNewLength()||0!==i.replaceRange.length){if(t&&t.replaceRange.endExclusive===i.replaceRange.start){const e=t.tryJoinTouching(i);if(e){t=e;continue}}t&&e.push(t),t=i}return t&&e.push(t),this._createNew(e)}compose(e){const t=this.normalize(),i=e.normalize();if(t.isEmpty())return i;if(i.isEmpty())return t;const n=[...t.replacements],o=[];let s=0;for(const r of i.replacements){for(;;){const e=n[0];if(!e||e.replaceRange.start+s+e.getNewLength()>=r.replaceRange.start)break;n.shift(),o.push(e),s+=e.getNewLength()-e.replaceRange.length}const e=s;let t,i;for(;;){const e=n[0];if(!e||e.replaceRange.start+s>r.replaceRange.endExclusive)break;t||(t=e),i=e,n.shift(),s+=e.getNewLength()-e.replaceRange.length}if(t){const a=Math.min(t.replaceRange.start,r.replaceRange.start-e),l=r.replaceRange.start-(t.replaceRange.start+e);if(l>0){const e=t.slice(hl.emptyAt(a),new hl(0,l));o.push(e)}if(!i)throw new y("Invariant violation: lastIntersecting is undefined");const d=i.replaceRange.endExclusive+s-r.replaceRange.endExclusive;if(d>0){const e=i.slice(hl.ofStartAndLength(i.replaceRange.endExclusive,0),new hl(i.getNewLength()-d,i.getNewLength()));n.unshift(e),s-=e.getNewLength()-e.replaceRange.length}const c=new hl(a,r.replaceRange.endExclusive-s),h=r.slice(c,new hl(0,r.getNewLength()));o.push(h)}else o.push(r.delta(-s))}for(;;){const e=n.shift();if(!e)break;o.push(e)}return this._createNew(o).normalize()}getNewRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(hl.ofStartAndLength(i.replaceRange.start+t,i.getNewLength())),t+=i.getLengthDelta();return e}isEmpty(){return 0===this.replacements.length}},qw=class{constructor(e){this.replaceRange=e}delta(e){return this.slice(this.replaceRange.delta(e),new hl(0,this.getNewLength()))}getLengthDelta(){return this.getNewLength()-this.replaceRange.length}toString(){return`{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`}get isEmpty(){return 0===this.getNewLength()&&0===this.replaceRange.length}getRangeAfterReplace(){return new hl(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},$w=class extends Kw{apply(e){const t=[];let i=0;for(const n of this.replacements)t.push(e.substring(i,n.replaceRange.start)),t.push(n.newText),i=n.replaceRange.endExclusive;return t.push(e.substring(i)),t.join("")}},Gw=class extends qw{constructor(e,t){super(e),this.newText=t}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){const t=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),i=sde(t,this.newText),n=Math.min(t.length-i,this.newText.length-i,rde(t,this.newText));return new Yw(new hl(this.replaceRange.start+i,this.replaceRange.endExclusive-n),this.newText.substring(i,this.newText.length-n))}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){const t=sde(this.replaceRange.substring(e),this.newText);return 0===t?this:this.slice(this.replaceRange.deltaStart(t),new hl(t,this.newText.length))}removeCommonSuffix(e){const t=rde(this.replaceRange.substring(e),this.newText);return 0===t?this:this.slice(this.replaceRange.deltaEnd(-t),new hl(0,this.newText.length-t))}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}},Zw=class e extends $w{static compose(t){if(0===t.length)return e.empty;let i=t[0];for(let e=1;e<t.length;e++)i=i.compose(t[e]);return i}constructor(e){super(e)}_createNew(t){return new e(t)}},(jw=Zw).empty=new jw([]),Yw=class e extends Gw{static insert(t,i){return new e(hl.emptyAt(t),i)}static replace(t,i){return new e(t,i)}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newText===e.newText}tryJoinTouching(t){return new e(this.replaceRange.joinRightTouching(t.replaceRange),this.newText+t.newText)}slice(t,i){return new e(t,i?i.substring(this.newText):this.newText)}},Qw=class e{static ofLength(t,i){return new e(t,t+i)}static fromRange(t){return new e(t.startLineNumber,t.endLineNumber)}static fromRangeInclusive(t){return new e(t.startLineNumber,t.endLineNumber+1)}static joinMany(e){if(0===e.length)return[];let t=new Xw(e[0].slice());for(let i=1;i<e.length;i++)t=t.getUnion(new Xw(e[i].slice()));return t.ranges}static join(t){if(0===t.length)throw new y("lineRanges cannot be empty");let i=t[0].startLineNumber,n=t[0].endLineNumberExclusive;for(let e=1;e<t.length;e++)i=Math.min(i,t[e].startLineNumber),n=Math.max(n,t[e].endLineNumberExclusive);return new e(i,n)}static deserialize(t){return new e(t[0],t[1])}constructor(e,t){if(e>t)throw new y(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(t){return new e(this.startLineNumber+t,this.endLineNumberExclusive+t)}deltaLength(t){return new e(this.startLineNumber,this.endLineNumberExclusive+t)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(t){return new e(Math.min(this.startLineNumber,t.startLineNumber),Math.max(this.endLineNumberExclusive,t.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}intersect(t){const i=Math.max(this.startLineNumber,t.startLineNumber),n=Math.min(this.endLineNumberExclusive,t.endLineNumberExclusive);if(i<=n)return new e(i,n)}intersectsStrict(e){return this.startLineNumber<e.endLineNumberExclusive&&e.startLineNumber<this.endLineNumberExclusive}intersectsOrTouches(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}equals(e){return this.startLineNumber===e.startLineNumber&&this.endLineNumberExclusive===e.endLineNumberExclusive}toInclusiveRange(){return this.isEmpty?null:new mr(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new mr(this.startLineNumber,1,this.endLineNumberExclusive,1)}mapToLineArray(e){const t=[];for(let i=this.startLineNumber;i<this.endLineNumberExclusive;i++)t.push(e(i));return t}forEach(e){for(let t=this.startLineNumber;t<this.endLineNumberExclusive;t++)e(t)}serialize(){return[this.startLineNumber,this.endLineNumberExclusive]}toOffsetRange(){return new hl(this.startLineNumber-1,this.endLineNumberExclusive-1)}addMargin(t,i){return new e(this.startLineNumber-t,this.endLineNumberExclusive+i)}},Qw.compareByStart=fce(e=>e.startLineNumber,Oi),Xw=class e{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(0===e.length)return;const t=$pe(this._normalizedRanges,t=>t.endLineNumberExclusive>=e.startLineNumber),i=jpe(this._normalizedRanges,t=>t.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const i=this._normalizedRanges[t];this._normalizedRanges[t]=i.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){const t=qpe(this._normalizedRanges,t=>t.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){const t=qpe(this._normalizedRanges,t=>t.startLineNumber<e.endLineNumberExclusive);return!!t&&t.endLineNumberExclusive>e.startLineNumber}getUnion(t){if(0===this._normalizedRanges.length)return t;if(0===t._normalizedRanges.length)return this;const i=[];let n=0,o=0,s=null;for(;n<this._normalizedRanges.length||o<t._normalizedRanges.length;){let e=null;if(n<this._normalizedRanges.length&&o<t._normalizedRanges.length){const i=this._normalizedRanges[n],s=t._normalizedRanges[o];i.startLineNumber<s.startLineNumber?(e=i,n++):(e=s,o++)}else n<this._normalizedRanges.length?(e=this._normalizedRanges[n],n++):(e=t._normalizedRanges[o],o++);null===s?s=e:s.endLineNumberExclusive>=e.startLineNumber?s=new Qw(s.startLineNumber,Math.max(s.endLineNumberExclusive,e.endLineNumberExclusive)):(i.push(s),s=e)}return null!==s&&i.push(s),new e(i)}subtractFrom(t){const i=$pe(this._normalizedRanges,e=>e.endLineNumberExclusive>=t.startLineNumber),n=jpe(this._normalizedRanges,e=>e.startLineNumber<=t.endLineNumberExclusive)+1;if(i===n)return new e([t]);const o=[];let s=t.startLineNumber;for(let e=i;e<n;e++){const t=this._normalizedRanges[e];t.startLineNumber>s&&o.push(new Qw(s,t.startLineNumber)),s=t.endLineNumberExclusive}return s<t.endLineNumberExclusive&&o.push(new Qw(s,t.endLineNumberExclusive)),new e(o)}toString(){return this._normalizedRanges.map(e=>e.toString()).join(", ")}getIntersection(t){const i=[];let n=0,o=0;for(;n<this._normalizedRanges.length&&o<t._normalizedRanges.length;){const e=this._normalizedRanges[n],s=t._normalizedRanges[o],r=e.intersect(s);r&&!r.isEmpty&&i.push(r),e.endLineNumberExclusive<s.endLineNumberExclusive?n++:o++}return new e(i)}getWithDelta(t){return new e(this._normalizedRanges.map(e=>e.delta(t)))}},eC=class e{static betweenPositions(t,i){return t.lineNumber===i.lineNumber?new e(0,i.column-t.column):new e(i.lineNumber-t.lineNumber,i.column-1)}static fromPosition(t){return new e(t.lineNumber-1,t.column-1)}static ofRange(t){return e.betweenPositions(t.getStartPosition(),t.getEndPosition())}static ofText(t){let i=0,n=0;for(const e of t)"\n"===e?(i++,n=0):n++;return new e(i,n)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(t){return 0===t.lineCount?new e(this.lineCount,this.columnCount+t.columnCount):new e(this.lineCount+t.lineCount,t.columnCount)}createRange(e){return 0===this.lineCount?new mr(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new mr(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new mr(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Qw.ofLength(1,this.lineCount+1)}addToPosition(e){return 0===this.lineCount?new to(e.lineNumber,e.column+this.columnCount):new to(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}},(Jw=eC).zero=new Jw(0,0),tC=class{getOffsetRange(e){return new hl(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return mr.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new iC.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new iC.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const t=e.replacements.map(e=>this.getTextReplacement(e));return new iC.deps.TextEdit(t)}},(iC=class{static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}})._deps=void 0,nC=class extends tC{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)"\n"===e.charAt(t)&&(this.lineStartOffsetByLineIdx.push(t+1),t>0&&"\r"===e.charAt(t-1)?this.lineEndOffsetByLineIdx.push(t-1):this.lineEndOffsetByLineIdx.push(t));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const t=this._validatePosition(e);return this.lineStartOffsetByLineIdx[t.lineNumber-1]+t.column-1}_validatePosition(e){if(e.lineNumber<1)return new to(1,1);const t=this.textLength.lineCount+1;if(e.lineNumber>t)return new to(t,this.getLineLength(t)+1);if(e.column<1)return new to(e.lineNumber,1);const i=this.getLineLength(e.lineNumber);return e.column-1>i?new to(e.lineNumber,i+1):e}getPosition(e){const t=jpe(this.lineStartOffsetByLineIdx,t=>t<=e);return new to(t+1,e-this.lineStartOffsetByLineIdx[t]+1)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new iC.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}},oC=class{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new to(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new mr(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new nC(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new mr(e,1,e,Number.MAX_SAFE_INTEGER))}},sC=class extends oC{constructor(e,t){tle(t>=1),super(),this._getLineContent=e,this._lineCount=t}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let t=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let i=e.startLineNumber+1;i<e.endLineNumber;i++)t+="\n"+this._getLineContent(i);return t+="\n"+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),t}getLineLength(e){return this._getLineContent(e).length}get length(){const e=this._getLineContent(this._lineCount);return new eC(this._lineCount-1,e.length)}},rC=class extends sC{constructor(e){super(t=>e[t-1],e.length)}},aC=class extends oC{constructor(e){super(),this.value=e,this._t=new nC(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}},lC=class e{static fromStringEdit(t,i){return new e(t.replacements.map(e=>dC.fromStringReplacement(e,i)))}static fromParallelReplacementsUnsorted(t){return new e(t.slice().sort(fce(e=>e.range,mr.compareRangesUsingStarts)))}constructor(e){this.replacements=e,nle(()=>ole(e,(e,t)=>e.range.getEndPosition().isBeforeOrEqual(t.range.getStartPosition())))}mapPosition(e){let t=0,i=0,n=0;for(const o of this.replacements){const s=o.range.getStartPosition();if(e.isBeforeOrEqual(s))break;const r=o.range.getEndPosition(),a=eC.ofText(o.text);if(e.isBefore(r)){const e=new to(s.lineNumber+t,s.column+(s.lineNumber+t===i?n:0));return kme(e,a.addToPosition(e))}s.lineNumber+t!==i&&(n=0),t+=a.lineCount-(o.range.endLineNumber-o.range.startLineNumber),0===a.lineCount?r.lineNumber!==s.lineNumber?n+=a.columnCount-(r.column-1):n+=a.columnCount-(r.column-s.column):n=a.columnCount,i=r.lineNumber+t}return new to(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){return kme((t=this.mapPosition(e.getStartPosition()))instanceof to?t:t.getStartPosition(),function(e){return e instanceof to?e:e.getEndPosition()}(this.mapPosition(e.getEndPosition())));var t}apply(e){let t="",i=new to(1,1);for(const o of this.replacements){const n=o.range,s=n.getStartPosition(),r=n.getEndPosition(),a=kme(i,s);a.isEmpty()||(t+=e.getValueOfRange(a)),t+=o.text,i=r}const n=kme(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new aC(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const o of this.replacements){const s=eC.ofText(o.text),r=to.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?n:0)}),a=s.createRange(r);e.push(a),i=a.endLineNumber-o.range.endLineNumber,n=a.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}toReplacement(e){if(0===this.replacements.length)throw new y;if(1===this.replacements.length)return this.replacements[0];const t=this.replacements[0].range.getStartPosition(),i=this.replacements[this.replacements.length-1].range.getEndPosition();let n="";for(let o=0;o<this.replacements.length;o++){const t=this.replacements[o];if(n+=t.text,o<this.replacements.length-1){const i=this.replacements[o+1],s=mr.fromPositions(t.range.getEndPosition(),i.range.getStartPosition());n+=e.getValueOfRange(s)}}return new dC(mr.fromPositions(t,i),n)}toString(e){return void 0===e?this.replacements.map(e=>e.toString()).join("\n"):"string"==typeof e?this.toString(new aC(e)):0===this.replacements.length?"":this.replacements.map(t=>{const i=10,n=e.getValueOfRange(t.range),o=mr.fromPositions(new to(Math.max(1,t.range.startLineNumber-1),1),t.range.getStartPosition());let s=e.getValueOfRange(o);s.length>i&&(s="..."+s.substring(s.length-i));const r=mr.fromPositions(t.range.getEndPosition(),new to(t.range.endLineNumber+1,1));let a=e.getValueOfRange(r);a.length>i&&(a=a.substring(0,i)+"...");let l=n;if(l.length>i){const e=Math.floor(5);l=l.substring(0,e)+"..."+l.substring(l.length-e)}let d=t.text;if(d.length>i){const e=Math.floor(5);d=d.substring(0,e)+"..."+d.substring(d.length-e)}return 0===l.length?`${s}❰${d}❱${a}`:`${s}❰${l}↦${d}❱${a}`}).join("\n")}},dC=class e{static joinReplacements(t,i){if(0===t.length)throw new y;if(1===t.length)return t[0];const n=t[0].range.getStartPosition(),o=t[t.length-1].range.getEndPosition();let s="";for(let e=0;e<t.length;e++){const n=t[e];if(s+=n.text,e<t.length-1){const o=t[e+1],r=mr.fromPositions(n.range.getEndPosition(),o.range.getStartPosition());s+=i.getValueOfRange(r)}}return new e(mr.fromPositions(n,o),s)}static fromStringReplacement(t,i){return new e(i.getTransformer().getRange(t.replaceRange),t.newText)}static delete(t){return new e(t,"")}constructor(e,t){this.range=e,this.text=t}get isEmpty(){return this.range.isEmpty()&&0===this.text.length}static equals(e,t){return e.range.equalsRange(t.range)&&e.text===t.text}equals(t){return e.equals(this,t)}removeCommonPrefixAndSuffix(e){return this.removeCommonPrefix(e).removeCommonSuffix(e)}removeCommonPrefix(t){const i=t.getValueOfRange(this.range).replaceAll("\r\n","\n"),n=this.text.replaceAll("\r\n","\n"),o=sde(i,n),s=eC.ofText(i.substring(0,o)).addToPosition(this.range.getStartPosition()),r=n.substring(o);return new e(mr.fromPositions(s,this.range.getEndPosition()),r)}removeCommonSuffix(t){const i=t.getValueOfRange(this.range).replaceAll("\r\n","\n"),n=this.text.replaceAll("\r\n","\n"),o=rde(i,n),s=eC.ofText(i.substring(0,i.length-o)).addToPosition(this.range.getStartPosition()),r=n.substring(0,n.length-o);return new e(mr.fromPositions(this.range.getStartPosition(),s),r)}toString(){const e=this.range.getStartPosition(),t=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${t.lineNumber},${t.column}): "${this.text}"`}},Yn={StringEdit:Zw,StringReplacement:Yw,TextReplacement:dC,TextEdit:lC,TextLength:eC},iC._deps=Yn,cC=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},hC=function(e,t){return function(i,n){t(i,n,e)}},uC=class extends Ie{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new Ne),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._strategy=new Lw,this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){const t=this._domNode.domNode,i=She().document.activeElement;if(i&&i===t)if(this._accessibilityService.isScreenReaderOptimized()){this._state=this._getScreenReaderContentState(e),t.textContent!==this._state.value&&(this._setIgnoreSelectionChangeTime("setValue"),t.textContent=this._state.value);const i=She().document.getSelection();if(!i)return;const n=this._getScreenReaderRange(this._state.selectionStart,this._state.selectionEnd);if(!n)return;this._setIgnoreSelectionChangeTime("setRange"),i.setBaseAndExtent(n.anchorNode,n.anchorOffset,n.focusNode,n.focusOffset)}else this._state=void 0,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}updateScrollTop(e){if(!this._state)return;const t=this._context.viewModel.viewLayout,i=this._state.startPositionWithinEditor.lineNumber,n=t.getVerticalOffsetForLineNumber(i),o=t.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=o-n}onFocusChange(e){this._selectionChangeListener.value=e?this._setSelectionChangeListener():void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;return ehe(this._domNode.domNode.ownerDocument,"selectionchange",()=>{const t=this._accessibilityService.isScreenReaderOptimized();if(!this._state||!t||!Sw.enabled)return;if(She().document.activeElement!==this._domNode.domNode)return;const i=She().document.getSelection();if(!i)return;if(0===i.rangeCount)return;const n=i.getRangeAt(0),o=Date.now(),s=o-e;if(e=o,s<5)return;const r=o-this._ignoreSelectionChangeTime;this._ignoreSelectionChangeTime=0,r<100||this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context,this._state,i.direction,n))})}_getScreenReaderContentState(e){const t=this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize,0===this._accessibilityService.getAccessibilitySupport()),i=this._context.viewModel.model.getPositionAt(1/0);let n=t.value;return 1===i.column&&e.getEndPosition().equals(i)&&(n+="\n"),t.value=n,t}_getScreenReaderRange(e,t){const i=this._domNode.domNode.firstChild;if(!i)return;const n=new globalThis.Range;return n.setStart(i,e),n.setEnd(i,t),{anchorNode:i,anchorOffset:e,focusNode:i,focusOffset:t}}_getEditorSelectionFromDomRange(e,t,i,n){const o=e.viewModel,s=o.model,r=o.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor),a=s.getOffsetAt(r);let l=n.startOffset+a,d=n.endOffset+a;if(1===s.getEndOfLineSequence()){const e=t.value,i=new nC(e),o=i.getPosition(n.startOffset),s=i.getPosition(n.endOffset);l+=o.lineNumber-1,d+=s.lineNumber-1}const c=s.getPositionAt(l),h=s.getPositionAt(d),u="forward"===i?c:h,g="forward"===i?h:c;return fr.fromPositions(u,g)}},uC=cC([hC(3,Fc)],uC),gC=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},pC=function(e,t){return function(i,n){t(i,n,e)}},mC=class extends Ie{constructor(e,t,i,n,o){super(),this._domNode=e,this._context=t,this._viewController=i,this._keybindingService=n,this._accessibilityService=o,this._contentLeft=1,this._contentWidth=1,this._contentHeight=1,this._divWidth=1,this._primarySelection=new fr(1,1,1,1),this._primaryCursorVisibleRange=null,this._state=this._register(new Ne),this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes()}onWillPaste(){this._state.value?.onWillPaste()}onWillCut(){this._state.value?.onWillCut()}handleFocusChange(e){this._state.value?.onFocusChange(e),this.writeScreenReaderContent()}onConfigurationChanged(e){this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes(),e.hasChanged(2)&&this.writeScreenReaderContent()}_instantiateScreenReaderContent(){const e=this._context.configuration.options.get(107);this._renderRichContent!==e&&(this._renderRichContent=e,this._state.value=this._createScreenReaderContent(e))}_createScreenReaderContent(e){return e?new Bw(this._domNode,this._context,this._viewController,this._accessibilityService):new uC(this._domNode,this._context,this._viewController,this._accessibilityService)}_updateConfigurationSettings(){const e=this._context.configuration.options,t=e.get(165),i=t.wrappingColumn;this._contentLeft=t.contentLeft,this._contentWidth=t.contentWidth,this._contentHeight=t.height,this._fontInfo=e.get(59),this._divWidth=Math.round(i*this._fontInfo.typicalHalfwidthCharacterWidth),this._state.value?.onConfigurationChanged(e)}_updateDomAttributes(){const e=this._context.configuration.options;this._domNode.domNode.setAttribute("role","textbox"),this._domNode.domNode.setAttribute("aria-required",e.get(9)?"true":"false"),this._domNode.domNode.setAttribute("aria-multiline","true"),this._domNode.domNode.setAttribute("aria-autocomplete",e.get(104)?"none":"both"),this._domNode.domNode.setAttribute("aria-roledescription",Vae(60,"editor")),this._domNode.domNode.setAttribute("aria-label",wme(e,this._keybindingService));const t=this._context.viewModel.model.getOptions().tabSize,i=e.get(59).spaceWidth;this._domNode.domNode.style.tabSize=t*i+"px";const n=e.get(154),o="inherit"===n?e.get(153):n,s="inherit"===o?e.get(149):o;this._domNode.domNode.style.textWrap="off"===s?"nowrap":"wrap"}onCursorStateChanged(e){this._primarySelection=e.selections[0]??new fr(1,1,1,1)}prepareRender(e){this.writeScreenReaderContent(),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primarySelection.getPosition())}render(e){if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const t=this._context.viewLayout.getCurrentScrollLeft(),i=this._contentLeft+this._primaryCursorVisibleRange.left-t;if(i<this._contentLeft||i>this._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const n=this._context.viewLayout.getCurrentScrollTop(),o=this._primarySelection.positionLineNumber,s=this._context.viewLayout.getVerticalOffsetForLineNumber(o)-n;if(s<0||s>this._contentHeight)return void this._renderAtTopLeft();const r=this._context.viewLayout.getLineHeightForLineNumber(o);this._doRender(s,this._contentLeft,this._divWidth,r),this._state.value?.updateScrollTop(this._primarySelection)}_renderAtTopLeft(){this._doRender(0,0,this._contentWidth,1)}_doRender(e,t,i,n){Wge(this._domNode,this._fontInfo),this._domNode.setTop(e),this._domNode.setLeft(t),this._domNode.setWidth(i),this._domNode.setHeight(n),this._domNode.setLineHeight(n)}setAriaOptions(e){e.activeDescendant?(this._domNode.setAttribute("aria-haspopup","true"),this._domNode.setAttribute("aria-autocomplete","list"),this._domNode.setAttribute("aria-activedescendant",e.activeDescendant)):(this._domNode.setAttribute("aria-haspopup","false"),this._domNode.setAttribute("aria-autocomplete","both"),this._domNode.removeAttribute("aria-activedescendant")),e.role&&this._domNode.setAttribute("role",e.role)}writeScreenReaderContent(){this._state.value?.updateScreenReaderContent(this._primarySelection)}},mC=gC([pC(3,xw),pC(4,Fc)],mC),function(e){e.create=function(e,t){return new e.EditContext(t)}}(fC||(fC={})),_C=new class{constructor(){this._nativeEditContextMapping=new Map}register(e,t){return this._nativeEditContextMapping.set(e,t),{dispose:()=>{this._nativeEditContextMapping.delete(e)}}}get(e){return this._nativeEditContextMapping.get(e)}},bC=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},vC=function(e,t){return function(i,n){t(i,n,e)}},function(e){e.NONE="edit-context-composition-none",e.SECONDARY="edit-context-composition-secondary",e.PRIMARY="edit-context-composition-primary"}(wC||(wC={})),CC=class extends kw{constructor(e,t,i,n,o,s,r){super(t),this._viewController=n,this._visibleRangeProvider=o,this.logService=r,this._previousEditContextSelection=new hl(0,0),this._editContextPrimarySelection=new fr(1,1,1,1),this._decorations=[],this._primarySelection=new fr(1,1,1,1),this._targetWindowId=-1,this._scrollTop=0,this._scrollLeft=0,this._linesVisibleRanges=null,this.domNode=new ad(document.createElement("div")),this.domNode.setClassName("native-edit-context"),this._imeTextArea=new ad(document.createElement("textarea")),this._imeTextArea.setClassName("ime-text-area"),this._imeTextArea.setAttribute("readonly","true"),this._imeTextArea.setAttribute("tabindex","-1"),this._imeTextArea.setAttribute("aria-hidden","true"),this.domNode.setAttribute("autocorrect","off"),this.domNode.setAttribute("autocapitalize","off"),this.domNode.setAttribute("autocomplete","off"),this.domNode.setAttribute("spellcheck","false"),this._updateDomAttributes(),i.appendChild(this.domNode),i.appendChild(this._imeTextArea),this._parent=i.domNode,this._focusTracker=this._register(new Ow(r,this.domNode.domNode,e=>{r.trace("NativeEditContext#handleFocusChange : ",e),this._screenReaderSupport.handleFocusChange(e),this._context.viewModel.setHasFocus(e)}));const a=pn(this.domNode.domNode);let l;this._editContext=fC.create(a),this.setEditContextOnDomNode(),this._screenReaderSupport=this._register(s.createInstance(mC,this.domNode,t,this._viewController)),this._register(ehe(this.domNode.domNode,"copy",e=>{this.logService.trace("NativeEditContext#copy"),this._ensureClipboardGetsEditorSelection(e)})),this._register(ehe(this.domNode.domNode,"cut",e=>{this.logService.trace("NativeEditContext#cut"),this._screenReaderSupport.onWillCut(),this._ensureClipboardGetsEditorSelection(e),this.logService.trace("NativeEditContext#cut (before viewController.cut)"),this._viewController.cut()})),this._register(ehe(this.domNode.domNode,"keyup",e=>this._onKeyUp(e))),this._register(ehe(this.domNode.domNode,"keydown",async e=>this._onKeyDown(e))),this._register(ehe(this._imeTextArea.domNode,"keyup",e=>this._onKeyUp(e))),this._register(ehe(this._imeTextArea.domNode,"keydown",async e=>this._onKeyDown(e))),this._register(ehe(this.domNode.domNode,"beforeinput",async e=>{"insertParagraph"!==e.inputType&&"insertLineBreak"!==e.inputType||this._onType(this._viewController,{text:"\n",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0})})),this._register(ehe(this.domNode.domNode,"paste",e=>{if(this.logService.trace("NativeEditContext#paste"),e.preventDefault(),!e.clipboardData)return;let[t,i]=jm.getTextData(e.clipboardData);if(this.logService.trace("NativeEditContext#paste with id : ",i?.id," with text.length: ",t.length),!t)return;i=i||Km.INSTANCE.get(t);let n=!1,o=null,s=null;i&&(n=this._context.configuration.options.get(45)&&!!i.isFromEmptySelection,o=void 0!==i.multicursorText?i.multicursorText:null,s=i.mode),this.logService.trace("NativeEditContext#paste (before viewController.paste)"),this._viewController.paste(t,n,o,s)})),this._register(Sme(this._editContext,"textformatupdate",e=>this._handleTextFormatUpdate(e))),this._register(Sme(this._editContext,"characterboundsupdate",e=>this._updateCharacterBounds(e))),this._register(Sme(this._editContext,"textupdate",e=>{const t=e.text;if(1===t.length){const i=t.charCodeAt(0);if(ade(i))return void(l=t);if(lde(i)&&l){const i={text:l+t,selectionEnd:e.selectionEnd,selectionStart:e.selectionStart,updateRangeStart:e.updateRangeStart-1,updateRangeEnd:e.updateRangeEnd-1};return l=void 0,void this._emitTypeEvent(this._viewController,i)}}this._emitTypeEvent(this._viewController,e)})),this._register(Sme(this._editContext,"compositionstart",e=>{this._updateEditContext(),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(Sme(this._editContext,"compositionend",e=>{this._updateEditContext(),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}));let d=!1;this._register(Sw.onDidChange(()=>{Sw.enabled&&d&&(this._focusTracker.resume(),this.domNode.focus(),d=!1),!Sw.enabled&&this.isFocused()&&(this._focusTracker.pause(),this._imeTextArea.focus(),d=!0)})),this._register(_C.register(e,this))}dispose(){this.domNode.domNode.editContext=void 0,this.domNode.domNode.blur(),this.domNode.domNode.remove(),this._imeTextArea.domNode.remove(),super.dispose()}setAriaOptions(e){this._screenReaderSupport.setAriaOptions(e)}getLastRenderData(){return this._primarySelection.getPosition()}prepareRender(e){this._screenReaderSupport.prepareRender(e),this._updateSelectionAndControlBoundsData(e)}onDidRender(){this._updateSelectionAndControlBoundsAfterRender()}render(e){this._screenReaderSupport.render(e)}onCursorStateChanged(e){return this._primarySelection=e.modelSelections[0]??new fr(1,1,1,1),this._screenReaderSupport.onCursorStateChanged(e),this._updateEditContext(),!0}onConfigurationChanged(e){return this._screenReaderSupport.onConfigurationChanged(e),this._updateDomAttributes(),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.fromLineNumber+e.count-1),!0}onLinesDeleted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}onLinesInserted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}_updateEditContextOnLineChange(e,t){this._editContextPrimarySelection.endLineNumber<e||this._editContextPrimarySelection.startLineNumber>t||this._updateEditContext()}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}onWillPaste(){this.logService.trace("NativeEditContext#onWillPaste"),this._onWillPaste()}_onWillPaste(){this._screenReaderSupport.onWillPaste()}onWillCopy(){this.logService.trace("NativeEditContext#onWillCopy"),this.logService.trace("NativeEditContext#isFocused : ",this.domNode.domNode===vhe())}writeScreenReaderContent(){this._screenReaderSupport.writeScreenReaderContent()}isFocused(){return this._focusTracker.isFocused}focus(){this._focusTracker.focus(),this.refreshFocusState()}refreshFocusState(){this._focusTracker.refreshFocusState()}setEditContextOnDomNode(){const e=bn(pn(this.domNode.domNode));this._targetWindowId!==e&&(this.domNode.domNode.editContext=this._editContext,this._targetWindowId=e)}_onKeyUp(e){this._viewController.emitKeyUp(new we(e))}_onKeyDown(e){const t=new we(e);114===t.keyCode&&t.stopPropagation(),this._viewController.emitKeyDown(t)}_updateDomAttributes(){const e=this._context.configuration.options;this.domNode.domNode.setAttribute("tabindex",String(e.get(140)))}_updateEditContext(){const e=this._getNewEditContextState();e&&(this._editContext.updateText(0,Number.MAX_SAFE_INTEGER,e.text??" "),this._editContext.updateSelection(e.selectionStartOffset,e.selectionEndOffset),this._editContextPrimarySelection=e.editContextPrimarySelection,this._previousEditContextSelection=new hl(e.selectionStartOffset,e.selectionEndOffset))}_emitTypeEvent(e,t){if(!this._editContext)return;const i=this._previousEditContextSelection.endExclusive,n=this._previousEditContextSelection.start;this._previousEditContextSelection=new hl(t.selectionStart,t.selectionEnd);let o=0,s=0;t.updateRangeEnd>i&&(o=t.updateRangeEnd-i),t.updateRangeStart<n&&(s=n-t.updateRangeStart);let r="";n<t.updateRangeStart&&(r+=this._editContext.text.substring(n,t.updateRangeStart)),r+=t.text,i>t.updateRangeEnd&&(r+=this._editContext.text.substring(t.updateRangeEnd,i));let a=0;t.selectionStart===t.selectionEnd&&n===i&&(a=t.selectionStart-(t.updateRangeStart+t.text.length));const l={text:r,replacePrevCharCnt:s,replaceNextCharCnt:o,positionDelta:a};this._onType(e,l)}_onType(e,t){t.replacePrevCharCnt||t.replaceNextCharCnt||t.positionDelta?e.compositionType(t.text,t.replacePrevCharCnt,t.replaceNextCharCnt,t.positionDelta):e.type(t.text)}_getNewEditContextState(){const e=this._primarySelection,t=this._context.viewModel.model;if(!t.isValidRange(e))return;const i=e.startLineNumber,n=e.endLineNumber,o=t.getLineMaxColumn(n),s=new mr(i,1,n,o),r=t.getValueInRange(s,0);return{text:r,selectionStartOffset:e.startColumn-1,selectionEndOffset:r.length+e.endColumn-o,editContextPrimarySelection:e}}_editContextStartPosition(){return new to(this._editContextPrimarySelection.startLineNumber,1)}_handleTextFormatUpdate(e){if(!this._editContext)return;const t=e.getTextFormats(),i=this._editContextStartPosition(),n=[];t.forEach(e=>{const t=this._context.viewModel.model,o=t.getOffsetAt(i),s=t.getPositionAt(o+e.rangeStart),r=t.getPositionAt(o+e.rangeEnd),a=mr.fromPositions(s,r),l=e.underlineThickness.toLowerCase();let d=wC.NONE;switch(l){case"thin":d=wC.SECONDARY;break;case"thick":d=wC.PRIMARY}n.push({range:a,options:{description:"textFormatDecoration",inlineClassName:d}})}),this._decorations=this._context.viewModel.model.deltaDecorations(this._decorations,n)}_updateSelectionAndControlBoundsData(e){const t=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection);this._primarySelection.isEmpty()?this._linesVisibleRanges=e.visibleRangeForPosition(t.getStartPosition()):this._linesVisibleRanges=null}_updateSelectionAndControlBoundsAfterRender(){const e=this._context.configuration.options.get(165).contentLeft,t=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection),i=this._context.viewLayout.getVerticalOffsetForLineNumber(t.startLineNumber),n=this._context.viewLayout.getVerticalOffsetAfterLineNumber(t.endLineNumber),o=this._parent.getBoundingClientRect(),s=o.top+i-this._scrollTop,r=n-i;let a,l=o.left+e-this._scrollLeft;this._primarySelection.isEmpty()?(this._linesVisibleRanges&&(l+=this._linesVisibleRanges.left),a=0):a=o.width-e;const d=new DOMRect(l,s,a,r);this._editContext.updateSelectionBounds(d),this._editContext.updateControlBounds(d)}_updateCharacterBounds(e){const t=this._context.configuration.options,i=t.get(59).typicalHalfwidthCharacterWidth,n=t.get(165).contentLeft,o=this._parent.getBoundingClientRect(),s=[],r=new nC(this._editContext.text);for(let a=e.rangeStart;a<e.rangeEnd;a++){const e=r.getPosition(a),t=new to(this._editContextPrimarySelection.startLineNumber-1+e.lineNumber,e.column),l=t.delta(0,1),d=mr.fromPositions(t,l),c=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(d),h=this._visibleRangeProvider.linesVisibleRangesForRange(c,!0)??[],u=c.startLineNumber,g=this._context.viewLayout.getVerticalOffsetForLineNumber(u),p=o.top+g-this._scrollTop;let m=0,f=i;if(h.length>0)for(const i of h[0].ranges){m=i.left,f=i.width;break}const _=this._context.viewLayout.getLineHeightForLineNumber(u);s.push(new DOMRect(o.left+n+m-this._scrollLeft,p,f,_))}this._editContext.updateCharacterBounds(e.rangeStart,s)}_ensureClipboardGetsEditorSelection(e){const t=this._context.configuration.options,i=t.get(45),n=t.get(31),o=this._context.viewModel.getCursorStates().map(e=>e.modelState.selection),s=Fpe(this._context.viewModel,o,i,n);let r;this.logService.getLevel()===js.Trace&&(r=Zm());const a={version:1,id:r,isFromEmptySelection:s.isFromEmptySelection,multicursorText:s.multicursorText,mode:s.mode};Km.INSTANCE.set(c?s.text.replace(/\r\n/g,"\n"):s.text,a),e.preventDefault(),e.clipboardData&&jm.setTextData(e.clipboardData,s.text,s.html,a),this.logService.trace("NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ",r," with text.length: ",s.text.length)}},CC=bC([vC(5,Jn),vC(6,Ks)],CC),yC=class extends Sp{constructor(e,t){super(e),this._viewGpuContext=t,this._gpuShapes=[],this._register(Rce(e=>this._updateEntries(e)))}onConfigurationChanged(e){return this._updateEntries(void 0),!0}prepareRender(e){}render(e){}_updateEntries(e){const t=this._context.configuration.options,i=t.get(116),n=t.get(59).typicalHalfwidthCharacterWidth,o=this._viewGpuContext.devicePixelRatio.read(e);for(let s=0,r=i.length;s<r;s++){const e=i[s],t=this._gpuShapes[s],r=e.color?eh.fromHex(e.color):this._context.theme.getColor(Xf)??eh.white,a=[e.column*n*o,0,Math.max(1,Math.ceil(o)),Number.MAX_SAFE_INTEGER,r.rgba.r/255,r.rgba.g/255,r.rgba.b/255,r.rgba.a];t?t.setRaw(a):this._gpuShapes[s]=this._viewGpuContext.rectangleRenderer.register(...a)}for(;this._gpuShapes.length>i.length;)this._gpuShapes.splice(-1,1)[0].dispose()}},(SC=class e extends yf{constructor(e,t){super(),this._viewGpuContext=t,this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onCursorStateChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return!0}prepareRender(t){const i=t.visibleRange.startLineNumber,n=t.visibleRange.endLineNumber,o=t.viewportData,s=new Y_(this._context.configuration,this._context.theme.type),r=[];for(let a=i;a<=n;a++){const t=a-i,n=this._viewGpuContext.canRenderDetailed(s,o,a);r[t]=n.length?`<div class="${e.CLASS_NAME}" title="Cannot render on GPU: ${n.join(", ")}"></div>`:""}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}).CLASS_NAME="gpu-mark",kC=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},LC=function(e,t){return function(i,n){t(i,n,e)}},DC=class extends yp{constructor(e,t,i,n,o,s,r,a,l){super(),this._instantiationService=l,this._shouldRecomputeGlyphMarginLanes=!1,this._ownerID=t,this._widgetFocusTracker=this._register(new NC(e,a)),this._register(this._widgetFocusTracker.onChange(()=>{this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus())})),this._selections=[new fr(1,1,1,1)],this._renderAnimationFrame=null,this._overflowGuardContainer=Fge(document.createElement("div")),xp.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._viewController=new rf(n,s,r,i),this._context=new Lv(n,o,s),this._context.addEventHandler(this),this._viewParts=[],this._editContextEnabled=this._context.configuration.options.get(170),this._accessibilitySupport=this._context.configuration.options.get(2),this._editContext=this._instantiateEditContext(),this._viewParts.push(this._editContext),this._linesContent=Fge(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Fge(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),"on"===this._context.configuration.options.get(46)&&(this._viewGpuContext=this._instantiationService.createInstance(hw,this._context)),this._scrollbar=new E_(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new eb(this._context,this._viewGpuContext,this._linesContent),this._viewGpuContext&&(this._viewLinesGpu=this._instantiationService.createInstance(yw,this._context,this._viewGpuContext)),this._viewZones=new Cv(this._context),this._viewParts.push(this._viewZones);const d=new sv(this._context);this._viewParts.push(d);const c=new hv(this._context);this._viewParts.push(c);const h=new gf(this._context);this._viewParts.push(h),h.addDynamicOverlay(new D_(this._context)),h.addDynamicOverlay(new mv(this._context)),h.addDynamicOverlay(new j_(this._context)),h.addDynamicOverlay(new N_(this._context)),h.addDynamicOverlay(new yv(this._context));const u=new pf(this._context);this._viewParts.push(u),u.addDynamicOverlay(new I_(this._context)),u.addDynamicOverlay(new ob(this._context)),u.addDynamicOverlay(new tb(this._context)),u.addDynamicOverlay(new $_(this._context)),this._viewGpuContext&&u.addDynamicOverlay(new SC(this._context,this._viewGpuContext)),this._glyphMarginWidgets=new A_(this._context),this._viewParts.push(this._glyphMarginWidgets);const g=new nb(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(u.getDomNode()),g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(g),this._contentWidgets=new _f(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new vv(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Xb(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);const p=this._viewGpuContext?new yC(this._context,this._viewGpuContext):new cv(this._context);this._viewParts.push(p);const m=new ff(this._context);this._viewParts.push(m);const f=new Zb(this._context);if(this._viewParts.push(f),d){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(d.getDomNode(),e.insertBefore)}this._linesContent.appendChild(h.getDomNode()),"domNode"in p&&this._linesContent.appendChild(p.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._viewGpuContext&&this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas),this._overflowGuardContainer.appendChild(c.getDomNode()),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),a?(a.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),a.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new sf(this._context,this._viewController,this._createPointerHandlerHelper()))}_instantiateEditContext(){return this._context.configuration.options.get(170)?this._instantiationService.createInstance(CC,this._ownerID,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper()):this._instantiationService.createInstance(Mw,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper())}_updateEditContext(){const e=this._context.configuration.options.get(170),t=this._context.configuration.options.get(2);if(this._editContextEnabled===e&&this._accessibilitySupport===t)return;this._editContextEnabled=e,this._accessibilitySupport=t;const i=this._editContext.isFocused(),n=this._viewParts.indexOf(this._editContext);this._editContext.dispose(),this._editContext=this._instantiateEditContext(),i&&this._editContext.focus(),-1!==n&&this._viewParts.splice(n,1,this._editContext)}_computeGlyphMarginLanes(){const e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes;let i=[],n=0;i=i.concat(e.getAllMarginDecorations().map(e=>{const t=e.options.glyphMargin?.position??Yr.Center;return n=Math.max(n,e.range.endLineNumber),{range:e.range,lane:t,persist:e.options.glyphMargin?.persistLane}})),i=i.concat(this._glyphMarginWidgets.getWidgets().map(t=>{const i=e.validateRange(t.preference.range);return n=Math.max(n,i.endLineNumber),{range:i,lane:t.preference.lane}})),i.sort((e,t)=>mr.compareRangesUsingStarts(e.range,t.range)),t.reset(n);for(const o of i)t.push(o.lane,o.range,o.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,viewLinesGpu:this._viewLinesGpu,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._editContext.domNode.domNode.dispatchEvent(e)},getLastRenderData:()=>new im(this._viewCursors.getLastRenderData()||[],this._editContext.getLastRenderData()),renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>{this._flushAccumulatedAndRenderNow();const i=new to(e,t);return this._viewLines.visibleRangeForPosition(i)??this._viewLinesGpu?.visibleRangeForPosition(i)??null},getLineWidth:e=>{if(this._flushAccumulatedAndRenderNow(),this._viewLinesGpu){const t=this._viewLinesGpu.getLineWidth(e);if(void 0!==t)return t}return this._viewLines.getLineWidth(e)}}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e)),linesVisibleRangesForRange:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.linesVisibleRangesForRange(e,t))}}_applyLayout(){const e=this._context.configuration.options.get(165);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){const e=this._editContext.isFocused()?" focused":"";return this._context.configuration.options.get(162)+" "+zpe(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._updateEditContext(),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewGpuContext?.dispose(),this._viewLines.dispose(),this._viewLinesGpu?.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){if(this._store.isDisposed)throw new y;if(null===this._renderAnimationFrame){this._editContext instanceof CC&&this._editContext.setEditContextOnDomNode();const e=this._createCoordinatedRendering();this._renderAnimationFrame=IC.INSTANCE.scheduleCoordinatedRendering({window:pn(this.domNode?.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new y;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new y;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new y;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new y;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){const e=this._createCoordinatedRendering();Lme(()=>e.prepareRenderText());const t=Lme(()=>e.renderText());if(t){const[i,n]=t;Lme(()=>e.prepareRender(i,n)),Lme(()=>e.render(i,n))}}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;const e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}qc.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return null;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new xv(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),this._viewLinesGpu?.shouldRender()&&(this._viewLinesGpu.renderText(i),this._viewLinesGpu.onDidRender()),[e,new Lp(this._context.viewLayout,i,this._viewLines,this._viewLinesGpu)]},prepareRender:(e,t)=>{for(const i of e)i.prepareRender(t)},render:(e,t)=>{for(const i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new to(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?mf.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new dv(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._editContext.writeScreenReaderContent(e)}focus(){this._editContext.focus()}isFocused(){return this._editContext.isFocused()}isWidgetFocused(){return this._widgetFocusTracker.hasFocus()}setAriaOptions(e){this._editContext.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}},DC=kC([LC(8,Jn)],DC),IC=class{constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{const t=this._coordinatedRenderings.indexOf(e);if(-1!==t&&(this._coordinatedRenderings.splice(t,1),0===this._coordinatedRenderings.length)){for(const[e,t]of this._animationFrameRunners)t.dispose();this._animationFrameRunners.clear()}}}}_scheduleRender(e){if(!this._animationFrameRunners.has(e)){const t=()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()};this._animationFrameRunners.set(e,Dn(e,t,100))}}_onRenderScheduled(){const e=this._coordinatedRenderings.slice(0);this._coordinatedRenderings=[];for(const i of e)Lme(()=>i.prepareRenderText());const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];t[i]=Lme(()=>n.renderText())}for(let i=0,n=e.length;i<n;i++){const n=e[i],o=t[i];if(!o)continue;const[s,r]=o;Lme(()=>n.prepareRender(s,r))}for(let i=0,n=e.length;i<n;i++){const n=e[i],o=t[i];if(!o)continue;const[s,r]=o;Lme(()=>n.render(s,r))}}},(xC=IC).INSTANCE=new xC,NC=class extends Ie{constructor(e,t){super(),this._onChange=this._register(new je),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(Ehe(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(Ehe(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){const e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}},EC=class{constructor(e,t,i,n,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=o}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length&&i>this.injectionOffsets[n];n++)i<this.injectionOffsets[n]+this.injectionOptions[n].content.length?i=this.injectionOffsets[n]:i-=this.injectionOptions[n].content.length;return i}translateToOutputPosition(e,t=2){let i=e;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length&&!(e<this.injectionOffsets[n])&&(1===t||e!==this.injectionOffsets[n]);n++)i+=this.injectionOptions[n].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let i=0,n=this.breakOffsets.length-1,o=0,s=0;for(;i<=n;){o=i+(n-i)/2|0;const r=this.breakOffsets[o];if(s=o>0?this.breakOffsets[o-1]:0,0===t)if(e<=s)n=o-1;else{if(!(e>r))break;i=o+1}else if(e<s)n=o-1;else{if(!(e>=r))break;i=o+1}}let r=e-s;return o>0&&(r+=this.wrappedTextIndentLength),new MC(o,r)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){const n=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(o!==n)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new MC(e-1,this.getMaxOutputOffset(e-1))}else if(1===i&&e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new MC(e+1,this.getMinOutputOffset(e+1));return new MC(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&Dme(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(Ime(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!Dme(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!Ime(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t||4===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}if(0===t||3===t){let e=i.offsetInInputWithInjections,t=i.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}ele()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(null!==t){let n=0;for(let o=0;o<t.length;o++){const s=i[o].content.length,r=t[o]+n,a=t[o]+n+s;if(r>e)break;if(e<=a)return{injectedTextIndex:o,offsetInInputWithInjections:r,length:s};n+=s}}}},MC=class{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new to(e+this.outputLineIndex,this.outputOffset+1)}},TC=class{constructor(){this.changeType=1}},RC=class e{static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(const o of t)i+=e.substring(n,o.column-1),n=o.column-1,i+=o.options.content;return i+=e.substring(n),i}static fromDecorations(t){const i=[];for(const n of t)n.options.before&&n.options.before.content.length>0&&i.push(new e(n.ownerId,n.range.startLineNumber,n.range.startColumn,n.options.before,0)),n.options.after&&n.options.after.content.length>0&&i.push(new e(n.ownerId,n.range.endLineNumber,n.range.endColumn,n.options.after,1));return i.sort((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber),i}constructor(e,t,i,n,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=o}},OC=class{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}},AC=class{constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}},PC=class{constructor(e,t){this.ownerId=e,this.lineNumber=t}},FC=class{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}},WC=class{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}},BC=class{constructor(){this.changeType=5}},VC=class e{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(t,i){const n=[].concat(t.changes).concat(i.changes),o=i.versionId;return new e(n,o,t.isUndoing||i.isUndoing,t.isRedoing||i.isRedoing)}},HC=class{constructor(e){this.changes=e}},zC=class{constructor(e){this.changes=e}},UC=class{constructor(e){this.changes=e}},KC=class e{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(t){return new e(VC.merge(this.rawContentChangedEvent,t.rawContentChangedEvent),e._mergeChangeEvents(this.contentChangedEvent,t.contentChangedEvent))}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),n=t.eol,o=t.versionId,s=e.isUndoing||t.isUndoing,r=e.isRedoing||t.isRedoing,a=e.isFlush||t.isFlush;return{changes:i,eol:n,isEolChange:e.isEolChange&&t.isEolChange,versionId:o,isUndoing:s,isRedoing:r,isFlush:a,detailedReasons:e.detailedReasons.concat(t.detailedReasons),detailedReasonsChangeLengths:e.detailedReasonsChangeLengths.concat(t.detailedReasonsChangeLengths)}}},qC=Bpe("domLineBreaksComputer",{createHTML:e=>e}),jC=class e{static create(t){return new e(new WeakRef(t))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,o,s){const r=[],a=[];return{addRequest:(e,t,i)=>{r.push(e),a.push(t)},finalize:()=>function(e,t,i,n,o,s,r,a){function l(e){const i=a[e];if(i){const n=RC.applyInjectedText(t[e],i),o=i.map(e=>e.options);return new EC(i.map(e=>e.column-1),o,[n.length],[],0)}return null}if(-1===o){const e=[];for(let i=0,n=t.length;i<n;i++)e[i]=l(i);return e}const d=Math.round(o*i.typicalHalfwidthCharacterWidth),c=3===s?2:2===s?1:0,h=Math.round(n*c),u=Math.ceil(i.spaceWidth*h),g=document.createElement("div");Wge(g,i);const p=new _a(1e4),m=[],f=[],_=[],b=[],v=[];for(let x=0;x<t.length;x++){const e=RC.applyInjectedText(t[x],a[x]);let o=0,r=0,l=d;if(0!==s)if(o=jle(e),-1===o)o=0;else{for(let i=0;i<o;i++)r+=9===e.charCodeAt(i)?n-r%n:1;const t=Math.ceil(i.spaceWidth*r);t+i.typicalFullwidthCharacterWidth>d?(o=0,r=0):l=d-t}const c=e.substr(o),h=Nme(c,r,n,l,p,u);m[x]=o,f[x]=r,_[x]=c,b[x]=h[0],v[x]=h[1]}const w=p.build();g.innerHTML=qC?.createHTML(w)??w,g.style.position="absolute",g.style.top="10000","keepAll"===r?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),e.document.body.appendChild(g);const C=document.createRange(),y=Array.prototype.slice.call(g.children,0),S=[];for(let x=0;x<t.length;x++){const e=Eme(C,y[x],_[x],b[x]);if(null===e){S[x]=l(x);continue}const t=m[x],i=f[x]+h,n=v[x],o=[];for(let a=0,l=e.length;a<l;a++)o[a]=n[e[a]];if(0!==t)for(let a=0,l=e.length;a<l;a++)e[a]+=t;let s,r;const d=a[x];d?(s=d.map(e=>e.options),r=d.map(e=>e.column-1)):(s=null,r=null),S[x]=new EC(r,s,e,o,i)}return g.remove(),S}(mle(this.targetWindow.deref()),r,e,t,i,n,o,a)}}},$C=class extends Ie{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new Te),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t)this._pending.has(n.id)?$ae(new Error(`Cannot have two contributions with the same id ${n.id}`)):this._pending.set(n.id,n);this._instantiateSome(0),this._register(ohe(pn(this._editor.getDomNode()),()=>{this._instantiateSome(1)})),this._register(ohe(pn(this._editor.getDomNode()),()=>{this._instantiateSome(2)})),this._register(ohe(pn(this._editor.getDomNode()),()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){return ohe(pn(this._editor?.getDomNode()),()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&0!==t.instantiation&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){$ae(i)}}}},GC=class{constructor(e,t,i,n,o,s,r){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=o,this._run=s,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}},ZC={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},YC=class{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}},QC=class{constructor(e,t,i,n,o,s){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=s}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}},XC=class extends QC{constructor(e,t,i,n,o,s,r){super(e,t,i,n,o,s),this.minVisibleColumnIndentation=r}},JC=2**26,ey=class e{static fromModelContentChanges(t){return t.map(t=>{const i=mr.lift(t.range);return new e(qme(i.getStartPosition()),qme(i.getEndPosition()),function(e){const t=qle(e);return Ame(t.length-1,t[t.length-1].length)}(t.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Pme(this.startOffset)}...${Pme(this.endOffset)}) -> ${Pme(this.newLength)}`}},ty=class{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(e=>iy.from(e))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return null===i?null:Hme(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ame(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ame(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Pme(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ame(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ame(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(!Ume(i,e))break;{this.nextEditIdx++;const e=Pme(i),n=Pme(this.translateOldToCur(t.endOffsetBeforeObj)),o=e.lineCount-n.lineCount;this.deltaOldToNewLineCount+=o,this.deltaOldToNewColumnCount=(this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0)+(e.columnCount-n.columnCount),this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}}}},iy=class e{static from(t){return new e(t.startOffset,t.endOffset,t.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=Pme(t),this.endOffsetAfterObj=Pme(Wme(e,i)),this.offsetObj=Pme(e)}},oy=[],sy=class e{static create(t,i){if(t<=128&&0===i.length){let n=e.cache[t];return n||(n=new e(t,i),e.cache[t]=n),n}return new e(t,i)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(t,i){const n=i.getKey(t);let o=n>>5;if(0===o){const t=1<<n|this.items;return t===this.items?this:e.create(t,this.additionalItems)}o--;const s=this.additionalItems.slice(0);for(;s.length<o;)s.push(0);return s[o]|=1<<(31&n),e.create(this.items,s)}merge(t){const i=this.items|t.items;if(this.additionalItems===oy&&t.additionalItems===oy)return i===this.items?this:i===t.items?t:e.create(i,oy);const n=[];for(let e=0;e<Math.max(this.additionalItems.length,t.additionalItems.length);e++){const i=this.additionalItems[e]||0,o=t.additionalItems[e]||0;n.push(i|o)}return e.create(i,n)}intersects(e){if(0!==(this.items&e.items))return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(0!==(this.additionalItems[t]&e.additionalItems[t]))return!0;return!1}},(ny=sy).cache=new Array(129),ny.empty=ny.create(0,oy),ry={getKey:e=>e},ay=class{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}},ly=class{get length(){return this._length}constructor(e){this._length=e}},dy=class e extends ly{static create(t,i,n){let o=t.length;return i&&(o=Wme(o,i.length)),n&&(o=Wme(o,n.length)),new e(o,t,i,n,i?i.missingOpeningBracketIds:sy.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw new Error("Invalid child index")}get children(){const e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=o}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new e(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(Wme(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}},cy=class extends ly{static create23(e,t,i,n=!1){let o=e.length,s=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=Wme(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=Wme(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return n?new uy(o,e.listHeight+1,e,t,i,s):new hy(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new py(0,0,[],sy.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;if(0===this.childrenLength)return!1;let t=this;for(;4===t.kind;){const e=t.childrenLength;if(0===e)throw new y;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){const e=this.getChild(n);t=Wme(t,e.length),i=i.merge(e.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(-1!==this.cachedMinIndentation)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let o=0;o<this.childrenLength;o++){const e=this.getChild(o);e&&(i=Math.min(i,e.computeMinIndentation(n,t)),n=Wme(n,e.length))}return this.cachedMinIndentation=i,i}},hy=class e extends cy{get childrenLength(){return null!==this._item3?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw new Error("Invalid child index")}setChild(e,t){switch(e){case 0:return void(this._item1=t);case 1:return void(this._item2=t);case 2:return void(this._item3=t)}throw new Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,n,o,s){super(e,t,s),this._item1=i,this._item2=n,this._item3=o}deepClone(){return new e(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw new Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}unappendChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw new Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw new Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();const e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}},uy=class extends hy{toMutable(){return new hy(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}},gy=class e extends cy{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,n){super(e,t,n),this._children=i}deepClone(){const t=new Array(this._children.length);for(let e=0;e<this._children.length;e++)t[e]=this._children[e].deepClone();return new e(this.length,this.listHeight,t,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();const e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();const e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}},py=class extends gy{toMutable(){return new gy(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}},my=[],fy=class extends ly{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return my}deepClone(){return this}},_y=class extends fy{get kind(){return 0}get missingOpeningBracketIds(){return sy.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=Pme(e),n=(0===i.columnCount?i.lineCount:i.lineCount+1)+1,o=(s=Wme(e,this.length),Math.floor(s/JC)+1);var s;let r=Number.MAX_SAFE_INTEGER;for(let a=n;a<=o;a++){const e=t.getLineFirstNonWhitespaceColumn(a),i=t.getLineContent(a);if(0===e)continue;const n=br.visibleColumnFromColumn(i,e,t.getOptions().tabSize);r=Math.min(r,n)}return r}},by=class e extends fy{static create(t,i,n){return new e(t,i,n)}get kind(){return 1}get missingOpeningBracketIds(){return sy.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}},vy=class extends fy{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}},wy=class{constructor(e,t,i,n,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=o}},Cy=class{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new yy(this.textModel,this.bracketTokens),this._offset=0,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return Ame(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Wme(this._offset,e);const t=Pme(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Wme(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}},yy=class{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,null!==this.line&&(this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=e.length,e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const n=this.lineTokens,o=n.getCount();let s=null;if(this.lineTokenOffset<o){const r=n.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<o&&r===n.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const a=0===cl.getTokenType(r),l=cl.containsBalancedBrackets(r),d=n.getEndOffset(this.lineTokenOffset);if(l&&a&&this.lineCharOffset<d){const e=n.getLanguageId(this.lineTokenOffset),t=this.line.substring(this.lineCharOffset,d),i=this.bracketTokens.getSingleLanguageBracketTokens(e),o=i.regExpGlobal;if(o){o.lastIndex=0;const e=o.exec(t);e&&(s=i.getToken(e[0]),s&&(this.lineCharOffset+=e.index))}}if(i+=d-this.lineCharOffset,s){if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=s;break}return this.lineCharOffset+=Fme(s.length),s}this.lineTokenOffset++,this.lineCharOffset=d}else{if(this.lineIdx===this.textBufferLineCount-1)break;if(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3)break}if(i>1500)break}const n=(o=e,s=t,r=this.lineIdx,a=this.lineCharOffset,o!==r?Ame(r-o,a):Ame(0,a-s));var o,s,r,a;return new wy(n,0,-1,sy.getEmpty(),new _y(n))}},Sy=class{constructor(e,t){this.text=e,this._offset=0,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+"|\n","gi"):null,o=[];let s,r=0,a=0,l=0,d=0;const c=[];for(let g=0;g<60;g++)c.push(new wy(Ame(0,g),0,-1,sy.getEmpty(),new _y(Ame(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new wy(Ame(1,g),0,-1,sy.getEmpty(),new _y(Ame(1,g))));if(n)for(n.lastIndex=0;null!==(s=n.exec(e));){const e=s.index,i=s[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(d===r){const i=e-l;if(i<c.length)t=c[i];else{const e=Ame(0,i);t=new wy(e,0,-1,sy.getEmpty(),new _y(e))}}else{const i=r-d,n=e-a;if(1===i&&n<h.length)t=h[n];else{const e=Ame(i,n);t=new wy(e,0,-1,sy.getEmpty(),new _y(e))}}o.push(t)}o.push(t.getToken(i)),l=e+i.length,d=r}}const u=e.length;if(l!==u){const e=d===r?Ame(0,u-l):Ame(r-d,u-a);o.push(new wy(e,0,-1,sy.getEmpty(),new _y(e)))}this.length=Ame(r,u-a),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new w}},xy=class e{static createFromLanguage(t,i){function n(e){return i.getKey(`${e.languageId}:::${e.bracketText}`)}const o=new Map;for(const e of t.bracketsNew.openingBrackets){const t=Ame(0,e.bracketText.length),i=n(e),s=sy.getEmpty().add(i,ry);o.set(e.bracketText,new wy(t,1,i,s,by.create(t,e,s)))}for(const e of t.bracketsNew.closingBrackets){const t=Ame(0,e.bracketText.length);let i=sy.getEmpty();const s=e.getOpeningBrackets();for(const e of s)i=i.add(n(e),ry);o.set(e.bracketText,new wy(t,2,n(s[0]),i,by.create(t,e,i)))}return new e(o)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(e=>function(e){let t=Ble(e);return/^[\w ]+/.test(e)&&(t=`\\b${t}`),/[\w ]+$/.test(e)&&(t=`${t}\\b`),t}(e)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(2===i.kind&&i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}},ky=class{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=xy.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}},Ly=class{constructor(e){this.lastOffset=0,this.nextNodes=[e],this.offsets=[0],this.idxs=[]}readLongestNodeAt(e,t){if(zme(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=Qme(this.nextNodes);if(!i)return;const n=Qme(this.offsets);if(zme(e,n))return;if(zme(n,e))if(Wme(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=Yme(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const e=Yme(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=Qme(this.offsets),t=Qme(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=Qme(this.nextNodes),n=Yme(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(Wme(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}},Dy=class{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw new Error("Not supported");this.oldNodeReader=i?new Ly(i):void 0,this.positionMapper=new ty(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(sy.getEmpty(),0);return e||(e=cy.getEmpty()),e}parseList(e,t){const i=[];for(;;){let n=this.tryReadChildFromCache(e);if(!n){const i=this.tokenizer.peek();if(!i||2===i.kind&&i.bracketIds.intersects(e))break;n=this.parseChild(e,t+1)}4===n.kind&&0===n.childrenLength||i.push(n)}return this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;const i=t,n=e[i].listHeight;for(t++;t<e.length&&e[t].listHeight===n;)t++;return t-i>=2?$me(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),o=i();if(!o)return n;for(let s=i();s;s=i())Gme(n,o)<=Gme(o,s)?(n=Zme(n,o),o=s):o=Zme(o,s);return Zme(n,o)}(i):$me(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(null===t||!Ome(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),i=>!(null!==t&&!zme(i.length,t))&&i.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new vy(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new _y(i.length);const n=e.merge(i.bracketIds),o=this.parseList(n,t+1),s=this.tokenizer.peek();return s&&2===s.kind&&(s.bracketId===i.bracketId||s.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),dy.create(i.astNode,o,s.astNode)):dy.create(i.astNode,o,null)}default:throw new Error("unexpected")}}},Iy=class e{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(t){const i=Hme(t,this.lengthAfter);return Vme(i,0)?[this,void 0]:this.modified?[new e(this.modified,this.lengthBefore,t),new e(this.modified,0,i)]:[new e(this.modified,t,t),new e(this.modified,i,i)]}toString(){return`${this.modified?"M":"U"}:${Pme(this.lengthBefore)} -> ${Pme(this.lengthAfter)}`}},Ny=class extends Ie{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new je,this.denseKeyProvider=new ay,this.brackets=new ky(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)2===e.tokenization.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId());this.initialAstWithoutTokens=Xme(new Sy(this.textModel.getValue(),e),[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.tokenization.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(e=>new ey(Ame(e.fromLineNumber-1,0),Ame(e.toLineNumber,0),Ame(e.toLineNumber-e.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=ey.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){this.queuedTextEdits=Jme(this.queuedTextEdits,e),this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=Jme(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const n=t;return Xme(new Cy(this.textModel,this.brackets),e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=Ame(e.startLineNumber-1,e.startColumn-1),n=Ame(e.endLineNumber-1,e.endColumn-1);return new Fi(e=>{const o=this.initialAstWithoutTokens||this.astWithTokens;nfe(o,0,o.length,i,n,e,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=qme(e.getStartPosition()),n=qme(e.getEndPosition());return new Fi(e=>{const o=this.initialAstWithoutTokens||this.astWithTokens,s=new Ey(e,t,this.textModel);ofe(o,0,o.length,i,n,s,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return ife(t,0,t.length,qme(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return tfe(t,0,t.length,qme(e))}},Ey=class{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}},Ty=class extends Ie{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Ne),this.onDidChangeEmitter=new je,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){e.languageId&&!this.bracketPairsTree.value?.object.didLanguageChange(e.languageId)||(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const i=new De;this.bracketPairsTree.value=(e=i.add(new Ny(this.textModel,e=>this.languageConfigurationService.getLanguageConfiguration(e))),t=i,{object:e,dispose:()=>t?.dispose()}),i.add(this.bracketPairsTree.value.object.onDidChange(e=>this.onDidChangeEmitter.fire(e))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire());var e,t}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||Fi.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||Fi.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||Fi.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const i=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!i)return null;const n=this.getBracketPairsInRange(mr.fromPositions(t,t)).findLast(e=>i.closes(e.openingBracketInfo));return n?n.openingBracketRange:null}{const t=e.toLowerCase(),s=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!s)return null;const r=s.textIsBracket[t];return r?rfe(this._findMatchingBracketUp(r,n,sfe(i))):null}}matchBracket(e,t){if(this.canBuildAST){const t=this.getBracketPairsInRange(mr.fromPositions(e,e)).filter(t=>void 0!==t.closingBracketRange&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e))).findLastMaxBy(fce(t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange,mr.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}{const i=sfe(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const o=t.getCount(),s=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let l=n-1;l>=0;l--){const e=t.getEndOffset(l);if(e<=r)break;if(Mue(t.getStandardTokenType(l))||t.getLanguageId(l)!==s){r=e;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=n+1;l<o;l++){const e=t.getStartOffset(l);if(e>=a)break;if(Mue(t.getStandardTokenType(l))||t.getLanguageId(l)!==s){a=e;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),s=n.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(s)).brackets;if(r&&!Mue(n.getStandardTokenType(s))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,s),d=null;for(;;){const n=Ca.findNextBracketInRange(r.forwardRegex,i,o,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=o.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof Ry)return null;d=i}}a=n.endColumn-1}if(d)return d}if(s>0&&n.getStartOffset(s)===e.column-1){const r=s-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Mue(n.getStandardTokenType(r))){const{searchStartOffset:s,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),d=Ca.findPrevBracketInRange(a.reversedRegex,i,o,s,l);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn){const e=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),i=this._matchFoundBracket(d,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof Ry?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return o?o instanceof Ry?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,o=e.reversedRegex;let s=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return Ry.INSTANCE;const d=Ca.findPrevBracketInRange(o,t,n,a,l);if(!d)break;const c=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(c)?s++:e.isClose(c)&&s--,0===s)return d;l=d.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const e=this.textModel.tokenization.getLineTokens(l),i=e.getCount(),o=this.textModel.getLineContent(l);let s=i-1,r=o.length,d=o.length;l===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,d=t.column-1);let c=!0;for(;s>=0;s--){const t=e.getLanguageId(s)===n&&!Mue(e.getStandardTokenType(s));if(t)c?r=e.getStartOffset(s):(r=e.getStartOffset(s),d=e.getEndOffset(s));else if(c&&r!==d){const e=a(l,o,r,d);if(e)return e}c=t}if(c&&r!==d){const e=a(l,o,r,d);if(e)return e}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,o=e.forwardRegex;let s=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return Ry.INSTANCE;const d=Ca.findNextBracketInRange(o,t,n,a,l);if(!d)break;const c=n.substring(d.startColumn-1,d.endColumn-1).toLowerCase();if(e.isOpen(c)?s++:e.isClose(c)&&s--,0===s)return d;a=d.endColumn-1}return null},l=this.textModel.getLineCount();for(let d=t.lineNumber;d<=l;d++){const e=this.textModel.tokenization.getLineTokens(d),i=e.getCount(),o=this.textModel.getLineContent(d);let s=0,r=0,l=0;d===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,l=t.column-1);let c=!0;for(;s<i;s++){const t=e.getLanguageId(s)===n&&!Mue(e.getStandardTokenType(s));if(t)c||(r=e.getStartOffset(s)),l=e.getEndOffset(s);else if(c&&r!==l){const e=a(d,o,r,l);if(e)return e}c=t}if(c&&r!==l){const e=a(d,o,r,l);if(e)return e}}return null}findPrevBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketBefore(t)||null;let i=null,n=null,o=null;for(let s=t.lineNumber;s>=1;s--){const e=this.textModel.tokenization.getLineTokens(s),r=e.getCount(),a=this.textModel.getLineContent(s);let l=r-1,d=a.length,c=a.length;if(s===t.lineNumber){l=e.findTokenIndexAtOffset(t.column-1),d=t.column-1,c=t.column-1;const s=e.getLanguageId(l);i!==s&&(i=s,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let h=!0;for(;l>=0;l--){const t=e.getLanguageId(l);if(i!==t){if(n&&o&&h&&d!==c){const e=Ca.findPrevBracketInRange(n.reversedRegex,s,a,d,c);if(e)return this._toFoundBracket(o,e);h=!1}i=t,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,o=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}const r=!!n&&!Mue(e.getStandardTokenType(l));if(r)h?d=e.getStartOffset(l):(d=e.getStartOffset(l),c=e.getEndOffset(l));else if(o&&n&&h&&d!==c){const e=Ca.findPrevBracketInRange(n.reversedRegex,s,a,d,c);if(e)return this._toFoundBracket(o,e)}h=r}if(o&&n&&h&&d!==c){const e=Ca.findPrevBracketInRange(n.reversedRegex,s,a,d,c);if(e)return this._toFoundBracket(o,e)}}return null}findNextBracket(e){const t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;const i=this.textModel.getLineCount();let n=null,o=null,s=null;for(let r=t.lineNumber;r<=i;r++){const e=this.textModel.tokenization.getLineTokens(r),i=e.getCount(),a=this.textModel.getLineContent(r);let l=0,d=0,c=0;if(r===t.lineNumber){l=e.findTokenIndexAtOffset(t.column-1),d=t.column-1,c=t.column-1;const i=e.getLanguageId(l);n!==i&&(n=i,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let h=!0;for(;l<i;l++){const t=e.getLanguageId(l);if(n!==t){if(s&&o&&h&&d!==c){const e=Ca.findNextBracketInRange(o.forwardRegex,r,a,d,c);if(e)return this._toFoundBracket(s,e);h=!1}n=t,o=this.languageConfigurationService.getLanguageConfiguration(n).brackets,s=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const i=!!o&&!Mue(e.getStandardTokenType(l));if(i)h||(d=e.getStartOffset(l)),c=e.getEndOffset(l);else if(s&&o&&h&&d!==c){const e=Ca.findNextBracketInRange(o.forwardRegex,r,a,d,c);if(e)return this._toFoundBracket(s,e)}h=i}if(s&&o&&h&&d!==c){const e=Ca.findNextBracketInRange(o.forwardRegex,r,a,d,c);if(e)return this._toFoundBracket(s,e)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const e=mr.fromPositions(i),t=this.getBracketPairsInRange(mr.fromPositions(i,i)).findLast(t=>void 0!==t.closingBracketRange&&t.range.strictContainsRange(e));return t?[t.openingBracketRange,t.closingBracketRange]:null}const n=sfe(t),o=this.textModel.getLineCount(),s=new Map;let r=[];const a=(e,t)=>{if(!s.has(e)){const i=[];for(let e=0,n=t?t.brackets.length:0;e<n;e++)i[e]=0;s.set(e,i)}r=s.get(e)};let l=0;const d=(e,t,i,o,s)=>{for(;;){if(n&&++l%100==0&&!n())return Ry.INSTANCE;const a=Ca.findNextBracketInRange(e.forwardRegex,t,i,o,s);if(!a)break;const d=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),c=e.textIsBracket[d];if(c&&(c.isOpen(d)?r[c.index]++:c.isClose(d)&&r[c.index]--,-1===r[c.index]))return this._matchFoundBracket(a,c,!1,n);o=a.endColumn-1}return null};let c=null,h=null;for(let u=i.lineNumber;u<=o;u++){const e=this.textModel.tokenization.getLineTokens(u),t=e.getCount(),n=this.textModel.getLineContent(u);let o=0,s=0,r=0;if(u===i.lineNumber){o=e.findTokenIndexAtOffset(i.column-1),s=i.column-1,r=i.column-1;const t=e.getLanguageId(o);c!==t&&(c=t,h=this.languageConfigurationService.getLanguageConfiguration(c).brackets,a(c,h))}let l=!0;for(;o<t;o++){const t=e.getLanguageId(o);if(c!==t){if(h&&l&&s!==r){const e=d(h,u,n,s,r);if(e)return rfe(e);l=!1}c=t,h=this.languageConfigurationService.getLanguageConfiguration(c).brackets,a(c,h)}const i=!!h&&!Mue(e.getStandardTokenType(o));if(i)l||(s=e.getStartOffset(o)),r=e.getEndOffset(o);else if(h&&l&&s!==r){const e=d(h,u,n,s,r);if(e)return rfe(e)}l=i}if(h&&l&&s!==r){const e=d(h,u,n,s,r);if(e)return rfe(e)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const n=e.getBracketInfo(i);return n?{range:t,bracketInfo:n}:null}},(My=Ry=class{constructor(){this._searchCanceledBrand=void 0}}).INSTANCE=new My,Oy=class extends Ie{constructor(e){super(),this.textModel=e,this.colorProvider=new Ay,this.onDidChangeEmitter=new je,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(e=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n||void 0===t?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range})).toArray():[]}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new mr(1,1,this.textModel.getLineCount(),1),e,t):[]}},Ay=class{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return"bracket-highlighting-"+e%30}},Upe((e,t)=>{const i=[a_,l_,d_,c_,h_,u_],n=new Ay;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(g_)}; }`);const o=i.map(t=>e.getColor(t)).filter(e=>!!e).filter(e=>!e.isTransparent());for(let s=0;s<30;s++){const e=o[s%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(s)} { color: ${e}; }`)}}),Py=class e{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${afe(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${afe(this.oldText)}")`:`(replace@${this.oldPosition} "${afe(this.oldText)}" with "${afe(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Vde(e,n,i),i+=4;for(let o=0;o<n;o++)Wde(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=Bde(e,t);return Que(e,t+=4,i)}writeSize(){return 8+e._writeStringSize(this.oldText)+e._writeStringSize(this.newText)}write(t,i){return Vde(t,this.oldPosition,i),i+=4,Vde(t,this.newPosition,i),i+=4,i=e._writeString(t,this.oldText,i),i=e._writeString(t,this.newText,i)}static read(t,i,n){const o=Bde(t,i),s=Bde(t,i+=4);i+=4;const r=e._readString(t,i);i+=e._writeStringSize(r);const a=e._readString(t,i);return i+=e._writeStringSize(a),n.push(new e(o,r,s,a)),i}},Fy=class e{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let t=0,i=0,n=this._getPrev(t),o=this._getCurr(i);for(;t<this._prevLen||i<this._currLen;){if(null===n){this._acceptCurr(o),o=this._getCurr(++i);continue}if(null===o){this._acceptPrev(n),n=this._getPrev(++t);continue}if(o.oldEnd<=n.newPosition){this._acceptCurr(o),o=this._getCurr(++i);continue}if(n.newEnd<=o.oldPosition){this._acceptPrev(n),n=this._getPrev(++t);continue}if(o.oldPosition<n.newPosition){const[t,i]=e._splitCurr(o,n.newPosition-o.oldPosition);this._acceptCurr(t),o=i;continue}if(n.newPosition<o.oldPosition){const[t,i]=e._splitPrev(n,o.oldPosition-n.newPosition);this._acceptPrev(t),n=i;continue}let s,r;if(o.oldEnd===n.newEnd)s=n,r=o,n=this._getPrev(++t),o=this._getCurr(++i);else if(o.oldEnd<n.newEnd){const[t,a]=e._splitPrev(n,o.oldLength);s=t,r=o,n=a,o=this._getCurr(++i)}else{const[i,a]=e._splitCurr(o,n.newLength);s=n,r=i,n=this._getPrev(++t),o=a}this._result[this._resultLen++]=new Py(s.oldPosition,s.oldText,r.newPosition,r.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=r.newLength-r.oldLength}const s=e._merge(this._result);return e._removeNoOps(s)}_acceptCurr(t){this._result[this._resultLen++]=e._rebaseCurr(this._prevDeltaOffset,t),this._currDeltaOffset+=t.newLength-t.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(t){this._result[this._resultLen++]=e._rebasePrev(this._currDeltaOffset,t),this._prevDeltaOffset+=t.newLength-t.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new Py(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new Py(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),n=e.newText.substr(t);return[new Py(e.oldPosition,e.oldText,e.newPosition,i),new Py(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new Py(e.oldPosition,i,e.newPosition,e.newText),new Py(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(0===e.length)return e;const t=[];let i=0,n=e[0];for(let o=1;o<e.length;o++){const s=e[o];n.oldEnd===s.oldPosition?n=new Py(n.oldPosition,n.oldText+s.oldText,n.newPosition,n.newText+s.newText):(t[i++]=n,n=s)}return t[i++]=n,t}static _removeNoOps(e){if(0===e.length)return e;const t=[];let i=0;for(let n=0;n<e.length;n++){const o=e[n];o.oldText!==o.newText&&(t[i++]=o)}return t}},Wy=Symbol("TextModelEditSource"),By=class{constructor(e,t){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){const e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e,t={}){const i=this.metadata;return Object.entries(i).filter(([i,n])=>{const o=t[i];return void 0!==o?o:(i.match(/\$/g)||[]).length<=e&&null!=n&&""!==n}).map(([e,t])=>`${e}:${t}`).join("-")}},Vy={unknown:e=>lfe({source:"unknown",name:e.name}),rename:()=>lfe({source:"rename"}),chatApplyEdits:e=>lfe({source:"Chat.applyEdits",$modelId:cfe(e.modelId),$extensionId:e.extensionId?.extensionId,$extensionVersion:e.extensionId?.version,$$languageId:e.languageId,$$sessionId:e.sessionId,$$requestId:e.requestId,$$mode:e.mode,$$codeBlockSuggestionId:e.codeBlockSuggestionId}),chatUndoEdits:()=>lfe({source:"Chat.undoEdits"}),chatReset:()=>lfe({source:"Chat.reset"}),inlineCompletionAccept:e=>lfe({source:"inlineCompletionAccept",$nes:e.nes,...dfe(e.providerId),$$requestUuid:e.requestUuid,$$languageId:e.languageId}),inlineCompletionPartialAccept:e=>lfe({source:"inlineCompletionPartialAccept",type:e.type,$nes:e.nes,...dfe(e.providerId),$$requestUuid:e.requestUuid,$$languageId:e.languageId}),inlineChatApplyEdit:e=>lfe({source:"inlineChat.applyEdits",$modelId:cfe(e.modelId),$extensionId:e.extensionId?.extensionId,$extensionVersion:e.extensionId?.version,$$sessionId:e.sessionId,$$requestId:e.requestId,$$languageId:e.languageId}),reloadFromDisk:()=>lfe({source:"reloadFromDisk"}),cursor:e=>lfe({source:"cursor",kind:e.kind,detailedSource:e.detailedSource}),setValue:()=>lfe({source:"setValue"}),eolChange:()=>lfe({source:"eolChange"}),applyEdits:()=>lfe({source:"applyEdits"}),snippet:()=>lfe({source:"snippet"}),suggest:e=>lfe({source:"suggest",...dfe(e.providerId)}),codeAction:e=>lfe({source:"codeAction",$kind:e.kind,...dfe(e.providerId)})},Hy=class e{static fromText(t){const i=eC.ofText(t).lineCount,n=t.length;return new e(i,0,n,0)}static tryCreate(t,i,n,o){if(void 0!==t&&void 0!==i&&void 0!==n&&void 0!==o)return new e(t,i,n,o)}constructor(e,t,i,n){this.linesAdded=e,this.linesRemoved=t,this.charsAdded=i,this.charsRemoved=n}},function(e){e.newId=function(e){return e?e("sgt"):Wpe("sgt")}}(zy||(zy={})),Uy=class e{static create(t,i){const n=t.getAlternativeVersionId(),o=ufe(t);return new e(n,n,o,o,i,i,[])}constructor(e,t,i,n,o,s,r){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=o,this.afterCursorState=s,this.changes=r}append(e,t,i,n,o){var s,r;t.length>0&&(this.changes=(s=this.changes,r=t,null===s||0===s.length?r:new Fy(s,r).compress())),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(Vde(e,t?t.length:0,i),i+=4,t)for(const n of t)Vde(e,n.selectionStartLineNumber,i),i+=4,Vde(e,n.selectionStartColumn,i),i+=4,Vde(e,n.positionLineNumber,i),i+=4,Vde(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=Bde(e,t);t+=4;for(let o=0;o<n;o++){const n=Bde(e,t),o=Bde(e,t+=4),s=Bde(e,t+=4),r=Bde(e,t+=4);t+=4,i.push(new fr(n,o,s,r))}return t}serialize(){let t=10+e._writeSelectionsSize(this.beforeCursorState)+e._writeSelectionsSize(this.afterCursorState)+4;for(const e of this.changes)t+=e.writeSize();const i=new Uint8Array(t);let n=0;Vde(i,this.beforeVersionId,n),n+=4,Vde(i,this.afterVersionId,n),n+=4,zde(i,this.beforeEOL,n),n+=1,zde(i,this.afterEOL,n),n+=1,n=e._writeSelections(i,this.beforeCursorState,n),n=e._writeSelections(i,this.afterCursorState,n),Vde(i,this.changes.length,n),n+=4;for(const e of this.changes)n=e.write(i,n);return i.buffer}static deserialize(t){const i=new Uint8Array(t);let n=0;const o=Bde(i,n);n+=4;const s=Bde(i,n);n+=4;const r=Hde(i,n);n+=1;const a=Hde(i,n);n+=1;const l=[];n=e._readSelections(i,n,l);const d=[];n=e._readSelections(i,n,d);const c=Bde(i,n);n+=4;const h=[];for(let e=0;e<c;e++)n=Py.read(i,n,h);return new e(o,s,r,a,l,d,h)}},Ky=class{get type(){return 0}get resource(){return _i.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,n){this.label=e,this.code=t,this.model=i,this._data=Uy.create(i,n)}toString(){return(this._data instanceof Uy?this._data:Uy.deserialize(this._data)).changes.map(e=>e.toString()).join(", ")}matchesResource(e){return(_i.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Uy}append(e,t,i,n,o){this._data instanceof Uy&&this._data.append(e,t,i,n,o)}close(){this._data instanceof Uy&&(this._data=this._data.serialize())}open(){this._data instanceof Uy||(this._data=Uy.deserialize(this._data))}undo(){if(_i.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Uy&&(this._data=this._data.serialize());const e=Uy.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(_i.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Uy&&(this._data=this._data.serialize());const e=Uy.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Uy&&(this._data=this._data.serialize()),this._data.byteLength+168}},qy=class{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const e=hfe(n.resource);this._editStackElementsMap.set(e,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=hfe(e);return this._editStackElementsMap.has(t)}setModel(e){const t=hfe(_i.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=hfe(e.uri);return!!this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).canAppend(e)}append(e,t,i,n,o){const s=hfe(e.uri);this._editStackElementsMap.get(s).append(e,t,i,n,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=hfe(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${Os(t.resource)}: ${t}`);return`{${e.join(", ")}}`}},jy=class e{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);gfe(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);gfe(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(gfe(i)&&i.canAppend(this._model))return i;const n=new Ky(Vae(785,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],ufe(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(t,i,n,o,s=Vy.unknown({name:"pushEditOperation"})){const r=this._getOrCreateEditStackElement(t,o),a=this._model.applyEdits(i,!0,s),l=e._computeCursorState(n,a),d=a.map((e,t)=>({index:t,textChange:e.textChange}));return d.sort((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition),r.append(this._model,d.map(e=>e.textChange),ufe(this._model),this._model.getAlternativeVersionId(),l),l}static _computeCursorState(e,t){try{return e?e(t):null}catch(Fae){return $ae(Fae),null}}},$y=class{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}},Gy=class{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,_fe(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,Cfe(this,!1),Sfe(this,!1),Lfe(this,1),Dfe(this,!1),kfe(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,vfe(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;Cfe(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),Sfe(this,null!==this.options.glyphMarginClassName),Lfe(this,this.options.stickiness),Dfe(this,this.options.collapseOnReplaceEdit),kfe(this,this.options.affectsFont??!1)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}},(Zy=new Gy(null,0,0)).parent=Zy,Zy.left=Zy,Zy.right=Zy,_fe(Zy,0),Yy=class{constructor(){this.root=Zy,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o,s,r){return this.root===Zy?[]:function(e,t,i,n,o,s,r,a){let l=e.root,d=0,c=0,h=0,u=0;const g=[];let p=0;for(;l!==Zy;)if(bfe(l))vfe(l.left,!1),vfe(l.right,!1),l===l.parent.right&&(d-=l.parent.delta),l=l.parent;else{if(!bfe(l.left)){if(c=d+l.maxEnd,c<t){vfe(l,!0);continue}if(l.left!==Zy){l=l.left;continue}}if(h=d+l.start,h>i)vfe(l,!0);else{if(u=d+l.end,u>=t){l.setCachedOffsets(h,u,r);let e=!0;n&&l.ownerId&&l.ownerId!==n&&(e=!1),o&&wfe(l)&&(e=!1),s&&xfe(l)&&(e=!1),a&&!yfe(l)&&(e=!1),e&&(g[p++]=l)}vfe(l,!0),l.right===Zy||bfe(l.right)||(d+=l.delta,l=l.right)}}return vfe(e.root,!1),g}(this,e,t,i,n,o,s,r)}search(e,t,i,n,o){return this.root===Zy?[]:function(e,t,i,n,o,s){let r=e.root,a=0,l=0,d=0;const c=[];let h=0;for(;r!==Zy;){if(bfe(r)){vfe(r.left,!1),vfe(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;continue}if(r.left!==Zy&&!bfe(r.left)){r=r.left;continue}l=a+r.start,d=a+r.end,r.setCachedOffsets(l,d,o);let e=!0;t&&r.ownerId&&r.ownerId!==t&&(e=!1),i&&wfe(r)&&(e=!1),n&&xfe(r)&&(e=!1),s&&!yfe(r)&&(e=!1),e&&(c[h++]=r),vfe(r,!0),r.right===Zy||bfe(r.right)||(a+=r.delta,r=r.right)}return vfe(e.root,!1),c}(this,e,t,i,n,o)}collectNodesFromOwner(e){return function(e,t){let i=e.root;const n=[];let o=0;for(;i!==Zy;)bfe(i)?(vfe(i.left,!1),vfe(i.right,!1),i=i.parent):i.left===Zy||bfe(i.left)?(i.ownerId===t&&(n[o++]=i),vfe(i,!0),i.right===Zy||bfe(i.right)||(i=i.right)):i=i.left;return vfe(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root;const i=[];let n=0;for(;t!==Zy;)bfe(t)?(vfe(t.left,!1),vfe(t.right,!1),t=t.parent):t.left===Zy||bfe(t.left)?t.right===Zy||bfe(t.right)?(i[n++]=t,vfe(t,!0)):t=t.right:t=t.left;return vfe(e.root,!1),i}(this)}insert(e){Efe(this,e),this._normalizeDeltaIfNecessary()}delete(e){Mfe(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const o=i.start+n,s=i.end+n;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,n){const o=function(e,t,i){let n=e.root,o=0,s=0,r=0,a=0;const l=[];let d=0;for(;n!==Zy;)if(bfe(n))vfe(n.left,!1),vfe(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!bfe(n.left)){if(s=o+n.maxEnd,s<t){vfe(n,!0);continue}if(n.left!==Zy){n=n.left;continue}}r=o+n.start,r>i?vfe(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[d++]=n),vfe(n,!0),n.right===Zy||bfe(n.right)||(o+=n.delta,n=n.right))}return vfe(e.root,!1),l}(this,e,e+t);for(let s=0,r=o.length;s<r;s++)Mfe(this,o[s]);this._normalizeDeltaIfNecessary(),function(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=n-(i-t);for(;o!==Zy;)if(bfe(o))vfe(o.left,!1),vfe(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),Pfe(o),o=o.parent;else{if(!bfe(o.left)){if(r=s+o.maxEnd,r<t){vfe(o,!0);continue}if(o.left!==Zy){o=o.left;continue}}a=s+o.start,a>i?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),vfe(o,!0)):(vfe(o,!0),o.right===Zy||bfe(o.right)||(s+=o.delta,o=o.right))}vfe(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,r=o.length;s<r;s++){const r=o[s];r.start=r.cachedAbsoluteStart,r.end=r.cachedAbsoluteEnd,Nfe(r,e,e+t,i,n),r.maxEnd=r.end,Efe(this,r)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,function(e){let t=e.root,i=0;for(;t!==Zy;)t.left===Zy||bfe(t.left)?t.right===Zy||bfe(t.right)?(t.start=i+t.start,t.end=i+t.end,t.delta=0,Pfe(t),vfe(t,!0),vfe(t.left,!1),vfe(t.right,!1),t===t.parent.right&&(i-=t.parent.delta),t=t.parent):(i+=t.delta,t=t.right):t=t.left;vfe(e.root,!1)}(this))}},(Xy=new(Qy=class{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Xy)return Bfe(this.right);let e=this;for(;e.parent!==Xy&&e.parent.left!==e;)e=e.parent;return e.parent===Xy?Xy:e.parent}prev(){if(this.left!==Xy)return Vfe(this.left);let e=this;for(;e.parent!==Xy&&e.parent.right!==e;)e=e.parent;return e.parent===Xy?Xy:e.parent}detach(){this.parent=null,this.left=null,this.right=null}})(null,0)).parent=Xy,Xy.left=Xy,Xy.right=Xy,Xy.color=0,Jy=class{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?Yfe(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=Ule(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(n){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new ia(t,this.wordSeparators?Fue(this.wordSeparators,[]):null,i?this.searchString:null)}},eS=class{constructor(e){const t=[];let i=0;for(let n=0,o=e.length;n<o;n++)10===e.charCodeAt(n)&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(-1===n)return 0;if(e<=t[0])return 0;for(;i<n;){const o=i+((n-i)/2|0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}},tS=class{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new iS(s.wordSeparators,s.regex),n,o):this._doFindMatchesLineByLine(e,i,s,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,s){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(o),r=t+o+l):r=t+o,n){const e=n.findLineFeedCountBeforeOffset(o+s.length)-l;a=r+s.length+e}else a=r+s.length;const d=e.getPositionAt(r),c=e.getPositionAt(a);return new mr(d.lineNumber,d.column,c.lineNumber,c.column)}static _doFindMatchesMultiline(e,t,i,n,o){const s=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new eS(r):null,l=[];let d,c=0;for(i.reset(0);d=i.next(r);)if(l[c++]=Qfe(this._getMultilineMatchRange(e,s,r,a,d.index,d[0]),d,n),c>=o)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,o){const s=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o),s}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,s,n,o);for(let l=t.startLineNumber+1;l<t.endLineNumber&&r<o;l++)r=this._findMatchesInLine(i,e.getLineContent(l),l,0,r,s,n,o);if(r<o){const a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);r=this._findMatchesInLine(i,a,t.endLineNumber,0,r,s,n,o)}return s}static _findMatchesInLine(e,t,i,n,o,s,r,a){const l=e.wordSeparators;if(!r&&e.simpleSearch){const r=e.simpleSearch,d=r.length,c=t.length;let h=-d;for(;-1!==(h=t.indexOf(r,h+d));)if((!l||Xfe(l,t,c,h,d))&&(s[o++]=new ea(new mr(i,h+1+n,i,h+1+d+n),null),o>=a))return o;return o}const d=new iS(e.wordSeparators,e.regex);let c;d.reset(0);do{if(c=d.next(t),c&&(s[o++]=Qfe(new mr(i,c.index+1+n,i,c.index+1+c[0].length+n),c,r),o>=a))return o}while(c);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new iS(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,n):this._doFindNextMatchLineByLine(e,i,s,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new to(t.lineNumber,1),s=e.getOffsetAt(o),r=e.getLineCount(),a=e.getValueInRange(new mr(o.lineNumber,o.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new eS(a):null;i.reset(t.column-1);const d=i.next(a);return d?Qfe(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new to(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s),a=this._findFirstMatchInLine(i,r,s,t.column,n);if(a)return a;for(let l=1;l<=o;l++){const t=(s+l-1)%o,r=e.getLineContent(t+1),a=this._findFirstMatchInLine(i,r,t+1,1,n);if(a)return a}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const s=e.next(t);return s?Qfe(new mr(i,s.index+1,i,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const s=new iS(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,n):this._doFindPreviousMatchLineByLine(e,i,s,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new mr(1,1,t.lineNumber,t.column),i,n,9990);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new to(s,e.getLineMaxColumn(s)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),s=t.lineNumber,r=e.getLineContent(s).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,s,n);if(a)return a;for(let l=1;l<=o;l++){const t=(o+s-l-1)%o,r=e.getLineContent(t+1),a=this._findLastMatchInLine(i,r,t+1,n);if(a)return a}return null}static _findLastMatchInLine(e,t,i,n){let o,s=null;for(e.reset(0);o=e.next(t);)s=Qfe(new mr(i,o.index+1,i,o.index+1+o[0].length),o,n);return s}},iS=class{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t)return null;if(i=this._searchRegex.exec(e),!i)return null;const n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(0===o){cde(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||Xfe(this._wordSeparators,e,t,n,o))return i}while(i);return null}},nS=65535,oS=class{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}},sS=class{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}},rS=class{constructor(e,t){this.buffer=e,this.lineStarts=t}},aS=class{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Xy&&e.iterate(e.root,e=>(e!==Xy&&this._pieces.push(e.piece),!0))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}},lS=class{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let n=0;n<i.length;n++){const o=i[n];(null===o.node.parent||o.nodeStartOffset>=e)&&(i[n]=null,t=!0)}if(t){const e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}},dS=class{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new rS("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Xy,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,s=e.length;o<s;o++)if(e[o].buffer.length>0){e[o].lineStarts||(e[o].lineStarts=e_e(e[o].buffer));const t=new sS(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),n=this.rbInsertRight(n,t)}this._searchCache=new lS(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=nS,i=t-Math.floor(21845),n=2*i;let o="",s=0;const r=[];if(this.iterate(this.root,t=>{const a=this.getNodeContent(t),l=a.length;if(s<=i||s+l<n)return o+=a,s+=l,!0;const d=o.replace(/\r\n|\r|\n/g,e);return r.push(new rS(d,e_e(d))),o=a,s=l,!0}),s>0){const t=o.replace(/\r\n|\r|\n/g,e);r.push(new rS(t,e_e(t)))}this.create(r,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new aS(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Xy;)if(n.left!==Xy&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e)return i+=n.size_left,i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1);e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const n=e;for(;t!==Xy;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,0===o.index){const e=n-this.getOffsetAt(i+1,1);return new to(i+1,e+1)}return new to(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Xy){const t=this.getOffsetAt(i+1,1);return new to(i+1,n-e-t+1)}t=t.right}return new to(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(o+e.remainder,o+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let s=n.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Xy;){const e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=e.substring(n,n+t.remainder);break}s+=e.substr(n,i.piece.length),i=i.next()}return s}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,o=>{if(o===Xy)return!0;const s=o.piece;let r=s.length;if(0===r)return!0;const a=this._buffers[s.bufferIndex].buffer,l=this._buffers[s.bufferIndex].lineStarts,d=s.start.line,c=s.end.line;let h=l[d]+s.start.column;if(n&&(10===a.charCodeAt(h)&&(h++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(d===c)return this._EOLNormalized||13!==a.charCodeAt(h+r-1)?i+=a.substr(h,r):(n=!0,i+=a.substr(h,r-1)),!0;i+=this._EOLNormalized?a.substring(h,Math.max(h,l[d+1]-this._EOLLength)):a.substring(h,l[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=d+1;n<c;n++)i=this._EOLNormalized?a.substring(l[n],l[n+1]-this._EOLLength):a.substring(l[n],l[n+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return this._EOLNormalized||13!==a.charCodeAt(l[c]+s.end.column-1)?i=a.substr(l[c],s.end.column):(n=!0,0===s.end.column?t--:i=a.substr(l[c],s.end.column-1)),!0}),n&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e||(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,"")),this._lastVisitedLine.value}_getCharCode(e){if(e.remainder===e.node.piece.length){const t=e.node.next();if(!t)return 0;const i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}{const t=this._buffers[e.node.piece.bufferIndex],i=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(i)}}getLineCharCode(e,t){const i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){const t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}getNearestChunk(e){const t=this.nodeAt(e);if(t.remainder===t.node.piece.length){const e=t.node.next();if(!e||e===Xy)return"";const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start);return i.buffer.substring(n,n+e.piece.length)}{const e=this._buffers[t.node.piece.bufferIndex],i=this.offsetInBuffer(t.node.piece.bufferIndex,t.node.piece.start),n=i+t.remainder,o=i+t.node.piece.length;return e.buffer.substring(n,o)}}findMatchesInNode(e,t,i,n,o,s,r,a,l,d,c){const h=this._buffers[e.piece.bufferIndex],u=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),g=this.offsetInBuffer(e.piece.bufferIndex,o),p=this.offsetInBuffer(e.piece.bufferIndex,s);let m;const f={line:0,column:0};let _,b;t._wordSeparators?(_=h.buffer.substring(g,p),b=e=>e+g,t.reset(0)):(_=h.buffer,b=e=>e,t.reset(g));do{if(m=t.next(_),m){if(b(m.index)>=p)return d;this.positionInBuffer(e,b(m.index)-u,f);const t=this.getLineFeedCnt(e.piece.bufferIndex,o,f),s=f.line===o.line?f.column-o.column+n:f.column+1,r=s+m[0].length;if(c[d++]=Qfe(new mr(i+t,s,i+t,r),m,a),b(m.index)+m[0].length>=p)return d;if(d>=l)return d}}while(m);return d}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new iS(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let d=this.positionInBuffer(a.node,a.remainder);const c=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,d,c,t,i,n,s,o),o;let h=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,d,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,c=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[d.line+l],p=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,h,p,d,this.positionInBuffer(u,g-c),t,i,n,s,o),s>=n)return o;h+=l}const c=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const a=this.getLineContent(h).substring(c,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,c,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(h).substr(c),h,c,s,o,i,n),s>=n)return o;h++,a=this.nodeAt2(h,1),u=a.node,d=this.positionInBuffer(a.node,a.remainder)}if(h===e.endLineNumber){const a=h===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(h).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}const g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,h,g,d,c,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const d=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,c=i.length;let h=-a;for(;-1!==(h=i.indexOf(t,h+a));)if((!d||Xfe(d,i,c,h,a))&&(r[s++]=new ea(new mr(n,h+1+o,n,h+1+a+o),null),s>=l))return s;return s}let c;t.reset(0);do{if(c=t.next(i),c&&(r[s++]=Qfe(new mr(n,c.index+1+o,n,c.index+1+c[0].length+o),c,a),s>=l))return s}while(c);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Xy){const{node:i,remainder:n,nodeStartOffset:o}=this.nodeAt(e),s=i.piece,r=s.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&s.end.line===this._lastChangeBufferPos.line&&s.end.column===this._lastChangeBufferPos.column&&o+s.length===e&&t.length<nS)return this.appendToNode(i,t),void this.computeBufferMetadata();if(o===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(o+i.piece.length>e){const e=[];let o=new sS(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),this.offsetInBuffer(r,s.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&10===this.nodeCharCodeAt(i,n)){const e={line:o.start.line+1,column:0};o=new sS(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(13===this.nodeCharCodeAt(i,n-1)){const o=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,o),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a);else this.deleteNodeTail(i,a);const l=this.createNewPieces(t);o.length>0&&this.rbInsertRight(i,o);let d=i;for(let t=0;t<l.length;t++)d=this.rbInsertRight(d,l[t]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,i)}else{const e=this.createNewPieces(t);let i=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)i=this.rbInsertRight(i,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===Xy)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),o=i.node,s=n.node;if(o===s){const s=this.positionInBuffer(o,i.remainder),r=this.positionInBuffer(o,n.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const e=o.next();return jfe(this,o),this.validateCRLFWithPrevNode(e),void this.computeBufferMetadata()}return this.deleteNodeHead(o,r),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),void this.computeBufferMetadata()}return i.nodeStartOffset+o.piece.length===e+t?(this.deleteNodeTail(o,s),this.validateCRLFWithNextNode(o),void this.computeBufferMetadata()):(this.shrinkNode(o,s,r),void this.computeBufferMetadata())}const r=[],a=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,a),this._searchCache.validate(e),0===o.piece.length&&r.push(o);const l=this.positionInBuffer(s,n.remainder);this.deleteNodeHead(s,l),0===s.piece.length&&r.push(s);for(let c=o.next();c!==Xy&&c!==s;c=c.next())r.push(c);const d=0===o.piece.length?o.prev():o;this.deleteNodes(r),this.validateCRLFWithNextNode(d),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const n=t.piece,o={line:n.start.line+1,column:0};t.piece=new sS(n.bufferIndex,o,n.end,this.getLineFeedCnt(n.bufferIndex,o,n.end),n.length-1),e+="\n",Gfe(this,t,-1,-1),0===t.piece.length&&i.push(t)}const n=this.createNewPieces(e);let o=this.rbInsertLeft(t,n[n.length-1]);for(let s=n.length-2;s>=0;s--)o=this.rbInsertLeft(o,n[s]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let s=1;s<i.length;s++)o=this.rbInsertRight(o,i[s]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,o=e.piece.bufferIndex,s=this._buffers[o].lineStarts,r=s[n.start.line]+n.start.column+t;let a=n.start.line,l=n.end.line,d=0,c=0,h=0;for(;a<=l&&(d=a+(l-a)/2|0,h=s[d],d!==l);)if(c=s[d+1],r<h)l=d-1;else{if(!(r>=c))break;a=d+1}return i?(i.line=d,i.column=r-h,null):{line:d,column:r-h}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],s=n[i.line]+i.column;if(o>s+1)return i.line-t.line;const r=s-1;return 13===this._buffers[e].buffer.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)jfe(this,e[t])}createNewPieces(e){if(e.length>nS){const t=[];for(;e.length>nS;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,nS),e=e.substring(nS));const o=e_e(n);t.push(new sS(this._buffers.length,{line:0,column:0},{line:o.length-1,column:n.length-o[o.length-1]},o.length-1,n.length)),this._buffers.push(new rS(n,o))}const i=e_e(e);return t.push(new sS(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new rS(e,i)),t}let t=this._buffers[0].buffer.length;const i=e_e(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let e=0;e<i.length;e++)i[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(0!==t)for(let e=0;e<i.length;e++)i[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,s=this._buffers[0].lineStarts.length-1,r={line:s,column:o-this._buffers[0].lineStarts[s]},a=new sS(0,n,r,this.getLineFeedCnt(0,n,r),o-t);return this._lastChangeBufferPos=r,[a]}getLineRawContent(e,t=0){let i=this.root,n="";const o=this._searchCache.get2(e);if(o){i=o.node;const s=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),r=this._buffers[i.piece.bufferIndex].buffer,a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt!==e){const n=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return r.substring(a+s,a+n-t)}n=r.substring(a+s,a+i.piece.length)}else{let o=0;const s=e;for(;i!==Xy;)if(i.left!==Xy&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,nodeStartLineNumber:s-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(i,e-i.lf_left-2),o=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=o.substring(s+t,s+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,o+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==Xy;){const e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(s,s+o-t),n}{const t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Xy;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,n=this.positionInBuffer(e,t),o=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==o)return{index:t,remainder:0}}return{index:o,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[o]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),s=t,r=this.offsetInBuffer(i.bufferIndex,s),a=this.getLineFeedCnt(i.bufferIndex,i.start,s),l=a-n,d=r-o,c=i.length+d;e.piece=new sS(i.bufferIndex,i.start,s,a,c),Gfe(this,e,d,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,r=this.getLineFeedCnt(i.bufferIndex,s,i.end),a=r-n,l=o-this.offsetInBuffer(i.bufferIndex,s),d=i.length+l;e.piece=new sS(i.bufferIndex,s,i.end,r,d),Gfe(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,d=this.getLineFeedCnt(n.bufferIndex,n.start,l),c=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new sS(n.bufferIndex,n.start,l,d,c),Gfe(this,e,c-r,d-a);const h=new sS(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=e_e(t,!1);for(let h=0;h<o.length;h++)o[h]+=n;if(i){const e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const s=this._buffers[0].lineStarts.length-1,r={line:s,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[s]},a=e.piece.length+t.length,l=e.piece.lineFeedCnt,d=this.getLineFeedCnt(0,e.piece.start,r),c=d-l;e.piece=new sS(e.piece.bufferIndex,e.piece.start,r,d,a),this._lastChangeBufferPos=r,Gfe(this,e,t.length,c)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==Xy;)if(t.size_left>e)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;const i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right}return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==Xy;)if(i.left!==Xy&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Xy;){if(i.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1)return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)};t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===Xy||0===e.piece.lineFeedCnt)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n!==i.length-1&&!(i[n+1]>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o)}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==Xy&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;o=0===e.piece.end.column?{line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new sS(e.piece.bufferIndex,e.piece.start,o,r,s),Gfe(this,e,-1,-1),0===e.piece.length&&i.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new sS(t.piece.bufferIndex,a,t.piece.end,d,l),Gfe(this,t,-1,-1),0===t.piece.length&&i.push(t);const c=this.createNewPieces("\r\n");this.rbInsertRight(e,c[0]);for(let h=0;h<i.length;h++)jfe(this,i[h])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+="\n",1===i.piece.length)jfe(this,i);else{const e=i.piece,t={line:e.start.line+1,column:0},n=e.length-1,o=this.getLineFeedCnt(e.bufferIndex,t,e.end);i.piece=new sS(e.bufferIndex,t,e.end,o,n),Gfe(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===Xy)return t(Xy);const i=this.iterate(e.left,t);return i?t(e)&&this.iterate(e.right,t):i}getNodeContent(e){if(e===Xy)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),o=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,o)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new Qy(t,1);if(i.left=Xy,i.right=Xy,i.parent=Xy,i.size_left=0,i.lf_left=0,this.root===Xy)this.root=i,i.color=0;else if(e.right===Xy)e.right=i,i.parent=e;else{const t=Bfe(e.right);t.left=i,i.parent=t}return $fe(this,i),i}rbInsertLeft(e,t){const i=new Qy(t,1);if(i.left=Xy,i.right=Xy,i.parent=Xy,i.size_left=0,i.lf_left=0,this.root===Xy)this.root=i,i.color=0;else if(e.left===Xy)e.left=i,i.parent=e;else{const t=Vfe(e.left);t.right=i,i.parent=t}return $fe(this,i),i}},cS=class e extends Ie{constructor(e,t,i,n,o,s,r){super(),this._onDidChangeContent=this._register(new je),this._BOM=t,this._mightContainNonBasicASCII=!s,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new dS(e,i,r)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new mr(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const s=this._getEndOfLine(t),r=this.getEOL();return s.length!==r.length&&(o=(s.length-r.length)*(e.endLineNumber-e.startLineNumber)),n-i+o}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let t=n;t<=o;t++){const s=this.getLineContent(t),r=t===n?e.startColumn-1:0,a=t===o?e.endColumn-1:s.length;for(let e=r;e<a;e++)ade(s.charCodeAt(e))?(i+=1,e+=1):i+=1}return i+=this._getEndOfLine(t).length*(o-n),i}return this.getValueLengthInRange(e,t)}getNearestChunk(e){return this._pieceTree.getNearestChunk(e)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=jle(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Gle(this.getLineContent(e));return-1===t?0:t+2}_getEndOfLine(e){switch(e){case 1:return"\n";case 2:return"\r\n";case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(t,i,n){let o=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let e=0;e<t.length;e++){const i=t[e];a&&i._isTracked&&(a=!1);const n=i.range;if(i.text){let e=!0;r||(e=!pde(i.text),r=e),!o&&e&&(o=gde(i.text)),!s&&e&&(s=mde(i.text))}let d="",c=0,h=0,u=0;if(i.text){let e;[c,h,u,e]=Rme(i.text);const t=this.getEOL();d=0===e||e===("\r\n"===t?2:1)?i.text:i.text.replace(/\r\n|\r|\n/g,t)}l[e]={sortIndex:e,identifier:i.identifier||null,range:n,rangeOffset:this.getOffsetAt(n.startLineNumber,n.startColumn),rangeLength:this.getValueLengthInRange(n),text:d,eolCount:c,firstLineLength:h,lastLineLength:u,forceMoveMarkers:Boolean(i.forceMoveMarkers),isAutoWhitespaceEdit:i.isAutoWhitespaceEdit||!1}}l.sort(e._sortOpsAscending);let d=!1;for(let e=0,m=l.length-1;e<m;e++){const t=l[e].range.getEndPosition(),i=l[e+1].range.getStartPosition();if(i.isBeforeOrEqual(t)){if(i.isBefore(t))throw new Error("Overlapping ranges are not allowed!");d=!0}}a&&(l=this._reduceOperations(l));const c=n||i?e._getInverseEditRanges(l):[],h=[];if(i)for(let e=0;e<l.length;e++){const t=l[e],i=c[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=i.startLineNumber;e<=i.endLineNumber;e++){let n="";e===i.startLineNumber&&(n=this.getLineContent(t.range.startLineNumber),-1!==jle(n))||h.push({lineNumber:e,oldContent:n})}}let u=null;if(n){let e=0;u=[];for(let t=0;t<l.length;t++){const i=l[t],n=c[t],o=this.getValueInRange(i.range),s=i.rangeOffset+e;e+=i.text.length-o.length,u[t]={sortIndex:i.sortIndex,identifier:i.identifier,range:n,text:o,textChange:new Py(i.rangeOffset,o,s,i.text)}}d||u.sort((e,t)=>e.sortIndex-t.sortIndex)}this._mightContainRTL=o,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;const g=this._doApplyEdits(l);let p=null;if(i&&h.length>0){h.sort((e,t)=>t.lineNumber-e.lineNumber),p=[];for(let e=0,t=h.length;e<t;e++){const t=h[e].lineNumber;if(e>0&&h[e-1].lineNumber===t)continue;const i=h[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===jle(n)&&p.push(t)}}return this._onDidChangeContent.fire(),new na(u,g,p)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new mr(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let u=0,g=e.length;u<g;u++){const i=e[u],n=i.range;t=t||i.forceMoveMarkers,a.push(this.getValueInRange(new mr(s,r,n.startLineNumber,n.startColumn))),i.text.length>0&&a.push(i.text),s=n.endLineNumber,r=n.endColumn}const l=a.join(""),[d,c,h]=Rme(l);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:l,eolCount:d,firstLineLength:c,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(t){t.sort(e._sortOpsDescending);const i=[];for(let e=0;e<t.length;e++){const n=t[e],o=n.range.startLineNumber,s=n.range.startColumn,r=n.range.endLineNumber,a=n.range.endColumn;if(o===r&&s===a&&0===n.text.length)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const l=new mr(o,s,r,a);i.push({range:l,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return i}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,o=null;for(let s=0,r=e.length;s<r;s++){const r=e[s];let a,l,d;if(o?o.range.endLineNumber===r.range.startLineNumber?(a=i,l=n+(r.range.startColumn-o.range.endColumn)):(a=i+(r.range.startLineNumber-o.range.endLineNumber),l=r.range.startColumn):(a=r.range.startLineNumber,l=r.range.startColumn),r.text.length>0){const e=r.eolCount+1;d=1===e?new mr(a,l,a,l+r.firstLineLength):new mr(a,l,a+e-1,r.lastLineLength+1)}else d=new mr(a,l,a,l);i=d.endLineNumber,n=d.endColumn,t.push(d),o=r}return t}static _sortOpsAscending(e,t){const i=mr.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=mr.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}},hS=class{constructor(e,t,i,n,o,s,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let o=0,s=i.length;o<s;o++){const e=i[o].buffer.replace(/\r\n|\r|\n/g,t);i[o]=new rS(e,e_e(e))}const n=new cS(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}},uS=class{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(0===e.length)return;0===this.chunks.length&&bde(e)&&(this.BOM="\ufeff",e=e.substr(1));const t=e.charCodeAt(e.length-1);13===t||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,o=0,s=0,r=!0;for(let l=0,d=t.length;l<d;l++){const a=t.charCodeAt(l);13===a?l+1<d&&10===t.charCodeAt(l+1)?(s++,e[i++]=l+2,l++):(n++,e[i++]=l+1):10===a?(o++,e[i++]=l+1):r&&9!==a&&(a<32||a>126)&&(r=!1)}const a=new oS(Jfe(e),n,o,s,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new rS(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=gde(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=mde(e)))}finish(e=!0){return this._finish(),new hS(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar),e.lineStarts=e_e(e.buffer),13===this._previousChar&&this.cr++}}},gS=class extends Xi{get debugName(){return new Ki(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t,i){super(i),this._debugName=e,this._owner=t}trigger(e,t){if(e)for(const i of this._observers)e.updateObserver(i,this),i.handleChange(this,t);else Wce(e=>{this.trigger(e,t)},()=>`Trigger signal ${this.debugName}`)}get(){}},pS=class extends Xi{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(const e of this._deltas){vce()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const t of this._observers)t.handleChange(this,e)}this._deltas.length=0}else{vce()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(const e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,1===this._updateCounter)for(const e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,0===this._updateCounter){this._update();const e=[...this._observers];for(const t of e)t.endUpdate(this)}}addObserver(e){const t=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){if(void 0===i&&this._equalityComparator(this._value,e))return;let n;t||(t=n=new on(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),void 0!==i&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(e,t)=>{},handlePossibleChange:e=>{}},this),this._updateCounter>1)for(const e of this._observers)e.handlePossibleChange(this)}finally{n&&n.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}},mS=class{constructor(){this._onDidChangeVisibleRanges=new je,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set,this._viewsChanged=t_e(this),this.visibleLineRanges=Nce({owner:this,equalsFn:wce((e,t)=>e.equals(t))},e=>(this._viewsChanged.read(e),Qw.joinMany([...this._views].map(t=>t.state.read(e)?.visibleLineRanges??[]))))}attachView(){const e=new _S(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),this._viewsChanged.trigger(void 0),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0}),this._viewsChanged.trigger(void 0)}},fS=class{constructor(e,t){this.visibleLineRanges=e,this.stabilized=t}equals(e){return this===e||!!Zde(this.visibleLineRanges,e.visibleLineRanges,(e,t)=>e.equals(t))&&this.stabilized===e.stabilized}},_S=class{get state(){return this._state}constructor(e){this.handleStateChange=e,this._state=i_e({owner:this,equalsFn:Cce((e,t)=>e.equals(t))},void 0)}setVisibleLines(e,t){const i=new fS(e.map(e=>new Qw(e.startLineNumber,e.endLineNumber+1)),t);this._state.set(i,void 0,void 0),this.handleStateChange(i)}},bS=class extends Ie{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new ft(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Zde(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}},vS=class extends Ie{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t){super(),this._languageIdCodec=e,this._textModel=t,this._onDidChangeTokens=this._register(new je),this.onDidChangeTokens=this._onDidChangeTokens.event}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}},wS=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},CS=function(e,t){return function(i,n){t(i,n,e)}},yS=class extends Ie{constructor(e,t,i,n,o,s,r){super(),this.languageId=e,this._ranges=t,this._parser=i,this._parserClass=n,this.textModel=o,this._logService=s,this._telemetryService=r,this._tree=Qce(this,void 0),this.tree=this._tree,this._treeLastParsedVersion=Qce(this,-1),this.treeLastParsedVersion=this._treeLastParsedVersion,this._onDidChangeContentQueue=new gt,this._tree=Qce(this,void 0),this.tree=this._tree,this._register(Dle(()=>{this._tree.get()?.delete(),this._lastFullyParsed?.delete(),this._lastFullyParsedWithEdits?.delete(),this._parser.delete()})),this.handleContentChange(void 0,this._ranges)}handleContentChange(e,t){const i=this.textModel.getVersionId();let n=[];t&&(n=this._setRanges(t)),e&&this._applyEdits(e.changes),this._onDidChangeContentQueue.clearPending(),this._onDidChangeContentQueue.schedule(async()=>{if(this._store.isDisposed)return;const e=this._lastFullyParsed;let t;this._lastFullyParsedWithEdits&&this._lastFullyParsed&&(t=this._findChangedNodes(this._lastFullyParsedWithEdits,this._lastFullyParsed));const o=await this._parseAndUpdateTree(i);if(o){let s;t?e&&t&&(s=this._findTreeChanges(o,t,n)):this._ranges&&(s=this._ranges.map(e=>({newRange:new mr(e.startPosition.row+1,e.startPosition.column+1,e.endPosition.row+1,e.endPosition.column+1),oldRangeLength:e.endIndex-e.startIndex,newRangeStartOffset:e.startIndex,newRangeEndOffset:e.endIndex}))),s||(s=[{newRange:this.textModel.getFullModelRange(),newRangeStartOffset:0,newRangeEndOffset:this.textModel.getValueLength()}]);const r=this._tree.get();Wce(e=>{this._tree.set(o,e,{ranges:s,versionId:i}),this._treeLastParsedVersion.set(i,e)}),r?.delete()}})}_applyEdits(e){for(const t of e){const e=eC.ofRange(mr.lift(t.range)),i=eC.ofText(t.text),n=0===t.text.length?i:e.add(i),o={startIndex:t.rangeOffset,oldEndIndex:t.rangeOffset+t.rangeLength,newEndIndex:t.rangeOffset+t.text.length,startPosition:{row:t.range.startLineNumber-1,column:t.range.startColumn-1},oldEndPosition:{row:t.range.endLineNumber-1,column:t.range.endColumn-1},newEndPosition:{row:t.range.startLineNumber+n.lineCount-1,column:n.lineCount?n.columnCount:t.range.endColumn+n.columnCount}};this._tree.get()?.edit(o),this._lastFullyParsedWithEdits?.edit(o)}}_findChangedNodes(e,t){if(this._ranges&&this._ranges.every(t=>t.startPosition.row!==e.rootNode.startPosition.row)||0!==e.rootNode.startPosition.row)return[];const i=e.walk(),n=t.walk(),o=[];let s=!0;do{if(i.currentNode.hasChanges){const t=i.currentNode.children,r=[],a=t.filter((e,t)=>!!(e?.hasChanges||n.currentNode.children.length<=t)&&(r.push(t),!0));if(0===a.length||i.currentNode.hasError!==n.currentNode.hasError){for(;i.currentNode.parent&&s&&!i.currentNode.isNamed;)s=o_e(i,n);const t=i.currentNode,r=a_e(i,e)??t;o.push({startIndex:r.startIndex,endIndex:t.endIndex,startPosition:r.startPosition,endPosition:t.endPosition}),s=r_e(i,n)}else a.length>=1&&(s=s_e(i,n,r[0]))}else s=r_e(i,n)}while(s);return i.delete(),n.delete(),o}_findTreeChanges(e,t,i){let n=0;const o=[];for(let s=0;s<t.length;s++){const r=t[s];if(o.length>0&&r.startIndex>=o[o.length-1].newRangeStartOffset&&r.endIndex<=o[o.length-1].newRangeEndOffset)continue;const a=e.walk(),l=()=>a.startIndex<r.startIndex&&a.endIndex>r.endIndex;for(;l();){let e=a.gotoFirstChild(),t=!1;for(;e;){if(l()&&a.currentNode.isNamed){t=!0;break}e=a.gotoNextSibling()}if(!t){a.gotoParent();break}if(0===a.currentNode.childCount)break}const d=a.currentNode.startPosition,c=a.currentNode.endPosition,h=a.currentNode.startIndex,u=a.currentNode.endIndex,g={newRange:new mr(d.row+1,d.column+1,c.row+1,c.column+1),newRangeStartOffset:h,newRangeEndOffset:u};n<i.length&&d_e(i[n],{startIndex:h,endIndex:u})?(i[n].startIndex<g.newRangeStartOffset&&(g.newRange=g.newRange.setStartPosition(i[n].startPosition.row+1,i[n].startPosition.column+1),g.newRangeStartOffset=i[n].startIndex),i[n].endIndex>g.newRangeEndOffset&&(g.newRange=g.newRange.setEndPosition(i[n].endPosition.row+1,i[n].endPosition.column+1),g.newRangeEndOffset=i[n].endIndex),n++):n<i.length&&i[n].endIndex<g.newRangeStartOffset&&o.push({newRange:new mr(i[n].startPosition.row+1,i[n].startPosition.column+1,i[n].endPosition.row+1,i[n].endPosition.column+1),newRangeStartOffset:i[n].startIndex,newRangeEndOffset:i[n].endIndex}),o.length>0&&o[o.length-1].newRangeEndOffset>=g.newRangeStartOffset?(o[o.length-1].newRange=mr.fromPositions(o[o.length-1].newRange.getStartPosition(),g.newRange.getEndPosition()),o[o.length-1].newRangeEndOffset=g.newRangeEndOffset):o.push(g)}return this._constrainRanges(o)}_constrainRanges(e){if(!this._ranges)return e;const t=[];let i=0,n=0;for(;i<e.length&&n<this._ranges.length;){const o=e[i],s=this._ranges[n];if(o.newRangeEndOffset<s.startIndex)i++;else if(o.newRangeStartOffset>s.endIndex)n++;else{const e=Math.max(o.newRangeStartOffset,s.startIndex),n=Math.min(o.newRangeEndOffset,s.endIndex),r=o.newRange.intersectRanges(new mr(s.startPosition.row+1,s.startPosition.column+1,s.endPosition.row+1,s.endPosition.column+1));t.push({newRange:r,newRangeEndOffset:n,newRangeStartOffset:e}),n<o.newRangeEndOffset?(o.newRange=mr.fromPositions(r.getEndPosition(),o.newRange.getEndPosition()),o.newRangeStartOffset=n+1):i++}}return t}async _parseAndUpdateTree(e){const t=await this._parse();if(t)return this._lastFullyParsed?.delete(),this._lastFullyParsed=t.copy(),this._lastFullyParsedWithEdits?.delete(),this._lastFullyParsedWithEdits=t.copy(),t;this._tree.get()||this._parser.reset()}_parse(){let e="fullParse";return this._tree.get()&&(e="incrementalParse"),this._parseAndYield(e)}async _parseAndYield(e){let t=0,i=0;const n=this.textModel.getVersionId();let o;const s=function(){let e=performance.now();return function(t){const i=performance.now();return i-e>50&&(e=i,!0)}}();do{const e=performance.now();o=this._parser.parse((e,t)=>this._parseCallback(e),this._tree.get(),{progressCallback:s,includedRanges:this._ranges}),t+=performance.now()-e,i++,await new Promise(e=>Z(e))}while(!this._store.isDisposed&&!o&&n===this.textModel.getVersionId());return this._sendParseTimeTelemetry(e,t,i),o&&n===this.textModel.getVersionId()?o:void 0}_parseCallback(e){try{return this.textModel.getTextBuffer().getNearestChunk(e)}catch(Fae){this._logService.debug("Error getting chunk for tree-sitter parsing",Fae)}}_setRanges(e){const t=[];if(this._ranges)for(const i of e){let e=!1;for(let t=0;t<this._ranges.length;t++){const n=this._ranges[t];if(l_e(n,i)||d_e(n,i)){e=!0;break}}e||t.push(i)}else t.push(...e);return this._ranges=e,t}_sendParseTimeTelemetry(e,t,i){this._logService.debug(`Tree parsing (${e}) took ${t} ms and ${i} passes.`),"fullParse"===e?this._telemetryService.publicLog2("treeSitter.fullParse",{languageId:this.languageId,time:t,passes:i}):this._telemetryService.publicLog2("treeSitter.incrementalParse",{languageId:this.languageId,time:t,passes:i})}createParsedTreeSync(e){const t=new this._parserClass;t.setLanguage(this._parser.language);const i=t.parse(e);return t.delete(),i??void 0}},yS=wS([CS(5,Ks),CS(6,fs)],yS),SS=new class{clone(){return this}equals(e){return this===e}},xS=class{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(0===t)return void this.insert(e,i);if(0===i)return void this.delete(e,t);const n=this._store.slice(0,e),o=this._store.slice(e+t),s=function(e,t){const i=[];for(let n=0;n<e;n++)i[n]=t;return i}(i,this._default);this._store=n.concat(s,o)}delete(e,t){0===t||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const i=[];for(let n=0;n<t;n++)i[n]=this._default;this._store=lce(this._store,e,i)}},kS=class{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}},LS=class{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e)return void i.appendLineTokens(t)}this._tokens.push(new kS(e,[t]))}finalize(){return this._tokens}},DS=class{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new NS(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}},IS=class extends DS{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const o=this._textModel.getLineContent(n.lineNumber),s=g_e(this._languageIdCodec,i,this.tokenizationSupport,o,!0,n.startState);e.add(n.lineNumber,s.tokens),this.store.setEndState(n.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),r=new gl(g_e(this._languageIdCodec,n,this.tokenizationSupport,s,!0,i).tokens,s,this._languageIdCodec);if(0===r.getCount())return 0;const a=r.findTokenIndexAtOffset(e.column-1);return r.getStandardTokenType(a)}tokenizeLinesAt(e,t){const i=this.getStartState(e);if(!i)return null;const n=this._textModel.getLanguageId(),o=[];let s=i;for(const r of t){const e=g_e(this._languageIdCodec,n,this.tokenizationSupport,r,!0,s);o.push(new gl(e.tokens,r,this._languageIdCodec)),s=e.endState}return o}hasAccurateTokensForLine(e){return e<this.store.getFirstInvalidEndStateLineNumberOrMax()}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e<t||e===t&&this._textModel.getLineLength(e)<2048}tokenizeHeuristically(e,t,i){if(i<=this.store.getFirstInvalidEndStateLineNumberOrMax())return{heuristicTokens:!1};if(t<=this.store.getFirstInvalidEndStateLineNumberOrMax())return this.updateTokensUntilLine(e,i),{heuristicTokens:!1};let n=this.guessStartState(t);const o=this._textModel.getLanguageId();for(let s=t;s<=i;s++){const t=this._textModel.getLineContent(s),i=g_e(this._languageIdCodec,o,this.tokenizationSupport,t,!0,n);e.add(s,i.tokens),n=i.endState}return{heuristicTokens:!0}}guessStartState(e){let{likelyRelevantLines:t,initialState:i}=u_e(this._textModel,e,this);i||(i=this.tokenizationSupport.getInitialState());const n=this._textModel.getLanguageId();let o=i;for(const s of t)o=g_e(this._languageIdCodec,n,this.tokenizationSupport,s,!1,o).endState;return o}},NS=class{constructor(e){this.lineCount=e,this._tokenizationStateStore=new ES,this._invalidEndStatesLineNumbers=new MS,this._invalidEndStatesLineNumbers.addRange(new hl(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){if(!t)throw new y("Cannot set null/undefined state");this._invalidEndStatesLineNumbers.delete(e);const i=this._tokenizationStateStore.setEndState(e,t);return i&&e<this.lineCount&&this._invalidEndStatesLineNumbers.addRange(new hl(e+1,e+2)),i}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new hl(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(const t of e){const[e]=Rme(t.text);this.acceptChange(new Qw(t.range.startLineNumber,t.range.endLineNumber+1),e+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new hl(e.startLineNumber,e.endLineNumberExclusive))}getFirstInvalidEndStateLineNumber(){return this._invalidEndStatesLineNumbers.min}getFirstInvalidEndStateLineNumberOrMax(){return this.getFirstInvalidEndStateLineNumber()||Number.MAX_SAFE_INTEGER}allStatesValid(){return null===this._invalidEndStatesLineNumbers.min}getStartState(e,t){return 1===e?t:this.getEndState(e-1)}getFirstInvalidLine(e){const t=this.getFirstInvalidEndStateLineNumber();if(null===t)return null;const i=this.getStartState(t,e);if(!i)throw new y("Start state must be defined");return{lineNumber:t,startState:i}}},ES=class{constructor(){this._lineEndStates=new xS(null)}getEndState(e){return this._lineEndStates.get(e)}setEndState(e,t){const i=this._lineEndStates.get(e);return!(i&&i.equals(t)||(this._lineEndStates.set(e,t),0))}acceptChange(e,t){let i=e.length;t>0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}},MS=class{constructor(){this._ranges=[]}get min(){return 0===this._ranges.length?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(t=>t.contains(e));if(-1!==t){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new hl(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new hl(i.start,e):this._ranges.splice(t,1,new hl(i.start,e),new hl(e+1,i.endExclusive))}}addRange(e){hl.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusive<this._ranges[n].start);)n++;const o=t-e.length;for(let s=n;s<this._ranges.length;s++)this._ranges[s]=this._ranges[s].delta(o);if(i===n){const n=new hl(e.start,e.start+t);n.isEmpty||this._ranges.splice(i,0,n)}else{const t=new hl(Math.min(e.start,this._ranges[i].start),Math.max(e.endExclusive,this._ranges[n-1].endExclusive)+o);t.isEmpty?this._ranges.splice(i,n-i):this._ranges.splice(i,n-i,t)}}toString(){return this._ranges.map(e=>e.toString()).join(" + ")}},TS=class{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){!this._isScheduled&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._isScheduled=!0,_t(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{!this._isDisposed&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?Z(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new LS,i=Fe.create(!1);do{if(i.elapsed()>1)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return!!this._tokenizerWithStateStore&&!this._tokenizerWithStateStore.store.allStatesValid()}_tokenizeOneInvalidLine(e){const t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Qw(e,t))}},RS=class e{get children(){return this._children}get length(){return this._length}constructor(e){this.height=e,this._children=[],this._length=0}static create(t,i){const n=new e(t.height+1);return n.appendChild(t),n.appendChild(i),n}canAppendChild(){return this._children.length<3}appendChild(e){if(!this.canAppendChild())throw new Error("Cannot insert more than 3 children in a ListNode");this._children.push(e),this._length+=e.length,this._updateParentLength(e.length),p_e(e)||(e.parent=this)}_updateParentLength(e){let t=this.parent;for(;t;)t._length+=e,t=t.parent}unappendChild(){const e=this._children.pop();return this._length-=e.length,this._updateParentLength(-e.length),e}prependChild(e){if(this._children.length>=3)throw new Error("Cannot prepend more than 3 children in a ListNode");this._children.unshift(e),this._length+=e.length,this._updateParentLength(e.length),p_e(e)||(e.parent=this)}unprependChild(){const e=this._children.shift();return this._length-=e.length,this._updateParentLength(-e.length),e}lastChild(){return this._children[this._children.length-1]}dispose(){this._children.splice(0,this._children.length)}},function(e){e[e.None=0]="None",e[e.ViewportGuess=1]="ViewportGuess",e[e.EditGuess=2]="EditGuess",e[e.Accurate=3]="Accurate"}(OS||(OS={})),AS=class{constructor(e){this._textModel=e,this._root=this.createEmptyRoot()}createEmptyRoot(){return{length:this._textModel.getValueLength(),token:0,height:0,tokenQuality:OS.None}}buildStore(e,t){this._root=this.createFromUpdates(e,t)}createFromUpdates(e,t){if(0===e.length)return this.createEmptyRoot();let i={length:e[0].length,token:e[0].token,height:0,tokenQuality:t};for(let n=1;n<e.length;n++)i=m_e(i,{length:e[n].length,token:e[n].token,height:0,tokenQuality:t});return i}update(e,t,i){0!==t.length&&this.replace(e,t[0].startOffsetInclusive,t,i)}delete(e,t){this.replace(e,t,[],OS.EditGuess)}replace(e,t,i,n){const o=t+e,s=[],r=[],a=[{node:this._root,offset:0}];for(;a.length>0;){const e=a.pop(),i=e.offset;if(i<t&&i+e.node.length<=t)p_e(e.node)||(e.node.parent=void 0),s.push(e.node);else if(p_e(e.node)&&i<t&&s.push({length:t-i,token:e.node.token,height:0,tokenQuality:e.node.tokenQuality}),!(t<=i&&i+e.node.length<=o))if(i>=o)p_e(e.node)||(e.node.parent=void 0),r.push(e.node);else if(p_e(e.node)&&i+e.node.length>o)r.push({length:i+e.node.length-o,token:e.node.token,height:0,tokenQuality:e.node.tokenQuality});else if(!p_e(e.node)){let t=i+e.node.length;for(let i=e.node.children.length-1;i>=0;i--)t-=e.node.children[i].length,a.push({node:e.node.children[i],offset:t})}}let l;l=i.length>0?s.concat(this.createFromUpdates(i,n),r):s.concat(r);let d=l[0];for(let c=1;c<l.length;c++)d=f_e(d,l[c]);this._root=d??this.createEmptyRoot()}traverseInOrderInRange(e,t,i){const n=[{node:this._root,offset:0}];for(;n.length>0;){const{node:o,offset:s}=n.pop();if(!(s+o.length<=e||s>=t)){if(i(o,s))return;if(!p_e(o)){let e=s+o.length;for(let t=o.children.length-1;t>=0;t--)e-=o.children[t].length,n.push({node:o.children[t],offset:e})}}}}getTokenAt(e){let t;return this.traverseInOrderInRange(e,this._root.length,(e,i)=>!!p_e(e)&&(t={token:e.token,startOffsetInclusive:i,length:e.length},!0)),t}getTokensInRange(e,t){const i=[];return this.traverseInOrderInRange(e,t,(n,o)=>{if(p_e(n)){let s=n.length,r=o;o<e&&o+n.length>t?(r=e,s=t-e):o<e?(s-=e-o,r=e):o+n.length>t&&(s-=o+n.length-t),i.push({token:n.token,startOffsetInclusive:r,length:s})}return!1}),i}markForRefresh(e,t){this.traverseInOrderInRange(e,t,e=>(p_e(e)&&(e.tokenQuality=OS.None),!1))}rangeHasTokens(e,t,i){let n=!0;return this.traverseInOrderInRange(e,t,e=>(p_e(e)&&e.tokenQuality<i&&(n=!1),!1)),n}rangeNeedsRefresh(e,t){let i=!1;return this.traverseInOrderInRange(e,t,e=>(p_e(e)&&e.tokenQuality!==OS.Accurate&&(i=!0),!1)),i}getNeedsRefresh(){const e=[];return this.traverseInOrderInRange(0,this._textModel.getValueLength(),(t,i)=>(p_e(t)&&t.tokenQuality!==OS.Accurate&&(e.length>0&&e[e.length-1].endOffset===i?e[e.length-1].endOffset+=t.length:e.push({startOffset:i,endOffset:i+t.length})),!1)),e}dispose(){const e=[[this._root,!1]];for(;e.length>0;){const[t,i]=e.pop();if(p_e(t));else if(i)t.dispose(),t.parent=void 0;else{e.push([t,!0]);for(let i=t.children.length-1;i>=0;i--)e.push([t.children[i],!1])}}this._root=void 0}},PS=eue("treeSitterThemeService"),FS=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},WS=function(e,t){return function(i,n){t(i,n,e)}},BS=class extends Ie{get _textModel(){return this._tree.textModel}constructor(e,t,i,n,o){var s;super(),this._tree=e,this._highlightingQueries=t,this._languageIdCodec=i,this._visibleLineRanges=n,this._treeSitterThemeService=o,this._onDidChangeTokens=this._register(new je),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidCompleteBackgroundTokenization=this._register(new je),this.onDidChangeBackgroundTokenization=this._onDidCompleteBackgroundTokenization.event,this._encodedLanguageId=this._languageIdCodec.encodeLanguageId(this._tree.languageId),this._register(ume(this._treeSitterThemeService.onChange,()=>{this._updateTheme()})),this._tokenStore=this._register(new AS(this._textModel)),this._accurateVersion=this._textModel.getVersionId(),this._guessVersion=this._textModel.getVersionId(),this._tokenStore.buildStore(this._createEmptyTokens(),OS.None),this._register(Rce(e=>{const t=this._visibleLineRanges.read(e);this._parseAndTokenizeViewPort(t)})),this._register(Ace({owner:this,changeTracker:(s={tree:this._tree.tree},{createChangeSummary:e=>({changes:[]}),handleChange(e,t){for(const i in s)e.didChange(s[i])&&t.changes.push({key:i,change:e.change});return!0},beforeUpdate(e,t){for(const i in s){if("changes"===i)throw new y('property name "changes" is reserved for change tracking');t[i]=s[i].read(e)}}})},(e,t)=>{const i=t.changes.at(0)?.change;if(t.changes.length>1)throw new y("The tree changed twice in one transaction. This is currently not supported and should not happen.");if(i){if(this.hasTokens())for(const e of i.ranges)this._markForRefresh(e.newRange);this.hasTokens()?this._handleTreeUpdate(i.ranges,i.versionId):this._firstTreeUpdate(i.versionId)}else t.tree&&this._firstTreeUpdate(this._tree.treeLastParsedVersion.read(e))}))}handleContentChanged(e){this._guessVersion=e.versionId;for(const t of e.changes)if(t.text.length>t.rangeLength){const e=t.rangeOffset>0?t.rangeOffset-1:t.rangeOffset,i=this._tokenStore.getTokenAt(e);let n;i?(n={startOffsetInclusive:i.startOffsetInclusive,length:i.length+t.text.length-t.rangeLength,token:i.token},this._tokenStore.markForRefresh(e,t.rangeOffset+(t.text.length>t.rangeLength?t.text.length:t.rangeLength))):n={startOffsetInclusive:e,length:t.text.length,token:0},this._tokenStore.update(i?.length??0,[n],OS.EditGuess)}else if(t.text.length<t.rangeLength){const e=t.rangeLength-t.text.length;this._tokenStore.delete(e,t.rangeOffset)}}getLineTokens(e){const t=this._textModel.getLineContent(e);return new gl(this.getTokens(e),t,this._languageIdCodec)}_createEmptyTokens(){const e=this._emptyToken(),t=this._textModel.getValueLength();return[this._emptyTokensForOffsetAndLength(0,t,e)]}_emptyToken(){return this._treeSitterThemeService.findMetadata([],this._encodedLanguageId,!1,void 0)}_emptyTokensForOffsetAndLength(e,t,i){return{token:i,length:e+t,startOffsetInclusive:0}}hasAccurateTokensForLine(e){return this.hasTokens(new mr(e,1,e,this._textModel.getLineMaxColumn(e)))}tokenizeLinesAt(e,t){const i=this._guessTokensForLinesContent(e,t),n=[];if(!i)return null;for(let o=0;o<i.length;o++)n.push(new gl(i[o],t[o],this._languageIdCodec));return n}_rangeHasTokens(e,t){return this._tokenStore.rangeHasTokens(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()),t)}hasTokens(e){return!e||this._guessVersion===this._accurateVersion||!this._tokenStore.rangeNeedsRefresh(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()))}getTokens(e){const t=this._textModel.getOffsetAt({lineNumber:e,column:1}),i=this._textModel.getOffsetAt({lineNumber:e,column:this._textModel.getLineLength(e)+1}),n=this._tokenStore.getTokensInRange(t,i),o=new Uint32Array(2*n.length);for(let s=0;s<n.length;s++)o[2*s]=n[s].startOffsetInclusive-t+n[s].length,o[2*s+1]=n[s].token;return o}getTokensInRange(e,t,i,n){const o=n?this._tokenizeCapturesWithMetadata(n,t,i):this._tokenize(e,t,i);if(o?.endOffsetsAndMetadata)return this._rangeTokensAsUpdates(t,o.endOffsetsAndMetadata)}_updateTokensInStore(e,t,i){this._accurateVersion=e;for(const n of t){const t=n.newTokens.length>0?n.newTokens[n.newTokens.length-1]:void 0;let o;o=t&&this._guessVersion>=e?t.startOffsetInclusive+t.length-n.newTokens[0].startOffsetInclusive:n.oldRangeLength?n.oldRangeLength:0,this._tokenStore.update(o,n.newTokens,i)}}_markForRefresh(e){this._tokenStore.markForRefresh(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()))}_getNeedsRefresh(){const e=this._tokenStore.getNeedsRefresh();return e?e.map(e=>({range:mr.fromPositions(this._textModel.getPositionAt(e.startOffset),this._textModel.getPositionAt(e.endOffset)),startOffset:e.startOffset,endOffset:e.endOffset})):[]}_parseAndTokenizeViewPort(e){const t=e.map(e=>e.toInclusiveRange()).filter(ule);for(const i of t){const e=this._textModel.getOffsetAt(i.getStartPosition()),t=this._textModel.getOffsetAt(i.getEndPosition()),n=this._textModel.getVersionId();if(this._rangeHasTokens(i,OS.ViewportGuess))continue;const o=this._textModel.getValueInRange(i),s=this._forceParseAndTokenizeContent(i,e,t,o,!0);if(!s||this._rangeHasTokens(i,OS.ViewportGuess))continue;if(0===s.length)continue;const r=s[s.length-1],a=r.startOffsetInclusive+r.length-s[0].startOffsetInclusive;this._updateTokensInStore(n,[{newTokens:s,oldRangeLength:a}],OS.ViewportGuess),this._onDidChangeTokens.fire({changes:{semanticTokensApplied:!1,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]}})}}_guessTokensForLinesContent(e,t){if(0===t.length)return;const i=t.join(this._textModel.getEOL()),n=new mr(1,1,e+t.length,t[t.length-1].length+1),o=this._textModel.getOffsetAt({lineNumber:e,column:1}),s=this._forceParseAndTokenizeContent(n,o,o+i.length,i,!1);if(!s)return;const r=new Array(t.length);let a=0,l=0,d=0;for(let c=0;c<t.length;c++){const e=[];let i=!1;for(let n=a;!i&&n<s.length;n++){const o=s[n],r=o.endOffset-d,h=l-d;if(r<=t[c].length)e.push({endOffset:r,metadata:o.metadata}),a++;else if(h<t[c].length){const n={endOffset:t[c].length,metadata:o.metadata};e.push(n),i=!0}else i=!0;l=o.endOffset}r[c]=this._endOffsetTokensToUint32Array(e),d+=t[c].length+this._textModel.getEOL().length}return r}_forceParseAndTokenizeContent(e,t,i,n,o){const s=u_e(this._textModel,e.startLineNumber).likelyRelevantLines,r=s.join(this._textModel.getEOL()),a=this._tree.createParsedTreeSync(`${r}${n}`);if(!a)return;const l=new mr(1,1,e.endLineNumber-e.startLineNumber+1+s.length,e.endColumn),d=this.captureAtRange(l),c=this._tokenizeCapturesWithMetadata(d,r.length,i-t+r.length);return a.delete(),c?o?this._rangeTokensAsUpdates(t,c.endOffsetsAndMetadata,r.length):c.endOffsetsAndMetadata:void 0}_firstTreeUpdate(e){return this._setViewPortTokens(e)}_setViewPortTokens(e){const t=this._visibleLineRanges.get().map(e=>{const t=e.toInclusiveRange();if(!t)return;const i=this._textModel.getOffsetAt(t.getStartPosition());return{newRange:t,newRangeEndOffset:this._textModel.getOffsetAt(t.getEndPosition()),newRangeStartOffset:i}}).filter(ule);return this._handleTreeUpdate(t,e)}_handleTreeUpdate(e,t){const i=[],n=1e3;for(let s=0;s<e.length;s++)if(e[s].newRange.endLineNumber-e[s].newRange.startLineNumber>n){const t=e[s].newRange.endLineNumber;let o=e[s].newRange.startLineNumber,r=e[s].newRange.startColumn,a=o+n;do{const l=new to(o,r),d=a===e[s].newRange.endLineNumber?e[s].newRange.endColumn:this._textModel.getLineMaxColumn(a),c=new to(a,d),h=mr.fromPositions(l,c);i.push({range:h,startOffset:this._textModel.getOffsetAt(h.getStartPosition()),endOffset:this._textModel.getOffsetAt(h.getEndPosition())}),o=a+1,r=1,a<t&&a+n>t?a=t:a+=n}while(a<=t)}else if(0===s||i[s-1].endOffset<e[s].newRangeStartOffset)i.push({range:e[s].newRange,startOffset:e[s].newRangeStartOffset,endOffset:e[s].newRangeEndOffset});else if(i[s-1].endOffset<e[s].newRangeEndOffset){const t=this._textModel.getPositionAt(i[s-1].endOffset+1),n=new mr(t.lineNumber,t.column,e[s].newRange.endLineNumber,e[s].newRange.endColumn);i.push({range:n,startOffset:i[s-1].endOffset+1,endOffset:e[s].newRangeEndOffset})}const o=i.map(e=>this._getCaptures(e.range));return this._updateTreeForRanges(i,t,o).then(()=>{this._textModel.isDisposed()||this._tree.treeLastParsedVersion.get()!==this._textModel.getVersionId()||this._refreshNeedsRefresh(t)})}async _updateTreeForRanges(e,t,i){let n;for(let o=0;o<e.length&&(this._textModel.isDisposed()||t===this._textModel.getVersionId());o++){const s=i[o],r=e[o],a=this.getTokensInRange(r.range,r.startOffset,r.endOffset,s);n=a?{newTokens:a}:{newTokens:[]},this._updateTokensInStore(t,[n],OS.Accurate),this._onDidChangeTokens.fire({changes:{semanticTokensApplied:!1,ranges:[{fromLineNumber:r.range.getStartPosition().lineNumber,toLineNumber:r.range.getEndPosition().lineNumber}]}}),await new Promise(e=>Z(e))}this._onDidCompleteBackgroundTokenization.fire()}_refreshNeedsRefresh(e){const t=this._getNeedsRefresh();if(0===t.length)return;const i=new Array(t.length);for(let n=0;n<t.length;n++){const e=t[n];i[n]={newRange:e.range,newRangeStartOffset:e.startOffset,newRangeEndOffset:e.endOffset}}this._handleTreeUpdate(i,e)}_rangeTokensAsUpdates(e,t,i){const n=[];let o=0;for(const s of t){if(s.endOffset<=o||i&&s.endOffset<i)continue;let t;t=i&&o<i?{startOffsetInclusive:e+i,length:s.endOffset-i,token:s.metadata}:{startOffsetInclusive:e+o,length:s.endOffset-o,token:s.metadata},n.push(t),o=s.endOffset}return n}_updateTheme(){const e=this._textModel.getFullModelRange();this._markForRefresh(e),this._parseAndTokenizeViewPort(this._visibleLineRanges.get())}captureAtRange(e){const t=this._tree.tree.get();return t?this._highlightingQueries.captures(t.rootNode,{startPosition:{row:e.startLineNumber-1,column:e.startColumn-1},endPosition:{row:e.endLineNumber-1,column:e.endColumn-1}}).map(e=>({name:e.name,text:e.node.text,node:{startIndex:e.node.startIndex,endIndex:e.node.endIndex,startPosition:{lineNumber:e.node.startPosition.row+1,column:e.node.startPosition.column+1},endPosition:{lineNumber:e.node.endPosition.row+1,column:e.node.endPosition.column+1}},encodedLanguageId:this._encodedLanguageId})):[]}captureAtRangeWithInjections(e){const t=this.captureAtRange(e);for(let i=0;i<t.length;i++){const n=t[i],o=n.node.startPosition.lineNumber,s=n.node.endPosition.lineNumber,r=n.node.startPosition.column,a=n.node.endPosition.column,l=o>e.startLineNumber&&o<e.endLineNumber?o:e.startLineNumber,d=s>e.startLineNumber&&s<e.endLineNumber?s:e.endLineNumber,c=new mr(l,o===e.startLineNumber?r<e.startColumn?e.startColumn:r:o<e.startLineNumber?e.startColumn:r,d,s===e.endLineNumber?a>e.endColumn?e.endColumn:a:s>e.endLineNumber?e.endColumn:a),h=this._getInjectionCaptures(n,c);h&&h.length>0&&(t.splice(i+1,0,...h),i+=h.length)}return t}tokenizeEncoded(e){const t=this._tokenizeEncoded(e);if(!t)return;const i=this._rangeTokensAsUpdates(this._textModel.getOffsetAt({lineNumber:e,column:1}),t.result);t.versionId===this._textModel.getVersionId()&&this._updateTokensInStore(t.versionId,[{newTokens:i,oldRangeLength:this._textModel.getLineLength(e)}],OS.Accurate)}_getCaptures(e){return this.captureAtRangeWithInjections(e)}_tokenize(e,t,i){const n=this._getCaptures(e),o=this._tokenizeCapturesWithMetadata(n,t,i);if(o)return{...o,versionId:this._tree.treeLastParsedVersion.get()}}_createTokensFromCaptures(e,t,i){const n=this._tree.tree.get(),o=Fe.create(),s=i-t,r=this._languageIdCodec.encodeLanguageId(this._tree.languageId),a=VS[this._tree.languageId]||"source";if(0===e.length)return n?(o.stop(),{endOffsets:[{endOffset:s,scopes:[],encodedLanguageId:r}],captureTime:o.elapsed()}):void 0;const l=Array(e.length);l.fill({endOffset:0,scopes:[a],encodedLanguageId:r});let d=0;const c=()=>{l.push({endOffset:0,scopes:[a],encodedLanguageId:r})},h=(e,t)=>e.name.includes("punctuation")&&e.text?Array.from(e.text.matchAll(HS)).map(e=>t+e.index):void 0,u=(e,t,i,n)=>{if(void 0!==n){const o=l[n].scopes;let s=l[n].bracket;if((n>0?l[n-1].endOffset:0)!==t){let r;if(s&&s.length>0){r=[];const e=[];for(let n=0;n<s.length;n++){const o=s[n];o<t?r.push(o):o>i&&e.push(o)}0===r.length&&(r=void 0),s=0===e.length?void 0:e}l.splice(n,0,{endOffset:t,scopes:[...o],bracket:r,encodedLanguageId:e.encodedLanguageId}),n++,c(),d++}l.splice(n,0,{endOffset:i,scopes:[...o,e.name],bracket:h(e,t),encodedLanguageId:e.encodedLanguageId}),l[d].bracket=s}else l[d]={endOffset:i,scopes:[a,e.name],bracket:h(e,t),encodedLanguageId:e.encodedLanguageId};d++};for(let g=0;g<e.length;g++){const n=e[g],o=n.node.endIndex<i?n.node.endIndex<t?t:n.node.endIndex:i,s=n.node.startIndex<t?t:n.node.startIndex,r=o-t;let p;const m=o-s;p=g>0?l[d-1].endOffset:s-t-1;const f=r-m;if(p>=0&&p<f&&(l[d]={endOffset:f,scopes:[a],encodedLanguageId:this._encodedLanguageId},d++,c()),!(m<0))if(p>=r){let e=d-1,t=l[e].endOffset,i=e>=2?l[e-1].endOffset:0;do{if(i+m===t){if(i===f){l[e].scopes.push(n.name);const t=l[e].bracket;l[e].bracket=t&&t.length>0?t:h(n,f)}}else if(i<=f){u(n,f,r,e);break}e--,i=e>=1?l[e-1].endOffset:0,t=e>=0?l[e].endOffset:0}while(t>f)}else u(n,f,r)}l[d-1].endOffset<s&&s-l[d-1].endOffset>0&&(c(),l[d]={endOffset:s,scopes:l[d].scopes,encodedLanguageId:this._encodedLanguageId},d++);for(let g=0;g<l.length;g++)if(0===l[g].endOffset&&0!==g){l.splice(g,l.length-g);break}return{endOffsets:l,captureTime:o.elapsed()}}_getInjectionCaptures(e,t){return[]}_tokenizeCapturesWithMetadata(e,t,i){const n=Fe.create(),o=this._createTokensFromCaptures(e,t,i);if(!o)return;const s=o.endOffsets;for(let a=0;a<s.length;a++){const e=s[a];e.metadata=this._treeSitterThemeService.findMetadata(e.scopes,e.encodedLanguageId,!!e.bracket&&e.bracket.length>0,void 0)}const r=n.elapsed();return{endOffsetsAndMetadata:s,captureTime:o.captureTime,metadataTime:r}}_tokenizeEncoded(e){const t=this._textModel.getOffsetAt({lineNumber:e,column:1}),i=e+1<=this._textModel.getLineCount()?this._textModel.getOffsetAt({lineNumber:e+1,column:1}):this._textModel.getValueLength(),n=i-t,o=this._tokenize(new mr(e,1,e,n+1),t,i);if(o)return{result:o.endOffsetsAndMetadata,captureTime:o.captureTime,metadataTime:o.metadataTime,versionId:o.versionId}}_endOffsetTokensToUint32Array(e){const t=new Uint32Array(2*e.length);for(let i=0;i<e.length;i++)t[2*i]=e[i].endOffset,t[2*i+1]=e[i].metadata;return t}},BS=FS([WS(4,PS)],BS),VS={css:"source.css",typescript:"source.ts",ini:"source.ini",regex:"source.regex"},HS=/[\{\}\[\]\<\>\(\)]/g,zS=eue("treeSitterLibraryService"),US=class{constructor(e){this._value=Qce(this,void 0),this.promiseResult=this._value,this.promise=e.then(e=>(Wce(t=>{this._value.set(new KS(e,void 0),t)}),e),e=>{throw Wce(t=>{this._value.set(new KS(void 0,e),t)}),e})}},KS=class{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}},qS=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jS=function(e,t){return function(i,n){t(i,n,e)}},$S=class extends vS{constructor(e,t,i,n,o,s){super(t,i),this._languageIdObs=e,this._treeSitterLibraryService=o,this._instantiationService=s,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new je),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event;const r=new US(this._treeSitterLibraryService.getParserClass()),a=Dce(this,e=>r.promiseResult?.read(e)?.getDataOrThrow());this._tree=Dce(this,e=>{const t=a.read(e);if(!t)return;const i=this._languageIdObs.read(e),n=this._treeSitterLibraryService.getLanguage(i,!1,e);if(!n)return;const o=new t;return e.store.add(Dle(()=>{o.delete()})),o.setLanguage(n),void 0!==this._treeSitterLibraryService.getInjectionQueries(i,e)?e.store.add(this._instantiationService.createInstance(yS,i,void 0,o,t,this._textModel)):void 0}),this._tokenizationImpl=Dce(this,e=>{const t=this._tree.read(e);if(!t)return;const i=this._treeSitterLibraryService.getHighlightingQueries(t.languageId,e);return i?e.store.add(this._instantiationService.createInstance(BS,t,i,this._languageIdCodec,n)):void 0}),this._register(Rce(e=>{const t=this._tokenizationImpl.read(e);t&&(e.store.add(t.onDidChangeTokens(e=>{this._onDidChangeTokens.fire(e.changes)})),e.store.add(t.onDidChangeBackgroundTokenization(e=>{this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire()})))}))}getLineTokens(e){const t=this._tokenizationImpl.get();if(!t){const t=this._textModel.getLineContent(e);return gl.createEmpty(t,this._languageIdCodec)}return t.getLineTokens(e)}todo_resetTokenization(e=!0){e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}handleDidChangeAttached(){}handleDidChangeContent(e){e.isFlush?this.todo_resetTokenization(!1):this._tokenizationImpl.get()?.handleContentChanged(e),this._tree.get()?.handleContentChange(e)}forceTokenization(e){const t=this._tokenizationImpl.get();t&&(t.hasAccurateTokensForLine(e)||t.tokenizeEncoded(e))}hasAccurateTokensForLine(e){const t=this._tokenizationImpl.get();return!!t&&t.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return!0}getTokenTypeIfInsertingCharacter(e,t,i){return 0}tokenizeLinesAt(e,t){const i=this._tokenizationImpl.get();return i?i.tokenizeLinesAt(e,t):null}get hasTokens(){const e=this._tokenizationImpl.get();return!!e&&e.hasTokens()}},$S=qS([jS(4,zS),jS(5,Jn)],$S),GS=class e{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t,i=void 0){if(this._pieces=e||[],this._isComplete=t,i)for(const n of this._pieces)n.reportIfInvalid(i)}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),o=t[t.length-1].getRange();if(!n||!o)return e;i=e.plusRange(n).plusRange(o)}let n=null;for(let o=0,s=this._pieces.length;o<s;o++){const e=this._pieces[o];if(e.endLineNumber<i.startLineNumber)continue;if(e.startLineNumber>i.endLineNumber){n=n||{index:o};break}if(e.removeTokens(i),e.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(e.endLineNumber<i.startLineNumber)continue;if(e.startLineNumber>i.endLineNumber){n=n||{index:o};continue}const[t,r]=e.split(i);t.isEmpty()?n=n||{index:o}:r.isEmpty()||(this._pieces.splice(o,1,t,r),o++,s++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=lce(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(t,i){if(0===i.getTextLength())return i;const n=this._pieces;if(0===n.length)return i;const o=n[e._findFirstPieceWithLine(n,t)].getLineTokens(t);if(!o)return i;const s=i.getCount(),r=o.getCount();let a=0;const l=[];let d=0,c=0;const h=(e,t)=>{e!==c&&(c=e,l[d++]=e,l[d++]=t)};for(let e=0;e<r;e++){const t=Math.min(o.getStartCharacter(e),i.getTextLength()),n=Math.min(o.getEndCharacter(e),i.getTextLength()),r=o.getMetadata(e),l=((1&r?2048:0)|(2&r?4096:0)|(4&r?8192:0)|(8&r?16384:0)|(16&r?16744448:0)|(32&r?4278190080:0))>>>0,d=~l>>>0;for(;a<s&&i.getEndOffset(a)<=t;)h(i.getEndOffset(a),i.getMetadata(a)),a++;for(a<s&&i.getStartOffset(a)<t&&h(t,i.getMetadata(a));a<s&&i.getEndOffset(a)<n;)h(i.getEndOffset(a),i.getMetadata(a)&d|r&l),a++;if(a<s)h(n,i.getMetadata(a)&d|r&l),i.getEndOffset(a)===n&&a++;else{const e=Math.min(Math.max(0,a-1),s-1);h(n,i.getMetadata(e)&d|r&l)}}for(;a<s;)h(i.getEndOffset(a),i.getMetadata(a)),a++;return new gl(new Uint32Array(l),i.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,n=e.length-1;for(;i<n;){let o=i+Math.floor((n-i)/2);if(e[o].endLineNumber<t)i=o+1;else{if(!(e[o].startLineNumber>t)){for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}n=o-1}}return i}acceptEdit(e,t,i,n,o){for(let s=0;s<this._pieces.length;s++){const r=this._pieces[s];r.acceptEdit(e,t,i,n,o),r.isEmpty()&&(this._pieces.splice(s,1),s--)}}},ZS=new Uint32Array(0).buffer,YS=class e{static deleteBeginning(t,i){return null===t||t===ZS?t:e.delete(t,0,i)}static deleteEnding(t,i){if(null===t||t===ZS)return t;const n=b_e(t),o=n[n.length-2];return e.delete(t,i,o)}static delete(e,t,i){if(null===e||e===ZS||t===i)return e;const n=b_e(e),o=n.length>>>1;if(0===t&&n[n.length-2]===i)return ZS;const s=gl.findIndexInTokensArray(n,t),r=s>0?n[s-1<<1]:0;if(i<n[s<<1]){const r=i-t;for(let e=s;e<o;e++)n[e<<1]-=r;return e}let a,l;r!==t?(n[s<<1]=t,a=s+1<<1,l=t):(a=s<<1,l=r);const d=i-t;for(let h=s+1;h<o;h++){const e=n[h<<1]-d;e>l&&(n[a++]=e,n[a++]=n[1+(h<<1)],l=e)}if(a===n.length)return e;const c=new Uint32Array(a);return c.set(n.subarray(0,a),0),c.buffer}static append(e,t){if(t===ZS)return e;if(e===ZS)return t;if(null===e)return e;if(null===t)return null;const i=b_e(e),n=b_e(t),o=n.length>>>1,s=new Uint32Array(i.length+n.length);s.set(i,0);let r=i.length;const a=i[i.length-2];for(let l=0;l<o;l++)s[r++]=n[l<<1]+a,s[r++]=n[1+(l<<1)];return s.buffer}static insert(e,t,i){if(null===e||e===ZS)return e;const n=b_e(e),o=n.length>>>1;let s=gl.findIndexInTokensArray(n,t);s>0&&n[s-1<<1]===t&&s--;for(let r=s;r<o;r++)n[r<<1]+=i;return e}},QS=class e{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),null!==n&&n!==ZS)return new gl(b_e(n),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=v_e(this._languageIdCodec.encodeLanguageId(e)),new gl(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const n=i?b_e(i):null;if(0===t){let t=!1;if(n&&n.length>1&&(t=cl.getLanguageId(n[1])!==e),!t)return ZS}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=v_e(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[];for(let n=0;n<t;n++)i[n]=null;this._lineTokens=lce(this._lineTokens,e,i),this._len+=t}setTokens(t,i,n,o,s){const r=e._massageTokens(this._languageIdCodec.encodeLanguageId(t),n,o);this._ensureLine(i);const a=this._lineTokens[i];return this._lineTokens[i]=r,!!s&&!e._equals(a,r)}static _equals(e,t){if(!e||!t)return!e&&!t;const i=b_e(e),n=b_e(t);if(i.length!==n.length)return!1;for(let o=0,s=i.length;o<s;o++)if(i[o]!==n[o])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new to(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=YS.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=YS.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i<this._len&&(n=YS.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=YS.append(this._lineTokens[t],n),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(0===t&&0===i)return;const n=e.lineNumber-1;n>=this._len||(0!==t?(this._lineTokens[n]=YS.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=YS.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=YS.insert(this._lineTokens[n],e.column-1,i))}setMultilineTokens(e,t){if(0===e.length)return{changes:[]};const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];let s=0,r=0,a=!1;for(let e=o.startLineNumber;e<=o.endLineNumber;e++)a?(this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),o.getLineTokens(e),!1),r=e):this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),o.getLineTokens(e),!0)&&(a=!0,s=e,r=e);a&&i.push({fromLineNumber:s,toLineNumber:r})}return{changes:i}}},XS=class extends vS{constructor(e,t,i,n){super(e,t),this.getLanguageId=i,this._tokenizer=null,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new je),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new Ne),this._tokens=new QS(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new Ne),this._attachedViewStates=this._register(new Te),this._register(Mb.onDidChange(e=>{const t=this.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&this.todo_resetTokenization()})),this.todo_resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:e,state:t})=>{if(t){let i=this._attachedViewStates.get(e);i||(i=new bS(()=>this.refreshRanges(i.lineRanges)),this._attachedViewStates.set(e,i)),i.handleStateChange(t)}else this._attachedViewStates.deleteAndDispose(e)}))}todo_resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new NS(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const[t,i]=(()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const e=Mb.get(this.getLanguageId());if(!e)return[null,null];let t;try{t=e.getInitialState()}catch(Fae){return $ae(Fae),[null,null]}return[e,t]})();if(this._tokenizer=t&&i?new IS(this._textModel.getLineCount(),t,this._textModel,this._languageIdCodec):null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const e={setTokens:e=>{this.setTokens(e)},backgroundTokenizationFinished:()=>{2!==this._backgroundTokenizationState&&(this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire())},setEndState:(e,t)=>{if(!this._tokenizer)return;const i=this._tokenizer.store.getFirstInvalidEndStateLineNumber();null!==i&&e>=i&&this._tokenizer?.store.setEndState(e,t)}};t&&t.createBackgroundTokenizer&&!t.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=t.createBackgroundTokenizer(this._textModel,e)),this._backgroundTokenizer.value||this._textModel.isTooLargeForTokenization()||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new TS(this._tokenizer,e),this._defaultBackgroundTokenizer.handleChanges()),t?.backgroundTokenizerShouldOnlyVerifyTokens&&t.createBackgroundTokenizer?(this._debugBackgroundTokens=new QS(this._languageIdCodec),this._debugBackgroundStates=new NS(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=t.createBackgroundTokenizer(this._textModel,{setTokens:e=>{this._debugBackgroundTokens?.setMultilineTokens(e,this._textModel)},backgroundTokenizationFinished(){},setEndState:(e,t)=>{this._debugBackgroundStates?.setEndState(e,t)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){this._defaultBackgroundTokenizer?.handleChanges()}handleDidChangeContent(e){if(e.isFlush)this.todo_resetTokenization(!1);else if(!e.isEolChange){for(const t of e.changes){const[e,i]=Rme(t.text);this._tokens.acceptEdit(t.range,e,i),this._debugBackgroundTokens?.acceptEdit(t.range,e,i)}this._debugBackgroundStates?.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),this._defaultBackgroundTokenizer?.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=Qw.joinMany([...this._attachedViewStates].map(([e,t])=>t.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const i=new LS,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),o=this.setTokens(i.finalize());if(n)for(const s of o.changes)this._backgroundTokenizer.value?.requestTokens(s.fromLineNumber,s.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){const t=new LS;this._tokenizer?.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),this._defaultBackgroundTokenizer?.checkFinished()}hasAccurateTokensForLine(e){return!this._tokenizer||this._tokenizer.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return!this._tokenizer||this._tokenizer.isCheapToTokenize(e)}getLineTokens(e){const t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const n=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(n)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new to(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLinesAt(e,t){return this._tokenizer?(this.forceTokenization(e),this._tokenizer.tokenizeLinesAt(e,t)):null}get hasTokens(){return this._tokens.hasTokens}},JS=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ex=function(e,t){return function(i,n){t(i,n,e)}},ix=tx=class extends V_{constructor(e,t,i,n,o,s,r,a){super(),this._textModel=e,this._bracketPairsTextModelPart=t,this._languageId=i,this._attachedViews=n,this._languageService=o,this._languageConfigurationService=s,this._instantiationService=r,this._treeSitterLibraryService=a,this._languageIdObs=Qce(this,this._languageId),this._useTreeSitter=Dce(this,e=>{const t=this._languageIdObs.read(e);return this._treeSitterLibraryService.supportsLanguage(t,e)}),this.tokens=Dce(this,e=>{let t;return t=this._useTreeSitter.read(e)?e.store.add(this._instantiationService.createInstance($S,this._languageIdObs,this._languageService.languageIdCodec,this._textModel,this._attachedViews.visibleLineRanges)):e.store.add(new XS(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),e.store.add(t.onDidChangeTokens(e=>{this._emitModelTokensChangedEvent(e)})),e.store.add(t.onDidChangeBackgroundTokenizationState(e=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})),t});let l=!1;this.tokens.recomputeInitiallyAndOnChange(this._store,e=>{l&&e.todo_resetTokenization(),l=!0}),this._semanticTokens=new GS(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new je),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new je),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new je),this.onDidChangeTokens=this._onDidChangeTokens.event}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[e,i,n]=Rme(t.text);this._semanticTokens.acceptEdit(t.range,e,i,n,t.text.length>0?t.text.charCodeAt(0):0)}this.tokens.get().handleDidChangeContent(e)}handleDidChangeAttached(){this.tokens.get().handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.tokens.get().getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new y("Illegal value for lineNumber")}get hasTokens(){return this.tokens.get().hasTokens}resetTokenization(){this.tokens.get().todo_resetTokenization()}get backgroundTokenizationState(){return this.tokens.get().backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.tokens.get().forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.tokens.get().hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.tokens.get().isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.tokens.get().tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.tokens.get().getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLinesAt(e,t){return this.tokens.get().tokenizeLinesAt(e,t)}setSemanticTokens(e,t){this._semanticTokens.set(e,t,this._textModel),this._emitModelTokensChangedEvent({semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),o=n.findTokenIndexAtOffset(t.column-1),[s,r]=tx._findLanguageBoundaries(n,o),a=$ue(t.column,this.getLanguageConfiguration(n.getLanguageId(o)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(o>0&&s===t.column-1){const[s,r]=tx._findLanguageBoundaries(n,o-1),a=$ue(t.column,this.getLanguageConfiguration(n.getLanguageId(o-1)).getWordDefinition(),i.substring(s,r),s);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let s=t;s>=0&&e.getLanguageId(s)===i;s--)n=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,r=e.getCount();s<r&&e.getLanguageId(s)===i;s++)o=e.getEndOffset(s);return[n,o]}getWordUntilPosition(e){const t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){const i=this._textModel.validatePosition(new to(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}setLanguageId(e,t="api"){if(this._languageId===e)return;const i={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this._languageIdObs.set(e,void 0),this._bracketPairsTextModelPart.handleDidChangeLanguage(i),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}},ix=tx=JS([ex(4,La),ex(5,il),ex(6,Jn),ex(7,zS)],ix),sx=eue("undoRedoService"),rx=class{constructor(e,t){this.resource=e,this.elements=t}},(nx=ax=class e{constructor(){this.id=e._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}})._ID=0,nx.None=new nx,(ox=lx=class e{constructor(){this.id=e._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}})._ID=0,ox.None=new ox,dx=Symbol.iterator,hx=class{constructor(e,t){this.toKey=t,this._map=new Map,this[cx]="SetWithKey";for(const i of e)this.add(i)}get size(){return this._map.size}add(e){const t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(const e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(const e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[dx](){return this.values()}},cx=Symbol.toStringTag,gx=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},px=function(e,t){return function(i,n){t(i,n,e)}},fx=0,_x=class{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;for(;;){const n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}},bx=()=>{throw new Error("Invalid change accessor")},ux=class extends Ie{static resolveOptions(e,t){if(t.detectIndentation){const i=mfe(e,t.tabSize,t.insertSpaces);return new Jr({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new Jr(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}get onDidChangeOptions(){return this._onDidChangeOptions.event}get onDidChangeAttached(){return this._onDidChangeAttached.event}get onDidChangeLineHeight(){return this._onDidChangeLineHeight.event}get onDidChangeFont(){return this._onDidChangeFont.event}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return Lle(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,n=null,o,s,r,a){super(),this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=r,this.instantiationService=a,this._onWillDispose=this._register(new je),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Ex((e,t,i)=>this.handleBeforeFireDecorationsChangedEvent(e,t,i))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new je),this._onDidChangeAttached=this._register(new je),this._onDidChangeInjectedText=this._register(new je),this._onDidChangeLineHeight=this._register(new je),this._onDidChangeFont=this._register(new je),this._eventEmitter=this._register(new Mx),this._languageSelectionListener=this._register(new Ne),this._deltaDecorationCallCnt=0,this._attachedViews=new mS,fx++,this.id="$model"+fx,this.isForSimpleWidget=i.isForSimpleWidget,this._associatedResource=null==n?_i.parse("inmemory://model/"+fx):n,this._attachedEditorCount=0;const{textBuffer:l,disposable:d}=C_e(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=d;const c=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new mr(1,1,c,this._buffer.getLineLength(c)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>mx.LARGE_FILE_SIZE_THRESHOLD||c>mx.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>mx.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._options=mx.resolveOptions(this._buffer,i);const u="string"==typeof t?t:t.languageId;"string"!=typeof t&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Ty(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new K_(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Oy(this)),this._tokenizationTextModelPart=this.instantiationService.createInstance(ix,this,this._bracketPairs,u,this._attachedViews),this._isTooLargeForSyncing=h>mx._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=vde(fx),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new wx,this._commandManager=new jy(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(u),this._register(this._languageConfigurationService.onDidChange(e=>{this._bracketPairs.handleLanguageConfigurationServiceChange(e),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(e)}))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new cS([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Ie.None}_assertNotDisposed(){if(this._isDisposed)throw new y("Model is disposed!")}getTextBuffer(){return this._assertNotDisposed(),this._buffer}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new KC(e,t)))}setValue(e,t=Vy.setValue()){if(this._assertNotDisposed(),null==e)throw Qae();const{textBuffer:i,disposable:n}=C_e(e,this._options.defaultEOL);this._setValueFromTextBuffer(i,n,t)}_createContentChanged2(e,t,i,n,o,s,r,a,l,d){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:o}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:s,isRedoing:r,isFlush:a,detailedReasons:[d],detailedReasonsChangeLengths:[1]}}_setValueFromTextBuffer(e,t,i){this._assertNotDisposed();const n=this.getFullModelRange(),o=this.getValueLengthInRange(n),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new wx,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new VC([new TC],this._versionId,!1,!1),this._createContentChanged2(new mr(1,1,s,r),0,o,new to(s,r),this.getValue(),!1,!1,!0,!1,i))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new VC([new BC],this._versionId,!1,!1),this._createContentChanged2(new mr(1,1,o,s),0,n,new to(o,s),this.getValue(),!1,!1,!1,!0,Vy.eolChange()))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const n=t[i],o=n.range,s=n.cachedAbsoluteStart-n.start,r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);n.cachedAbsoluteStart=r,n.cachedAbsoluteEnd=a,n.cachedVersionId=e,n.start=r-s,n.end=a-s,Pfe(n)}}onBeforeAttached(){return this._attachedEditorCount++,1===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,0===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.originalIndentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new Jr({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(r))return;const a=this._options.createChangeEvent(r);this._options=r,this._bracketPairs.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const i=mfe(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),Tue(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(Pt.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(e=>({range:e.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new y("Operation would exceed heap memory limits");const i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new _x(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new y("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new y("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new y("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new y("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new y("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new y("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor("number"!=typeof i||isNaN(i)?1:i),s=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const e=this.getLineMaxColumn(o);s>=e&&(s=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),d=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,d=1;else if(l>t)l=t,d=this.getLineMaxColumn(l);else if(d<=1)d=1;else{const e=this.getLineMaxColumn(l);d>=e&&(d=e)}return i===o&&n===s&&r===l&&a===d&&e instanceof mr&&!(e instanceof fr)?e:new mr(o,s,l,d)}_isValidPosition(e,t,i){return!("number"!=typeof e||"number"!=typeof t||isNaN(e)||isNaN(t)||e<1||t<1||(0|e)!==e||(0|t)!==t||e>this._buffer.getLineCount()||1!==t&&(t>this.getLineMaxColumn(e)||1===i&&ade(this._buffer.getLineCharCode(e,t-2))))}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),o=Math.floor("number"!=typeof t||isNaN(t)?1:t),s=this._buffer.getLineCount();if(n<1)return new to(1,1);if(n>s)return new to(s,this.getLineMaxColumn(s));if(o<=1)return new to(n,1);const r=this.getLineMaxColumn(n);return o>=r?new to(n,r):1===i&&ade(this._buffer.getLineCharCode(n,o-2))?new to(n,o-1):new to(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof to&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}isValidRange(e){return this._isValidRange(e,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(o,s,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,r=ade(e),a=ade(t);return!r&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof mr&&!(e instanceof fr)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,o=t.column,s=i.lineNumber,r=i.column;{const e=o>1?this._buffer.getLineCharCode(n,o-2):0,t=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,i=ade(e),a=ade(t);return i||a?n===s&&o===r?new mr(n,o-1,s,r-1):i&&a?new mr(n,o-1,s,r+1):i?new mr(n,o-1,s,r):new mr(n,o,s,r+1):new mr(n,o,s,r)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new mr(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,s,r=999){this._assertNotDisposed();let a=null;null!==t&&"boolean"!=typeof t&&(Array.isArray(t)||(t=[t]),t.every(e=>mr.isIRange(e))&&(a=t.map(e=>this.validateRange(e)))),null===a&&(a=[this.getFullModelRange()]),a=a.sort((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn);const l=[];let d;if(l.push(a.reduce((e,t)=>mr.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t))),!i&&e.indexOf("\n")<0){const t=new Jy(e,i,n,o).parseSearchRequest();if(!t)return[];d=e=>this.findMatchesLineByLine(e,t,s,r)}else d=t=>tS.findMatches(this,new Jy(e,i,n,o),t,s,r);return l.map(d).reduce((e,t)=>e.concat(t),[])}findNextMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new Jy(e,i,n,o).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new mr(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),d=this.findMatchesLineByLine(l,t,s,1);return tS.findNextMatch(this,new Jy(e,i,n,o),r,s),d.length>0?d[0]:(l=new mr(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),d=this.findMatchesLineByLine(l,t,s,1),d.length>0?d[0]:null)}return tS.findNextMatch(this,new Jy(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return tS.findPreviousMatch(this,new Jy(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof ta?e:new ta(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n,o){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n,o)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n,o){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const i=t.map(e=>({range:this.validateRange(e.range),text:e.text}));let n=!0;if(e)for(let t=0,o=e.length;t<o;t++){const o=e[t];let s=!1;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,n=t.startLineNumber>o.endLineNumber,r=o.startLineNumber>t.endLineNumber;if(!n&&!r){s=!0;break}}if(!s){n=!1;break}}if(n)for(let e=0,o=this._trimAutoWhitespaceLines.length;e<o;e++){const n=this._trimAutoWhitespaceLines[e],o=this.getLineMaxColumn(n);let s=!0;for(let e=0,t=i.length;e<t;e++){const t=i[e].range,r=i[e].text;if(!(n<t.startLineNumber||n>t.endLineNumber||n===t.startLineNumber&&t.startColumn===o&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){s=!1;break}}if(s){const e=new mr(n,1,n,o);t.push(new ta(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n,o)}_applyUndo(e,t,i,n){const o=e.map(e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new mr(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new mr(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t,i){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const n=this._validateEditOperations(e);return this._doApplyEdits(n,t??!1,i??Vy.applyEdits())}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t,i){const n=this._buffer.getLineCount(),o=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),s=this._buffer.getLineCount(),r=o.changes;if(this._trimAutoWhitespaceLines=o.trimAutoWhitespaceLineNumbers,0!==r.length){for(let i=0,n=r.length;i<n;i++){const e=r[i];this._decorationsTree.acceptReplace(e.rangeOffset,e.rangeLength,e.text.length,e.forceMoveMarkers)}const e=[];this._increaseVersionId();let t=n;for(let i=0,n=r.length;i<n;i++){const n=r[i],[o]=Rme(n.text);this._onDidChangeDecorations.fire();const a=n.range.startLineNumber,l=n.range.endLineNumber,d=l-a,c=o,h=Math.min(d,c),u=c-d,g=s-t-u+a,p=g,m=g+c,f=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new to(p,1)),this.getOffsetAt(new to(m,this.getLineMaxColumn(m))),0),_=RC.fromDecorations(f),b=new Pi(_);for(let t=h;t>=0;t--){const i=a+t,n=g+t;b.takeFromEndWhile(e=>e.lineNumber>n);const o=b.takeFromEndWhile(e=>e.lineNumber===n);e.push(new OC(i,this.getLineContent(n),o))}if(h<d){const t=a+h;e.push(new FC(t+1,l))}if(h<c){const i=new Pi(_),n=a+h,o=c-h,r=s-t-o+n+1,l=[],d=[];for(let e=0;e<o;e++){const t=r+e;d[e]=this.getLineContent(t),i.takeWhile(e=>e.lineNumber<t),l[e]=i.takeWhile(e=>e.lineNumber===t)}e.push(new WC(n+1,a+c,d,l))}t+=u}this._emitContentChangedEvent(new VC(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1,detailedReasons:[i],detailedReasonsChangeLengths:[r.length]})}return null===o.reverseEdits?void 0:o.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e,t,i){if(e&&e.size>0){const t=Array.from(e).map(e=>new OC(e,this.getLineContent(e),this._getInjectedTextInLine(e)));this._onDidChangeInjectedText.fire(new HC(t))}if(t&&t.size>0){const e=Array.from(t).map(e=>new AC(e.ownerId,e.decorationId,e.lineNumber,e.lineHeight));this._onDidChangeLineHeight.fire(new zC(e))}if(i&&i.size>0){const e=Array.from(i).map(e=>new PC(e.ownerId,e.lineNumber));this._onDidChangeFont.fire(new UC(e))}}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(t,i)=>{this._changeDecorationImpl(e,t,i)},changeDecorationOptions:(t,i)=>{this._changeDecorationOptionsImpl(e,t,L_e(i))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)};let n=null;try{n=t(i)}catch(Fae){$ae(Fae)}return i.addDecoration=bx,i.changeDecoration=bx,i.changeDecorationOptions=bx,i.removeDecoration=bx,i.deltaDecorations=bx,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),$ae(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:Dx[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),n.setOptions(Dx[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;i<n;i++){const e=t[i];this._decorationsTree.delete(e),delete this._decorations[e.id]}}getDecorationOptions(e){const t=this._decorations[e];return t?t.options:null}getDecorationRange(e){const t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,i=!1,n=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i,n)}getLinesDecorations(e,t,i=0,n=!1,o=!1,s=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),l=Math.min(r,Math.max(1,t)),d=new mr(a,1,l,this.getLineMaxColumn(l)),c=this._getDecorationsInRange(d,i,n,o,s);return hce(c,this._decorationProvider.getDecorationsInRange(d,i,n)),c}getDecorationsInRange(e,t=0,i=!1,n=!1,o=!1,s=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,n,s);return hce(a,this._decorationProvider.getDecorationsInRange(r,t,i,o)),a}getOverviewRulerDecorations(e=0,t=!1,i=!1){return this._decorationsTree.getAll(this,e,t,i,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}getCustomLineHeightsDecorations(e=0){return this._decorationsTree.getAllCustomLineHeights(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return RC.fromDecorations(n).filter(t=>t.lineNumber===e)}getFontDecorationsInRange(e,t=0){const i=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),n=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getFontDecorationsInInterval(this,i,n,t)}getAllDecorations(e=0,t=!1,i=!1){let n=this._decorationsTree.getAll(this,e,t,i,!1,!1);return n=n.concat(this._decorationProvider.getAllDecorations(e,t)),n}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!1,!0)}_getDecorationsInRange(e,t,i,n,o){const s=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,s,r,t,i,n,o)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t,i){const n=this._decorations[t];if(!n)return;if(n.options.after){const e=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(n.options.before){const e=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}if(null!==n.options.lineHeight){const i=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,i.startLineNumber,null)}if(n.options.affectsFont){const i=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,i.startLineNumber)}const o=this._validateRangeRelaxedNoAllocations(i),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),r=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),s,r,o),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(o.startLineNumber),null!==n.options.lineHeight&&this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,o.startLineNumber,n.options.lineHeight),n.options.affectsFont&&this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,o.startLineNumber)}_changeDecorationOptionsImpl(e,t,i){const n=this._decorations[t];if(!n)return;const o=!(!n.options.overviewRuler||!n.options.overviewRuler.color),s=!(!i.overviewRuler||!i.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(i),n.options.after||i.after){const e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(n.options.before||i.before){const e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}if(null!==n.options.lineHeight||null!==i.lineHeight){const o=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,o.startLineNumber,i.lineHeight)}if(n.options.affectsFont||i.affectsFont){const i=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,t,i.startLineNumber)}const r=o!==s,a=function(e){return!!e.after||!!e.before}(i)!==x_e(n);r||a?(this._decorationsTree.delete(n),n.setOptions(i),this._decorationsTree.insert(n)):n.setOptions(i)}_deltaDecorationsImpl(e,t,i,n=!1){const o=this.getVersionId(),s=t.length;let r=0;const a=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(a);for(;r<s||l<a;){let c=null;if(r<s){let i;do{i=t[r++],c=this._decorations[i]}while(!c&&r<s);if(c){if(c.options.after){const e=this._decorationsTree.getNodeRange(this,c);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(c.options.before){const e=this._decorationsTree.getNodeRange(this,c);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}if(null!==c.options.lineHeight){const t=this._decorationsTree.getNodeRange(this,c);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,i,t.startLineNumber,null)}if(c.options.affectsFont){const t=this._decorationsTree.getNodeRange(this,c);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,i,t.startLineNumber)}this._decorationsTree.delete(c),n||this._onDidChangeDecorations.checkAffectedAndFire(c.options)}}if(l<a){if(!c){const e=++this._lastDecorationId,t=`${this._instanceId};${e}`;c=new Gy(t,0,0),this._decorations[t]=c}const t=i[l],s=this._validateRangeRelaxedNoAllocations(t.range),r=L_e(t.options),a=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),h=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);c.ownerId=e,c.reset(o,a,h,s),c.setOptions(r),c.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),c.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber),null!==c.options.lineHeight&&this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,c.id,s.startLineNumber,c.options.lineHeight),c.options.affectsFont&&this._onDidChangeDecorations.recordLineAffectedByFontChange(e,c.id,s.startLineNumber),n||this._onDidChangeDecorations.checkAffectedAndFire(r),this._decorationsTree.insert(c),d[l]=c.id,l++}else c&&delete this._decorations[c.id]}return d}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setLanguage(e,t){"string"==typeof e?(this._languageSelectionListener.clear(),this._setLanguage(e,t)):(this._languageSelectionListener.value=e.onDidChange(()=>this._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return y_e(this.getLineContent(e))+1}toString(){return`TextModel(${this.uri.toString()})`}},mx=ux,ux._MODEL_SYNC_LIMIT=52428800,ux.LARGE_FILE_SIZE_THRESHOLD=20971520,ux.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5,ux.LARGE_FILE_HEAP_OPERATION_THRESHOLD=268435456,ux.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:wd.tabSize,indentSize:wd.indentSize,insertSpaces:wd.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:wd.trimAutoWhitespace,largeFileOptimizations:wd.largeFileOptimizations,bracketPairColorizationOptions:wd.bracketPairColorizationOptions},vx=ux,vx=mx=gx([px(4,sx),px(5,La),px(6,il),px(7,Jn)],vx),wx=class{constructor(){this._decorationsTree0=new Yy,this._decorationsTree1=new Yy,this._injectedTextDecorationsTree=new Yy}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)null===i.range&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,o,s,r){const a=e.getVersionId(),l=this._intervalSearch(t,i,n,o,s,a,r);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,n,o,s,r){const a=this._decorationsTree0.intervalSearch(e,t,i,n,o,s,r),l=this._decorationsTree1.intervalSearch(e,t,i,n,o,s,r),d=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,o,s,r);return a.concat(l).concat(d)}getInjectedTextInInterval(e,t,i,n){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getFontDecorationsInInterval(e,t,i,n){const o=e.getVersionId(),s=this._decorationsTree0.intervalSearch(t,i,n,!1,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter(e=>e.options.affectsFont)}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getAllCustomLineHeights(e,t){const i=e.getVersionId(),n=this._search(t,!1,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(e=>"number"==typeof e.options.lineHeight)}getAll(e,t,i,n,o,s){const r=e.getVersionId(),a=this._search(t,i,n,o,r,s);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,o,s){if(n)return this._decorationsTree1.search(e,t,i,o,s);{const n=this._decorationsTree0.search(e,t,i,o,s),r=this._decorationsTree1.search(e,t,i,o,s),a=this._injectedTextDecorationsTree.search(e,t,i,o,s);return n.concat(r).concat(a)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(n)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){x_e(e)?this._injectedTextDecorationsTree.insert(e):S_e(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){x_e(e)?this._injectedTextDecorationsTree.delete(e):S_e(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){x_e(e)?this._injectedTextDecorationsTree.resolveNode(e,t):S_e(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}},Cx=class{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}},yx=class extends Cx{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:Zr.Center}getColor(e){return this._resolvedColor||(Epe(e.type)&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if("string"==typeof e)return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}},Sx=class{constructor(e){this.position=e?.position??Yr.Center,this.persistLane=e?.persistLane}},xx=class extends Cx{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(Epe(e.type)&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return"string"==typeof e?eh.fromHex(e):t.getColor(e.id)}},kx=class e{static from(t){return t instanceof e?t:new e(t)}constructor(e){this.content=e.content||"",this.tokens=e.tokens??null,this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}},(Lx=class e{static register(t){return new e(t)}static createDynamic(t){return new e(t)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?k_e(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?k_e(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.lineHeight=e.lineHeight?Math.min(e.lineHeight,300):null,this.fontSize=e.fontSize||null,this.affectsFont=!!(e.fontSize||e.fontFamily||e.fontWeight||e.fontStyle),this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new yx(e.overviewRuler):null,this.minimap=e.minimap?new xx(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Sx(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?k_e(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?k_e(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?k_e(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?e.linesDecorationsTooltip.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&apos;";case"&":return"&amp;"}return e}):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?k_e(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?k_e(e.marginClassName):null,this.inlineClassName=e.inlineClassName?k_e(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?k_e(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?k_e(e.afterContentClassName):null,this.after=e.after?kx.from(e.after):null,this.before=e.before?kx.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1,this.textDirection=e.textDirection??null}}).EMPTY=Lx.register({description:"empty"}),Dx=[Lx.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Lx.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Lx.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Lx.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})],Ix=class{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}},Nx=class{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i){this.ownerId=e,this.decorationId=t,this.lineNumber=i}},Ex=class extends Ie{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new je),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._affectedLineHeights=null,this._affectedFontLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){this._deferredCnt--,0===this._deferredCnt&&(this._shouldFireDeferred&&this.doFire(),this._affectedInjectedTextLines?.clear(),this._affectedInjectedTextLines=null,this._affectedLineHeights?.clear(),this._affectedLineHeights=null,this._affectedFontLines?.clear(),this._affectedFontLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}recordLineAffectedByLineHeightChange(e,t,i,n){this._affectedLineHeights||(this._affectedLineHeights=new hx([],Ix.toKey)),this._affectedLineHeights.add(new Ix(e,t,i,n))}recordLineAffectedByFontChange(e,t,i){this._affectedFontLines||(this._affectedFontLines=new hx([],Nx.toKey)),this._affectedFontLines.add(new Nx(e,t,i))}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!e.minimap?.position),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!e.overviewRuler?.color),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this._affectsLineNumber||(this._affectsLineNumber=!!e.lineNumberClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){0===this._deferredCnt?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines,this._affectedLineHeights,this._affectedFontLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}},Mx=class extends Ie{constructor(){super(),this._fastEmitter=this._register(new je),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new je),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}},Tx=eue("ILanguageFeaturesService"),Rx=class e{static create(t){return new e(t.get(151),t.get(150))}constructor(e,t){this.classifier=new Ox(e,t)}createLineBreaksComputer(e,t,i,n,o,s){const r=[],a=[],l=[];return{addRequest:(e,t,i)=>{r.push(e),a.push(t),l.push(i)},finalize:()=>{const d=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,c=[];for(let e=0,h=r.length;e<h;e++){const h=a[e],u=l[e],g=r[e],p=s&&g.includes('"')&&g.includes("\\n");!u||u.injectionOptions||h||p?c[e]=I_e(this.classifier,g,h,t,i,d,n,o,p):c[e]=D_e(this.classifier,u,g,t,i,d,n,o)}return Ax.length=0,Px.length=0,c}}}},Ox=class extends zr{constructor(e,t){super(0);for(let i=0;i<e.length;i++)this.set(e.charCodeAt(i),1);for(let i=0;i<t.length;i++)this.set(t.charCodeAt(i),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}},Ax=[],Px=[],Fx=class e{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new Dr(new mr(1,1,1,1),0,0,new to(1,1),0),new Dr(new mr(1,1,1,1),0,0,new to(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new xr(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?fr.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):fr.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,s),a=this._validatePositionWithCache(e,o,n,r);return i.equals(s)&&n.equals(r)&&o.equals(a)?t:new Dr(mr.fromPositions(r,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-r.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(t,i,n){if(n&&(n=e._validateViewState(t.viewModel,n)),i){const e=t.model.validateRange(i.selectionStart),n=i.selectionStart.equalsRange(e)?i.selectionStartLeftoverVisibleColumns:0,o=t.model.validatePosition(i.position),s=i.position.equals(o)?i.leftoverVisibleColumns:0;i=new Dr(e,i.selectionStartKind,n,o,s)}else{if(!n)return;const e=t.model.validateRange(t.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)),o=t.model.validatePosition(t.coordinatesConverter.convertViewPositionToModelPosition(n.position));i=new Dr(e,n.selectionStartKind,n.selectionStartLeftoverVisibleColumns,o,n.leftoverVisibleColumns)}if(n){const e=t.coordinatesConverter.validateViewRange(n.selectionStart,i.selectionStart),o=t.coordinatesConverter.validateViewPosition(n.position,i.position);n=new Dr(e,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}else{const e=t.coordinatesConverter.convertModelPositionToViewPosition(new to(i.selectionStart.startLineNumber,i.selectionStart.startColumn)),o=t.coordinatesConverter.convertModelPositionToViewPosition(new to(i.selectionStart.endLineNumber,i.selectionStart.endColumn)),s=new mr(e.lineNumber,e.column,o.lineNumber,o.column),r=t.coordinatesConverter.convertModelPositionToViewPosition(i.position);n=new Dr(s,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,r,i.leftoverVisibleColumns)}this.modelState=i,this.viewState=n,this._updateTrackedRange(t)}},Wx=class{constructor(e){this.context=e,this.cursors=[new Fx(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return Ype(this.cursors,fce(e=>e.viewState.position,to.compare)).viewState.position}getBottomMostViewPosition(){return Zpe(this.cursors,fce(e=>e.viewState.position,to.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(xr.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(t<i){const e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){const e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let n=0;n<i;n++)this.cursors[n+1].setState(this.context,e[n].modelState,e[n].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new Fx(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort(fce(e=>e.selection,mr.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],s=n.selection,r=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let a;if(a=r.isEmpty()||s.isEmpty()?r.getStartPosition().isBeforeOrEqual(s.getEndPosition()):r.getStartPosition().isBefore(s.getEndPosition()),a){const s=n.index<o.index?i:i+1,r=n.index<o.index?i+1:i,a=t[r].index,l=t[s].index,d=t[r].selection,c=t[s].selection;if(!d.equalsSelection(c)){const i=d.plusRange(c),n=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn,o=c.selectionStartLineNumber===c.startLineNumber&&c.selectionStartColumn===c.startColumn;let r,h;a===this.lastAddedCursorIndex?(r=n,this.lastAddedCursorIndex=l):r=o,h=r?new fr(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn):new fr(i.endLineNumber,i.endColumn,i.startLineNumber,i.startColumn),t[s].selection=h;const u=xr.fromModelSelection(h);e[l].setState(this.context,u.modelState,u.viewState)}for(const e of t)e.index>a&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}},Bx=class{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}},Vx=class{constructor(){this.type=0}},Hx=class{constructor(){this.type=1}},zx=class{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}},Ux=class{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}},Kx=class{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}},qx=class{constructor(){this.type=5}},jx=class{constructor(e){this.type=6,this.isFocused=e}},$x=class{constructor(){this.type=7}},Gx=class{constructor(){this.type=8}},Zx=class{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}},Yx=class{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}},Qx=class{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}},Xx=class{constructor(e,t,i,n,o,s,r){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=o,this.revealHorizontal=s,this.scrollType=r,this.type=12}},Jx=class{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}},ek=class{constructor(e){this.theme=e,this.type=14}},tk=class{constructor(e){this.type=15,this.ranges=e}},ik=class{constructor(){this.type=16}},nk=class{constructor(){this.type=17}},ok=class extends Ie{constructor(){super(),this._onEvent=this._register(new je),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++){const i=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(i)return void(this._outgoingEvents[t]=i)}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new sk),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const i of e)this._addOutgoingEvent(i);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}},sk=class{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}},rk=class e{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(t){return t.kind!==this.kind?null:new e(this._oldContentWidth,this._oldContentHeight,t.contentWidth,t.contentHeight)}},ak=class e{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(t){return t.kind!==this.kind?null:new e(this.oldHasFocus,t.hasFocus)}},lk=class{constructor(e,t){this.kind=2,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new ak(this.oldHasFocus,e.hasFocus)}},dk=class e{constructor(e,t,i,n,o,s,r,a){this.kind=3,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=r,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!(this.scrollWidthChanged||this.scrollLeftChanged||this.scrollHeightChanged||this.scrollTopChanged)}attemptToMerge(t){return t.kind!==this.kind?null:new e(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,t.scrollWidth,t.scrollLeft,t.scrollHeight,t.scrollTop)}},ck=class{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}},hk=class{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}},uk=class e{constructor(e,t,i,n,o,s,r){this.kind=7,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=o,this.reason=s,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!e[n].equalsSelection(t[n]))return!1;return!0}isNoOp(){return e._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(t){return t.kind!==this.kind?null:new e(this.oldSelections,t.selections,this.oldModelVersionId,t.modelVersionId,t.source,t.reason,this.reachedMaxCursorCount||t.reachedMaxCursorCount)}},gk=class{constructor(){this.kind=6}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}},pk=class{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}},mk=class{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}},fk=class{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}},_k=class{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}},bk=class{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}},vk=class{constructor(e){this.event=e,this.kind=13}isNoOp(){return!1}attemptToMerge(e){return null}},wk=class{constructor(e){this.event=e,this.kind=14}isNoOp(){return!1}attemptToMerge(e){return null}},Ck=class{constructor(e){this.event=e,this.kind=15}isNoOp(){return!1}attemptToMerge(e){return null}},yk=class extends Ie{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new Bx(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new Wx(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=kle(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new Bx(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){const e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){const i=this._autoClosedActions[t];i.isValid(e)||(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let o=!1;const s=this.context.cursorConfig.multiCursorLimit;null!==n&&n.length>s&&(n=n.slice(0,s),o=!0);const r=Sk.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,o,s){const r=this._cursors.getViewPositions();let a=null,l=null;r.length>1?l=this._cursors.getViewSelections():a=mr.fromPositions(r[0],r[0]),e.emitViewEvent(new Xx(t,i,a,l,n,o,s))}revealPrimary(e,t,i,n,o,s){const r=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new Xx(t,i,null,r,n,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push({inSelectionMode:!n.isEmpty(),selectionStart:{lineNumber:n.selectionStartLineNumber,column:n.selectionStartColumn},position:{lineNumber:n.positionLineNumber,column:n.positionColumn}})}return e}restoreState(e,t){const i=[];for(let n=0,o=t.length;n<o;n++){const e=t[n];let o=1,s=1;e.position&&e.position.lineNumber&&(o=e.position.lineNumber),e.position&&e.position.column&&(s=e.position.column);let r=o,a=s;e.selectionStart&&e.selectionStart.lineNumber&&(r=e.selectionStart.lineNumber),e.selectionStart&&e.selectionStart.column&&(a=e.selectionStart.column),i.push({selectionStartLineNumber:r,selectionStartColumn:a,positionLineNumber:o,positionColumn:s})}this.setStates(e,"restoreState",0,xr.fromModelSelections(i)),this.revealAll(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof HC){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;const n=i.containsEvent(1);if(this._prevEditOperationType=0,n)this._cursors.dispose(),this._cursors=new Wx(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const t=xr.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,xr.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,xr.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let r=0,a=e.length;r<a;r++)i.push({range:e[r],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[r],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),s=this._model.deltaDecorations([],n);this._autoClosedActions.push(new xk(this._model,o,s))}_executeEditOperation(e,t){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const i=kk.executeCommands(this._model,this._cursors.getSelections(),e.commands,t);if(i){this._interpretCommandResult(i);const t=[],n=[];for(let i=0;i<e.commands.length;i++){const o=e.commands[i];o instanceof Hl&&o.enclosingRange&&o.closeCharacterRange&&(t.push(o.closeCharacterRange),n.push(o.enclosingRange))}t.length>0&&this._pushAutoClosedAction(t,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,o){const s=Sk.from(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new Ux(a,r,i)),!n||n.cursorState.length!==s.cursorState.length||s.cursorState.some((e,t)=>!e.modelState.equals(n.cursorState[t].modelState))){const a=n?n.cursorState.map(e=>e.modelState.selection):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new uk(a,r,l,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.text||n.text.indexOf("\n")>=0)return null;const o=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const s=o[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(s);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-o[2].length-1,d=n.text.lastIndexOf(a,l-1);if(-1===d)return null;t.push([d,l])}return t}executeEdits(e,t,i,n,o){let s=null;"snippet"===t&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,e=>{if(s)for(let i=0,n=s.length;i<n;i++){const[t,n]=s[i],o=e[i],l=o.range.startLineNumber,d=o.range.startColumn-1+t,c=o.range.startColumn-1+n;r.push(new mr(l,c+1,l,c+2)),a.push(new mr(l,d+1,l,c+2))}const t=n(e);return t&&(this._isHandling=!0),t},void 0,o);l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),r.length>0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=Sk.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){$ae(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return xk.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new Dk(this._model,this.getSelections())}endComposition(e,t){const i=Vy.cursor({kind:"compositionEnd",detailedSource:t}),n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{"keyboard"===t&&this._executeEditOperation(Kl.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()),i)},e,t)}type(e,t,i){const n=Vy.cursor({kind:"type",detailedSource:i});this._executeEdit(()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i<e;){const e=hde(t,i),o=t.substr(i,e);this._executeEditOperation(Kl.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),o),n),i+=e}}else this._executeEditOperation(Kl.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t),n)},e,i)}compositionType(e,t,i,n,o,s){const r=Vy.cursor({kind:"compositionType",detailedSource:s});if(0!==t.length||0!==i||0!==n)this._executeEdit(()=>{this._executeEditOperation(Kl.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o),r)},e,s);else if(0!==o){const t=this.getSelections().map(e=>{const t=e.getPosition();return new fr(t.lineNumber,t.column+o,t.lineNumber,t.column+o)});this.setSelections(e,s,t,0)}}paste(e,t,i,n,o){const s=Vy.cursor({kind:"paste",detailedSource:o});this._executeEdit(()=>{this._executeEditOperation(Kl.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]),s)},e,o,4)}cut(e,t){const i=Vy.cursor({kind:"cut",detailedSource:t});this._executeEdit(()=>{this._executeEditOperation(Vr.cut(this.context.cursorConfig,this._model,this.getSelections()),i)},e,t)}executeCommand(e,t,i){const n=Vy.cursor({kind:"executeCommand",detailedSource:i});this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Ir(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}executeCommands(e,t,i){const n=Vy.cursor({kind:"executeCommands",detailedSource:i});this._executeEdit(()=>{this._executeEditOperation(new Ir(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}},Sk=class e{static from(t,i){return new e(t.getVersionId(),i.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}},xk=class{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){const e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){const i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){const t=[];for(let i=0;i<this._autoClosedEnclosingDecorations.length;i++){const e=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[i]);if(e&&(t.push(e),e.startLineNumber!==e.endLineNumber))return!1}t.sort(mr.compareRangesUsingStarts),e.sort(mr.compareRangesUsingStarts);for(let i=0;i<e.length;i++){if(i>=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}},kk=class{static executeCommands(e,t,i,n=Vy.unknown({name:"executeCommands"})){const o={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},s=this._innerExecuteCommands(o,i,n);for(let r=0,a=o.trackedRanges.length;r<a;r++)o.model._setTrackedRange(o.trackedRanges[r],null,0);return s}static _innerExecuteCommands(e,t,i){if(this._arrayIsEmpty(t))return null;const n=this._getEditOperations(e,t);if(0===n.operations.length)return null;const o=n.operations,s=this._getLoserCursorMap(o);if(s.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const r=[];for(let d=0,c=o.length;d<c;d++)s.hasOwnProperty(o[d].identifier.major.toString())||r.push(o[d]);n.hadTrackedEditOperation&&r.length>0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,i=>{const n=[];for(let t=0;t<e.selectionsBefore.length;t++)n[t]=[];for(const e of i)e.identifier&&n[e.identifier.major].push(e);const o=(e,t)=>e.identifier.minor-t.identifier.minor,s=[];for(let r=0;r<e.selectionsBefore.length;r++)n[r].length>0?(n[r].sort(o),s[r]=t[r].computeCursorState(e.model,{getInverseEditOperations:()=>n[r],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new fr(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new fr(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[r]=e.selectionsBefore[r];return s},void 0,i);a||(a=e.selectionsBefore);const l=[];for(const d in s)s.hasOwnProperty(d)&&l.push(parseInt(d,10));l.sort((e,t)=>t-e);for(const d of l)a.splice(d,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let o=0,s=t.length;o<s;o++){const s=t[o];if(s){const t=this._getEditOperationsFromCommand(e,o,s);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){const n=[];let o=0;const s=(e,s,r=!1)=>{mr.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a={addEditOperation:s,addTrackedEditOperation:(e,t,i)=>{r=!0,s(e,t,i)},trackSelection:(t,i)=>{const n=fr.liftSelection(t);let o;if(n.isEmpty())if("boolean"==typeof i)o=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);o=n.startColumn===t?2:3}else o=1;const s=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,o);return e.trackedRanges[s]=r,e.trackedRangesDirection[s]=n.getDirection(),s.toString()}};try{i.getEditOperations(e.model,a)}catch(Fae){return $ae(Fae),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){(e=e.slice(0)).sort((e,t)=>-mr.compareRangesUsingEnds(e.range,t.range));const t={};for(let i=1;i<e.length;i++){const n=e[i-1],o=e[i];if(mr.getStartPosition(n.range).isBefore(mr.getEndPosition(o.range))){let s;s=n.identifier.major>o.identifier.major?n.identifier.major:o.identifier.major,t[s.toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===s&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}},Lk=class{constructor(e,t,i,n){this.text=e,this.lineNumber=t,this.startSelectionOffset=i,this.endSelectionOffset=n}},Dk=class e{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;const t=n.startLineNumber;i.push(new Lk(e.getLineContent(t),t,n.startColumn-1,n.endColumn-1))}return i}constructor(t,i){this._original=e._capture(t,i)}deduceOutcome(t,i){if(!this._original)return null;const n=e._capture(t,i);if(!n)return null;if(this._original.length!==n.length)return null;const o=[];for(let s=0,r=this._original.length;s<r;s++)o.push(e._deduceOutcome(this._original[s],n[s]));return o}static _deduceOutcome(e,t){const i=Math.min(e.startSelectionOffset,t.startSelectionOffset,sde(e.text,t.text)),n=Math.min(e.text.length-e.endSelectionOffset,t.text.length-t.endSelectionOffset,rde(e.text,t.text)),o=e.text.substring(i,e.text.length-n),s=i,r=t.text.length-n,a=t.text.substring(s,r),l=new mr(t.lineNumber,s+1,t.lineNumber,r+1);return new ql(o,e.startSelectionOffset-i,e.endSelectionOffset-i,a,t.startSelectionOffset-i,t.endSelectionOffset-i,l)}},Ik={getInitialState:()=>SS,tokenizeEncoded:(e,t,i)=>h_e(0,i)},Nk=class{constructor(e,t,i,n,o){this.decorationId=e,this.index=t,this.lineNumber=i,this.specialHeight=n,this.prefixSum=o,this.maximumSpecialHeight=n,this.deleted=!1}},Ek=class{constructor(e,t){if(this._decorationIDToCustomLine=new Mk,this._orderedCustomLines=[],this._pendingSpecialLinesToInsert=[],this._invalidIndex=0,this._hasPending=!1,this._defaultLineHeight=e,t.length>0){for(const e of t)this.insertOrChangeCustomLineHeight(e.decorationId,e.startLineNumber,e.endLineNumber,e.lineHeight);this.commit()}}set defaultLineHeight(e){this._defaultLineHeight=e}get defaultLineHeight(){return this._defaultLineHeight}removeCustomLineHeight(e){const t=this._decorationIDToCustomLine.get(e);if(t){this._decorationIDToCustomLine.delete(e);for(const e of t)e.deleted=!0,this._invalidIndex=Math.min(this._invalidIndex,e.index);this._hasPending=!0}}insertOrChangeCustomLineHeight(e,t,i,n){this.removeCustomLineHeight(e);for(let o=t;o<=i;o++){const t=new Nk(e,-1,o,n,0);this._pendingSpecialLinesToInsert.push(t)}this._hasPending=!0}heightForLineNumber(e){const t=this._binarySearchOverOrderedCustomLinesArray(e);return t>=0?this._orderedCustomLines[t].maximumSpecialHeight:this._defaultLineHeight}getAccumulatedLineHeightsIncludingLineNumber(e){const t=this._binarySearchOverOrderedCustomLinesArray(e);if(t>=0)return this._orderedCustomLines[t].prefixSum+this._orderedCustomLines[t].maximumSpecialHeight;if(-1===t)return this._defaultLineHeight*e;const i=-(t+1),n=this._orderedCustomLines[i-1];return n.prefixSum+n.maximumSpecialHeight+this._defaultLineHeight*(e-n.lineNumber)}onLinesDeleted(e,t){const i=t-e+1,n=this._orderedCustomLines.length,o=this._binarySearchOverOrderedCustomLinesArray(e);let s;if(o>=0){s=o;for(let t=o-1;t>=0&&this._orderedCustomLines[t].lineNumber===e;t--)s--}else s=o===-(n+1)&&-1!==o?n-1:-(o+1);const r=this._binarySearchOverOrderedCustomLinesArray(t);let a;if(r>=0){a=r;for(let e=r+1;e<n&&this._orderedCustomLines[e].lineNumber===t;e++)a++}else a=r===-(n+1)&&-1!==r?n-1:-(r+1);const l=a>s,d=a===s&&this._orderedCustomLines[s]&&this._orderedCustomLines[s].lineNumber>=e&&this._orderedCustomLines[s].lineNumber<=t;if(l||d){let n=0;for(let e=s;e<=a;e++)n=Math.max(n,this._orderedCustomLines[e].maximumSpecialHeight);let o=0;if(s>0){const t=this._orderedCustomLines[s-1];o=t.prefixSum+t.maximumSpecialHeight+this._defaultLineHeight*(e-t.lineNumber-1)}else o=e>0?(e-1)*this._defaultLineHeight:0;const r=this._orderedCustomLines[s],l=this._orderedCustomLines[a],d=this._orderedCustomLines[a+1],c=d&&d.lineNumber===t+1?d.maximumSpecialHeight:this._defaultLineHeight,h=l.prefixSum+l.maximumSpecialHeight-r.prefixSum+this._defaultLineHeight*(t-l.lineNumber)+this._defaultLineHeight*(r.lineNumber-e)+c-n,u=new Set,g=[],p=new Mk;let m=0;for(let t=0;t<this._orderedCustomLines.length;t++){const r=this._orderedCustomLines[t];if(t<s)g.push(r),p.add(r.decorationId,r);else if(t>=s&&t<=a){const t=r.decorationId;u.has(t)?m++:(r.index-=m,r.lineNumber=e,r.prefixSum=o,r.maximumSpecialHeight=n,g.push(r),p.add(r.decorationId,r))}else t>a&&(r.index-=m,r.lineNumber-=i,r.prefixSum-=h,g.push(r),p.add(r.decorationId,r));u.add(r.decorationId)}this._orderedCustomLines=g,this._decorationIDToCustomLine=p}else{const e=i*this._defaultLineHeight;for(let n=a;n<this._orderedCustomLines.length;n++){const o=this._orderedCustomLines[n];o.lineNumber>t&&(o.lineNumber-=i,o.prefixSum-=e)}}}onLinesInserted(e,t){const i=t-e+1,n=this._binarySearchOverOrderedCustomLinesArray(e);let o;if(n>=0){o=n;for(let t=n-1;t>=0&&this._orderedCustomLines[t].lineNumber===e;t--)o--}else o=-(n+1);const s=[],r=new Set;for(let d=o;d<this._orderedCustomLines.length;d++)this._orderedCustomLines[d].lineNumber===e&&r.add(this._orderedCustomLines[d].decorationId);const a=new Set;for(let d=o-1;d>=0;d--)this._orderedCustomLines[d].lineNumber===e-1&&a.add(this._orderedCustomLines[d].decorationId);const l=w_e(a,r);for(let d=o;d<this._orderedCustomLines.length;d++)this._orderedCustomLines[d].lineNumber+=i,this._orderedCustomLines[d].prefixSum+=this._defaultLineHeight*i;if(l.size>0){for(const t of l){const i=this._decorationIDToCustomLine.get(t);if(i){const n=i.reduce((e,t)=>Math.min(e,t.lineNumber),e),o=i.reduce((e,t)=>Math.max(e,t.lineNumber),e),r=i.reduce((e,t)=>Math.max(e,t.specialHeight),0);s.push({decorationId:t,startLineNumber:n,endLineNumber:o,lineHeight:r})}}for(const e of s)this.insertOrChangeCustomLineHeight(e.decorationId,e.startLineNumber,e.endLineNumber,e.lineHeight);this.commit()}}commit(){if(!this._hasPending)return;for(const o of this._pendingSpecialLinesToInsert){const e=this._binarySearchOverOrderedCustomLinesArray(o.lineNumber),t=e>=0?e:-(e+1);this._orderedCustomLines.splice(t,0,o),this._invalidIndex=Math.min(this._invalidIndex,t)}this._pendingSpecialLinesToInsert=[];const e=new Mk,t=[];for(let o=0;o<this._invalidIndex;o++){const i=this._orderedCustomLines[o];t.push(i),e.add(i.decorationId,i)}let i=0,n=this._invalidIndex>0?t[this._invalidIndex-1]:void 0;for(let o=this._invalidIndex;o<this._orderedCustomLines.length;o++){const s=this._orderedCustomLines[o];if(s.deleted)i++;else{if(s.index=o-i,n&&n.lineNumber===s.lineNumber)s.maximumSpecialHeight=n.maximumSpecialHeight,s.prefixSum=n.prefixSum;else{let e,t=s.specialHeight;for(let i=o;i<this._orderedCustomLines.length;i++){const e=this._orderedCustomLines[i];if(!e.deleted){if(e.lineNumber!==s.lineNumber)break;t=Math.max(t,e.specialHeight)}}s.maximumSpecialHeight=t,e=n?n.prefixSum+n.maximumSpecialHeight+this._defaultLineHeight*(s.lineNumber-n.lineNumber-1):this._defaultLineHeight*(s.lineNumber-1),s.prefixSum=e}n=s,t.push(s),e.add(s.decorationId,s)}}this._orderedCustomLines=t,this._decorationIDToCustomLine=e,this._invalidIndex=1/0,this._hasPending=!1}_binarySearchOverOrderedCustomLinesArray(e){return Qde(this._orderedCustomLines.length,t=>{const i=this._orderedCustomLines[t];return i.lineNumber===e?0:i.lineNumber<e?-1:1})}},Mk=class{constructor(){this._map=new Map}add(e,t){const i=this._map.get(e);i?i.push(t):this._map.set(e,[t])}get(e){return this._map.get(e)}delete(e){this._map.delete(e)}},Tk=class{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}},Rk=class{constructor(e,t,i,n,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=o,this.prefixSum=0}},Ok=class e{constructor(t,i,n,o,s){this._instanceId=vde(++e.INSTANCE_COUNT),this._pendingChanges=new Tk,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=t,this._paddingTop=n,this._paddingBottom=o,this._lineHeightsManager=new Ek(i,s)}static findInsertionIndex(e,t,i){let n=0,o=e.length;for(;n<o;){const s=n+o>>>1;t===e[s].afterLineNumber?i<e[s].ordinal?o=s:n=s+1:t<e[s].afterLineNumber?o=s:n=s+1}return n}setDefaultLineHeight(e){this._lineHeightsManager.defaultLineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e,t){this._lineCount=e,this._lineHeightsManager=new Ek(this._lineHeightsManager.defaultLineHeight,t)}changeLineHeights(e){let t=!1;try{e({insertOrChangeCustomLineHeight:(e,i,n,o)=>{t=!0,this._lineHeightsManager.insertOrChangeCustomLineHeight(e,i,n,o)},removeCustomLineHeight:e=>{t=!0,this._lineHeightsManager.removeCustomLineHeight(e)}})}finally{this._lineHeightsManager.commit()}return t}changeWhitespace(e){let t=!1;try{e({insertWhitespace:(e,i,n,o)=>{t=!0,e|=0,i|=0,n|=0,o|=0;const s=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new Rk(s,e,i,n,o)),s},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const a of i)n.add(a.id);const o=new Map;for(const a of t)o.set(a.id,a);const s=e=>{const t=[];for(const i of e)if(!n.has(i.id)){if(o.has(i.id)){const e=o.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=s(this._arr).concat(s(e));r.sort((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber),this._arr=r,this._prefixSumValidIndex=-1}_insertWhitespace(t){const i=e.findInsertionIndex(this._arr,t.afterLineNumber,t.ordinal);this._arr.splice(i,0,t),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,i-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,n=t.length;i<n;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const n=this._findWhitespaceIndex(e);if(-1!==n&&(this._arr[n].height!==i&&(this._arr[n].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)),this._arr[n].afterLineNumber!==t)){const e=this._arr[n];this._removeWhitespace(n),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){e|=0,t|=0,this._lineCount-=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){const n=this._arr[i].afterLineNumber;e<=n&&n<=t?this._arr[i].afterLineNumber=e-1:n>t&&(this._arr[i].afterLineNumber-=t-e+1)}this._lineHeightsManager.onLinesDeleted(e,t)}onLinesInserted(e,t){e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i<n;i++)e<=this._arr[i].afterLineNumber&&(this._arr[i].afterLineNumber+=t-e+1);this._lineHeightsManager.onLinesInserted(e,t)}getWhitespacesTotalHeight(){return 0===this._arr.length?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);0===t&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){return this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(this._lineCount)+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e);return-1===t?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;const t=this._arr;let i=0,n=t.length-1;for(;i<=n;){const o=i+((n-i|0)/2|0)|0;if(t[o].afterLineNumber<e){if(o+1>=t.length||t[o+1].afterLineNumber>=e)return o;i=o+1|0}else n=o-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){let i;return i=(e|=0)>1?this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e-1):0,i+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0))+this._paddingTop}getLineHeightForLineNumber(e){return this._lineHeightsManager.heightForLineNumber(e)}getVerticalOffsetAfterLineNumber(e,t=!1){return e|=0,this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e)+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0))+this._paddingTop}getWhitespaceMinWidth(){if(-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){return e>this.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&e<this._paddingTop}isInBottomPadding(e){return 0!==this._paddingBottom&&e>=this.getLinesTotalHeight()-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if((e|=0)<0)return 1;const t=0|this._lineCount;let i=1,n=t;for(;i<n;){const t=(i+n)/2|0,o=this.getLineHeightForLineNumber(t),s=0|this.getVerticalOffsetForLineNumber(t);if(e>=s+o)i=t+1;else{if(e>=s)return t;n=t}}return i>t?t:i}getLinesViewportData(e,t){e|=0,t|=0;const i=0|this.getLineNumberAtOrAfterVerticalOffset(e),n=0|this.getVerticalOffsetForLineNumber(i);let o=0|this._lineCount,s=0|this.getFirstWhitespaceIndexAfterLineNumber(i);const r=0|this.getWhitespacesCount();let a,l;-1===s?(s=r,l=o+1,a=0):(l=0|this.getAfterLineNumberForWhitespaceIndex(s),a=0|this.getHeightForWhitespaceIndex(s));let d=n,c=d;const h=5e5;let u=0;n>=h&&(u=Math.floor(n/h)*h,u=Math.floor(u/this._lineHeightsManager.defaultLineHeight)*this._lineHeightsManager.defaultLineHeight,c-=u);const g=[],p=e+(t-e)/2;let m=-1;for(let v=i;v<=o;v++){const e=this.getLineHeightForLineNumber(v);for(-1===m&&(d<=p&&p<d+e||d>p)&&(m=v),d+=e,g[v-i]=c,c+=e;l===v;)c+=a,d+=a,s++,s>=r?l=o+1:(l=0|this.getAfterLineNumberForWhitespaceIndex(s),a=0|this.getHeightForWhitespaceIndex(s));if(d>=t){o=v;break}}-1===m&&(m=o);const f=0|this.getVerticalOffsetForLineNumber(o);let _=i,b=o;return _<b&&n<e&&_++,_<b&&f+this.getLineHeightForLineNumber(o)>t&&b--,{bigNumbersDelta:u,startLineNumber:i,endLineNumber:o,relativeVerticalOffset:g,centeredLineNumber:m,completelyVisibleStartLineNumber:_,completelyVisibleEndLineNumber:b,lineHeight:this._lineHeightsManager.defaultLineHeight}}getVerticalOffsetForWhitespaceIndex(e){e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(t):0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t<i;){const n=Math.floor((t+i)/2),o=this.getVerticalOffsetForWhitespaceIndex(n);if(e>=o+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=o)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let s=i;s<=n;s++){const e=this.getVerticalOffsetForWhitespaceIndex(s),i=this.getHeightForWhitespaceIndex(s);if(e>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:e,height:i})}return o}getWhitespaces(){return this._arr.slice(0)}getWhitespacesCount(){return this._arr.length}getIdForWhitespaceIndex(e){return e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return e|=0,this._arr[e].height}},Ok.INSTANCE_COUNT=0,Ak=class{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}},Pk=class extends Ie{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new je),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new Ak(0,0,0,0),this._scrollable=this._register(new Sm({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new rk(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}},Fk=class extends Ie{constructor(e,t,i,n){super(),this._configuration=e;const o=this._configuration.options,s=o.get(165),r=o.get(96);this._linesLayout=new Ok(t,o.get(75),r.top,r.bottom,i),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new Pk(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new Ak(s.contentWidth,0,s.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(130)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(75)&&this._linesLayout.setDefaultLineHeight(t.get(75)),e.hasChanged(96)){const e=t.get(96);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(165)){const e=t.get(165),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new Ak(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(130)&&this._configureSmoothScrollDuration()}onFlushed(e,t){this._linesLayout.onFlushed(e,t)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const i=this._configuration.options.get(117);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(119)?o+=Math.max(0,t-n.get(75)-n.get(96).bottom):n.get(117).ignoreHorizontalScrollbarInContentHeight||(o+=this._getHorizontalScrollbarHeight(e,i)),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new Ak(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Jb(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Jb(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(166),n=e.get(59),o=e.get(165);if(i.isViewportWrapping){const i=e.get(81);return t>o.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?t+o.verticalScrollbarWidth:t}{const i=e.get(118)*n.typicalHalfwidthCharacterWidth,s=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+i+o.verticalScrollbarWidth,s,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new Ak(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}changeSpecialLineHeights(e){const t=this._linesLayout.changeLineHeights(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._linesLayout.getLineHeightForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}},Wk=class{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}},Bk=class{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new Wk(new mr(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}},Vk=class{constructor(e,t,i,n,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const n=e.range,o=e.options;let s;if(o.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new to(n.startLineNumber,1),0,!1,!0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new to(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);s=new mr(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new Hb(s,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getDecorationsOnLine(e,t=!1,i=!1){const n=new mr(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i)}_getDecorationsInRange(e,t,i){const n=this._linesCollection.getDecorationsInRange(e,this.editorId,Gge(this.configuration.options),Zge(this.configuration.options),t,i),o=e.startLineNumber,s=e.endLineNumber,r=[];let a=0;const l=[];for(let c=o;c<=s;c++)l[c-o]=[];let d=!1;for(let c=0,h=n.length;c<h;c++){const e=n[c],t=e.options;if(!tme(this.model,e))continue;const i=this._getOrCreateViewModelDecoration(e),h=i.range;if(r[a++]=i,t.inlineClassName){const e=new Wk(h,t.inlineClassName,t.inlineClassNameAffectsLetterSpacing?3:0),i=Math.max(o,h.startLineNumber),n=Math.min(s,h.endLineNumber);for(let t=i;t<=n;t++)l[t-o].push(e)}if(t.beforeContentClassName&&o<=h.startLineNumber&&h.startLineNumber<=s){const e=new Wk(new mr(h.startLineNumber,h.startColumn,h.startLineNumber,h.startColumn),t.beforeContentClassName,1);l[h.startLineNumber-o].push(e)}if(t.afterContentClassName&&o<=h.endLineNumber&&h.endLineNumber<=s){const e=new Wk(new mr(h.endLineNumber,h.endColumn,h.endLineNumber,h.endColumn),t.afterContentClassName,2);l[h.endLineNumber-o].push(e)}t.affectsFont&&(d=!0)}return{decorations:r,inlineDecorations:l,hasVariableFonts:d}}},Uk=class{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const n=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let s;if(null!==this._projectionData.injectionOffsets){const i=this._projectionData.injectionOffsets.map((e,t)=>new RC(0,0,e+1,this._projectionData.injectionOptions[t],0));s=RC.applyInjectedText(e.getLineContent(t),i).substring(n,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=F_e(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const n=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,o,s,r){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,d=a.injectionOptions;let c,h=null;if(l){h=[];let e=0,t=0;for(let i=0;i<a.getOutputLineCount();i++){const n=new Array;h[i]=n;const o=i>0?a.breakOffsets[i-1]:0,s=a.breakOffsets[i];for(;t<l.length;){const r=d[t].content.length,c=l[t]+e,h=c+r;if(c>s)break;if(o<h){const e=d[t];if(e.inlineClassName){const t=i>0?a.wrappedTextIndentLength:0,r=t+Math.max(c-o,0),l=t+Math.min(h-o,s-o);r!==l&&n.push(new Bk(r,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(h<=s))break;e+=r,t++}}}if(l){const i=[];for(let e=0;e<l.length;e++){const t=l[e],n=d[e].tokens;n?n.forEach((n,o)=>{i.push({offset:t,text:n.substring(d[e].content),tokenMetadata:o.metadata})}):i.push({offset:t,text:d[e].content,tokenMetadata:gl.defaultTokenMetadata})}c=e.tokenization.getLineTokens(t).withInserted(i)}else c=e.tokenization.getLineTokens(t);for(let u=i;u<i+n;u++){const e=o+u-i;s[e]?r[e]=this._getViewLineData(c,h?h[u]:null,u):r[e]=null}}_getViewLineData(e,t,i){this._assertVisible();const n=this._projectionData,o=i>0?n.wrappedTextIndentLength:0,s=i>0?n.breakOffsets[i-1]:0,r=n.breakOffsets[i],a=e.sliceAndInflate(s,r,o);let l=a.getLineContent();i>0&&(l=F_e(n.wrappedTextIndentLength)+l);const d=this._projectionData.getMinOutputOffset(i)+1,c=l.length+1,h=i+1<this.getViewLineCount(),u=0===i?0:n.breakOffsetsVisibleColumn[i-1];return new tv(l,h,d,c,u,a,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){return this._assertVisible(),e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,i){const n=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(n)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}},(Hk=Kk=class{constructor(){}isVisible(){return!0}setVisible(e){return e?this:qk.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){const n=e.tokenization.getLineTokens(t),o=n.getLineContent();return new tv(o,!1,1,o.length+1,0,n.inflate(),null)}getViewLinesData(e,t,i,n,o,s,r){s[o]?r[o]=this.getViewLineData(e,t,0):r[o]=null}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new to(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}).INSTANCE=new Hk,(zk=qk=class{constructor(){}isVisible(){return!1}setVisible(e){return e?Kk.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,n,o,s,r){throw new Error("Not supported")}getModelColumnOfViewPosition(e,t){throw new Error("Not supported")}getViewPositionOfModelPosition(e,t){throw new Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw new Error("Not supported")}normalizePosition(e,t,i){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}).INSTANCE=new zk,jk=[""],$k=class{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Pue(e);const i=this.values,n=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=Pue(e),t=Pue(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=Pue(e),t=Pue(t);const i=this.values,n=this.prefixSum;if(e>=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),0!==t&&(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Pue(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,o=0,s=0;for(;t<=i;)if(n=t+(i-t)/2|0,o=this.prefixSum[n],s=o-this.values[n],e<s)i=n-1;else{if(!(e>=o))break;t=n+1}return new Zk(n,e-s)}},Gk=class{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),0===e?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e];return new Zk(t,e-(t>0?this._prefixSum[t-1]:0))}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=lce(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){const t=this._values[e],i=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=i+t;for(let n=0;n<t;n++)this._indexBySum[i+n]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}},Zk=class{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}},Yk=class{constructor(e){this._model=e}_validPosition(e){return this._model.validatePosition(e)}_validRange(e){return this._model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){const t=this._model.getLineCount();return!(e.lineNumber<1||e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}},Qk=class{constructor(e,t,i,n,o,s,r,a,l,d,c){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=d,this.wrapOnEscapedLineFeeds=c,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new eL(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),o=i.length,s=this.createLineBreaksComputer(),r=new Pi(RC.fromDecorations(n));for(let p=0;p<o;p++){const e=r.takeWhile(e=>e.lineNumber===p+1);s.addRequest(i[p],e,t?t[p]:null)}const a=s.finalize(),l=[],d=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(mr.compareRangesUsingStarts);let c=1,h=0,u=-1,g=u+1<d.length?h+1:o+2;for(let p=0;p<o;p++){const e=p+1;e===g&&(u++,c=d[u].startLineNumber,h=d[u].endLineNumber,g=u+1<d.length?h+1:o+2);const t=e>=c&&e<=h,i=P_e(a[p],!t);l[p]=i.getViewLineCount(),this.modelLineProjections[p]=i}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new Gk(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=function(e){if(0===e.length)return[];const t=e.slice();t.sort(mr.compareRangesUsingStarts);const i=[];let n=t[0].startLineNumber,o=t[0].endLineNumber;for(let s=1,r=t.length;s<r;s++){const e=t[s];e.startLineNumber>o+1?(i.push(new mr(n,1,o,1)),n=e.startLineNumber,o=e.endLineNumber):e.endLineNumber>o&&(o=e.endLineNumber)}return i.push(new mr(n,1,o,1)),i}(e.map(e=>this.model.validateRange(e))),i=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(mr.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n<t.length;n++)if(!t[n].equalsRange(i[n])){e=!0;break}if(!e)return!1}const n=t.map(e=>({range:e,options:Lx.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,n);const o=t;let s=1,r=0,a=-1,l=a+1<o.length?r+1:this.modelLineProjections.length+2,d=!1;for(let c=0;c<this.modelLineProjections.length;c++){const e=c+1;e===l&&(a++,s=o[a].startLineNumber,r=o[a].endLineNumber,l=a+1<o.length?r+1:this.modelLineProjections.length+2);let t=!1;if(e>=s&&e<=r?this.modelLineProjections[c].isVisible()&&(this.modelLineProjections[c]=this.modelLineProjections[c].setVisible(!1),t=!0):(d=!0,this.modelLineProjections[c].isVisible()||(this.modelLineProjections[c]=this.modelLineProjections[c].setVisible(!0),t=!0)),t){const e=this.modelLineProjections[c].getViewLineCount();this.projectedModelLineLineCounts.setValue(c,e)}}return d||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,o){const s=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,d=this.wordBreak===o;if(s&&r&&a&&l&&d)return!1;const c=s&&r&&!a&&l&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=o;let h=null;if(c){h=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)h[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,h),!0}createLineBreaksComputer(){return("advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak,this.wrapOnEscapedLineFeeds)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;const n=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new Yx(n,o)}onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.modelLineProjections[t-2].isVisible(),s=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let r=0;const a=[],l=[];for(let d=0,c=n.length;d<c;d++){const e=P_e(n[d],!o);a.push(e);const t=e.getViewLineCount();r+=t,l[d]=t}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(a).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,l),new Qx(s,s+r-1)}onModelLineChanged(e,t,i){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];const n=t-1,o=this.modelLineProjections[n].getViewLineCount(),s=P_e(i,this.modelLineProjections[n].isVisible());this.modelLineProjections[n]=s;const r=this.modelLineProjections[n].getViewLineCount();let a=!1,l=0,d=-1,c=0,h=-1,u=0,g=-1;return o>r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+r-1,u=d+1,g=u+(o-r)-1,a=!0):o<r?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+o-1,c=d+1,h=c+(r-o)-1,a=!0):(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=l+r-1),this.projectedModelLineLineCounts.setValue(n,r),[a,l<=d?new Zx(l,d-l+1):null,c<=h?new Qx(c,h):null,u<=g?new Yx(u,g):null]}acceptVersionId(e){this._validModelVersionId=e,1!==this.modelLineProjections.length||this.modelLineProjections[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;const t=this.getViewLineCount();return e>t?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.guides.getActiveIndentGuide(n.lineNumber,o.lineNumber,s.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new Xk(i+1,n)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new to(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new to(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(i),r=new Array;for(let a=i.modelLineNumber;a<=n.modelLineNumber;a++){const e=this.modelLineProjections[a-1];if(e.isVisible()){const t=a===i.modelLineNumber?i.modelLineWrappedLineIdx:0,o=a===n.modelLineNumber?n.modelLineWrappedLineIdx+1:e.getViewLineCount();for(let e=t;e<o;e++)r.push(new Xk(a,e))}if(!e.isVisible()&&s){const e=new to(a-1,this.model.getLineMaxColumn(a-1)+1),t=mr.fromPositions(s,e);o.push(new Jk(t,r)),r=[],s=null}else e.isVisible()&&!s&&(s=new to(a,1))}if(s){const e=mr.fromPositions(s,this.getModelEndPositionOfViewLine(n));o.push(new Jk(e,r))}return o}getViewLinesBracketGuides(e,t,i,n){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,s=[];for(const r of this.getViewLineInfosGroupedByModelRanges(e,t)){const e=r.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,r.modelRange.endLineNumber,o,n);for(const i of r.viewLines){const n=t[i.modelLineNumber-e].map(e=>{if(-1!==e.forWrappedLinesAfterColumn&&this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=i.modelLineWrappedLineIdx)return;if(-1!==e.forWrappedLinesBeforeOrAtColumn&&this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumber<i.modelLineWrappedLineIdx)return;if(!e.horizontalLine)return e;let t=-1;if(-1!==e.column){const n=this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.column);if(n.lineNumber===i.modelLineWrappedLineIdx)t=n.column;else if(n.lineNumber<i.modelLineWrappedLineIdx)t=this.getMinColumnOfViewLine(i);else if(n.lineNumber>i.modelLineWrappedLineIdx)return}const n=this.convertModelPositionToViewPosition(i.modelLineNumber,e.horizontalLine.endColumn),o=this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return o.lineNumber===i.modelLineWrappedLineIdx?new z_(e.visibleColumn,t,e.className,new U_(e.horizontalLine.top,n.column),-1,-1):o.lineNumber<i.modelLineWrappedLineIdx||-1!==e.visibleColumn?void 0:new z_(e.visibleColumn,t,e.className,new U_(e.horizontalLine.top,this.getMaxColumnOfViewLine(i)),-1,-1)});s.push(n.filter(e=>!!e))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],r=[],a=i.lineNumber-1,l=n.lineNumber-1;let d=null;for(let g=a;g<=l;g++){const e=this.modelLineProjections[g];if(e.isVisible()){const t=e.getViewLineNumberOfModelPosition(0,g===a?i.column:1),n=e.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),o=n-t+1;let l=0;o>1&&1===e.getViewLineMinColumn(this.model,g+1,n)&&(l=0===t?1:2),s.push(o),r.push(l),null===d&&(d=new to(g+1,0))}else null!==d&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}null!==d&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,n.lineNumber)),d=null);const c=t-e+1,h=new Array(c);let u=0;for(let g=0,p=o.length;g<p;g++){let e=o[g];const t=Math.min(c-u,s[g]),i=r[g];let n;n=2===i?0:1===i?1:t;for(let o=0;o<t;o++)o===n&&(e=0),h[u++]=e}return h}getViewLineContent(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){const t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const n=this.projectedModelLineLineCounts.getIndexOf(e-1);let o=e;const s=n.index,r=n.remainder,a=[];for(let l=s,d=this.model.getLineCount();l<d;l++){const n=this.modelLineProjections[l];if(!n.isVisible())continue;const d=l===s?r:0;let c=n.getViewLineCount()-d,h=!1;if(o+c>t&&(h=!0,c=t-o+1),n.getViewLinesData(this.model,l+1,d,c,o-e,i,a),o+=c,h)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),o=n.index,s=n.remainder,r=this.modelLineProjections[o],a=r.getViewLineMinColumn(this.model,o+1,s),l=r.getViewLineMaxColumn(this.model,o+1,s);t<a&&(t=a),t>l&&(t=l);const d=r.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new to(o+1,d)).equals(i)?new to(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new mr(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new to(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new mr(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,o=!1){const s=this.model.validatePosition(new to(e,t)),r=s.lineNumber,a=s.column;let l=r-1,d=!1;if(o)for(;l<this.modelLineProjections.length&&!this.modelLineProjections[l].isVisible();)l++,d=!0;else for(;l>0&&!this.modelLineProjections[l].isVisible();)l--,d=!0;if(0===l&&!this.modelLineProjections[l].isVisible())return new to(n?0:1,1);const c=1+this.projectedModelLineLineCounts.getPrefixSum(l);let h;return h=d?o?this.modelLineProjections[l].getViewPositionOfModelPosition(c,1,i):this.modelLineProjections[l].getViewPositionOfModelPosition(c,this.model.getLineMaxColumn(l+1),i):this.modelLineProjections[r-1].getViewPositionOfModelPosition(c,a,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return mr.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new mr(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!this.modelLineProjections[i].isVisible())return 1;const n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,o,s){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new mr(r.lineNumber,1,a.lineNumber,a.column),t,i,n,o,s);let l=[];const d=r.lineNumber-1,c=a.lineNumber-1;let h=null;for(let m=d;m<=c;m++)if(this.modelLineProjections[m].isVisible())null===h&&(h=new to(m+1,m===d?r.column:1));else if(null!==h){const e=this.model.getLineMaxColumn(m);l=l.concat(this.model.getDecorationsInRange(new mr(h.lineNumber,h.column,m,e),t,i,n,o)),h=null}null!==h&&(l=l.concat(this.model.getDecorationsInRange(new mr(h.lineNumber,h.column,a.lineNumber,a.column),t,i,n,o)),h=null),l.sort((e,t)=>{const i=mr.compareRangesUsingStarts(e.range,t.range);return 0===i?e.id<t.id?-1:e.id>t.id?1:0:i});const u=[];let g=0,p=null;for(const m of l){const e=m.id;p!==e&&(p=e,u[g++]=m)}return u}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}},Xk=class{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}},Jk=class{constructor(e,t){this.modelRange=e,this.viewLines=t}},eL=class{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}},tL=class{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Yk(this.model)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new Yx(t,i)}onModelLinesInserted(e,t,i,n){return new Qx(t,i)}onModelLineChanged(e,t,i){return[!1,new Zx(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,n=new Array(i);for(let o=0;o<i;o++)n[o]=0;return n}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){const t=this.model.tokenization.getLineTokens(e),i=t.getLineContent();return new tv(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){const n=this.model.getLineCount();e=Math.min(Math.max(1,e),n),t=Math.min(Math.max(1,t),n);const o=[];for(let s=e;s<=t;s++){const t=s-e;o[t]=i[t]?this.getViewLineData(s):null}return o}getDecorationsInRange(e,t,i,n,o,s){return this.model.getDecorationsInRange(e,t,i,n,o,s)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}},iL=Yr.Right,nL=class{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*iL/8))}reset(e){const t=Math.ceil((e+1)*iL/8);this.lanes.length<t?this.lanes=new Uint8Array(t):this.lanes.fill(0),this._requiredLanes=1}get requiredLanes(){return this._requiredLanes}push(e,t,i){i&&(this.persist|=1<<e-1);for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const t=iL*n+(e-1);this.lanes[t>>>3]|=1<<t%8,this._requiredLanes=Math.max(this._requiredLanes,this.countAtLine(n))}}getLanesAtLine(e){const t=[];let i=iL*e;for(let n=0;n<iL;n++)(this.persist&1<<n||this.lanes[i>>>3]&1<<i%8)&&t.push(n+1),i++;return t.length?t:[Yr.Center]}countAtLine(e){let t=iL*e,i=0;for(let n=0;n<iL;n++)(this.persist&1<<n||this.lanes[t>>>3]&1<<t%8)&&i++,t++;return i}},oL=class extends Ie{constructor(e,t,i,n,o,s,r,a,l,d){if(super(),this.languageConfigurationService=r,this._themeService=a,this._attachedView=l,this._transactionalTarget=d,this.hiddenAreasModel=new aL,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new ok,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Sr(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new ft(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=sL.create(this.model),this.glyphLanes=new nL(0),this.model.isTooLargeForTokenization())this._lines=new tL(this.model);else{const e=this._configuration.options,t=e.get(59),i=e.get(156),s=e.get(166),r=e.get(155),a=e.get(146),l=e.get(160);this._lines=new Qk(this._editorId,this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r,a,l)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new yk(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new Fk(this._configuration,this.getLineCount(),this._getCustomLineHeights(),s)),this._register(this.viewLayout.onDidScroll(e=>{e.scrollTopChanged&&this._handleVisibleLinesChanged(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new Jx(e)),this._eventDispatcher.emitOutgoingEvent(new dk(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(e=>{this._eventDispatcher.emitOutgoingEvent(e)})),this._decorations=new Vk(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(Tb.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new ik)})),this._register(this._themeService.onDidColorThemeChange(e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new ek(e))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_getCustomLineHeights(){return this._configuration.options.get(5)?this.model.getCustomLineHeightsDecorations(this._editorId).map(e=>{const t=e.range.startLineNumber,i=this.coordinatesConverter.convertModelRangeToViewRange(new mr(t,1,t,this.model.getLineMaxColumn(t)));return{decorationId:e.id,startLineNumber:i.startLineNumber,endLineNumber:i.endLineNumber,lineHeight:e.options.lineHeight||0}}):[]}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new mr(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new jx(e)),this._eventDispatcher.emitOutgoingEvent(new ak(!e,e))}setHasWidgetFocus(e){this._eventDispatcher.emitOutgoingEvent(new lk(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new Vx)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new Hx)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new to(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber));return new lL(this.coordinatesConverter.convertViewPositionToModelPosition(e),this._viewportStart.startLineDelta)}return new lL(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,o=n.get(59),s=n.get(156),r=n.get(166),a=n.get(155),l=n.get(146);this._lines.setWrappingSettings(o,s,r.wrappingColumn,a,l)&&(e.emitViewEvent(new qx),e.emitViewEvent(new Gx),e.emitViewEvent(new Kx(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(104)&&(this._decorations.reset(),e.emitViewEvent(new Kx(null))),t.hasChanged(112)&&(this._decorations.reset(),e.emitViewEvent(new Kx(null))),e.emitViewEvent(new zx(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),Sr.shouldRecreate(t)&&(this.cursorConfig=new Sr(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const o=e instanceof KC?e.rawContentChangedEvent.changes:e.changes,s=e instanceof KC?e.rawContentChangedEvent.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of o)switch(e.changeType){case 4:for(let t=0;t<e.detail.length;t++){const i=e.detail[t];let n=e.injectedTexts[t];n&&(n=n.filter(e=>!e.ownerId||e.ownerId===this._editorId)),r.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter(e=>!e.ownerId||e.ownerId===this._editorId)),r.addRequest(e.detail,t,null);break}}const a=new Pi(r.finalize());for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new qx),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(s,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=a.takeCount(e.detail.length),o=this._lines.onModelLinesInserted(s,e.fromLineNumber,e.toLineNumber,n);null!==o&&(t.emitViewEvent(o),this.viewLayout.onLinesInserted(o.fromLineNumber,o.toLineNumber)),i=!0;break}case 2:{const i=a.dequeue(),[o,r,l,d]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),l&&(t.emitViewEvent(l),this.viewLayout.onLinesInserted(l.fromLineNumber,l.toLineNumber)),d&&(t.emitViewEvent(d),this.viewLayout.onLinesDeleted(d.fromLineNumber,d.toLineNumber));break}}null!==s&&this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new Gx),t.emitViewEvent(new Kx(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();e instanceof KC&&t.emitOutgoingEvent(new _k(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._configuration.options.get(5)&&this._register(this.model.onDidChangeLineHeight(e=>{const t=e.changes.filter(e=>e.ownerId===this._editorId||0===e.ownerId);if(this.viewLayout.changeSpecialLineHeights(e=>{for(const i of t){const{decorationId:t,lineNumber:n,lineHeight:o}=i,s=this.coordinatesConverter.convertModelRangeToViewRange(new mr(n,1,n,this.model.getLineMaxColumn(n)));null!==o?e.insertOrChangeCustomLineHeight(t,s.startLineNumber,s.endLineNumber,o):e.removeCustomLineHeight(t)}}),t.length>0){const e=new zC(t);this._eventDispatcher.emitOutgoingEvent(new wk(e))}})),this._configuration.options.get(172)&&this._register(this.model.onDidChangeFont(e=>{const t=e.changes.filter(e=>e.ownerId===this._editorId||0===e.ownerId);if(t.length>0){const e=new UC(t);this._eventDispatcher.emitOutgoingEvent(new Ck(e))}})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,n=e.ranges.length;i<n;i++){const n=e.ranges[i];t[i]={fromLineNumber:this.coordinatesConverter.convertModelPositionToViewPosition(new to(n.fromLineNumber,1)).lineNumber,toLineNumber:this.coordinatesConverter.convertModelPositionToViewPosition(new to(n.toLineNumber,this.model.getLineMaxColumn(n.toLineNumber))).lineNumber}}this._eventDispatcher.emitSingleViewEvent(new tk(t)),this._eventDispatcher.emitOutgoingEvent(new vk(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new $x),this.cursorConfig=new Sr(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new fk(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Sr(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new mk(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new qx),e.emitViewEvent(new Gx),e.emitViewEvent(new Kx(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Sr(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new bk(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Kx(e)),this._eventDispatcher.emitOutgoingEvent(new pk(e))}))}getFontSizeAtPosition(e){if(!this._configuration.options.get(172))return null;const t=this.model.getFontDecorationsInRange(mr.fromPositions(e),this._editorId);let i=this._configuration.options.get(59).fontSize+"px";for(const n of t)if(n.options.fontSize){i=n.options.fontSize;break}return i}setHiddenAreas(e,t,i){this.hiddenAreasModel.setHiddenAreas(t,e);const n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas&&!i)return;this.previousHiddenAreas=n;const o=this._captureStableViewport();let s=!1;try{const e=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(n),s&&(e.emitViewEvent(new qx),e.emitViewEvent(new Gx),e.emitViewEvent(new Kx(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this.viewLayout.onHeightMaybeChanged());const t=o.viewportStartModelPosition?.lineNumber;t&&n.some(e=>e.startLineNumber<=t&&t<=e.endLineNumber)||o.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new hk)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(165),t=this._configuration.options.get(75),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),o=Math.max(1,n.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new mr(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];const n=[];let o=0,s=t.startLineNumber,r=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let d=0,c=i.length;d<c;d++){const e=i[d].startLineNumber,t=i[d].endLineNumber;t<s||e>a||(s<e&&(n[o++]=new mr(s,r,e-1,this.model.getLineMaxColumn(e-1))),s=t+1,r=1)}return(s<a||s===a&&r<l)&&(n[o++]=new mr(s,r,a,l)),n}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new mr(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new mr(i,this.getLineMinColumn(i),n,this.getLineMaxColumn(n))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),n=this.coordinatesConverter.convertViewPositionToModelPosition(new to(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:o}}reduceRestoreState(e){if(void 0===e.firstPosition)return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=jle(this.getLineContent(e));return-1===t?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Gle(this.getLineContent(e));return-1===t?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}_getTextDirection(e,t){let i=0;for(const n of t){const t=n.range;if(t.startLineNumber>e||t.endLineNumber<e)continue;const o=n.options.textDirection;o===Qr.RTL?i++:o===Qr.LTR&&i--}return i>0?Qr.RTL:Qr.LTR}getTextDirection(e){const t=this._decorations.getDecorationsOnLine(e);return this._getTextDirection(e,t.decorations)}getViewportViewLineRenderingData(e,t){const i=this._decorations.getDecorationsViewportData(e),n=i.inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,n,i.hasVariableFonts,i.decorations)}getViewLineRenderingData(e){const t=this._decorations.getDecorationsOnLine(e);return this._getViewLineRenderingData(e,t.inlineDecorations[0],t.hasVariableFonts,t.decorations)}_getViewLineRenderingData(e,t,i,n){const o=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),r=this.getTabSize(),a=this._lines.getViewLineData(e);return a.inlineDecorations&&(t=[...t,...a.inlineDecorations.map(t=>t.toInlineDecoration(e))]),new iv(a.minColumn,a.maxColumn,a.content,a.continuesWithWrappedLine,o,s,a.tokens,t,r,a.startVisibleColumn,this._getTextDirection(e,n),i)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new ev(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,Gge(this._configuration.options),Zge(this._configuration.options)),i=new rL;for(const n of t){const t=n.options,o=t.overviewRuler;if(!o)continue;const s=o.position;if(0===s)continue;const r=o.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(r,t.zIndex,a,l,s)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e)t.options.overviewRuler?.invalidateCachedColor(),t.options.minimap?.invalidateCachedColor()}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const o=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(o)}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(mr.compareRangesUsingStarts);let o=!1,s=!1;for(const a of e)a.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const i=e.map(e=>e.startLineNumber);let o="";for(let e=0;e<i.length;e++)e>0&&i[e-1]===i[e]||(o+=this.model.getLineContent(i[e])+n);return o}if(o&&t){const t=[];let n=0;for(const o of e){const e=o.startLineNumber;o.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(o,i?2:0)),n=e}return 1===t.length?t[0]:t}const r=[];for(const a of e)a.isEmpty()||r.push(this.model.getValueInRange(a,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if("plaintext"===i)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new mr(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(59),s=this._getColorMap();let r;return/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===vd.fontFamily?r=vd.fontFamily:(r=o.fontFamily,r=r.replace(/"/g,"'"),/[,']/.test(r)||/[+ ]/.test(r)&&(r=`'${r}'`),r=`${r}, ${vd.fontFamily}`),{mode:i,html:`<div style="color: ${s[1]};background-color: ${s[2]};font-family: ${r};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,s)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=this.getTabSize();let a="";for(let l=i;l<=o;l++){const e=this.model.tokenization.getLineTokens(l),d=e.getLineContent(),c=l===i?n-1:0,h=l===o?s-1:d.length;a+=""===d?"<br>":O_e(d,e.inflate(),t,c,h,r,P)}return a}_getColorMap(){const e=Mb.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=eh.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new gk):this._withViewEventsCollector(e)}executeEdits(e,t,i,n){this._executeCursorEdit(o=>this._cursor.executeEdits(o,e,t,i,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,o){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new mr(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new Xx(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new mr(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new Xx(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(s=>s.emitViewEvent(new Xx(e,!1,i,null,n,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new nk),this._eventDispatcher.emitOutgoingEvent(new ck))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}})}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}},sL=class e{static create(t){return new e(t,1,!1,t._setTrackedRange(null,new mr(1,1,1,1),1),0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new to(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new mr(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=s-o}invalidate(){this._isValid=!1}},rL=class{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,o){const s=this._asMap[e];if(s){const e=s.data,t=e[e.length-3],r=e[e.length-1];if(t===o&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(o,i,n)}else{const s=new nv(e,t,[o,i,n]);this._asMap[e]=s,this.asArray.push(s)}}},aL=class{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&B_e(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((e,t)=>function(e,t){const i=[];let n=0,o=0;for(;n<e.length&&o<t.length;){const s=e[n],r=t[o];if(s.endLineNumber<r.startLineNumber-1)i.push(e[n++]);else if(r.endLineNumber<s.startLineNumber-1)i.push(t[o++]);else{const e=Math.min(s.startLineNumber,r.startLineNumber),t=Math.max(s.endLineNumber,r.endLineNumber);i.push(new mr(e,1,t,1)),n++,o++}}for(;n<e.length;)i.push(e[n++]);for(;o<t.length;)i.push(t[o++]);return i}(e,t),[]);return B_e(this.ranges,e)||(this.ranges=e),this.ranges}},lL=class{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;const i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),n=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:n+this.startLineDelta},1)}},dL=class{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}},hL=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},uL=function(e,t){return function(i,n){t(i,n,e)}},cL=class extends Ie{get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}get contextKeyService(){return this._contextKeyService}constructor(e,t,i,n,o,s,r,a,l,d,c,h){super(),this.languageConfigurationService=c,this._deliveryQueue=$e(),this._contributions=this._register(new $C),this._onDidDispose=this._register(new je),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeLineHeight=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeLineHeight=this._onDidChangeLineHeight.event,this._onDidChangeFont=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeFont=this._onDidChangeFont.event,this._onDidChangeModelTokens=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new bL(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new _L({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new _L({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new bL(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new bL(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new bL(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new bL(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new bL(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new bL(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new bL(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new bL(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new bL(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new bL(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new bL(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new bL(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new bL(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new bL(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new bL(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new bL(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new bL(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new je({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onWillTriggerEditorOperationEvent=this._register(new je),this._onBeginUpdate=this._register(new je),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new je),this.onEndUpdate=this._onEndUpdate.event,this._onBeforeExecuteEdit=this._register(new je),this.onBeforeExecuteEdit=this._onBeforeExecuteEdit.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),this.inComposition=!1,o.willCreateCodeEditor();const u={...t};if(this._domElement=e,this._overflowWidgetsDomNode=u.overflowWidgetsDomNode,delete u.overflowWidgetsDomNode,this._id=++mL,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,i.contextMenuId??(i.isSimpleWidget?ds.SimpleEditorContext:ds.EditorContext),u,d)),this._register(this._configuration.onDidChange(e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(165)){const e=t.get(165);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(r.createScoped(this._domElement)),i.contextKeyValues)for(const[m,f]of Object.entries(i.contextKeyValues))this._contextKeyService.createKey(m,f);let g;this._notificationService=l,this._codeEditorService=o,this._commandService=s,this._themeService=a,this._register(new vL(this,this._contextKeyService)),this._register(new wL(this,this._contextKeyService,h)),this._instantiationService=this._register(n.createChild(new dL([es,this._contextKeyService]))),this._modelData=null,this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={},g=Array.isArray(i.contributions)?i.contributions:dr.getEditorContributions(),this._contributions.initialize(this,g,this._instantiationService);for(const m of dr.getEditorActions()){if(this._actions.has(m.id)){$ae(new Error(`Cannot have two actions with the same id ${m.id}`));continue}const e=new GC(m.id,m.label,m.alias,m.metadata,m.precondition??void 0,e=>this._instantiationService.invokeFunction(t=>Promise.resolve(m.runEditorCommand(t,this,e))),this._contextKeyService);this._actions.set(e.id,e)}const p=()=>!this._configuration.options.get(104)&&this._configuration.options.get(43).enabled;this._register(new Vn(this._domElement,{onDragOver:e=>{if(!p())return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this.showDropIndicatorAt(t.position)},onDrop:async e=>{if(!p())return;if(this.removeDropIndicator(),!e.dataTransfer)return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this._onDropIntoEditor.fire({position:t.position,event:e})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n){return new Hc(e,t,i,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return ZC.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?jr.getWordAtPosition(this._modelData.model,this._configuration.options.get(148),this._configuration.options.get(147),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{this._beginUpdate();const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const i={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:t?.uri||null};this._onWillChangeModel.fire(i);const n=this.hasTextFocus(),o=this._detachModel();this._attachModel(t),this.hasModel()?n&&this.focus():(this._editorTextFocus.setValue(!1),this._editorWidgetFocus.setValue(!1)),this._removeDecorationTypes(),this._onDidChangeModel.fire(i),this._postDetachModelCleanup(o),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?gL._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?gL._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,n)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return-1;const i=this._modelData.model.getLineMaxColumn(e);return gL._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}getLineHeightForPosition(e){if(!this._modelData)return-1;const t=this._modelData.viewModel,i=t.coordinatesConverter,n=to.lift(e);if(i.modelPositionIsVisible(n)){const e=i.convertModelPositionToViewPosition(n);return t.viewLayout.getLineHeightForLineNumber(e.lineNumber)}return 0}setHiddenAreas(e,t,i){this._modelData?.viewModel.setHiddenAreas(e.map(e=>mr.lift(e)),t,i)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return br.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!to.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!mr.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new mr(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!to.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new mr(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=fr.isISelection(e),n=mr.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new fr(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new mr(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!mr.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(mr.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t<i;t++)if(!fr.isISelection(e[t]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!=typeof e)throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}hasPendingScrollAnimation(){return!!this._modelData&&this._modelData.viewModel.viewLayout.hasPendingScrollAnimation()}saveViewState(){if(!this._modelData)return null;const e=this._contributions.saveViewState();return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const e=t.cursorState;Array.isArray(e)?e.length>0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]),this._contributions.restoreViewState(t.contributionsState||{});const i=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(i)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(e=>e.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._onWillTriggerEditorOperationEvent.fire({source:e,handlerId:t,payload:i}),this._beginUpdate(),t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null,t.clipboardEvent)}case"cut":return void this._cut(e)}const n=this.getAction(t);if(n)return void Promise.resolve(n.run(i)).then(void 0,$ae);if(!this._modelData)return;if(this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this.inComposition=!0,this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this.inComposition=!1,this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,o,e)}_paste(e,t,i,n,o,s){if(!this._modelData)return;const r=this._modelData.viewModel,a=r.getSelection().getStartPosition();r.paste(t,i,n,e);const l=r.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({clipboardEvent:s,range:new mr(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=dr.getEditorCommand(t);return!!n&&(rle(i=i||{})&&(i.source=e),this._instantiationService.invokeFunction(e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,$ae)}),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&!this._configuration.options.get(104)&&(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!!this._modelData&&!this._configuration.options.get(104)&&(this._modelData.model.popStackElement(),!0)}edit(e,t){return this.executeEdits(t,e.replacements.map(e=>({range:e.range,text:e.text})),void 0)}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(104))return!1;let n,o,s;return n=i?Array.isArray(i)?()=>i:i:()=>null,e instanceof By?(s=e,o=e.metadata.source):(s=Vy.unknown({name:o}),o=e),this._onBeforeExecuteEdit.fire({source:o??void 0}),this._modelData.viewModel.executeEdits(o,t,n,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new CL(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){if(!this._modelData)return null;const t=this._configuration.options;return this._modelData.model.getLineDecorations(e,this._id,Gge(t),Zge(t))}getDecorationsInRange(e){if(!this._modelData)return null;const t=this._configuration.options;return this._modelData.model.getDecorationsInRange(e,this._id,Gge(t),Zge(t))}getFontSizeAtPosition(e){return this._modelData?this._modelData.viewModel.getFontSizeAtPosition(e):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(e=>e.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(165)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarPointerDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isFocused()}hasWidgetFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&this._modelData.view.isWidgetFocused()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const e=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options.get(165);return{top:gL._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+i.glyphMarginWidth+i.lineNumbersWidth+i.decorationsWidth-this.getScrollLeft(),height:this.getLineHeightForPosition(t)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Wge(e,this._configuration.options.get(59))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e)return void(this._modelData=null);const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),n=new oL(this._id,this._configuration,e,jC.create(pn(this._domElement)),Rx.create(this._configuration.options),e=>In(pn(this._domElement),e),this.languageConfigurationService,this._themeService,i,{batchChanges:e=>{try{return this._beginUpdate(),e()}finally{this._endUpdate()}}});t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._editorWidgetFocus.setValue(t.hasFocus);break;case 3:this._onDidScrollChange.fire(t);break;case 4:this._onDidChangeViewZones.fire();break;case 5:this._onDidChangeHiddenAreas.fire();break;case 6:this._onDidAttemptReadOnlyEdit.fire();break;case 7:{if(t.reachedMaxCursorCount){const e=Vae(83,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",this.getOption(89));this._notificationService.prompt(Qv.Warning,e,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:Vae(84,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const e=[];for(let o=0,s=t.selections.length;o<s;o++)e[o]=t.selections[o].getPosition();const i={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(i);const n={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(n);break}case 8:this._onDidChangeModelDecorations.fire(t.event);break;case 9:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t.event);break;case 10:this._onDidChangeModelLanguageConfiguration.fire(t.event);break;case 11:this._onDidChangeModelContent.fire(t.event);break;case 12:this._onDidChangeModelOptions.fire(t.event);break;case 13:this._onDidChangeModelTokens.fire(t.event);break;case 14:this._onDidChangeLineHeight.fire(t.event);break;case 15:this._onDidChangeFont.fire(t.event)}}));const[o,s]=this._createView(n);if(s){this._domElement.appendChild(o.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];o.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];o.addOverlayWidget(this._overlayWidgets[i])}t=Object.keys(this._glyphMarginWidgets);for(let e=0,i=t.length;e<i;e++){const i=t[e];o.addGlyphMarginWidget(this._glyphMarginWidgets[i])}o.render(!1,!0),o.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new fL(e,n,o,s,t,i)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,i,n)=>{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const o={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",o)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const o={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",o)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new mf(e.coordinatesConverter);return i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e),[new DC(this._domElement,this.getId(),t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(e){const t=[{range:new mr(e.lineNumber,e.column,e.lineNumber,e.column),options:gL.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}_beginUpdate(){this._updateCounter++,1===this._updateCounter&&this._onBeginUpdate.fire()}_endUpdate(){this._updateCounter--,0===this._updateCounter&&this._onEndUpdate.fire()}},gL=cL,cL.dropIntoEditorDecorationOptions=Lx.register({description:"workbench-dnd-target",className:"dnd-target"}),pL=cL,pL=gL=hL([uL(3,Jn),uL(4,eo),uL(5,fo),uL(6,es),uL(7,Sf),uL(8,Xv),uL(9,Fc),uL(10,il),uL(11,Tx)],pL),mL=0,fL=class{constructor(e,t,i,n,o,s){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o,this.attachedView=s}dispose(){kle(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},_L=class extends Ie{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new je(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new je(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}},bL=class extends je{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}},vL=class extends Ie{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=jl.editorSimpleInput.bindTo(t),this._editorFocus=jl.focus.bindTo(t),this._textInputFocus=jl.textInputFocus.bindTo(t),this._editorTextFocus=jl.editorTextFocus.bindTo(t),this._tabMovesFocus=jl.tabMovesFocus.bindTo(t),this._editorReadonly=jl.readOnly.bindTo(t),this._inDiffEditor=jl.inDiffEditor.bindTo(t),this._editorColumnSelection=jl.columnSelection.bindTo(t),this._hasMultipleSelections=jl.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=jl.hasNonEmptySelection.bindTo(t),this._canUndo=jl.canUndo.bindTo(t),this._canRedo=jl.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(Pc.onDidChangeTabFocus(e=>this._tabMovesFocus.set(e))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(e.get(164)||Pc.getTabFocusMode()),this._editorReadonly.set(e.get(104)),this._inDiffEditor.set(e.get(70)),this._editorColumnSelection.set(e.get(28))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(e=>!e.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}},wL=class extends Ie{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=jl.languageId.bindTo(t),this._hasCompletionItemProvider=jl.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=jl.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=jl.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=jl.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=jl.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=jl.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=jl.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=jl.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=jl.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=jl.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=jl.hasReferenceProvider.bindTo(t),this._hasRenameProvider=jl.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=jl.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=jl.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=jl.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=jl.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=jl.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=jl.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=jl.isInEmbeddedEditor.bindTo(t);const n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){const e=this._editor.getModel();e?this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===yi.walkThroughSnippet||e.uri.scheme===yi.vscodeChatCodeBlock)}):this.reset()}},CL=class{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(i=>{this._isChangingDecorations||e.call(t,i)},i)}getRange(e){return this._editor.hasModel()?e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e]):null}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const n=e.getDecorationRange(i);n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){0!==this._decorationIds.length&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}},yL=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),SL=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>"),xL=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),kL=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>'),Upe((e,t)=>{const i=e.getColor(kh);i&&(t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${V_e(i)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-error-decoration: url("data:image/svg+xml,${V_e(i)}"); }`));const n=e.getColor(Ih);n&&(t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${V_e(n)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-warning-decoration: url("data:image/svg+xml,${V_e(n)}"); }`));const o=e.getColor(Eh);o&&(t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${V_e(o)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-info-decoration: url("data:image/svg+xml,${V_e(o)}"); }`));const s=e.getColor(Th);s&&(t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${H_e(s)}") no-repeat bottom left; }`),t.addRule(`:root { --monaco-editor-hint-decoration: url("data:image/svg+xml,${H_e(s)}"); }`));const r=e.getColor(t_);r&&(t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`),t.addRule(`:root { --monaco-editor-unnecessary-decoration-opacity: ${r.rgba.a}; }`))}),LL=class extends Qi{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}},NL=eue("accessibilitySignalService"),(DL=EL=class e{static register(t){return new e(t.fileName)}constructor(e){this.fileName=e}}).error=DL.register({fileName:"error.mp3"}),DL.warning=DL.register({fileName:"warning.mp3"}),DL.success=DL.register({fileName:"success.mp3"}),DL.foldedArea=DL.register({fileName:"foldedAreas.mp3"}),DL.break=DL.register({fileName:"break.mp3"}),DL.quickFixes=DL.register({fileName:"quickFixes.mp3"}),DL.taskCompleted=DL.register({fileName:"taskCompleted.mp3"}),DL.taskFailed=DL.register({fileName:"taskFailed.mp3"}),DL.terminalBell=DL.register({fileName:"terminalBell.mp3"}),DL.diffLineInserted=DL.register({fileName:"diffLineInserted.mp3"}),DL.diffLineDeleted=DL.register({fileName:"diffLineDeleted.mp3"}),DL.diffLineModified=DL.register({fileName:"diffLineModified.mp3"}),DL.requestSent=DL.register({fileName:"requestSent.mp3"}),DL.responseReceived1=DL.register({fileName:"responseReceived1.mp3"}),DL.responseReceived2=DL.register({fileName:"responseReceived2.mp3"}),DL.responseReceived3=DL.register({fileName:"responseReceived3.mp3"}),DL.responseReceived4=DL.register({fileName:"responseReceived4.mp3"}),DL.clear=DL.register({fileName:"clear.mp3"}),DL.save=DL.register({fileName:"save.mp3"}),DL.format=DL.register({fileName:"format.mp3"}),DL.voiceRecordingStarted=DL.register({fileName:"voiceRecordingStarted.mp3"}),DL.voiceRecordingStopped=DL.register({fileName:"voiceRecordingStopped.mp3"}),DL.progress=DL.register({fileName:"progress.mp3"}),DL.chatEditModifiedFile=DL.register({fileName:"chatEditModifiedFile.mp3"}),DL.editsKept=DL.register({fileName:"editsKept.mp3"}),DL.editsUndone=DL.register({fileName:"editsUndone.mp3"}),DL.nextEditSuggestion=DL.register({fileName:"nextEditSuggestion.mp3"}),DL.terminalCommandSucceeded=DL.register({fileName:"terminalCommandSucceeded.mp3"}),DL.chatUserActionRequired=DL.register({fileName:"chatUserActionRequired.mp3"}),DL.codeActionTriggered=DL.register({fileName:"codeActionTriggered.mp3"}),DL.codeActionApplied=DL.register({fileName:"codeActionApplied.mp3"}),ML=class{constructor(e){this.randomOneOf=e}},(IL=TL=class e{constructor(e,t,i,n,o,s,r=!1){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=s,this.managesOwnEnablement=r}static register(t){const i=new e(new ML("randomOneOf"in t.sound?t.sound.randomOneOf:[t.sound]),t.name,t.legacySoundSettingsKey,t.settingsKey,t.legacyAnnouncementSettingsKey,t.announcementMessage,t.managesOwnEnablement);return e._signals.add(i),i}})._signals=new Set,IL.errorAtPosition=IL.register({name:Vae(1576,"Error at Position"),sound:EL.error,announcementMessage:Vae(1577,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),IL.warningAtPosition=IL.register({name:Vae(1578,"Warning at Position"),sound:EL.warning,announcementMessage:Vae(1579,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),IL.errorOnLine=IL.register({name:Vae(1580,"Error on Line"),sound:EL.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:Vae(1581,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),IL.warningOnLine=IL.register({name:Vae(1582,"Warning on Line"),sound:EL.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:Vae(1583,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),IL.foldedArea=IL.register({name:Vae(1584,"Folded Area on Line"),sound:EL.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:Vae(1585,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),IL.break=IL.register({name:Vae(1586,"Breakpoint on Line"),sound:EL.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:Vae(1587,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),IL.inlineSuggestion=IL.register({name:Vae(1588,"Inline Suggestion on Line"),sound:EL.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),IL.nextEditSuggestion=IL.register({name:Vae(1589,"Next Edit Suggestion on Line"),sound:EL.nextEditSuggestion,legacySoundSettingsKey:"audioCues.nextEditSuggestion",settingsKey:"accessibility.signals.nextEditSuggestion",announcementMessage:Vae(1590,"Next Edit Suggestion")}),IL.terminalQuickFix=IL.register({name:Vae(1591,"Terminal Quick Fix"),sound:EL.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:Vae(1592,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),IL.onDebugBreak=IL.register({name:Vae(1593,"Debugger Stopped on Breakpoint"),sound:EL.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:Vae(1594,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),IL.noInlayHints=IL.register({name:Vae(1595,"No Inlay Hints on Line"),sound:EL.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:Vae(1596,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),IL.taskCompleted=IL.register({name:Vae(1597,"Task Completed"),sound:EL.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:Vae(1598,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),IL.taskFailed=IL.register({name:Vae(1599,"Task Failed"),sound:EL.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:Vae(1600,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),IL.terminalCommandFailed=IL.register({name:Vae(1601,"Terminal Command Failed"),sound:EL.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:Vae(1602,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),IL.terminalCommandSucceeded=IL.register({name:Vae(1603,"Terminal Command Succeeded"),sound:EL.terminalCommandSucceeded,announcementMessage:Vae(1604,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),IL.terminalBell=IL.register({name:Vae(1605,"Terminal Bell"),sound:EL.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:Vae(1606,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),IL.notebookCellCompleted=IL.register({name:Vae(1607,"Notebook Cell Completed"),sound:EL.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:Vae(1608,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),IL.notebookCellFailed=IL.register({name:Vae(1609,"Notebook Cell Failed"),sound:EL.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:Vae(1610,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),IL.diffLineInserted=IL.register({name:Vae(1611,"Diff Line Inserted"),sound:EL.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),IL.diffLineDeleted=IL.register({name:Vae(1612,"Diff Line Deleted"),sound:EL.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),IL.diffLineModified=IL.register({name:Vae(1613,"Diff Line Modified"),sound:EL.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),IL.chatEditModifiedFile=IL.register({name:Vae(1614,"Chat Edit Modified File"),sound:EL.chatEditModifiedFile,announcementMessage:Vae(1615,"File Modified from Chat Edits"),settingsKey:"accessibility.signals.chatEditModifiedFile"}),IL.chatRequestSent=IL.register({name:Vae(1616,"Chat Request Sent"),sound:EL.requestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:Vae(1617,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),IL.chatResponseReceived=IL.register({name:Vae(1618,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[EL.responseReceived1,EL.responseReceived2,EL.responseReceived3,EL.responseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),IL.codeActionTriggered=IL.register({name:Vae(1619,"Code Action Request Triggered"),sound:EL.codeActionTriggered,legacySoundSettingsKey:"audioCues.codeActionRequestTriggered",legacyAnnouncementSettingsKey:"accessibility.alert.codeActionRequestTriggered",announcementMessage:Vae(1620,"Code Action Request Triggered"),settingsKey:"accessibility.signals.codeActionTriggered"}),IL.codeActionApplied=IL.register({name:Vae(1621,"Code Action Applied"),legacySoundSettingsKey:"audioCues.codeActionApplied",sound:EL.codeActionApplied,settingsKey:"accessibility.signals.codeActionApplied"}),IL.progress=IL.register({name:Vae(1622,"Progress"),sound:EL.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:Vae(1623,"Progress"),settingsKey:"accessibility.signals.progress"}),IL.clear=IL.register({name:Vae(1624,"Clear"),sound:EL.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:Vae(1625,"Clear"),settingsKey:"accessibility.signals.clear"}),IL.save=IL.register({name:Vae(1626,"Save"),sound:EL.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:Vae(1627,"Save"),settingsKey:"accessibility.signals.save"}),IL.format=IL.register({name:Vae(1628,"Format"),sound:EL.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:Vae(1629,"Format"),settingsKey:"accessibility.signals.format"}),IL.voiceRecordingStarted=IL.register({name:Vae(1630,"Voice Recording Started"),sound:EL.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),IL.voiceRecordingStopped=IL.register({name:Vae(1631,"Voice Recording Stopped"),sound:EL.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"}),IL.editsKept=IL.register({name:Vae(1632,"Edits Kept"),sound:EL.editsKept,announcementMessage:Vae(1633,"Edits Kept"),settingsKey:"accessibility.signals.editsKept"}),IL.editsUndone=IL.register({name:Vae(1634,"Undo Edits"),sound:EL.editsUndone,announcementMessage:Vae(1635,"Edits Undone"),settingsKey:"accessibility.signals.editsUndone"}),IL.chatUserActionRequired=IL.register({name:Vae(1636,"Chat User Action Required"),sound:EL.chatUserActionRequired,announcementMessage:Vae(1637,"Chat User Action Required"),settingsKey:"accessibility.signals.chatUserActionRequired",managesOwnEnablement:!0}),RL=eue("progressService"),(OL=class{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}).None=Object.freeze({report(){}}),AL=eue("editorProgressService"),PL=class e{static capture(t){if(0===t.getScrollTop()||t.hasPendingScrollAnimation())return new e(t.getScrollTop(),t.getContentHeight(),null,0,null);let i=null,n=0;const o=t.getVisibleRanges();if(o.length>0){i=o[0].getStartPosition();const e=t.getTopForPosition(i.lineNumber,i.column);n=t.getScrollTop()-e}return new e(t.getScrollTop(),t.getContentHeight(),i,n,t.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=o}restore(e){if((this._initialContentHeight!==e.getContentHeight()||this._initialScrollTop!==e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,1)}},FL={RESOURCES:"ResourceURLs",TEXT:Na.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},WL=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}}),BL=new Nt(()=>WL("mouse",!1)),VL=new Nt(()=>WL("element",!1)),HL=class{constructor(){this._parts=[]}push(...e){this._parts.push(...e)}join(e="\n"){return this._parts.join(e)}},zL=0,UL=new Uint32Array(10),KL=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),qL=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),jL=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),$L=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),obe.bind(void 0,!1),GL=obe.bind(void 0,!0),ZL=new Set,"()[]{}<>`'\"-/;:,.?!".split("").forEach(e=>ZL.add(e.charCodeAt(0))),YL=new Map,QL=nbe(GL,vbe,sbe),XL=nbe(GL,vbe,rbe),JL=new Ls(1e4),tD=Ibe(2*(eD=128)),iD=Ibe(2*eD),nD=Dbe(),oD=Dbe(),sD=Dbe(),function(e){e.Default=[-100,0],e.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}}(rD||(rD={})),(aD=class{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}).default={boostFullMatch:!0,firstMatchCanBeWeak:!1},lD="$(",dD=new RegExp(`\\$\\(${mo.iconNameExpression}(?:${mo.iconModifierExpression})?\\)`,"g"),cD=new RegExp(`(\\\\)?${dD.source}`,"g"),hD=new RegExp(`\\\\${dD.source}`,"g"),uD=new RegExp(`(\\s)?(\\\\)?${dD.source}(\\s)?`,"g"),gD=new RegExp(`\\$\\(${mo.iconNameCharacter}+\\)`,"g"),pD=class{constructor(e="",t=!1){if(this.value=e,"string"!=typeof this.value)throw Qae("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1,this.supportAlertSyntax=t.supportAlertSyntax??!1)}appendText(e,t=0){return this.value+=function(e){return e.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}(this.supportThemeIcons?function(e){return e.replace(cD,(e,t)=>t?e:`\\${e}`)}(e):e).replace(/([ \t]+)/g,(e,t)=>"&nbsp;".repeat(t.length)).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`\n${function(e,t){const i=e.match(/^`+/gm)?.reduce((e,t)=>e.length>t.length?e:t).length??0,n=i>=3?i+1:3;return[`${"`".repeat(n)}${t}`,e,`${"`".repeat(n)}`].join("\n")}(t,e)}\n`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Ble(t),"g");return e.replace(i,(t,i)=>"\\"!==e.charAt(i-1)?`\\${t}`:t)}},fD=new(mD=class{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}})("id#"),_D={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null},bD=/[&<>"']/,vD=new RegExp(bD.source,"g"),wD=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,CD=new RegExp(wD.source,"g"),yD={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},SD=e=>yD[e],xD=/(^|[^\[])\^/g,kD={exec:()=>null},LD=class{constructor(e){n(this,"options",void 0),n(this,"rules",void 0),n(this,"lexer",void 0),this.options=e||_D}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Qbe(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],i=function(e,t){const i=e.match(/^(\s+)(?:```)/);if(null===i)return t;const n=i[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[i]=t;return i.length>=n.length?e.slice(n.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Qbe(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Qbe(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=Qbe(t[0],"\n").split("\n"),i="",n="";const o=[];for(;e.length>0;){let t=!1;const s=[];let r;for(r=0;r<e.length;r++)if(/^ {0,3}>/.test(e[r]))s.push(e[r]),t=!0;else{if(t)break;s.push(e[r])}e=e.slice(r);const a=s.join("\n"),l=a.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1").replace(/^ {0,3}>[ \t]?/gm,"");i=i?`${i}\n${a}`:a,n=n?`${n}\n${l}`:l;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=d,0===e.length)break;const c=o[o.length-1];if("code"===c?.type)break;if("blockquote"===c?.type){const t=c,s=t.raw+"\n"+e.join("\n"),r=this.blockquote(s);o[o.length-1]=r,i=i.substring(0,i.length-t.raw.length)+r.raw,n=n.substring(0,n.length-t.text.length)+r.text;break}if("list"===c?.type){const t=c,s=t.raw+"\n"+e.join("\n"),r=this.list(s);o[o.length-1]=r,i=i.substring(0,i.length-c.raw.length)+r.raw,n=n.substring(0,n.length-t.raw.length)+r.raw,e=s.substring(o[o.length-1].raw.length).split("\n");continue}}return{type:"blockquote",raw:i,tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim();const n=i.length>1,o={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");const s=new RegExp(`^( {0,3}${i})((?:[\t ][^\\n]*)?(?:\\n|$))`);let r=!1;for(;e;){let i=!1,n="",a="";if(!(t=s.exec(e)))break;if(this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let l=t[2].split("\n",1)[0].replace(/^\t+/,e=>" ".repeat(3*e.length)),d=e.split("\n",1)[0],c=!l.trim(),h=0;if(this.options.pedantic?(h=2,a=l.trimStart()):c?h=t[1].length+1:(h=t[2].search(/[^ ]/),h=h>4?1:h,a=l.slice(h),h+=t[1].length),c&&/^ *$/.test(d)&&(n+=d+"\n",e=e.substring(d.length+1),i=!0),!i){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),i=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),s=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const r=e.split("\n",1)[0];if(d=r,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),o.test(d))break;if(s.test(d))break;if(t.test(d))break;if(i.test(e))break;if(d.search(/[^ ]/)>=h||!d.trim())a+="\n"+d.slice(h);else{if(c)break;if(l.search(/[^ ]/)>=4)break;if(o.test(l))break;if(s.test(l))break;if(i.test(l))break;a+="\n"+d}c||d.trim()||(c=!0),n+=r+"\n",e=e.substring(r.length+1),l=d.slice(h)}}o.loose||(r?o.loose=!0:/\n *\n *$/.test(n)&&(r=!0));let u,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(a),g&&(u="[ ] "!==g[0],a=a.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:n,task:!!g,checked:u,loose:!1,text:a,tokens:[]}),o.raw+=n}o.items[o.items.length-1].raw=o.items[o.items.length-1].raw.trimEnd(),o.items[o.items.length-1].text=o.items[o.items.length-1].text.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter(e=>"space"===e.type);o.loose=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw))}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:n}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const i=Ybe(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(i.length===n.length){for(const e of n)/^ *-+: *$/.test(e)?s.align.push("right"):/^ *:-+: *$/.test(e)?s.align.push("center"):/^ *:-+ *$/.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<i.length;e++)s.header.push({text:i[e],tokens:this.lexer.inline(i[e]),header:!0,align:s.align[e]});for(const e of o)s.rows.push(Ybe(e,s.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]})));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:$be(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Qbe(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let i=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if(e[n]===t[0])i++;else if(e[n]===t[1]&&(i--,i<0))return n;return-1}(t[2],"()");if(e>-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e&&(i=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(i=this.options.pedantic&&!/>$/.test(e)?i.slice(1):i.slice(1,-1)),Xbe(t,{href:i?i.replace(this.rules.inline.anyPunctuation,"$1"):i,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){const e=t[(i[2]||i[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return Xbe(i,e,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(n&&(!n[3]||!i.match(/[\p{L}\p{N}]/u))&&(!n[1]&&!n[2]||!i||this.rules.inline.punctuation.exec(i))){const i=[...n[0]].length-1;let o,s,r=i,a=0;const l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!=(n=l.exec(t));){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(s=[...o].length,n[3]||n[4]){r+=s;continue}if((n[5]||n[6])&&i%3&&!((i+s)%3)){a+=s;continue}if(r-=s,r>0)continue;s=Math.min(s,s+r+a);const t=[...n[0]][0].length,l=e.slice(0,i+n.index+t+s);if(Math.min(i,s)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const d=l.slice(2,-2);return{type:"strong",raw:l,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const i=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return i&&n&&(e=e.substring(1,e.length-1)),e=$be(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,i;return"@"===t[2]?(e=$be(t[1]),i="mailto:"+e):(e=$be(t[1]),i=e),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,i;if("@"===t[2])e=$be(t[0]),i="mailto:"+e;else{let n;do{n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(n!==t[0]);e=$be(t[0]),i="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:$be(t[0]),{type:"text",raw:t[0],text:e}}}},DD=/^(?: *(?:\n|$))+/,ID=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,ND=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ED=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,MD=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,TD=/(?:[*+-]|\d{1,9}[.)])/,RD=Gbe(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,TD).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),OD=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,AD=/^[^\n]+/,PD=/(?!\s*\])(?:\\.|[^\[\]\\])+/,FD=Gbe(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",PD).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),WD=Gbe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,TD).getRegex(),BD="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",VD=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,HD=Gbe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",VD).replace("tag",BD).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),zD=Gbe(OD).replace("hr",ED).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",BD).getRegex(),UD={blockquote:Gbe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",zD).getRegex(),code:ID,def:FD,fences:ND,heading:MD,hr:ED,html:HD,lheading:RD,list:WD,newline:DD,paragraph:zD,table:kD,text:AD},KD=Gbe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ED).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",BD).getRegex(),qD={...UD,table:KD,paragraph:Gbe(OD).replace("hr",ED).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",KD).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",BD).getRegex()},jD={...UD,html:Gbe("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",VD).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:kD,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Gbe(OD).replace("hr",ED).replace("heading"," *#{1,6} *[^\n]").replace("lheading",RD).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},$D=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,GD=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ZD=/^( {2,}|\\)\n(?!\s*$)/,YD=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,QD="\\p{P}\\p{S}",XD=Gbe(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,QD).getRegex(),JD=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,eI=Gbe(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,QD).getRegex(),tI=Gbe("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,QD).getRegex(),iI=Gbe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,QD).getRegex(),nI=Gbe(/\\([punct])/,"gu").replace(/punct/g,QD).getRegex(),oI=Gbe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),sI=Gbe(VD).replace("(?:--\x3e|$)","--\x3e").getRegex(),rI=Gbe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",sI).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),aI=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,lI=Gbe(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",aI).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),dI=Gbe(/^!?\[(label)\]\[(ref)\]/).replace("label",aI).replace("ref",PD).getRegex(),cI=Gbe(/^!?\[(ref)\](?:\[\])?/).replace("ref",PD).getRegex(),hI={_backpedal:kD,anyPunctuation:nI,autolink:oI,blockSkip:JD,br:ZD,code:GD,del:kD,emStrongLDelim:eI,emStrongRDelimAst:tI,emStrongRDelimUnd:iI,escape:$D,link:lI,nolink:cI,punctuation:XD,reflink:dI,reflinkSearch:Gbe("reflink|nolink(?!\\()","g").replace("reflink",dI).replace("nolink",cI).getRegex(),tag:rI,text:YD,url:kD},uI={...hI,link:Gbe(/^!?\[(label)\]\((.*?)\)/).replace("label",aI).getRegex(),reflink:Gbe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",aI).getRegex()},gI={...hI,escape:Gbe($D).replace("])","~|])").getRegex(),url:Gbe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},pI={...gI,br:Gbe(ZD).replace("{2,}","*").getRegex(),text:Gbe(gI.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},mI={normal:UD,gfm:qD,pedantic:jD},fI={normal:hI,gfm:gI,breaks:pI,pedantic:uI},_I=class e{constructor(e){n(this,"tokens",void 0),n(this,"options",void 0),n(this,"state",void 0),n(this,"tokenizer",void 0),n(this,"inlineQueue",void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_D,this.options.tokenizer=this.options.tokenizer||new LD,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:mI.normal,inline:fI.normal};this.options.pedantic?(t.block=mI.pedantic,t.inline=fI.pedantic):this.options.gfm&&(t.block=mI.gfm,this.options.breaks?t.inline=fI.breaks:t.inline=fI.gfm),this.tokenizer.rules=t}static get rules(){return{block:mI,inline:fI}}static lex(t,i){return new e(i).lex(t)}static lexInline(t,i){return new e(i).inlineTokens(t)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){let n,o,s;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(e,t,i)=>t+" ".repeat(i.length));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(i=>!!(n=i.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?t.push(n):(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(o.raw+="\n"+n.raw,o.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(s=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startBlock.forEach(e=>{n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s)))o=t[t.length-1],i&&"paragraph"===o?.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n),i=s.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===o.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let i,n,o,s,r,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,s.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(r||(a=""),r=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,l,a))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startInline.forEach(e=>{n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(i=this.tokenizer.inlineText(o))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(a=i.raw.slice(-1)),r=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(i.raw.length),t.push(i);return t}},bI=class{constructor(e){n(this,"options",void 0),n(this,"parser",void 0),this.options=e||_D}space(e){return""}code({text:e,lang:t,escaped:i}){const n=(t||"").match(/^\S*/)?.[0],o=e.replace(/\n$/,"")+"\n";return n?'<pre><code class="language-'+$be(n)+'">'+(i?o:$be(o,!0))+"</code></pre>\n":"<pre><code>"+(i?o:$be(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,i=e.start;let n="";for(let s=0;s<e.items.length;s++){const t=e.items[s];n+=this.listitem(t)}const o=t?"ol":"ul";return"<"+o+(t&&1!==i?' start="'+i+'"':"")+">\n"+n+"</"+o+">\n"}listitem(e){let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=i+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" "}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",i="";for(let o=0;o<e.header.length;o++)i+=this.tablecell(e.header[o]);t+=this.tablerow({text:i});let n="";for(let o=0;o<e.rows.length;o++){const t=e.rows[o];i="";for(let e=0;e<t.length;e++)i+=this.tablecell(t[e]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+n+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:i}){const n=this.parser.parseInline(i),o=Zbe(e);if(null===o)return n;let s='<a href="'+(e=o)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>",s}image({href:e,title:t,text:i}){const n=Zbe(e);if(null===n)return i;let o=`<img src="${e=n}" alt="${i}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}},vI=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},wI=class e{constructor(e){n(this,"options",void 0),n(this,"renderer",void 0),n(this,"textRenderer",void 0),this.options=e||_D,this.options.renderer=this.options.renderer||new bI,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vI}static parse(t,i){return new e(i).parse(t)}static parseInline(t,i){return new e(i).parseInline(t)}parse(e,t=!0){let i="";for(let n=0;n<e.length;n++){const o=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=o,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){i+=t||"";continue}}const s=o;switch(s.type){case"space":i+=this.renderer.space(s);continue;case"hr":i+=this.renderer.hr(s);continue;case"heading":i+=this.renderer.heading(s);continue;case"code":i+=this.renderer.code(s);continue;case"table":i+=this.renderer.table(s);continue;case"blockquote":i+=this.renderer.blockquote(s);continue;case"list":i+=this.renderer.list(s);continue;case"html":i+=this.renderer.html(s);continue;case"paragraph":i+=this.renderer.paragraph(s);continue;case"text":{let o=s,r=this.renderer.text(o);for(;n+1<e.length&&"text"===e[n+1].type;)o=e[++n],r+="\n"+this.renderer.text(o);i+=t?this.renderer.paragraph({type:"paragraph",raw:r,text:r,tokens:[{type:"text",raw:r,text:r}]}):r;continue}default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}parseInline(e,t){t=t||this.renderer;let i="";for(let n=0;n<e.length;n++){const o=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=e||"";continue}}const s=o;switch(s.type){case"escape":case"text":i+=t.text(s);break;case"html":i+=t.html(s);break;case"link":i+=t.link(s);break;case"image":i+=t.image(s);break;case"strong":i+=t.strong(s);break;case"em":i+=t.em(s);break;case"codespan":i+=t.codespan(s);break;case"br":i+=t.br(s);break;case"del":i+=t.del(s);break;default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return i}},CI=class{constructor(e){n(this,"options",void 0),this.options=e||_D}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}},n(CI,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),yI=class{constructor(...e){n(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),n(this,"options",this.setOptions),n(this,"parse",this.parseMarkdown(_I.lex,wI.parse)),n(this,"parseInline",this.parseMarkdown(_I.lexInline,wI.parseInline)),n(this,"Parser",wI),n(this,"Renderer",bI),n(this,"TextRenderer",vI),n(this,"Lexer",_I),n(this,"Tokenizer",LD),n(this,"Hooks",CI),this.use(...e)}walkTokens(e,t){let i=[];for(const n of e)switch(i=i.concat(t.call(this,n)),n.type){case"table":{const e=n;for(const n of e.header)i=i.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)i=i.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=n;i=i.concat(this.walkTokens(e.items,t));break}default:{const e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{const o=e[n].flat(1/0);i=i.concat(this.walkTokens(o,t))}):e.tokens&&(i=i.concat(this.walkTokens(e.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const i={...e};if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const i=t.renderers[e.name];t.renderers[e.name]=i?function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=i.apply(this,t)),n}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const i=t[e.level];i?i.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),i.extensions=t),e.renderer){const t=this.defaults.renderer||new bI(this.defaults);for(const i in e.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const n=i,o=e.renderer[n],s=t[n];t[n]=(...e)=>{let i=o.apply(t,e);return!1===i&&(i=s.apply(t,e)),i||""}}i.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new LD(this.defaults);for(const i in e.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const n=i,o=e.tokenizer[n],s=t[n];t[n]=(...e)=>{let i=o.apply(t,e);return!1===i&&(i=s.apply(t,e)),i}}i.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new CI;for(const i in e.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if("options"===i)continue;const n=i,o=e.hooks[n],s=t[n];CI.passThroughHooks.has(i)?t[n]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then(e=>s.call(t,e));const i=o.call(t,e);return s.call(t,i)}:t[n]=(...e)=>{let i=o.apply(t,e);return!1===i&&(i=s.apply(t,e)),i}}i.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,n=e.walkTokens;i.walkTokens=function(e){let i=[];return i.push(n.call(this,e)),t&&(i=i.concat(t.call(this,e))),i}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _I.lex(e,t??this.defaults)}parser(e,t){return wI.parse(e,t??this.defaults)}parseMarkdown(e,t){return(i,n)=>{const o={...n},s={...this.defaults,...o},r=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===o.async)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==i)return r(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof i)return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(i):i).then(t=>e(t,s)).then(e=>s.hooks?s.hooks.processAllTokens(e):e).then(e=>s.walkTokens?Promise.all(this.walkTokens(e,s.walkTokens)).then(()=>e):e).then(e=>t(e,s)).then(e=>s.hooks?s.hooks.postprocess(e):e).catch(r);try{s.hooks&&(i=s.hooks.preprocess(i));let n=e(i,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let o=t(n,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(Fae){return r(Fae)}}}onError(e,t){return i=>{if(i.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+$be(i.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(i);throw i}}},SI=new yI,Jbe.options=Jbe.setOptions=function(e){return SI.setOptions(e),Jbe.defaults=SI.defaults,jbe(Jbe.defaults),Jbe},Jbe.getDefaults=qbe,Jbe.defaults=_D,Jbe.use=function(...e){return SI.use(...e),Jbe.defaults=SI.defaults,jbe(Jbe.defaults),Jbe},Jbe.walkTokens=function(e,t){return SI.walkTokens(e,t)},Jbe.parseInline=SI.parseInline,Jbe.Parser=wI,Jbe.parser=wI.parse,Jbe.Renderer=bI,Jbe.TextRenderer=vI,Jbe.Lexer=_I,Jbe.lexer=_I.lex,Jbe.Tokenizer=LD,Jbe.Hooks=CI,Jbe.parse=Jbe,Jbe.options,Jbe.setOptions,Jbe.use,Jbe.walkTokens,Jbe.parseInline,xI=Jbe,wI.parse,kI=_I.lex,({entries:LI,setPrototypeOf:DI,isFrozen:II,getPrototypeOf:NI,getOwnPropertyDescriptor:EI}=Object),({freeze:MI,seal:TI,create:RI}=Object),({apply:OI,construct:AI}="undefined"!=typeof Reflect&&Reflect),MI||(MI=function(e){return e}),TI||(TI=function(e){return e}),OI||(OI=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),o=2;o<i;o++)n[o-2]=arguments[o];return e.apply(t,n)}),AI||(AI=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return new e(...i)}),PI=nve(Array.prototype.forEach),FI=nve(Array.prototype.lastIndexOf),WI=nve(Array.prototype.pop),BI=nve(Array.prototype.push),VI=nve(Array.prototype.splice),HI=nve(String.prototype.toLowerCase),zI=nve(String.prototype.toString),UI=nve(String.prototype.match),KI=nve(String.prototype.replace),qI=nve(String.prototype.indexOf),jI=nve(String.prototype.trim),$I=nve(Object.prototype.hasOwnProperty),GI=nve(RegExp.prototype.test),Qn=TypeError,ZI=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return AI(Qn,t)},YI=MI(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),QI=MI(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),XI=MI(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),JI=MI(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),eN=MI(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),tN=MI(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),iN=MI(["#text"]),nN=MI(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),oN=MI(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),sN=MI(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),rN=MI(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),aN=TI(/\{\{[\w\W]*|[\w\W]*\}\}/gm),lN=TI(/<%[\w\W]*|[\w\W]*%>/gm),dN=TI(/\$\{[\w\W]*/gm),cN=TI(/^data-[\-\w.\u00B7-\uFFFF]+$/),hN=TI(/^aria-[\-\w]+$/),uN=TI(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gN=TI(/^(?:\w+script|data):/i),pN=TI(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mN=TI(/^html$/i),fN=TI(/^[a-z][.\w]*(-[.\w]+)+$/i),_N=Object.freeze({__proto__:null,ARIA_ATTR:hN,ATTR_WHITESPACE:pN,CUSTOM_ELEMENT:fN,DATA_ATTR:cN,DOCTYPE_NAME:mN,ERB_EXPR:lN,IS_ALLOWED_URI:uN,IS_SCRIPT_OR_DATA:gN,MUSTACHE_EXPR:aN,TMPLIT_EXPR:dN}),bN={element:1,text:3,progressingInstruction:7,comment:8,document:9},vN=function(){return"undefined"==typeof window?null:window},wN=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(s){return console.warn("TrustedTypes policy "+o+" could not be created."),null}},CN=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},yN=lve(),SN=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","s","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]),xN=Object.freeze(["href","target","src","alt","title","for","name","role","tabindex","x-dispatch","required","checked","placeholder","type","start","width","height","align"]),kN="vscode-relative-path",LN=Object.freeze({ALLOWED_TAGS:[...SN],ALLOWED_ATTR:[...xN],ALLOW_UNKNOWN_PROTOCOLS:!0}),DN=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],IN=(e,t,i)=>{if(!t.allowedTags[t.tagName]&&"body"!==t.tagName){const t=hve(e);t&&(e.nodeType===Node.COMMENT_NODE?e.parentElement?.insertBefore(t,e):e.parentElement?.replaceChild(t,e))}},NN=new RegExp(`(\\\\)?\\$\\((${mo.iconNameExpression}(?:${mo.iconModifierExpression})?)\\)`,"g"),EN=Object.freeze({image:({href:e,title:t,text:i})=>{let n=[],o=[];return e&&(({href:e,dimensions:n}=function(e){const t=[],i=e.split("|").map(e=>e.trim());e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),o=e?e[1]:"",s=i?i[1]:"",r=isFinite(parseInt(s)),a=isFinite(parseInt(o));r&&t.push(`width="${s}"`),a&&t.push(`height="${o}"`)}return{href:e,dimensions:t}}(e)),o.push(`src="${zbe(e)}"`)),i&&o.push(`alt="${zbe(i)}"`),t&&o.push(`title="${zbe(t)}"`),n.length&&(o=o.concat(n)),"<img "+o.join(" ")+">"},paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>`},link({href:e,title:t,tokens:i}){let n=this.parser.parseInline(i);return"string"!=typeof e?"":(e===n&&(n=Ube(n)),t="string"==typeof t?zbe(Ube(t)):"",`<a href="${e=(e=Ube(e)).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}" title="${t||e}" draggable="false">${n}</a>`)}});MN=Object.freeze([...SN,"input"]),TN=Object.freeze(["align","autoplay","alt","colspan","controls","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","target","title","type","width","start","checked","disabled","value","data-code","data-href","data-severity",{attributeName:"style",shouldKeep:(e,t)=>"SPAN"===e.tagName&&"style"===t.attrName&&/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(t.attrValue)},{attributeName:"class",shouldKeep:(e,t)=>"SPAN"===e.tagName&&"class"===t.attrName&&/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue)}]),RN=new Map([["&quot;",'"'],["&nbsp;"," "],["&amp;","&"],["&#39;","'"],["&lt;","<"],["&gt;",">"]]),ON=new Nt(Sve),new Nt(()=>{const e=Sve();return e.code=({text:e})=>`\n\`\`\`\n${Wle(e)}\n\`\`\`\n`,e}),AN=3,PN={showInstantHover:()=>{},showDelayedHover:()=>{},setupDelayedHover:()=>Ie.None,setupDelayedHoverAtMouse:()=>Ie.None,hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>({dispose:()=>{},show:()=>{},hide:()=>{},update:()=>{}}),showManagedHover:()=>{}},FN=class{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}},WN=class{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}},BN=class{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}},VN=class extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}},function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],o={start:e.start,end:Math.min(t.start,e.end)},s={start:Math.max(t.end,e.start),end:e.end};return i(o)||n.push(o),i(s)||n.push(s),n}}(HN||(HN={})),zN=class{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,o=Hve({start:0,end:e},this.groups),s=Hve({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(e=>({range:zve(e.range,n),size:e.size}));this.groups=function(...e){return function(e){const t=[];let i=null;for(const n of e){const e=n.range.start,o=n.range.end,s=n.size;i&&s===i.size?i.range.end=o:(i={range:{start:e,end:o},size:s},t.push(i))}return t}(e.reduce((e,t)=>e.concat(t),[]))}(o,i.map((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size})),s),this._size=this._paddingTop+this.groups.reduce((e,t)=>e+t.size*(t.range.end-t.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e<this._paddingTop)return 0;let t=0,i=this._paddingTop;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o*n.size;if(e<s)return t+Math.floor((e-i)/n.size);t+=o,i=s}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const o=n.range.end-n.range.start,s=i+o;if(e<s)return this._paddingTop+t+(e-i)*n.size;t+=o*n.size,i=s}return-1}},UN=class{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const i=Ahe(".monaco-list-row");t={domNode:i,templateId:e,templateData:this.getRenderer(e).renderTemplate(i)}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const e of this.transactionNodesPendingRemoval)this.doRemoveNode(e);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),e.remove()}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}},KN=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},qN={CurrentDragAndDropData:void 0},jN={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0},$N=class{constructor(e){this.elements=e}update(){}getData(){return this.elements}},GN=class{constructor(e){this.elements=e}update(){}getData(){return this.elements}},ZN=class{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}},YN=class{constructor(e){this.getSetSize=e?.getSetSize?e.getSetSize.bind(e):(e,t,i)=>i,this.getPosInSet=e?.getPosInSet?e.getPosInSet.bind(e):(e,t)=>t+1,this.getRole=e?.getRole?e.getRole.bind(e):e=>"listitem",this.isChecked=e?.isChecked?e.isChecked.bind(e):e=>{}}},QN=class e{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:hhe(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(t,i,n,o=jN){if(this.virtualDelegate=i,this.domId="list_id_"+ ++e.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new ht(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Ie.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Ie.None,this.onDragLeaveTimeout=Ie.None,this.currentSelectionDisposable=Ie.None,this.disposables=new De,this._onDidChangeContentHeight=new je,this._onDidChangeContentWidth=new je,this.onDidChangeContentHeight=Be.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,o.horizontalScrolling&&o.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(o.paddingTop??0);for(const e of n)this.renderers.set(e.templateId,e);if(this.cache=this.disposables.add(new UN(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support","boolean"!=typeof o.mouseSupport||o.mouseSupport),this._horizontalScrolling=o.horizontalScrolling??jN.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=void 0===o.paddingBottom?0:o.paddingBottom,this.accessibilityProvider=new YN(o.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(o.transformOptimization??jN.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(pm.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new Sm({forceIntegerValues:!0,smoothScrollDuration:o.smoothScrolling?125:0,scheduleAtNextAnimationFrame:e=>In(pn(this.domNode),e)})),this.scrollableElement=this.disposables.add(new Mm(this.rowsContainer,{alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel??jN.alwaysConsumeMouseWheel,horizontal:1,vertical:o.verticalScrollMode??jN.verticalScrollMode,useShadows:o.useShadows??jN.useShadows,mouseWheelScrollSensitivity:o.mouseWheelScrollSensitivity,fastScrollSensitivity:o.fastScrollSensitivity,scrollByPage:o.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),t.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(ehe(this.rowsContainer,gm.Change,e=>this.onTouchChange(e))),this.disposables.add(ehe(this.scrollableElement.getDomNode(),"scroll",e=>{const t=e.target,i=t.scrollTop;t.scrollTop=0,o.scrollToActiveElement&&this.setScrollTop(this.scrollTop+i)})),this.disposables.add(ehe(this.domNode,"dragover",e=>this.onDragOver(this.toDragEvent(e)))),this.disposables.add(ehe(this.domNode,"drop",e=>this.onDrop(this.toDragEvent(e)))),this.disposables.add(ehe(this.domNode,"dragleave",e=>this.onDragLeave(this.toDragEvent(e)))),this.disposables.add(ehe(this.domNode,"dragend",e=>this.onDragEnd(e))),o.userSelection){if(o.dnd)throw new Error("DND and user selection cannot be used simultaneously");this.disposables.add(ehe(this.domNode,"mousedown",e=>this.onPotentialSelectionStart(e)))}this.setRowLineHeight=o.setRowLineHeight??jN.setRowLineHeight,this.setRowHeight=o.setRowHeight??jN.setRowHeight,this.supportDynamicHeights=o.supportDynamicHeights??jN.supportDynamicHeights,this.dnd=o.dnd??this.disposables.add(jN.dnd),this.layout(o.initialSize?.height,o.initialSize?.width),o.scrollToActiveElement&&this._setupFocusObserver(t)}_setupFocusObserver(e){this.disposables.add(ehe(e,"focus",()=>{const t=vhe();this.activeElement!==t&&null!==t&&(this.activeElement=t,this._scrollToActiveElement(this.activeElement,e))},!0))}_scrollToActiveElement(e,t){const i=t.getBoundingClientRect(),n=e.getBoundingClientRect().top-i.top;n<0&&this.setScrollTop(this.scrollTop+n)}updateOptions(e){let t;if(void 0!==e.paddingBottom&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.scrollByPage&&(t={...t??{},scrollByPage:e.scrollByPage}),void 0!==e.mouseWheelScrollSensitivity&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),void 0!==e.fastScrollSensitivity&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),void 0!==e.paddingTop&&e.paddingTop!==this.rangeMap.paddingTop){const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),i=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(t,Math.max(0,this.lastRenderTop+i),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new zN(e)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=HN.intersect(n,o),r=new Map;for(let v=s.end-1;v>=s.start;v--){const e=this.items[v];if(e.dragStartDisposable.dispose(),e.checkedDisposable.dispose(),e.row){let t=r.get(e.templateId);t||(t=[],r.set(e.templateId,t));const i=this.renderers.get(e.templateId);i&&i.disposeElement&&i.disposeElement(e.element,v,e.row.templateData,{height:e.size}),t.unshift(e.row)}e.row=null,e.stale=!0}const a={start:e+t,end:this.items.length},l=HN.intersect(a,n),d=HN.relativeComplement(a,n),c=i.map(e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Ie.None,checkedDisposable:Ie.None,stale:!1}));let h;0===e&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,c),h=this.items,this.items=c):(this.rangeMap.splice(e,t,c),h=pce(this.items,e,t,c));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=zve(l,u),m=HN.intersect(g,p);for(let v=m.start;v<m.end;v++)this.updateItemInDOM(this.items[v],v);const f=HN.relativeComplement(p,g);for(const v of f)for(let e=v.start;e<v.end;e++)this.removeItemFromDOM(e);const _=d.map(e=>zve(e,u)),b=[{start:e,end:e+i.length},..._].map(e=>HN.intersect(g,e)).reverse();for(const v of b)for(let e=v.end-1;e>=v.start;e--){const t=this.items[e],i=r.get(t.templateId)?.pop();this.insertItemInDOM(e,i)}for(const v of r.values())for(const e of v)this.cache.release(e);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(e=>e.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=In(pn(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth()):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getVisibleRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:"number"==typeof e?e:uhe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:hhe(this.domNode)})}render(e,t,i,n,o,s=!1,r=!1){const a=this.getRenderRange(t,i),l=HN.relativeComplement(a,e).reverse(),d=HN.relativeComplement(e,a);if(s){const t=HN.intersect(e,a);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}this.cache.transact(()=>{for(const e of d)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t,r);for(const e of l)for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t)}),void 0!==n&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&void 0!==o&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const e=this.cache.alloc(i.templateId);i.row=e.row,i.stale||(i.stale=e.isReusingConnectedDomNode)}const n=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",n);const o=this.accessibilityProvider.isChecked(i.element),s=e=>"mixed"===e?"mixed":String(!!e);if("boolean"==typeof o||"mixed"===o)i.row.domNode.setAttribute("aria-checked",s(o));else if(o){const e=e=>i.row.domNode.setAttribute("aria-checked",s(e));e(o.value),i.checkedDisposable=o.onDidChange(()=>e(o.value))}if(i.stale||!i.row.domNode.parentElement){const t=this.items.at(e+1)?.row?.domNode??null;i.row.domNode.parentElement===this.rowsContainer&&i.row.domNode.nextElementSibling===t||this.rowsContainer.insertBefore(i.row.domNode,t),i.stale=!1}this.updateItemInDOM(i,e);const r=this.renderers.get(i.templateId);if(!r)throw new Error(`No renderer found for template id ${i.templateId}`);r?.renderElement(i.element,e,i.row.templateData,{height:i.size});const a=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!a,a&&(i.dragStartDisposable=ehe(i.row.domNode,"dragstart",e=>this.onDragStart(i.element,a,e))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=hhe(e.row.domNode);const t=pn(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2==0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e,t){const i=this.items[e];if(i.dragStartDisposable.dispose(),i.checkedDisposable.dispose(),i.row){const n=this.renderers.get(i.templateId);n&&n.disposeElement&&n.disposeElement(i.element,e,i.row.templateData,{height:i.size,onScroll:t}),this.cache.release(i.row),i.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return Be.map(this.disposables.add(new zm(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return Be.map(this.disposables.add(new zm(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return Be.filter(Be.map(this.disposables.add(new zm(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>1===e.browserEvent.button,this.disposables)}get onMouseDown(){return Be.map(this.disposables.add(new zm(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return Be.map(this.disposables.add(new zm(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return Be.map(this.disposables.add(new zm(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return Be.any(Be.map(this.disposables.add(new zm(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),Be.map(this.disposables.add(new zm(this.domNode,gm.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return Be.map(this.disposables.add(new zm(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return Be.map(this.disposables.add(new zm(this.rowsContainer,gm.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element,sector:this.getTargetSector(e,t)}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth,void 0,!0),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){if(!i.dataTransfer)return;const n=this.dnd.getDragElements(e);let o;i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(FL.TEXT,t),this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(n,i)),void 0===o&&(o=String(n.length)),function(e,t,i,n=[]){if(!e.dataTransfer)return;const o=Ahe(".monaco-drag-image");o.textContent=i,o.classList.add(...n),(e=>{for(;e&&!e.classList.contains("monaco-workbench");)e=e.parentElement;return e||t.ownerDocument.body})(t).appendChild(o),e.dataTransfer.setDragImage(o,-10,-10),setTimeout(()=>o.remove(),0)}(i,this.domNode,o,[this.domId]),this.domNode.classList.add("dragging"),this.currentDragData=new $N(n),qN.CurrentDragAndDropData=new GN(n),this.dnd.onDragStart?.(this.currentDragData,i)}onPotentialSelectionStart(e){this.currentSelectionDisposable.dispose();const t=mn(this.domNode),i=this.currentSelectionDisposable=new De,n=i.add(new De);n.add(ehe(this.domNode,"selectstart",()=>{n.add(ehe(t,"mousemove",e=>{!1===t.getSelection()?.isCollapsed&&this.setupDragAndDropScrollTopAnimation(e)})),i.add(Dle(()=>{const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.currentSelectionBounds=void 0,this.render(e,this.lastRenderTop,this.lastRenderHeight,void 0,void 0)})),i.add(ehe(t,"selectionchange",()=>{const e=t.getSelection();if(!e||e.isCollapsed)return void(n.isDisposed&&i.dispose());let o=this.getIndexOfListElement(e.anchorNode),s=this.getIndexOfListElement(e.focusNode);void 0!==o&&void 0!==s&&(s<o&&([o,s]=[s,o]),this.currentSelectionBounds={start:o,end:s})}))})),n.add(ehe(t,"mouseup",()=>{n.dispose(),this.teardownDragAndDropScrollTopAnimation(),!1!==t.getSelection()?.isCollapsed&&i.dispose()}))}getIndexOfListElement(e){if(e&&this.domNode.contains(e))for(;e&&e!==this.domNode;){if(e.dataset?.index)return Number(e.dataset.index);e=e.parentElement}}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),qN.CurrentDragAndDropData&&"vscode-ui"===qN.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(qN.CurrentDragAndDropData)this.currentDragData=qN.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new ZN}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop="boolean"==typeof t?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let i;e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof t&&0===t.effect?.type?"copy":"move",i="boolean"!=typeof t&&t.feedback?t.feedback:void 0===e.index?[-1]:[e.index],i=rce(i).filter(e=>e>=-1&&e<this.length).sort((e,t)=>e-t),i=-1===i[0]?[-1]:i;let n="boolean"!=typeof t&&t.effect&&t.effect.position?t.effect.position:"drop-target";if(o=this.currentDragFeedback,s=i,(Array.isArray(o)&&Array.isArray(s)?Zde(o,s):o===s)&&this.currentDragFeedbackPosition===n)return!0;var o,s;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=n,this.currentDragFeedbackDisposable.dispose(),-1===i[0])this.domNode.classList.add(n),this.rowsContainer.classList.add(n),this.currentDragFeedbackDisposable=Dle(()=>{this.domNode.classList.remove(n),this.rowsContainer.classList.remove(n)});else{if(i.length>1&&"drop-target"!==n)throw new Error("Can't use multiple feedbacks with position different than 'over'");"drop-target-after"===n&&i[0]<this.length-1&&(i[0]+=1,n="drop-target-before");for(const e of i){const t=this.items[e];t.dropTarget=!0,t.row?.domNode.classList.add(n)}this.currentDragFeedbackDisposable=Dle(()=>{for(const e of i){const t=this.items[e];t.dropTarget=!1,t.row?.domNode.classList.remove(n)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=Rle(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,qN.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,qN.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Ie.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=ahe(this.domNode).top;this.dragOverAnimationDisposable=function(e,t){const i=()=>{t(),n=In(e,i)};let n=In(e,i);return Dle(()=>n.dispose())}(pn(this.domNode),this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Rle(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(void 0===t)return;const i=e.offsetY/this.items[t].size;return Vve(Math.floor(i/.25),0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(xhe(i)||Lhe(i))&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}i=i.parentElement}}getVisibleRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}getRenderRange(e,t){const i=this.getVisibleRange(e,t);if(this.currentSelectionBounds){const e=this.rangeMap.count;i.start=Math.min(i.start,this.currentSelectionBounds.start,e),i.end=Math.min(Math.max(i.end,this.currentSelectionBounds.end+1),e)}return i}_rerender(e,t,i){const n=this.getRenderRange(e,t);let o,s;e===this.elementTop(n.start)?(o=n.start,s=0):n.end-n.start>1&&(o=n.start+1,s=this.elementTop(o)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e<a.end;e++){const t=this.probeDynamicHeight(e);0!==t&&this.rangeMap.splice(e,1,[this.items[e]]),r+=t,l=l||0!==t}if(!l){0!==r&&this.eventuallyUpdateScrollDimensions();const t=HN.relativeComplement(n,a);for(const e of t)for(let t=e.start;t<e.end;t++)this.items[t].row&&this.removeItemFromDOM(t);const l=HN.relativeComplement(a,n).reverse();for(const e of l)for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t);for(let e=a.start;e<a.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if("number"==typeof o){const t=this.scrollable.getFutureScrollPosition().scrollTop-e,n=this.elementTop(o)-s+t;this.setScrollTop(n,i)}return void this._onDidChangeContentHeight.fire(this.contentHeight)}}}probeDynamicHeight(e){const t=this.items[e];if(this.virtualDelegate.getDynamicHeight){const e=this.virtualDelegate.getDynamicHeight(t.element);if(null!==e){const i=t.size;return t.size=e,t.lastDynamicHeightWidth=this.renderWidth,e-i}}if(!t.hasDynamicHeight||t.lastDynamicHeightWidth===this.renderWidth)return 0;if(this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(t.element))return 0;const i=t.size;if(t.row)return t.row.domNode.style.height="",t.size=t.row.domNode.offsetHeight,0!==t.size||phe(t.row.domNode,pn(t.row.domNode).document.body)||console.warn("Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!",(new Error).stack),t.lastDynamicHeightWidth=this.renderWidth,t.size-i;const{row:n}=this.cache.alloc(t.templateId);n.domNode.style.height="",this.rowsContainer.appendChild(n.domNode);const o=this.renderers.get(t.templateId);if(!o)throw new y("Missing renderer for templateId: "+t.templateId);return o.renderElement(t.element,e,n.templateData),t.size=n.domNode.offsetHeight,o.disposeElement?.(t.element,e,n.templateData),this.virtualDelegate.setDynamicHeight?.(t.element,t.size),t.lastDynamicHeightWidth=this.renderWidth,n.domNode.remove(),this.cache.release(n),t.size-i}getElementDomId(e){return`${this.domId}_${e}`}dispose(){for(const e of this.items)if(e.dragStartDisposable.dispose(),e.checkedDisposable.dispose(),e.row){const t=this.renderers.get(e.row.templateId);t&&(t.disposeElement?.(e.element,-1,e.row.templateData,void 0),t.disposeTemplate(e.row.templateData))}this.items=[],this.domNode?.remove(),this.dragOverAnimationDisposable?.dispose(),this.disposables.dispose()}},QN.InstanceCount=0,KN([Ape],QN.prototype,"onMouseClick",null),KN([Ape],QN.prototype,"onMouseDblClick",null),KN([Ape],QN.prototype,"onMouseMiddleClick",null),KN([Ape],QN.prototype,"onMouseDown",null),KN([Ape],QN.prototype,"onMouseOver",null),KN([Ape],QN.prototype,"onMouseOut",null),KN([Ape],QN.prototype,"onContextMenu",null),KN([Ape],QN.prototype,"onTouchStart",null),KN([Ape],QN.prototype,"onTap",null),XN=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},JN=class{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const n=this.renderedElements.findIndex(e=>e.templateData===i);if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const o of this.renderedElements)o.index<e?n.push(o):o.index>=e+t&&n.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=n}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(t=>t.templateData===e);t<0||this.renderedElements.splice(t,1)}},eE=class{get onChange(){return this._onChange.event}get name(){return this._trait}get renderer(){return new JN(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new je}splice(e,t,i){const n=i.length-t,o=e+t,s=[];let r=0;for(;r<this.sortedIndexes.length&&this.sortedIndexes[r]<e;)s.push(this.sortedIndexes[r++]);for(let a=0;a<i.length;a++)i[a]&&s.push(a+e);for(;r<this.sortedIndexes.length&&this.sortedIndexes[r]>=o;)s.push(this.sortedIndexes[r++]+n);this.renderer.splice(e,t,i.length),this._set(s,s)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(pE),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=Yve(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return Yde(this.sortedIndexes,e,pE)>=0}dispose(){kle(this._onChange)}},XN([Ape],eE.prototype,"renderer",null),tE=class extends eE{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}},iE=class{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const n=this.trait.get().map(e=>this.identityProvider.getId(this.view.element(e)).toString());if(0===n.length)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(n),s=i.map(e=>o.has(this.identityProvider.getId(e).toString()));this.trait.splice(e,t,s)}},nE=class{get onKeyDown(){return Be.chain(this.disposables.add(new zm(this.view.domNode,"keydown")).event,e=>e.filter(e=>!zhe(e.target)).map(e=>new we(e)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new De,this.multipleSelectionDisposables=new De,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(e=>{switch(e.keyCode){case 3:return this.onEnter(e);case 16:return this.onUpArrow(e);case 18:return this.onDownArrow(e);case 11:return this.onPageUpArrow(e);case 12:return this.onPageDownArrow(e);case 9:return this.onEscape(e);case 31:this.multipleSelectionSupport&&(F?e.metaKey:e.ctrlKey)&&this.onCtrlA(e)}}))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(ace(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}},XN([Ape],nE.prototype,"onKeyDown",null),function(e){e[e.Automatic=0]="Automatic",e[e.Trigger=1]="Trigger"}(oE||(oE={})),function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(sE||(sE={})),rE=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=98&&e.keyCode<=107||e.keyCode>=85&&e.keyCode<=95)}},aE=class{constructor(e,t,i,n,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=o,this.enabled=!1,this.state=sE.Idle,this.mode=oE.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new De,this.disposables=new De,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??1?this.enable():this.disable(),this.mode=e.typeNavigationMode??oE.Automatic}enable(){if(this.enabled)return;let e=!1;const t=Be.chain(this.enabledDisposables.add(new zm(this.view.domNode,"keydown")).event,t=>t.filter(e=>!zhe(e.target)).filter(()=>this.mode===oE.Automatic||this.triggered).map(e=>new we(e)).filter(t=>e||this.keyboardNavigationEventFilter(t)).filter(e=>this.delegate.mightProducePrintableCharacter(e)).forEach(e=>An.stop(e,!0)).map(e=>e.browserEvent.key)),i=Be.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);Be.reduce(Be.any(t,i),(e,t)=>null===t?null:(e||"")+t,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));"string"==typeof t?Qhe(t):t&&Qhe(t.get())}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=sE.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===sE.Idle?1:0;this.state=sE.Typing;for(let o=0;o<this.list.length;o++){const t=(i+o+n)%this.list.length,s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(t)),r=s&&s.toString();if(this.list.options.typeNavigationEnabled){if(void 0!==r){if(GL(e,r))return this.previouslyFocused=i,this.list.setFocus([t]),void this.list.reveal(t);const n=xbe(e,r);if(n&&n[0].end-n[0].start>1&&1===n.length)return this.previouslyFocused=i,this.list.setFocus([t]),void this.list.reveal(t)}}else if(void 0===r||GL(e,r))return this.previouslyFocused=i,this.list.setFocus([t]),void this.list.reveal(t)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}},lE=class{constructor(e,t){this.list=e,this.view=t,this.disposables=new De;const i=Be.chain(this.disposables.add(new zm(t.domNode,"keydown")).event,e=>e.filter(e=>!zhe(e.target)).map(e=>new we(e)));Be.chain(i,e=>e.filter(e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!n||!xhe(n)||-1===n.tabIndex)return;const o=pn(n).getComputedStyle(n);"hidden"!==o.visibility&&"none"!==o.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}},dE={isSelectionSingleChangeEvent:Gve,isSelectionRangeChangeEvent:Zve},cE=class{get onPointer(){return this._onPointer.event}constructor(e){this.list=e,this.disposables=new De,this._onPointer=this.disposables.add(new je),!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||dE),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(pm.addTarget(e.getHTMLElement()))),Be.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||dE))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){Kve(e.browserEvent.target)||vhe()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(zhe(e.browserEvent.target)||Kve(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(zhe(e.browserEvent.target)||Kve(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),Dhe(i=e.browserEvent)&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(zhe(e.browserEvent.target)||Kve(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){void 0===i&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const n=ace(Math.min(i,t),Math.max(i,t)+1),o=this.list.getSelection(),s=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;for(;o>=0&&e[o]===t-(i-o);)n.push(e[o--]);for(n.reverse(),o=i;o<e.length&&e[o]===t+(o-i);)n.push(e[o++]);return n}(Yve(o,[i]),i);if(0===s.length)return;const r=Yve(n,function(e,t){const i=[];let n=0,o=0;for(;n<e.length||o<t.length;)if(n>=e.length)i.push(t[o++]);else if(o>=t.length)i.push(e[n++]);else{if(e[n]===t[o]){n++,o++;continue}e[n]<t[o]?i.push(e[n++]):o++}return i}(o,s));this.list.setSelection(r,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const i=this.list.getSelection(),n=i.filter(e=>e!==t);this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}},hE=class{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(`\n\t\t\t\t.monaco-drag-image${t},\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&i.push(`\n\t\t\t\t.monaco-drag-image${t},\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const n=Z_e(e.listFocusAndSelectionOutline,Z_e(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(`\n\t\t\t\t.monaco-drag-image${t},\n\t\t\t\t.monaco-list${t}:focus .monaco-list-row.focused,\n\t\t\t\t.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`);const o=Z_e(e.listSelectionOutline,e.listInactiveFocusOutline??"");o&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${o}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(`\n\t\t\t\t.monaco-list${t}.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }\n\t\t\t`),e.listDropBetweenBackground&&(i.push(`\n\t\t\t.monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,\n\t\t\t.monaco-list${t} .monaco-list-row.drop-target-before::before {\n\t\t\t\tcontent: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;\n\t\t\t\tbackground-color: ${e.listDropBetweenBackground};\n\t\t\t}`),i.push(`\n\t\t\t.monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,\n\t\t\t.monaco-list${t} .monaco-list-row.drop-target-after::after {\n\t\t\t\tcontent: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;\n\t\t\t\tbackground-color: ${e.listDropBetweenBackground};\n\t\t\t}`)),e.tableColumnsBorder&&i.push(`\n\t\t\t\t.monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n\t\t\t\t.monaco-enable-motion .monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-enable-motion .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t\t}\n\n\t\t\t\t.monaco-enable-motion .monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-enable-motion .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: transparent;\n\t\t\t\t}\n\t\t\t`),e.tableOddRowsBackgroundColor&&i.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=i.join("\n")}},uE={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:eh.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:eh.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:eh.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},gE={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}}},pE=(e,t)=>e-t,mE=class{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){let o=0;for(const s of this.renderers)s.disposeElement?.(e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}},fE=class{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new De}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),o=n&&"string"!=typeof n?n:z_e(n);i.disposables.add(Rce(e=>{this.setAriaLabel(e.readObservable(o),i.container)}));const s=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof s?i.container.setAttribute("aria-level",`${s}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}},_E=class{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,n,o){return this.dnd.onDragOver(e,t,i,n,o)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,o){this.dnd.drop(e,t,i,n,o)}dispose(){this.dnd.dispose()}},bE=class{get onDidChangeFocus(){return Be.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return Be.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=Be.chain(this.disposables.add(new zm(this.view.domNode,"keydown")).event,t=>t.map(e=>new we(e)).filter(t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode).map(e=>An.stop(e,!0)).filter(()=>!1)),i=Be.chain(this.disposables.add(new zm(this.view.domNode,"keyup")).event,t=>t.forEach(()=>e=!1).map(e=>new we(e)).filter(e=>58===e.keyCode||e.shiftKey&&68===e.keyCode).map(e=>An.stop(e,!0)).map(({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})),n=Be.chain(this.view.onContextMenu,t=>t.filter(t=>!e).map(({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:new Se(pn(this.view.domNode),i),browserEvent:i})));return Be.any(t,i,n)}get onKeyDown(){return this.disposables.add(new zm(this.view.domNode,"keydown")).event}get onDidFocus(){return Be.signal(this.disposables.add(new zm(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return Be.signal(this.disposables.add(new zm(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,o=gE){this.user=e,this._options=o,this.focus=new eE("focused"),this.anchor=new eE("anchor"),this.eventBufferer=new Je,this._ariaLabel="",this.disposables=new De,this._onDidDispose=new je,this.onDidDispose=this._onDidDispose.event;const s=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new tE("listbox"!==s);const r=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(r.push(new fE(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(e=>new mE(e.templateId,[...r,e]));const a={...o,dnd:o.dnd&&new _E(this,o.dnd)};if(this.view=this.createListView(t,i,n,a),this.view.domNode.setAttribute("role",s),o.styleController?this.styleController=o.styleController(this.view.domId):this.styleController=new hE(npe(this.view.domNode),this.view.domId),this.spliceable=new FN([new iE(this.focus,this.view,o.identityProvider),new iE(this.selection,this.view,o.identityProvider),new iE(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new lE(this,this.view)),("boolean"!=typeof o.keyboardSupport||o.keyboardSupport)&&(this.keyboardController=new nE(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||rE;this.typeNavigationController=new aE(this,this.view,o.keyboardNavigationLabelProvider,o.keyboardNavigationEventFilter??(()=>!0),e),this.disposables.add(this.typeNavigationController)}if(this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider){const e=this.accessibilityProvider.getWidgetAriaLabel(),t=e&&"string"!=typeof e?e:z_e(e);this.disposables.add(Rce(e=>{this.ariaLabel=e.readObservable(t)}))}!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new QN(e,t,i,n)}createMouseController(e){return new cE(this)}updateOptions(e={}){this._options={...this._options,...e},this.typeNavigationController?.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),this.keyboardController?.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new VN(this.user,`Invalid start index: ${e}`);if(t<0)throw new VN(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new VN(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(void 0!==e){if(e<0||e>=this.length)throw new VN(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return this.anchor.get().at(0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new VN(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,n);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,n);s>-1&&this.setFocus([s],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.getFocus()[0];if(n!==i&&(void 0===n||i>n)){const o=this.findPreviousIndex(i,!1,t);o>-1&&n!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;i>n&&(s-=this.view.elementHeight(i)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),await Tle(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;const o=i(),s=this.view.getScrollTop()+o;n=0===s?this.view.indexAt(s):this.view.indexAfter(s-1);const r=this.getFocus()[0];if(r!==n&&(void 0===r||r>=n)){const i=this.findNextIndex(n,!1,t);i>-1&&r!==i?this.setFocus([i],e):this.setFocus([n],e)}else{const n=s;this.view.setScrollTop(s-this.view.renderHeight-o),this.view.getScrollTop()+i()!==n&&(this.setFocus([]),await Tle(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(0===this.length)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(0===this.length)return;const n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e>=this.length&&!t)return-1;if(e%=this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let n=0;n<this.length;n++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return-1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map(e=>this.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new VN(this.user,`Invalid index ${e}`);const n=this.view.getScrollTop(),o=this.view.elementTop(e),s=this.view.elementHeight(e);if(lle(t)){const e=s-this.view.renderHeight+i;this.view.setScrollTop(e*Vve(t,0,1)+o-i)}else{const e=o+s,t=n+this.view.renderHeight;o<n+i&&e>=t||(o<n+i||e>=t&&s>=this.view.renderHeight?this.view.setScrollTop(o-i):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new VN(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(n<i+t||n+o>i+this.view.renderHeight)return null;const s=o-this.view.renderHeight+t;return Math.abs((i+t-n)/s)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(e=>this.view.element(e)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){const e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}},XN([Ape],bE.prototype,"onDidChangeFocus",null),XN([Ape],bE.prototype,"onDidChangeSelection",null),XN([Ape],bE.prototype,"onContextMenu",null),XN([Ape],bE.prototype,"onKeyDown",null),XN([Ape],bE.prototype,"onDidFocus",null),XN([Ape],bE.prototype,"onDidBlur",null),wE=Ahe,CE="selectOption.entry.template",yE=class{get templateId(){return CE}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Mhe(e,wE(".option-text")),t.detail=Mhe(e,wE(".option-detail")),t.decoratorRight=Mhe(e,wE(".option-decorator-right")),t}renderElement(e,t,i){const n=i,o=e.text,s=e.detail,r=e.decoratorRight,a=e.isDisabled;n.text.textContent=o,n.detail.textContent=s||"",n.decoratorRight.textContent=r||"",a?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}},SE=class e extends Ie{constructor(t,i,n,o,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._selectionDetailsDisposables=this._register(new De),this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=o,this.selectBoxOptions=s||Object.create(null),"number"!=typeof this.selectBoxOptions.minBottomMargin?this.selectBoxOptions.minBottomMargin=e.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new je,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(n),this.selected=i||0,t&&this.setOptions(t,i),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(Bve().setupManagedHover($_e("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return CE}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=Ahe(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Mhe(this.selectDropDownContainer,wE(".select-box-details-pane"));const t=Mhe(Mhe(this.selectDropDownContainer,wE(".select-box-dropdown-container-width-control")),wE(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Mhe(t,this.widthControlElement),this._dropDownPosition=0,this.styleElement=npe(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(ehe(this.selectDropDownContainer,On.DRAG_START,e=>{An.stop(e,!0)}))}registerListeners(){let e;this._register(xn(this.selectElement,"change",e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(ehe(this.selectElement,On.CLICK,e=>{An.stop(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ehe(this.selectElement,On.MOUSE_DOWN,e=>{An.stop(e)})),this._register(ehe(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(ehe(this.selectElement,"touchend",t=>{An.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(ehe(this.selectElement,On.KEY_DOWN,e=>{const t=new we(e);let i=!1;F?18!==t.keyCode&&16!==t.keyCode&&10!==t.keyCode&&3!==t.keyCode||(i=!0):(18===t.keyCode&&t.altKey||16===t.keyCode&&t.altKey||10===t.keyCode||3===t.keyCode)&&(i=!0),i&&(this.showSelectDropDown(),An.stop(e,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Zde(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),"string"==typeof e.description&&(this._hasDetails=!0)})),void 0!==t&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){this.selectList?.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join("\n")}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=Z_e(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.textContent="",this.contextViewProvider&&!this._isVisible&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){this.contextViewProvider&&this._isVisible&&(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(t){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const i=pn(this.selectElement),n=lhe(this.selectElement),o=pn(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(o.getPropertyValue("--dropdown-padding-top"))+parseFloat(o.getPropertyValue("--dropdown-padding-bottom")),r=i.innerHeight-n.top-n.height-(this.selectBoxOptions.minBottomMargin||0),a=n.top-e.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,d=this.setWidthControlElement(this.widthControlElement),c=Math.max(d,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&void 0===this._cachedMaxDetailsHeight&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,g=h+s+u,p=Math.floor((r-s-u)/this.getHeight()),m=Math.floor((a-s-u)/this.getHeight());if(t)return!(n.top+n.height>i.innerHeight-22||n.top<e.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||p<1&&m<1||(p<e.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&m>p&&this.options.length>p?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),0));if(n.top+n.height>i.innerHeight-22||n.top<e.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||0===this._dropDownPosition&&p<1||1===this._dropDownPosition&&m<1)return this.hideSelectDropDown(!0),!1;if(0===this._dropDownPosition){if(this._isVisible&&p+m<1)return this.hideSelectDropDown(!0),!1;g>r&&(h=p*this.getHeight())}else g>a&&(h=m*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach((e,t)=>{const o=e.detail?e.detail.length:0,s=e.decoratorRight?e.decoratorRight.length:0,r=e.text.length+o+s;r>n&&(i=t,n=r)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=che(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Mhe(e,wE(".select-box-dropdown-list-container")),this.listRenderer=new yE,this.selectList=this._register(new bE("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=`. ${e.detail}`),e.decoratorRight&&(t+=`. ${e.decoratorRight}`),e.description&&(t+=`. ${e.description}`),t},getWidgetAriaLabel:()=>Vae(16,"Select Box"),getRole:()=>F?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new zm(this.selectDropDownListContainer,"keydown")),i=Be.chain(t.event,e=>e.filter(()=>this.selectList.length>0).map(e=>new we(e)));this._register(Be.chain(i,e=>e.filter(e=>3===e.keyCode))(this.onEnter,this)),this._register(Be.chain(i,e=>e.filter(e=>2===e.keyCode))(this.onEnter,this)),this._register(Be.chain(i,e=>e.filter(e=>9===e.keyCode))(this.onEscape,this)),this._register(Be.chain(i,e=>e.filter(e=>16===e.keyCode))(this.onUpArrow,this)),this._register(Be.chain(i,e=>e.filter(e=>18===e.keyCode))(this.onDownArrow,this)),this._register(Be.chain(i,e=>e.filter(e=>12===e.keyCode))(this.onPageDown,this)),this._register(Be.chain(i,e=>e.filter(e=>11===e.keyCode))(this.onPageUp,this)),this._register(Be.chain(i,e=>e.filter(e=>14===e.keyCode))(this.onHome,this)),this._register(Be.chain(i,e=>e.filter(e=>13===e.keyCode))(this.onEnd,this)),this._register(Be.chain(i,e=>e.filter(e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=85&&e.keyCode<=113))(this.onCharacter,this)),this._register(ehe(this.selectList.getHTMLElement(),On.POINTER_UP,e=>this.onPointerUp(e))),this._register(this.selectList.onMouseOver(e=>void 0!==e.index&&this.selectList.setFocus([e.index]))),this._register(this.selectList.onDidChangeFocus(e=>this.onListFocus(e))),this._register(ehe(this.selectDropDownContainer,On.FOCUS_OUT,e=>{this._isVisible&&!phe(e.relatedTarget,this.selectDropDownContainer)&&this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;An.stop(e);const t=e.target;if(!t)return;if(t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");n>=0&&n<this.options.length&&!o&&(this.selected=n,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){const i=e=>{for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes.item(t);"img"===(n.tagName&&n.tagName.toLowerCase())?n.remove():i(n)}},n=mve({value:e,supportThemeIcons:!0},{actionHandler:t});return n.element.classList.add("select-box-description-markdown"),i(n.element),n}onListFocus(e){this._isVisible&&this._hasDetails&&this.updateDetail(e.indexes[0])}updateDetail(e){this._selectionDetailsDisposables.clear(),this.selectionDetailsPane.textContent="";const t=this.options[e],i=t?.description??"";if(i){if(t?.descriptionIsMarkdown){const e=t.descriptionMarkdownActionHandler,n=this._selectionDetailsDisposables.add(this.renderDescriptionMarkdown(i,e));this.selectionDetailsPane.appendChild(n.element)}else this.selectionDetailsPane.textContent=i;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){An.stop(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){An.stop(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){An.stop(e,!0);const t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(An.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){An.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onPageDown(e){An.stop(e),this.selectList.focusNextPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){An.stop(e),this.options.length<2||(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){An.stop(e),this.options.length<2||(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=ge.toString(e.keyCode);let i=-1;for(let n=0;n<this.options.length-1;n++)if(i=(n+this.selected+1)%this.options.length,this.options[i].text.charAt(0).toUpperCase()===t&&!this.options[i].isDisabled){this.select(i),this.selectList.setFocus([i]),this.selectList.reveal(this.selectList.getFocus()[0]),An.stop(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}},(vE=SE).DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32,vE.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2,vE.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3,xE=class extends Ie{constructor(e,t,i,n){super(),this.selected=0,this.selectBoxOptions=n||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new je),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(pm.addTarget(this.selectElement)),[gm.Tap].forEach(e=>{this._register(ehe(this.selectElement,e,e=>{this.selectElement.focus()}))}),this._register(xn(this.selectElement,"click",e=>{An.stop(e,!0)})),this._register(xn(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(xn(this.selectElement,"keydown",e=>{let t=!1;F?18!==e.keyCode&&16!==e.keyCode&&10!==e.keyCode||(t=!0):(18===e.keyCode&&e.altKey||10===e.keyCode||3===e.keyCode)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){this.options&&Zde(this.options,e)||(this.options=e,this.selectElement.options.length=0,this.options.forEach((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))})),void 0!==t&&this.select(t)}select(e){0===this.options.length?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&"string"==typeof this.options[this.selected].text?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){this.selectElement&&(this.selectElement.style.backgroundColor=this.styles.selectBackground??"",this.selectElement.style.color=this.styles.selectForeground??"",this.selectElement.style.borderColor=this.styles.selectBorder??"")}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}},kE=class extends mm{constructor(e,t,i,n,o){super(),this.selectBoxDelegate=F&&!o?.useCustomDrawn?new xE(e,t,n,o):new SE(e,t,i,n,o),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}},LE=class extends Ie{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof oo&&this._register(t.onDidChange(e=>{this.element&&this.handleActionChangeEvent(e)}))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new so)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(pm.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,c&&this._register(ehe(e,On.DRAG_START,e=>e.dataTransfer?.setData(FL.TEXT,this._action.label)))),this._register(ehe(t,gm.Tap,e=>this.onClick(e,!0))),this._register(ehe(t,On.MOUSE_DOWN,e=>{i||An.stop(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")})),F&&this._register(ehe(t,On.CONTEXT_MENU,e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)})),this._register(ehe(t,On.CLICK,e=>{An.stop(e,!0),this.options&&this.options.isMenu||this.onClick(e)})),this._register(ehe(t,On.DBLCLICK,e=>{An.stop(e,!0)})),[On.MOUSE_UP,On.MOUSE_OUT].forEach(e=>{this._register(ehe(t,e,e=>{An.stop(e),t.classList.remove("active")}))})}onClick(e,t=!1){An.stop(e,!0);const i=gle(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}getHoverContents(){return this.getTooltip()}updateTooltip(){if(!this.element)return;const e=this.getHoverContents()??"";if(this.updateAriaLabel(),this.customHover||""===e)this.customHover&&this.customHover.update(e);else{const t=this.options.hoverDelegate??$_e("element");this.customHover=this._store.add(Bve().setupManagedHover(t,this.element,e))}}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}},DE=class extends LE{constructor(e,t,i){super(e,t,i={...i,icon:void 0!==i.icon&&i.icon,label:void 0===i.label||i.label}),this.options=i,this.cssClass=""}render(e){super.render(e),ple(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding&&!this.options.keybindingNotRenderedWithLabel){const e=document.createElement("span");e.classList.add("keybinding"),e.textContent=this.options.keybinding,this.element.appendChild(e)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===ro.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label,this.options.keybinding&&(e=Vae(0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label?.classList.remove("codicon")}updateEnabled(){this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element?.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element?.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(void 0!==this.action.checked?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}},IE=class extends LE{constructor(e,t,i,n,o,s,r){super(e,t),this.selectBox=new kE(i,n,o,s,r),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){this.selectBox?.focus()}blur(){this.selectBox?.blur()}render(e){this.selectBox.render(e)}},NE=class extends Ie{get onDidBlur(){return this._onDidBlur.event}get onDidCancel(){return this._onDidCancel.event}get onDidRun(){return this._onDidRun.event}get onWillRun(){return this._onWillRun.event}constructor(e,t={}){let i,n;switch(super(),this._actionRunnerDisposables=this._register(new De),this.viewItemDisposables=this._register(new Te),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new je),this._onDidCancel=this._register(new je({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.cancelHasListener=!1,this._onDidRun=this._register(new je),this._onWillRun=this._register(new je),this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(G_e()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new so,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(e=>this._onWillRun.fire(e))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",this._orientation){case 0:i=[15],n=[17];break;case 1:i=[16],n=[18],this.domNode.className+=" vertical"}this._register(ehe(this.domNode,On.KEY_DOWN,e=>{const t=new we(e);let o=!0;const s="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;i&&(t.equals(i[0])||t.equals(i[1]))?o=this.focusPrevious():n&&(t.equals(n[0])||t.equals(n[1]))?o=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?o=this.focusFirst():t.equals(13)?o=this.focusLast():t.equals(2)&&s instanceof LE&&s.trapsArrowNavigation?o=this.focusNext(void 0,!0):this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:o=!1,o&&(t.preventDefault(),t.stopPropagation())})),this._register(ehe(this.domNode,On.KEY_UP,e=>{const t=new we(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026)||t.equals(16)||t.equals(18)||t.equals(15)||t.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(Ehe(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{vhe()!==this.domNode&&phe(vhe(),this.domNode)||(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find(e=>e instanceof LE&&e.isEnabled());e instanceof LE&&e.setFocusable(!0)}else this.viewItems.forEach(e=>{e instanceof LE&&e.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(phe(vhe(),t)){this.focusedItem=e,this.viewItems[this.focusedItem]?.showHover?.();break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach(t=>t.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(e=>this._onWillRun.fire(e))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){if("number"==typeof e)return this.viewItems[e]?.action;if(xhe(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t<this.actionsList.childNodes.length;t++)if(this.actionsList.childNodes[t]===e)return this.viewItems[t].action}}push(e,t={}){const i=Array.isArray(e)?e:[e];let n=lle(t.index)?t.index:null;if(i.forEach(e=>{const i=document.createElement("li");let o;i.className="action-item",i.setAttribute("role","presentation");const s={hoverDelegate:this._hoverDelegate,...t,isTabList:"tablist"===this.options.ariaRole};this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e,s)),o||(o=new DE(this.context,e,s)),this.options.allowContextMenu||this.viewItemDisposables.set(o,ehe(i,On.CONTEXT_MENU,e=>{An.stop(e,!0)})),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(o)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,o),n++)}),this.focusable){let e=!1;for(const t of this.viewItems){if(!(t instanceof LE))continue;let i;i=!(e||t.action.id===ro.ID||!t.isEnabled()&&this.options.focusOnlyEnabledItems),i?(t.setFocusable(!0),e=!0):t.setFocusable(!1)}}"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e<this.actionsList.children.length){const t=this.actionsList.children.item(e);if(t)return t.clientWidth}return 0}pull(e){e>=0&&e<this.viewItems.length&&(this.actionsList.childNodes[e].remove(),this.viewItemDisposables.deleteAndDispose(this.viewItems[e]),kle(this.viewItems.splice(e,1)),this.refreshRole())}clear(){this.isEmpty()||(this.viewItems=kle(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Jce(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return 0===this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){const e=this.viewItems.findIndex(e=>e.isEnabled());this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e,t){if(void 0===this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const i=this.focusedItem;let n;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=i,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,n=this.viewItems[this.focusedItem]}while(this.focusedItem!==i&&(this.options.focusOnlyEnabledItems&&!n.isEnabled()||n.action.id===ro.ID));return this.updateFocus(void 0,void 0,t),!0}focusPrevious(e){if(void 0===this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===ro.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&this.viewItems[this.previouslyFocusedItem]?.blur();const n=void 0!==this.focusedItem?this.viewItems[this.focusedItem]:void 0;if(n){let o=!0;fle(n.focus)||(o=!1),this.options.focusOnlyEnabledItems&&fle(n.isEnabled)&&!n.isEnabled()&&(o=!1),n.action.id===ro.ID&&(o=!1),o?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),o&&n.showHover?.()}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof LE){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=kle(this.viewItems),this.getContainer().remove(),super.dispose()}},EE=class extends Ie{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new ld(e,t)),this._width=Qce(this,this.elementSizeObserver.getWidth()),this._height=Qce(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(e=>Wce(e=>{this._width.set(this.elementSizeObserver.getWidth(),e),this._height.set(this.elementSizeObserver.getHeight(),e)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}},ME=class extends Ie{constructor(e,t,i){super(),this._register(new RE(e,i)),this._register(ewe(i,{height:t.actualHeight,top:t.actualTop}))}},TE=class{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=Qce(this,void 0),this._actualHeight=Qce(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=e=>{this._actualTop.set(e,void 0)},this.onComputedHeight=e=>{this._actualHeight.set(e,void 0)}}},(RE=class e{constructor(t,i){this._editor=t,this._domElement=i,this._overlayWidgetId="managedOverlayWidget-"+e._counter++,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}})._counter=0,OE=class extends ot{dispose(){super.dispose(!0)}},AE=class{static create(e,t=void 0){return new PE(e,e,t)}static createWithDisposable(e,t,i=void 0){const n=new De;return n.add(t),n.add(e),new PE(e,n,i)}},PE=class extends AE{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new FE(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,0===this._refCount&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);-1!==t&&this._owners.splice(t,1)}}},FE=class extends AE{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}},WE=class e{static inverse(t,i,n){const o=[];let s=1,r=1;for(const l of t){const t=new e(new Qw(s,l.original.startLineNumber),new Qw(r,l.modified.startLineNumber));t.modified.isEmpty||o.push(t),s=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new e(new Qw(s,i+1),new Qw(r,n+1));return a.modified.isEmpty||o.push(a),o}static clip(t,i,n){const o=[];for(const s of t){const t=s.original.intersect(i),r=s.modified.intersect(n);t&&!t.isEmpty&&r&&!r.isEmpty&&o.push(new e(t,r))}return o}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new e(this.modified,this.original)}join(t){return new e(this.original.join(t.original),this.modified.join(t.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new VE(e,t);if(1===this.original.startLineNumber||1===this.modified.startLineNumber){if(1!==this.modified.startLineNumber||1!==this.original.startLineNumber)throw new y("not a valid diff");return new VE(new mr(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new mr(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}return new VE(new mr(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new mr(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,t){if(owe(this.original.endLineNumberExclusive,e)&&owe(this.modified.endLineNumberExclusive,t))return new VE(new mr(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new mr(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new VE(mr.fromPositions(new to(this.original.startLineNumber,1),nwe(new to(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),mr.fromPositions(new to(this.modified.startLineNumber,1),nwe(new to(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new VE(mr.fromPositions(nwe(new to(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),nwe(new to(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),mr.fromPositions(nwe(new to(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),nwe(new to(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new y}},BE=class e extends WE{static fromRangeMappings(t){return new e(Qw.join(t.map(e=>Qw.fromRangeInclusive(e.originalRange))),Qw.join(t.map(e=>Qw.fromRangeInclusive(e.modifiedRange))),t)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new e(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new e(this.original,this.modified,[this.toRangeMapping()])}},VE=class e{static fromEdit(t){const i=t.getNewRanges();return t.replacements.map((t,n)=>new e(t.range,i[n]))}static assertSorted(e){for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];if(!i.originalRange.getEndPosition().isBeforeOrEqual(n.originalRange.getStartPosition())||!i.modifiedRange.getEndPosition().isBeforeOrEqual(n.modifiedRange.getStartPosition()))throw new y("Range mappings must be sorted")}}constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new e(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new dC(this.originalRange,t)}},HE={IconContribution:"base.contributions.icons"},function(e){e.getDefinition=function(e,t){let i=e.defaults;for(;mo.isThemeIcon(i);){const e=$E.getIcon(i.id);if(!e)return;i=e.defaults}return i}}(zE||(zE={})),function(e){e.toJSONObject=function(e){return{weight:e.weight,style:e.style,src:e.src.map(e=>({format:e.format,location:e.location.toString()}))}},e.fromJSONObject=function(e){const t=e=>sle(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every(e=>sle(e.format)&&sle(e.location)))return{weight:t(e.weight),style:t(e.style),src:e.src.map(e=>({format:e.format,location:_i.parse(e.location)}))}}}(UE||(UE={})),KE=/^([\w_-]+)$/,qE=Vae(2024,"The font ID must only contain letters, numbers, underscores and dashes."),jE=class extends Ie{constructor(){super(),this._onDidChange=this._register(new je),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:Vae(2025,"The id of the font to use. If not set, the font that is defined first is used."),pattern:KE.source,patternErrorMessage:qE},fontCharacter:{type:"string",description:Vae(2026,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${mo.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return o}const s={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=s;const r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;mo.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map(e=>this.iconsById[e]);for(const o of n.filter(e=>!!e.description).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${mo.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(e=>!mo.isThemeIcon(e.defaults)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join("\n")}},$E=new jE,ts.add(HE.IconContribution,$E),function(){const e=nue();for(const t in e){const i="\\"+e[t].toString(16);$E.registerIcon(t,{fontCharacter:i})}}(),GE="vscode://schemas/icons",(ZE=ts.as(Ea.JSONContribution)).registerSchema(GE,$E.getIconSchema()),YE=new ft(()=>ZE.notifySchemaChanged(GE),200),$E.onDidChange(()=>{YE.isScheduled()||YE.schedule()}),QE=rwe("widget-close",go.close,Vae(2027,"Icon for the close action in widgets.")),rwe("goto-previous-location",go.arrowUp,Vae(2028,"Icon for goto previous editor location.")),rwe("goto-next-location",go.arrowDown,Vae(2029,"Icon for goto next editor location.")),mo.modify(go.sync,"spin"),mo.modify(go.loading,"spin"),JE=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},eM=function(e,t){return function(i,n){t(i,n,e)}},tM=rwe("diff-review-insert",go.add,Vae(97,"Icon for 'Insert' in accessible diff viewer.")),iM=rwe("diff-review-remove",go.remove,Vae(98,"Icon for 'Remove' in accessible diff viewer.")),nM=rwe("diff-review-close",go.close,Vae(99,"Icon for 'Close' in accessible diff viewer.")),(XE=class extends Ie{constructor(e,t,i,n,o,s,r,a,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=o,this._height=s,this._diffs=r,this._models=a,this._instantiationService=l,this._state=Dce(this,e=>{const t=this._visible.read(e);if(this._parentNode.style.visibility=t?"visible":"hidden",!t)return null;const i=e.store.add(this._instantiationService.createInstance(sM,this._diffs,this._models,this._setVisible,this._canClose));return{model:i,view:e.store.add(this._instantiationService.createInstance(gM,this._parentNode,i,this._width,this._height,this._models))}}).recomputeInitiallyAndOnChange(this._store)}next(){Wce(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){Wce(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){Wce(e=>{this._setVisible(!1,e)})}})._ttPolicy=Bpe("diffReview",{createHTML:e=>e}),oM=XE,oM=JE([eM(8,Jn)],oM),sM=class extends Ie{constructor(e,t,i,n,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=o,this._groups=Qce(this,[]),this._currentGroupIdx=Qce(this,0),this._currentElementIdx=Qce(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((e,t)=>this._groups.read(t)[e]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((e,t)=>this.currentGroup.read(t)?.lines[e]),this._register(Rce(e=>{const t=this._diffs.read(e);if(!t)return void this._groups.set([],void 0);const i=function(e,t,i){const n=[];for(const o of ece(e,(e,t)=>t.modified.startLineNumber-e.modified.endLineNumberExclusive<2*rM)){const e=[];e.push(new dM);const s=new Qw(Math.max(1,o[0].original.startLineNumber-rM),Math.min(o[o.length-1].original.endLineNumberExclusive+rM,t+1)),r=new Qw(Math.max(1,o[0].modified.startLineNumber-rM),Math.min(o[o.length-1].modified.endLineNumberExclusive+rM,i+1));tce(o,(t,i)=>{const n=new Qw(t?t.original.endLineNumberExclusive:s.startLineNumber,i?i.original.startLineNumber:s.endLineNumberExclusive),o=new Qw(t?t.modified.endLineNumberExclusive:r.startLineNumber,i?i.modified.startLineNumber:r.endLineNumberExclusive);n.forEach(t=>{e.push(new uM(t,o.startLineNumber+(t-n.startLineNumber)))}),i&&(i.original.forEach(t=>{e.push(new cM(i,t))}),i.modified.forEach(t=>{e.push(new hM(i,t))}))});const a=o[0].modified.join(o[o.length-1].modified),l=o[0].original.join(o[o.length-1].original);n.push(new lM(new WE(a,l),e))}return n}(t,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());Wce(e=>{const t=this._models.getModifiedPosition();if(t){const n=i.findIndex(e=>t?.lineNumber<e.range.modified.endLineNumberExclusive);-1!==n&&this._currentGroupIdx.set(n,e)}this._groups.set(i,e)})})),this._register(Rce(e=>{const t=this.currentElement.read(e);t?.type===aM.Deleted?this._accessibilitySignalService.playSignal(TL.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):t?.type===aM.Added&&this._accessibilitySignalService.playSignal(TL.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(Rce(e=>{const t=this.currentElement.read(e);if(t&&t.type!==aM.Header){const e=t.modifiedLineNumber??t.diff.modified.startLineNumber;this._models.modifiedSetSelection(mr.fromPositions(new to(e,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||Vce(t,t=>{this._currentGroupIdx.set(hl.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),t),this._currentElementIdx.set(0,t)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Wce(i=>{this._currentElementIdx.set(hl.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);-1!==i&&Wce(e=>{this._currentElementIdx.set(i,e)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===aM.Deleted?this._models.originalReveal(mr.fromPositions(new to(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==aM.Header?mr.fromPositions(new to(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}},sM=JE([eM(4,NL)],sM),rM=3,function(e){e[e.Header=0]="Header",e[e.Unchanged=1]="Unchanged",e[e.Deleted=2]="Deleted",e[e.Added=3]="Added"}(aM||(aM={})),lM=class{constructor(e,t){this.range=e,this.lines=t}},dM=class{constructor(){this.type=aM.Header}},cM=class{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=aM.Deleted,this.modifiedLineNumber=void 0}},hM=class{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=aM.Added,this.originalLineNumber=void 0}},uM=class{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=aM.Unchanged}},gM=class extends Ie{constructor(e,t,i,n,o,s){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=o,this._languageService=s,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const r=document.createElement("div");r.className="diff-review-actions",this._actionBar=this._register(new NE(r)),this._register(Rce(e=>{this._actionBar.clear(),this._model.canClose.read(e)&&this._actionBar.push(tue({id:"diffreview.close",label:Vae(100,"Close"),class:"close-diff-review "+mo.asClassName(nM),enabled:!0,run:async()=>t.close()}),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new Tm(this._content,{})),Rhe(this.domNode,this._scrollbar.getDomNode(),r),this._register(Rce(e=>{this._height.read(e),this._width.read(e),this._scrollbar.scanDomNode()})),this._register(Dle(()=>{Rhe(this.domNode)})),this._register(ewe(this.domNode,{width:this._width,height:this._height})),this._register(ewe(this._content,{width:this._width,height:this._height})),this._register(Pce((e,t)=>{this._model.currentGroup.read(e),this._render(t)})),this._register(xn(this.domNode,"keydown",e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._model.goToNextLine()),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._model.goToPreviousLine()),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this._model.close()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",Vae(101,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Wge(n,i.get(59)),Rhe(this._content,n);const o=this._models.getOriginalModel(),s=this._models.getModifiedModel();if(!o||!s)return;const r=o.getOptions(),a=s.getOptions(),l=i.get(75),d=this._model.currentGroup.get();for(const c of d?.lines||[]){if(!d)break;let h;if(c.type===aM.Header){const e=document.createElement("div");e.className="diff-review-row",e.setAttribute("role","listitem");const t=d.range,i=this._model.currentGroupIndex.get(),n=this._model.groups.get().length,o=e=>0===e?Vae(102,"no lines changed"):1===e?Vae(103,"1 line changed"):Vae(104,"{0} lines changed",e),s=o(t.original.length),r=o(t.modified.length);e.setAttribute("aria-label",Vae(105,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",i+1,n,t.original.startLineNumber,s,t.modified.startLineNumber,r));const a=document.createElement("div");a.className="diff-review-cell diff-review-summary",a.appendChild(document.createTextNode(`${i+1}/${n}: @@ -${t.original.startLineNumber},${t.original.length} +${t.modified.startLineNumber},${t.modified.length} @@`)),e.appendChild(a),h=e}else h=this._createRow(c,l,this._width.get(),t,o,r,i,s,a);n.appendChild(h);const u=Dce(e=>this._model.currentElement.read(e)===c);e.add(Rce(e=>{const t=u.read(e);h.tabIndex=t?0:-1,t&&h.focus()})),e.add(ehe(h,"focus",()=>{this._model.goToLine(c)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,o,s,r,a,l){const d=n.get(165),c=d.glyphMarginWidth+d.lineNumbersWidth,h=r.get(165),u=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="",m=null;switch(e.type){case aM.Added:g="diff-review-row line-insert",p=" char-insert",m=tM;break;case aM.Deleted:g="diff-review-row line-delete",p=" char-delete",m=iM}const f=document.createElement("div");f.style.minWidth=i+"px",f.className=g,f.setAttribute("role","listitem"),f.ariaLevel="";const _=document.createElement("div");_.className="diff-review-cell",_.style.height=`${t}px`,f.appendChild(_);const b=document.createElement("span");b.style.width=c+"px",b.style.minWidth=c+"px",b.className="diff-review-line-number"+p,void 0!==e.originalLineNumber?b.appendChild(document.createTextNode(String(e.originalLineNumber))):b.innerText=" ",_.appendChild(b);const v=document.createElement("span");v.style.width=u+"px",v.style.minWidth=u+"px",v.style.paddingRight="10px",v.className="diff-review-line-number"+p,void 0!==e.modifiedLineNumber?v.appendChild(document.createTextNode(String(e.modifiedLineNumber))):v.innerText=" ",_.appendChild(v);const w=document.createElement("span");if(w.className="diff-review-spacer",m){const e=document.createElement("span");e.className=mo.asClassName(m),e.innerText="  ",w.appendChild(e)}else w.innerText="  ";let C;if(_.appendChild(w),void 0!==e.modifiedLineNumber){let t=this._getLineHtml(a,r,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);oM._ttPolicy&&(t=oM._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),C=a.getLineContent(e.modifiedLineNumber)}else{let t=this._getLineHtml(o,n,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);oM._ttPolicy&&(t=oM._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),C=o.getLineContent(e.originalLineNumber)}0===C.length&&(C=Vae(106,"blank"));let y="";switch(e.type){case aM.Unchanged:y=e.originalLineNumber===e.modifiedLineNumber?Vae(107,"{0} unchanged line {1}",C,e.originalLineNumber):Vae(108,"{0} original line {1} modified line {2}",C,e.originalLineNumber,e.modifiedLineNumber);break;case aM.Added:y=Vae(109,"+ {0} modified line {1}",C,e.modifiedLineNumber);break;case aM.Deleted:y=Vae(110,"- {0} original line {1}",C,e.originalLineNumber)}return f.setAttribute("aria-label",y),f}_getLineHtml(e,t,i,n,o){const s=e.getLineContent(n),r=t.get(59),a=t.get(117).verticalScrollbarSize,l=gl.createEmpty(s,o),d=iv.isBasicASCII(s,e.mightContainNonBasicASCII()),c=iv.containsRTL(s,d,e.mightContainRTL());return Lpe(new Wp(r.isMonospace&&!t.get(40),r.canUseHalfwidthRightwardsArrow,s,!1,d,c,0,l,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(133),t.get(113),t.get(108),t.get(60)!==zd.OFF,null,null,a)).html}},gM=JE([eM(5,La)],gM),pM=class{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}},mpe("diffEditor.move.border","#8b8b8b9c",Vae(137,"The border color for text that got moved in the diff editor.")),mpe("diffEditor.moveActive.border","#FFA500",Vae(138,"The active border color for text that got moved in the diff editor.")),mpe("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},Vae(139,"The color of the shadow around unchanged region widgets.")),mM=rwe("diff-insert",go.add,Vae(140,"Line decoration for inserts in the diff editor.")),fM=rwe("diff-remove",go.remove,Vae(141,"Line decoration for removals in the diff editor.")),_M=Lx.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+mo.asClassName(mM),marginClassName:"gutter-insert"}),bM=Lx.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+mo.asClassName(fM),marginClassName:"gutter-delete"}),vM=Lx.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),wM=Lx.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),CM=Lx.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),yM=Lx.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),SM=Lx.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),xM=Lx.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),kM=Lx.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),LM=Lx.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),DM=eue("editorWorkerService"),NM=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},EM=function(e,t){return function(i,n){t(i,n,e)}},TM=eue("diffProviderFactoryService"),RM=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(OM,e)}},RM=NM([EM(0,Jn)],RM),dge(TM,RM,1),IM=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new je,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,i,n){if("string"!=typeof this.diffAlgorithm)return this.diffAlgorithm.computeDiff(e,t,i,n);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return 1===t.getLineCount()&&1===t.getLineMaxColumn(1)?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new BE(new Qw(1,2),new Qw(1,t.getLineCount()+1),[new VE(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const o=JSON.stringify([e.uri.toString(),t.uri.toString()]),s=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),r=MM.diffCache.get(o);if(r&&r.context===s)return r.result;const a=Fe.create(),l=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=a.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:l?.quitEarly??!0,detectedMoves:i.computeMoves?l?.moves.length??0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!l)throw new Error("no diff result available");return MM.diffCache.size>10&&MM.diffCache.delete(MM.diffCache.keys().next().value),MM.diffCache.set(o,{result:l,context:s}),l}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,"string"!=typeof e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},MM=IM,IM.diffCache=new Map,OM=IM,OM=MM=NM([EM(1,DM),EM(2,fs)],OM),FM=class e{static trivial(t,i){return new e([new WM(hl.ofLength(t.length),hl.ofLength(i.length))],!1)}static trivialTimedOut(t,i){return new e([new WM(hl.ofLength(t.length),hl.ofLength(i.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}},WM=class e{static invert(t,i){const n=[];return tce(t,(t,o)=>{n.push(e.fromOffsetPairs(t?t.getEndExclusives():BM.zero,o?o.getStarts():new BM(i,(t?t.seq2Range.endExclusive-t.seq1Range.endExclusive:0)+i)))}),n}static fromOffsetPairs(t,i){return new e(new hl(t.offset1,i.offset1),new hl(t.offset2,i.offset2))}static assertSorted(e){let t;for(const i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new y("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new e(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(t){return new e(this.seq1Range.join(t.seq1Range),this.seq2Range.join(t.seq2Range))}delta(t){return 0===t?this:new e(this.seq1Range.delta(t),this.seq2Range.delta(t))}deltaStart(t){return 0===t?this:new e(this.seq1Range.deltaStart(t),this.seq2Range.deltaStart(t))}deltaEnd(t){return 0===t?this:new e(this.seq1Range.deltaEnd(t),this.seq2Range.deltaEnd(t))}intersect(t){const i=this.seq1Range.intersect(t.seq1Range),n=this.seq2Range.intersect(t.seq2Range);if(i&&n)return new e(i,n)}getStarts(){return new BM(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new BM(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}},(AM=BM=class e{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(t){return 0===t?this:new e(this.offset1+t,this.offset2+t)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}).zero=new AM(0,0),AM.max=new AM(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),(PM=VM=class{isValid(){return!0}}).instance=new PM,HM=class{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new y("timeout must be positive")}isValid(){return Date.now()-this.startTime<this.timeout||!this.valid||(this.valid=!1),this.valid}},zM=class{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}},UM=class e{static getKey(e){let t=this.chrKeys.get(e);return void 0===t&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(t,i,n){this.range=t,this.lines=i,this.source=n,this.histogram=[];let o=0;for(let s=t.startLineNumber-1;s<t.endLineNumberExclusive-1;s++){const t=i[s];for(let i=0;i<t.length;i++){o++;const n=t[i],s=e.getKey(n);this.histogram[s]=(this.histogram[s]||0)+1}o++;const n=e.getKey("\n");this.histogram[n]=(this.histogram[n]||0)+1}this.totalCount=o}computeSimilarity(e){let t=0;const i=Math.max(this.histogram.length,e.histogram.length);for(let n=0;n<i;n++)t+=Math.abs((this.histogram[n]??0)-(e.histogram[n]??0));return 1-t/(this.totalCount+e.totalCount)}},UM.chrKeys=new Map,KM=class extends Xi{constructor(e,t,i){super(i),this.event=t,this.handleEvent=()=>{Wce(e=>{for(const t of this._observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>this.debugName)},this.debugName="string"==typeof e?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}},qM=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jM=function(e,t){return function(i,n){t(i,n,e)}},$M=class extends Ie{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=Qce(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Qce(this,void 0),this.diff=this._diff,this._unchangedRegions=Qce(this,void 0),this.unchangedRegions=Dce(this,e=>this._options.hideUnchangedRegions.read(e)?this._unchangedRegions.read(e)?.regions??[]:(Wce(e=>{for(const t of this._unchangedRegions.read(void 0)?.regions||[])t.collapseAll(e)}),[])),this.movedTextToCompare=Qce(this,void 0),this._activeMovedText=Qce(this,void 0),this._hoveredMovedText=Qce(this,void 0),this.activeMovedText=Dce(this,e=>this.movedTextToCompare.read(e)??this._hoveredMovedText.read(e)??this._activeMovedText.read(e)),this._cancellationTokenSource=new ot,this._diffProvider=Dce(this,e=>{const t=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(e)});return{diffProvider:t,onChangeSignal:cwe("onDidChange",t.onDidChange)}}),this._register(Dle(()=>this._cancellationTokenSource.cancel()));const n=t_e("contentChangedSignal"),o=this._register(new ft(()=>n.trigger(void 0),200));this._register(Rce(t=>{const i=this._unchangedRegions.read(t);if(!i||i.regions.some(e=>e.isDragged.read(t)))return;const n=i.originalDecorationIds.map(t=>e.original.getDecorationRange(t)).map(e=>e?Qw.fromRangeInclusive(e):void 0),o=i.modifiedDecorationIds.map(t=>e.modified.getDecorationRange(t)).map(e=>e?Qw.fromRangeInclusive(e):void 0),s=i.regions.map((e,i)=>n[i]&&o[i]?new YM(n[i].startLineNumber,o[i].startLineNumber,n[i].length,e.visibleLineCountTop.read(t),e.visibleLineCountBottom.read(t)):void 0).filter(ule),r=[];let a=!1;for(const e of ece(s,(e,i)=>e.getHiddenModifiedRange(t).endLineNumberExclusive===i.getHiddenModifiedRange(t).startLineNumber))if(e.length>1){a=!0;const t=e.reduce((e,t)=>e+t.lineCount,0),i=new YM(e[0].originalLineNumber,e[0].modifiedLineNumber,t,e[0].visibleLineCountTop.read(void 0),e[e.length-1].visibleLineCountBottom.read(void 0));r.push(i)}else r.push(e[0]);if(a){const t=e.original.deltaDecorations(i.originalDecorationIds,r.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),n=e.modified.deltaDecorations(i.modifiedDecorationIds,r.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));Wce(e=>{this._unchangedRegions.set({regions:r,originalDecorationIds:t,modifiedDecorationIds:n},e)})}}));const s=(t,i,n)=>{const o=YM.fromDiffs(t.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(n),this._options.hideUnchangedRegionsContextLineCount.read(n));let s;const r=this._unchangedRegions.get();if(r){const t=r.originalDecorationIds.map(t=>e.original.getDecorationRange(t)).map(e=>e?Qw.fromRangeInclusive(e):void 0),i=r.modifiedDecorationIds.map(t=>e.modified.getDecorationRange(t)).map(e=>e?Qw.fromRangeInclusive(e):void 0);let o=function(e,t){let i;return e.filter(e=>{const n=t(e,i);return i=e,n})}(r.regions.map((e,n)=>{if(!t[n]||!i[n])return;const o=t[n].length;return new YM(t[n].startLineNumber,i[n].startLineNumber,o,Math.min(e.visibleLineCountTop.get(),o),Math.min(e.visibleLineCountBottom.get(),o-e.visibleLineCountTop.get()))}).filter(ule),(e,t)=>!t||e.modifiedLineNumber>=t.modifiedLineNumber+t.lineCount&&e.originalLineNumber>=t.originalLineNumber+t.lineCount).map(e=>new WE(e.getHiddenOriginalRange(n),e.getHiddenModifiedRange(n)));o=WE.clip(o,Qw.ofLength(1,e.original.getLineCount()),Qw.ofLength(1,e.modified.getLineCount())),s=WE.inverse(o,e.original.getLineCount(),e.modified.getLineCount())}const a=[];if(s)for(const e of o){const t=s.filter(t=>t.original.intersectsStrict(e.originalUnchangedRange)&&t.modified.intersectsStrict(e.modifiedUnchangedRange));a.push(...e.setVisibleRanges(t,i))}else a.push(...o);const l=e.original.deltaDecorations(r?.originalDecorationIds||[],a.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),d=e.modified.deltaDecorations(r?.modifiedDecorationIds||[],a.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:a,originalDecorationIds:l,modifiedDecorationIds:d},i)};this._register(e.modified.onDidChangeContent(t=>{this._diff.get()&&(ey.fromModelContentChanges(t.changes),this._lastDiff,e.original,e.modified),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(t=>{this._diff.get()&&(ey.fromModelContentChanges(t.changes),this._lastDiff,e.original,e.modified),this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(Pce(async(t,i)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(t),this._options.hideUnchangedRegionsContextLineCount.read(t),o.cancel(),n.read(t);const r=this._diffProvider.read(t);r.onChangeSignal.read(t),this._isDiffUpToDate.set(!1,void 0);let a=[];i.add(e.original.onDidChangeContent(e=>{const t=ey.fromModelContentChanges(e.changes);a=Jme(a,t)}));let l=[];i.add(e.modified.onDidChangeContent(e=>{const t=ey.fromModelContentChanges(e.changes);l=Jme(l,t)}));let d=await r.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(t),maxComputationTimeMs:this._options.maxComputationTimeMs.read(t),computeMoves:this._options.showMoves.read(t)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(d=hwe(d,e.original,e.modified),e.original,d=void e.modified??d,e.original,d=void e.modified??d,Wce(e=>{s(d,e),this._lastDiff=d;const t=GM.fromDiffResult(d);this._diff.set(t,e),this._isDiffUpToDate.set(!0,e);const i=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(i?this._lastDiff.moves.find(e=>e.lineRangeMapping.modified.intersect(i.lineRangeMapping.modified)):void 0,e)}))}))}ensureModifiedLineIsVisible(e,t,i){if(0===this.diff.get()?.mappings.length)return;const n=this._unchangedRegions.get()?.regions||[];for(const o of n)if(o.getHiddenModifiedRange(void 0).contains(e))return void o.showModifiedLine(e,t,i)}ensureOriginalLineIsVisible(e,t,i){if(0===this.diff.get()?.mappings.length)return;const n=this._unchangedRegions.get()?.regions||[];for(const o of n)if(o.getHiddenOriginalRange(void 0).contains(e))return void o.showOriginalLine(e,t,i)}async waitForDiff(){await dwe(this.isDiffUpToDate,e=>e)}serializeState(){return{collapsedRegions:this._unchangedRegions.get()?.regions.map(e=>({range:e.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions?.map(e=>Qw.deserialize(e.range)),i=this._unchangedRegions.get();i&&t&&Wce(e=>{for(const n of i.regions)for(const i of t)if(n.modifiedUnchangedRange.intersect(i)){n.setHiddenModifiedRange(i,e);break}})}},$M=qM([jM(2,TM)],$M),GM=class e{static fromDiffResult(t){return new e(t.changes.map(e=>new ZM(e)),t.moves||[],t.identical,t.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}},ZM=class{constructor(e){this.lineRangeMapping=e}},YM=class e{static fromDiffs(t,i,n,o,s){const r=BE.inverse(t,i,n),a=[];for(const l of r){let t=l.original.startLineNumber,r=l.modified.startLineNumber,d=l.original.length;const c=1===t&&1===r,h=t+d===i+1&&r+d===n+1;(c||h)&&d>=s+o?(c&&!h&&(d-=s),h&&!c&&(t+=s,r+=s,d-=s),a.push(new e(t,r,d,0,0))):d>=2*s+o&&(t+=s,r+=s,d-=2*s,a.push(new e(t,r,d,0,0)))}return a}get originalUnchangedRange(){return Qw.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Qw.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Qce(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Qce(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Dce(this,e=>this.visibleLineCountTop.read(e)+this.visibleLineCountBottom.read(e)===this.lineCount&&!this.isDragged.read(e)),this.isDragged=Qce(this,void 0);const s=Math.max(Math.min(n,this.lineCount),0),r=Math.max(Math.min(o,this.lineCount-n),0);ile(n===s),ile(o===r),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(r,void 0)}setVisibleRanges(t,i){const n=[],o=new Xw(t.map(e=>e.modified)).subtractFrom(this.modifiedUnchangedRange);let s=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(0===o.ranges.length)this.showAll(i),n.push(this);else{let t=0;for(const l of o.ranges){const d=t===o.ranges.length-1;t++;const c=(d?a:l.endLineNumberExclusive)-r,h=new e(s,r,c,0,0);h.setHiddenModifiedRange(l,i),n.push(h),s=h.originalUnchangedRange.endLineNumberExclusive,r=h.modifiedUnchangedRange.endLineNumberExclusive}}return n}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Qw.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Qw.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;0===t&&n<o||1===t?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+n,i):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+o,i)}showOriginalLine(e,t,i){const n=e-this.originalLineNumber,o=this.originalLineNumber+this.lineCount-e;0===t&&n<o||1===t?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+o-n,this.getMaxVisibleLineCountTop()),i):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+n-o,this.getMaxVisibleLineCountBottom()),i)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,i){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,i),this._visibleLineCountBottom.set(t,i)}},QM=class extends Ie{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,o,s,r,a,l,d){super(),this._getViewZoneId=e,this._marginDomNode=t,this._deletedCodeDomNode=i,this._modifiedEditor=n,this._diff=o,this._editor=s,this._renderLinesResult=r,this._originalTextModel=a,this._contextMenuService=l,this._clipboardService=d,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=mo.asClassName(go.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const c=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${c}px`,this._diffActions.style.lineHeight=`${c}px`,this._marginDomNode.appendChild(this._diffActions);let h=0;const u=n.getOption(144)&&!U,g=(e,t,i)=>{this._contextMenuService.showContextMenu({domForShadowRoot:u?n.getDomNode()??void 0:void 0,getAnchor:()=>e,onHide:i,getActions:()=>{const e=[],t=o.modified.isEmpty;return e.push(new oo("diff.clipboard.copyDeletedContent",t?o.original.length>1?Vae(112,"Copy deleted lines"):Vae(113,"Copy deleted line"):o.original.length>1?Vae(114,"Copy changed lines"):Vae(115,"Copy changed line"),void 0,!0,async()=>{const e=this._originalTextModel.getValueInRange(o.original.toExclusiveRange());await this._clipboardService.writeText(e)})),o.original.length>1&&e.push(new oo("diff.clipboard.copyDeletedLineContent",t?Vae(116,"Copy deleted line ({0})",o.original.startLineNumber+h):Vae(117,"Copy changed line ({0})",o.original.startLineNumber+h),void 0,!0,async()=>{let e=this._originalTextModel.getLineContent(o.original.startLineNumber+h);""===e&&(e=0===this._originalTextModel.getEndOfLineSequence()?"\n":"\r\n"),await this._clipboardService.writeText(e)})),n.getOption(104)||e.push(new oo("diff.inline.revertChange",Vae(118,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),e},autoSelectFirstItem:!0})};this._register(xn(this._diffActions,"mousedown",e=>{if(!e.leftButton)return;const{top:t,height:i}=lhe(this._diffActions),n=Math.floor(c/3);e.preventDefault(),g({x:e.posx,y:t+i+n})})),this._register(n.onMouseMove(e=>{8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId!==this._getViewZoneId()?this.visibility=!1:(h=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,c),this.visibility=!0)})),this._register(function(e){const{domNode:t,renderLinesResult:i,diffEntry:n,originalModel:o,clipboardService:s}=e,r=new De;return r.add(ehe(t,"copy",e=>{e.preventDefault();const r=t.ownerDocument.getSelection();if(!r||0===r.rangeCount)return;const a=r.getRangeAt(0);if(!a||a.collapsed)return;const l=a.startContainer.nodeType===Node.TEXT_NODE?a.startContainer.parentElement:a.startContainer,d=a.endContainer.nodeType===Node.TEXT_NODE?a.endContainer.parentElement:a.endContainer;if(!l||!d)return;const c=i.getModelPositionAt(l,a.startOffset),h=i.getModelPositionAt(d,a.endOffset);if(!c||!h)return;const u=c.delta(n.original.startLineNumber-1),g=h.delta(n.original.startLineNumber-1),p=g.isBefore(u)?mr.fromPositions(g,u):mr.fromPositions(u,g),m=o.getValueInRange(p);s.writeText(m)})),r}({domNode:this._deletedCodeDomNode,diffEntry:o,originalModel:this._originalTextModel,renderLinesResult:this._renderLinesResult,clipboardService:d}))}_updateLightBulbPosition(e,t,i){const{top:n}=lhe(e),o=t-n,s=Math.floor(o/i),r=s*i;if(this._diffActions.style.top=`${r}px`,this._renderLinesResult.viewLineCounts){let e=0;for(let t=0;t<this._renderLinesResult.viewLineCounts.length;t++)if(e+=this._renderLinesResult.viewLineCounts[t],s<e)return t}return s}},XM=Bpe("diffEditorWidget",{createHTML:e=>e}),JM=class{constructor(e,t=e.map(e=>null),i=!0,n=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}},eT=class e{static fromEditor(t){const i=t.getOptions(),n=i.get(59),o=i.get(165);return new e(t.getModel()?.getOptions().tabSize||0,n,i.get(40),n.typicalHalfwidthCharacterWidth,i.get(118),i.get(75),o.decorationsWidth,i.get(133),i.get(113),i.get(108),i.get(60),i.get(117).verticalScrollbarSize)}constructor(e,t,i,n,o,s,r,a,l,d,c,h,u=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=o,this.lineHeight=s,this.lineDecorationsWidth=r,this.stopRenderingLineAfter=a,this.renderWhitespace=l,this.renderControlCharacters=d,this.fontLigatures=c,this.verticalScrollbarSize=h,this.setWidth=u}withSetWidth(t){return new e(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,t)}withScrollBeyondLastColumn(t){return new e(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,t,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}},tT=class{constructor(e,t,i,n,o){this.heightInLines=e,this.minWidthInPx=t,this.viewLineCounts=i,this._renderOutputs=n,this._source=o}getModelPositionAt(e,t){let i=e;for(;i&&!i.classList.contains("view-line");)i=i.parentElement;if(!i)return;const n=i.parentElement;if(!n)return;const o=n.querySelectorAll(".view-line");let s=-1;for(let c=0;c<o.length;c++)if(o[c]===i){s=c;break}if(-1===s||s>=this._renderOutputs.length)return;let r=1,a=s;for(let c=0;c<this.viewLineCounts.length;c++){if(a<this.viewLineCounts[c]){r=c+1;break}a-=this.viewLineCounts[c]}if(r>this._source.lineTokens.length)return;const l=this._renderOutputs[s];if(!l)return;const d=Rpe(l.characterMapping,e,t)+l.offset;return new to(r,d)}},iT=class extends Hp{constructor(e,t,i){super(e,t),this.offset=i}},nT=eue("clipboardService"),oT=eue("contextViewService"),sT=eue("contextMenuService"),rT=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},aT=function(e,t){return function(i,n){t(i,n,e)}},lT=class extends Ie{constructor(e,t,i,n,o,s,r,a,l,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=s,this._origViewZonesToIgnore=r,this._modViewZonesToIgnore=a,this._clipboardService=l,this._contextMenuService=d,this._originalTopPadding=Qce(this,0),this._originalScrollOffset=Qce(this,0),this._originalScrollOffsetAnimated=Jve(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Qce(this,0),this._modifiedScrollOffset=Qce(this,0),this._modifiedScrollOffsetAnimated=Jve(this._targetWindow,this._modifiedScrollOffset,this._store);const c=Qce("invalidateAlignmentsState",0),h=this._register(new ft(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(e=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(e=>{this._canIgnoreViewZoneUpdateEvent()||h.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(e=>{(e.hasChanged(166)||e.hasChanged(75))&&h.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(e=>{(e.hasChanged(166)||e.hasChanged(75))&&h.schedule()}));const u=this._diffModel.map(e=>e?Hce(this,e.model.original.onDidChangeTokens,()=>2===e.model.original.tokenization.backgroundTokenizationState):void 0).map((e,t)=>e?.read(t)),g=Dce(e=>{const t=this._diffModel.read(e),i=t?.diff.read(e);if(!t||!i)return null;c.read(e);const n=this._options.renderSideBySide.read(e);return pwe(this._editors.original,this._editors.modified,i.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,n)}),p=Dce(e=>{const t=this._diffModel.read(e)?.movedTextToCompare.read(e);if(!t)return null;c.read(e);const i=t.changes.map(e=>new ZM(e));return pwe(this._editors.original,this._editors.modified,i,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function m(){const e=document.createElement("div");return e.className="diagonal-fill",e}const f=this._register(new De);this.viewZones=Dce(this,e=>{f.clear();const t=g.read(e)||[],i=[],n=[],s=this._modifiedTopPadding.read(e);s>0&&n.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:s,showInHiddenAreas:!0,suppressMouseDown:!0});const r=this._originalTopPadding.read(e);r>0&&i.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:r,showInHiddenAreas:!0,suppressMouseDown:!0});const a=this._options.renderSideBySide.read(e),l=a?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(l){const C=this._editors.original.getModel();for(const y of t)if(y.diff)for(let S=y.originalRange.startLineNumber;S<y.originalRange.endLineNumberExclusive;S++){if(S>C.getLineCount())return{orig:i,mod:n};l?.addRequest(C.getLineContent(S),null,null)}}const d=l?.finalize()??[];let c=0;const h=this._editors.modified.getOption(75),_=this._diffModel.read(e)?.movedTextToCompare.read(e),b=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,v=this._editors.original.getModel()?.mightContainRTL()??!1,w=eT.fromEditor(this._editors.modified);for(const x of t)if(!x.diff||a||this._options.useTrueInlineDiffRendering.read(e)&&fwe(x.diff)){const k=x.modifiedHeightInPx-x.originalHeightInPx;if(k>0){if(_?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(x.originalRange.endLineNumberExclusive-1))continue;i.push({afterLineNumber:x.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:k,showInHiddenAreas:!0,suppressMouseDown:!0})}else{if(_?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(x.modifiedRange.endLineNumberExclusive-1))continue;function L(){const t=document.createElement("div");return t.className="arrow-revert-change "+mo.asClassName(go.arrowRight),e.store.add(ehe(t,"mousedown",e=>e.stopPropagation())),e.store.add(ehe(t,"click",e=>{e.stopPropagation(),o.revert(x.diff)})),Ahe("div",{},t)}let D;x.diff&&x.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(e)&&(D=L()),n.push({afterLineNumber:x.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-k,marginDomNode:D,showInHiddenAreas:!0,suppressMouseDown:!0})}}else{if(!x.originalRange.isEmpty){u.read(e);const N=document.createElement("div");N.classList.add("view-lines","line-delete","line-delete-selectable","monaco-mouse-cursor-text");const E=this._editors.original.getModel();if(x.originalRange.endLineNumberExclusive-1>E.getLineCount())return{orig:i,mod:n};const M=new JM(x.originalRange.mapToLineArray(e=>E.tokenization.getLineTokens(e)),x.originalRange.mapToLineArray(e=>d[c++]),b,v),T=[];for(const P of x.diff.innerChanges||[])T.push(new Wk(P.originalRange.delta(-(x.diff.original.startLineNumber-1)),xM.className,0));const R=uwe(M,w,T,N),O=document.createElement("div");if(O.className="inline-deleted-margin-view-zone",Wge(O,w.fontInfo),this._options.renderIndicators.read(e))for(let F=0;F<R.heightInLines;F++){const W=document.createElement("div");W.className=`delete-sign ${mo.asClassName(fM)}`,W.setAttribute("style",`position:absolute;top:${F*h}px;width:${w.lineDecorationsWidth}px;height:${h}px;right:0;`),O.appendChild(W)}let A;f.add(new QM(()=>mle(A),O,N,this._editors.modified,x.diff,this._diffEditorWidget,R,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let B=0;B<R.viewLineCounts.length;B++){const V=R.viewLineCounts[B];V>1&&i.push({afterLineNumber:x.originalRange.startLineNumber+B,domNode:m(),heightInPx:(V-1)*h,showInHiddenAreas:!0,suppressMouseDown:!0})}n.push({afterLineNumber:x.modifiedRange.startLineNumber-1,domNode:N,heightInPx:R.heightInLines*h,minWidthInPx:R.minWidthInPx,marginDomNode:O,setZoneId(e){A=e},showInHiddenAreas:!0,suppressMouseDown:!1})}const I=document.createElement("div");I.className="gutter-delete",i.push({afterLineNumber:x.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:x.modifiedHeightInPx,marginDomNode:I,showInHiddenAreas:!0,suppressMouseDown:!0})}for(const H of p.read(e)??[]){if(!_?.lineRangeMapping.original.intersect(H.originalRange)||!_?.lineRangeMapping.modified.intersect(H.modifiedRange))continue;const z=H.modifiedHeightInPx-H.originalHeightInPx;z>0?i.push({afterLineNumber:H.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:z,showInHiddenAreas:!0,suppressMouseDown:!0}):n.push({afterLineNumber:H.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-z,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:i,mod:n}});let _=!1;this._register(this._editors.original.onDidScrollChange(e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.modified.setScrollLeft(e.scrollLeft),_=!1)})),this._register(this._editors.modified.onDidScrollChange(e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.original.setScrollLeft(e.scrollLeft),_=!1)})),this._originalScrollTop=Hce(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Hce(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(Rce(e=>{const t=this._originalScrollTop.read(e)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(e))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(e));t!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(t,1)})),this._register(Rce(e=>{const t=this._modifiedScrollTop.read(e)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(e))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(e));t!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(t,1)})),this._register(Rce(e=>{const t=this._diffModel.read(e)?.movedTextToCompare.read(e);let i=0;if(t){const e=this._editors.original.getTopForLineNumber(t.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);i=this._editors.modified.getTopForLineNumber(t.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-e}i>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(i,void 0)):i<0?(this._modifiedTopPadding.set(-i,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-i,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+i,void 0,!0)}))}},lT=rT([aT(8,nT),aT(9,sT)],lT),dT=class e extends Ie{constructor(t,i,n,o,s){super(),this._rootElement=t,this._diffModel=i,this._originalEditorLayoutInfo=n,this._modifiedEditorLayoutInfo=o,this._editors=s,this._originalScrollTop=Hce(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Hce(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=cwe("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Qce(this,0),this._modifiedViewZonesChangedSignal=cwe("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=cwe("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Dce(this,t=>{this._element.replaceChildren();const i=this._diffModel.read(t),n=i?.diff.read(t)?.movedTexts;if(!n||0===n.length)return void this.width.set(0,void 0);this._viewZonesChanged.read(t);const o=this._originalEditorLayoutInfo.read(t),s=this._modifiedEditorLayoutInfo.read(t);if(!o||!s)return void this.width.set(0,void 0);this._modifiedViewZonesChangedSignal.read(t),this._originalViewZonesChangedSignal.read(t);const r=n.map(e=>{function i(e,t){return(t.getTopForLineNumber(e.startLineNumber,!0)+t.getTopForLineNumber(e.endLineNumberExclusive,!0))/2}const n=i(e.lineRangeMapping.original,this._editors.original),o=this._originalScrollTop.read(t),s=i(e.lineRangeMapping.modified,this._editors.modified),r=n-o,a=s-this._modifiedScrollTop.read(t);return{range:new hl(Math.min(n,s),Math.max(n,s)),from:r,to:a,fromWithoutScroll:n,toWithoutScroll:s,move:e}});r.sort(function(...e){return(t,i)=>{for(const n of e){const e=n(t,i);if(!Ri.isNeitherLessOrGreaterThan(e))return e}return Ri.neitherLessOrGreaterThan}}(fce(e=>e.fromWithoutScroll>e.toWithoutScroll,Ai),fce(e=>e.fromWithoutScroll>e.toWithoutScroll?e.fromWithoutScroll:-e.toWithoutScroll,Oi)));const a=cT.compute(r.map(e=>e.range)),l=o.verticalScrollbarWidth,d=10*(a.getTrackCount()-1)+20,c=l+d+(s.contentLeft-e.movedCodeBlockPadding);let h=0;for(const e of r){const n=l+10+10*a.getTrack(h),o=15,r=15,d=c,u=s.glyphMarginWidth+s.lineNumbersWidth,g=18,p=document.createElementNS("http://www.w3.org/2000/svg","rect");p.classList.add("arrow-rectangle"),p.setAttribute("x",""+(d-u)),p.setAttribute("y",""+(e.to-g/2)),p.setAttribute("width",`${u}`),p.setAttribute("height",`${g}`),this._element.appendChild(p);const m=document.createElementNS("http://www.w3.org/2000/svg","g"),f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttribute("d",`M 0 ${e.from} L ${n} ${e.from} L ${n} ${e.to} L ${d-r} ${e.to}`),f.setAttribute("fill","none"),m.appendChild(f);const _=document.createElementNS("http://www.w3.org/2000/svg","polygon");_.classList.add("arrow"),t.store.add(Rce(t=>{f.classList.toggle("currentMove",e.move===i.activeMovedText.read(t)),_.classList.toggle("currentMove",e.move===i.activeMovedText.read(t))})),_.setAttribute("points",`${d-r},${e.to-o/2} ${d},${e.to} ${d-r},${e.to+o/2}`),m.appendChild(_),this._element.appendChild(m),h++}this.width.set(d,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Dle(()=>this._element.remove())),this._register(Rce(t=>{const i=this._originalEditorLayoutInfo.read(t),n=this._modifiedEditorLayoutInfo.read(t);i&&n&&(this._element.style.left=i.width-i.verticalScrollbarWidth+"px",this._element.style.height=`${i.height}px`,this._element.style.width=`${i.verticalScrollbarWidth+i.contentLeft-e.movedCodeBlockPadding+this.width.read(t)}px`)})),this._register(Kce(this._state));const r=Dce(e=>{const t=this._diffModel.read(e)?.diff.read(e);return t?t.movedTexts.map(e=>({move:e,original:new TE(z_e(e.lineRangeMapping.original.startLineNumber-1),18),modified:new TE(z_e(e.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(twe(this._editors.original,r.map(e=>e.map(e=>e.original)))),this._register(twe(this._editors.modified,r.map(e=>e.map(e=>e.modified)))),this._register(Pce((e,t)=>{const i=r.read(e);for(const n of i)t.add(new hT(this._editors.original,n.original,n.move,"original",this._diffModel.get())),t.add(new hT(this._editors.modified,n.modified,n.move,"modified",this._diffModel.get()))}));const a=cwe("original.onDidFocusEditorWidget",e=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>e(void 0),0))),l=cwe("modified.onDidFocusEditorWidget",e=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>e(void 0),0)));let d="modified";this._register(Ace({changeTracker:{createChangeSummary:()=>{},handleChange:(e,t)=>(e.didChange(a)&&(d="original"),e.didChange(l)&&(d="modified"),!0)}},e=>{a.read(e),l.read(e);const t=this._diffModel.read(e);if(!t)return;const i=t.diff.read(e);let n;if(i&&"original"===d){const t=this._editors.originalCursor.read(e);t&&(n=i.movedTexts.find(e=>e.lineRangeMapping.original.contains(t.lineNumber)))}if(i&&"modified"===d){const t=this._editors.modifiedCursor.read(e);t&&(n=i.movedTexts.find(e=>e.lineRangeMapping.modified.contains(t.lineNumber)))}n!==t.movedTextToCompare.read(void 0)&&t.movedTextToCompare.set(void 0,void 0),t.setActiveMovedText(n)}))}},dT.movedCodeBlockPadding=4,cT=class e{static compute(t){const i=[],n=[];for(const e of t){let t=i.findIndex(t=>!t.intersectsStrict(e));-1===t&&(i.length>=6?t=Qpe(i,fce(t=>t.intersectWithRangeLength(e),Oi)):(t=i.length,i.push(new ul))),i[t].addRange(e),n.push(t)}return new e(i.length,n)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}},hT=class extends ME{constructor(e,t,i,n,o){const s=Vhe("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=o,this._nodes=Vhe("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Vhe("div.text-content@textContent"),Vhe("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const r=Hce(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());let a;this._register(ewe(this._nodes.root,{paddingRight:r.map(e=>e.verticalScrollbarWidth)})),a=i.changes.length>0?"original"===this._kind?Vae(131,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):Vae(132,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):"original"===this._kind?Vae(133,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):Vae(134,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new NE(this._nodes.actionBar,{highlightToggledItems:!0})),d=new oo("",a,"",!1);l.push(d,{icon:!1,label:!0});const c=new oo("","Compare",mo.asClassName(go.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(Rce(e=>{c.checked=this._diffModel.movedTextToCompare.read(e)===i})),l.push(c,{icon:!1,label:!0})}},uT=class extends Ie{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Dce(this,e=>{const t=this._diffModel.read(e),i=t?.diff.read(e);if(!i)return null;const n=this._diffModel.read(e).movedTextToCompare.read(e),o=this._options.renderIndicators.read(e),s=this._options.showEmptyDecorations.read(e),r=[],a=[];if(!n)for(const d of i.mappings)if(d.lineRangeMapping.original.isEmpty||r.push({range:d.lineRangeMapping.original.toInclusiveRange(),options:o?bM:wM}),d.lineRangeMapping.modified.isEmpty||a.push({range:d.lineRangeMapping.modified.toInclusiveRange(),options:o?_M:vM}),d.lineRangeMapping.modified.isEmpty||d.lineRangeMapping.original.isEmpty)d.lineRangeMapping.original.isEmpty||r.push({range:d.lineRangeMapping.original.toInclusiveRange(),options:kM}),d.lineRangeMapping.modified.isEmpty||a.push({range:d.lineRangeMapping.modified.toInclusiveRange(),options:yM});else{const i=this._options.useTrueInlineDiffRendering.read(e)&&fwe(d.lineRangeMapping);for(const e of d.lineRangeMapping.innerChanges||[])if(d.lineRangeMapping.original.contains(e.originalRange.startLineNumber)&&r.push({range:e.originalRange,options:e.originalRange.isEmpty()&&s?LM:xM}),d.lineRangeMapping.modified.contains(e.modifiedRange.startLineNumber)&&a.push({range:e.modifiedRange,options:e.modifiedRange.isEmpty()&&s&&!i?SM:CM}),i){const i=t.model.original.getValueInRange(e.originalRange);a.push({range:e.modifiedRange,options:{description:"deleted-text",before:{content:i,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(n)for(const d of n.changes){const e=d.original.toInclusiveRange();e&&r.push({range:e,options:o?bM:wM});const t=d.modified.toInclusiveRange();t&&a.push({range:t,options:o?_M:vM});for(const i of d.innerChanges||[])r.push({range:i.originalRange,options:xM}),a.push({range:i.modifiedRange,options:CM})}const l=this._diffModel.read(e).activeMovedText.read(e);for(const d of i.movedTexts)r.push({range:d.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(d===l?" currentMove":""),blockPadding:[dT.movedCodeBlockPadding,0,dT.movedCodeBlockPadding,dT.movedCodeBlockPadding]}}),a.push({range:d.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(d===l?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:r,modifiedDecorations:a}}),this._register(Qve(this._editors.original,this._decorations.map(e=>e?.originalDecorations||[]))),this._register(Qve(this._editors.modified,this._decorations.map(e=>e?.modifiedDecorations||[])))}},gT=class e{static equals(e,t){return e.x===t.x&&e.y===t.y}constructor(e,t){this.x=e,this.y=t}add(t){return new e(this.x+t.x,this.y+t.y)}deltaX(t){return new e(this.x+t,this.y)}deltaY(t){return new e(this.x,this.y+t)}toString(){return`(${this.x},${this.y})`}subtract(t){return new e(this.x-t.x,this.y-t.y)}scale(t){return new e(this.x*t,this.y*t)}mapComponents(t){return new e(t(this.x),t(this.y))}isZero(){return 0===this.x&&0===this.y}withThreshold(e){return this.mapComponents(t=>t>e?t-e:t<-e?t+e:0)}},pT=class e extends Ie{static get(t){let i=e._map.get(t);if(!i){i=new e(t),e._map.set(t,i);const n=t.onDidDispose(()=>{const i=e._map.get(t);i&&(e._map.delete(t),i.dispose(),n.dispose())})}return i}_beginUpdate(){this._updateCounter++,1===this._updateCounter&&(this._currentTransaction=new on(()=>{}))}_endUpdate(){if(this._updateCounter--,0===this._updateCounter){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=Qce(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Hce(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(104)),this._versionId=i_e({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=i_e({owner:this,equalsFn:Cce(wce(fr.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=Nce({owner:this,equalsFn:Cce(wce(to.equals))},e=>this.selections.read(e)?.map(e=>e.getStartPosition())??null),this.isFocused=Hce(this,e=>{const t=this.editor.onDidFocusEditorWidget(e),i=this.editor.onDidBlurEditorWidget(e);return{dispose(){t.dispose(),i.dispose()}}},()=>this.editor.hasWidgetFocus()),this.isTextFocused=Hce(this,e=>{const t=this.editor.onDidFocusEditorText(e),i=this.editor.onDidBlurEditorText(e);return{dispose(){t.dispose(),i.dispose()}}},()=>this.editor.hasTextFocus()),this.inComposition=Hce(this,e=>{const t=this.editor.onDidCompositionStart(()=>{e(void 0)}),i=this.editor.onDidCompositionEnd(()=>{e(void 0)});return{dispose(){t.dispose(),i.dispose()}}},()=>this.editor.inComposition),this.value=Ice(this,e=>(this.versionId.read(e),this.model.read(e)?.getValue()??""),(e,t)=>{const i=this.model.get();null!==i&&e!==i.getValue()&&i.setValue(e)}),this.valueIsEmpty=Dce(this,e=>(this.versionId.read(e),0===this.editor.getModel()?.getValueLength())),this.cursorSelection=Nce({owner:this,equalsFn:Cce(fr.selectionsEqual)},e=>this.selections.read(e)?.[0]??null),this.cursorPosition=Nce({owner:this,equalsFn:to.equals},e=>this.selections.read(e)?.[0]?.getPosition()??null),this.cursorLineNumber=Dce(this,e=>this.cursorPosition.read(e)?.lineNumber??null),this.onDidType=t_e(this),this.onDidPaste=t_e(this),this.scrollTop=Hce(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Hce(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Hce(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(e=>e.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(e=>e.decorationsLeft),this.layoutInfoWidth=this.layoutInfo.map(e=>e.width),this.layoutInfoHeight=this.layoutInfo.map(e=>e.height),this.layoutInfoMinimap=this.layoutInfo.map(e=>e.minimap),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map(e=>e.verticalScrollbarWidth),this.contentWidth=Hce(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this.contentHeight=Hce(this.editor.onDidContentSizeChange,()=>this.editor.getContentHeight()),this._widgetCounter=0,this.openedPeekWidgets=Qce(this,0),this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(e=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,e)}finally{this._endUpdate()}})),this._register(this.editor.onDidPaste(e=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,e)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(e=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,e),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(e=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,e),this._forceUpdate()}finally{this._endUpdate()}})),this.domNode=Dce(e=>(this.model.read(e),this.editor.getDomNode()))}forceUpdate(e){this._beginUpdate();try{if(this._forceUpdate(),!e)return;return e(this._currentTransaction)}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e,t=Hi.ofCaller()){return Hce(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e),t)}setDecorations(e){const t=new De,i=this.editor.createDecorationsCollection();return t.add(Oce({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},t=>{const n=e.read(t);i.set(n)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const n=Rce(t=>{e.position.read(t),e.minContentWidthInPx.read(t),this.editor.layoutOverlayWidget(i)});return Dle(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}createContentWidget(e){const t="observableContentWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow};this.editor.addContentWidget(i);const n=Rce(t=>{e.position.read(t),this.editor.layoutContentWidget(i)});return Dle(()=>{n.dispose(),this.editor.removeContentWidget(i)})}observeLineOffsetRange(e,t){const i=this.observePosition(e.map(e=>new to(e.startLineNumber,1)),t),n=this.observePosition(e.map(e=>new to(e.endLineNumberExclusive+1,1)),t);return Dce(t=>{i.read(t),n.read(t);const o=e.read(t),s=this.model.read(t)?.getLineCount(),r=(void 0!==s&&o.startLineNumber>s?this.editor.getBottomForLineNumber(s):this.editor.getTopForLineNumber(o.startLineNumber))-this.scrollTop.read(t);return new hl(r,o.isEmpty?r:this.editor.getBottomForLineNumber(o.endLineNumberExclusive-1)-this.scrollTop.read(t))})}observePosition(e,t){let i=e.get();const n=i_e({owner:this,debugName:()=>`topLeftOfPosition${i?.toString()}`,equalsFn:Cce(gT.equals)},new gT(0,0)),o="observablePositionWidget"+this._widgetCounter++,s=document.createElement("div"),r={getDomNode:()=>s,getPosition:()=>i?{preference:[0],position:e.get()}:null,getId:()=>o,allowEditorOverflow:!1,afterRender:(e,t)=>{const o=this._model.get();o&&i&&i.lineNumber>o.getLineCount()?n.set(new gT(0,this.editor.getBottomForLineNumber(o.getLineCount())-this.scrollTop.get()),void 0):n.set(t?new gT(t.left,t.top):null,void 0)}};return this.editor.addContentWidget(r),t.add(Rce(t=>{i=e.read(t),this.editor.layoutContentWidget(r)})),t.add(Dle(()=>{this.editor.removeContentWidget(r)})),n}isTargetHovered(e,t){const i=Qce("isInjectedTextHovered",!1);return t.add(this.editor.onMouseMove(t=>{const n=e(t);i.set(n,void 0)})),t.add(this.editor.onMouseLeave(e=>{i.set(!1,void 0)})),i}observeLineHeightForPosition(e){return Dce(t=>{const i=e instanceof to?e:e.read(t);return null===i?null:(this.getOption(75).read(t),this.editor.getLineHeightForPosition(i))})}observeLineHeightForLine(e){return"number"==typeof e?this.observeLineHeightForPosition(new to(e,1)):Dce(t=>{const i=e.read(t);return null===i?null:this.observeLineHeightForPosition(new to(i,1)).read(t)})}observeLineHeightsForLineRange(e){return Dce(t=>{const i=e instanceof Qw?e:e.read(t),n=[];for(let e=i.startLineNumber;e<i.endLineNumberExclusive;e++)n.push(this.observeLineHeightForLine(e).read(t));return n})}},pT._map=new Map,fT=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_T=function(e,t){return function(i,n){t(i,n,e)}},mT=class extends Ie{constructor(e,t,i,n,o,s,r){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=o,this._modifiedEditorLayoutInfo=s,this._themeService=r,this.width=bT.ENTIRE_DIFF_OVERVIEW_WIDTH;const a=Hce(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),l=Dce(e=>{const t=a.read(e);return{insertColor:t.getColor(ou)||(t.getColor(tu)||Jh).transparent(2),removeColor:t.getColor(su)||(t.getColor(iu)||eu).transparent(2)}}),d=Fge(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const c=Vhe("div.diffOverview",{style:{position:"absolute",top:"0px",width:bT.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(Xve(c,d.domNode)),this._register(xn(c,On.POINTER_DOWN,e=>{this._editors.modified.delegateVerticalScrollbarPointerDown(e)})),this._register(ehe(c,On.MOUSE_WHEEL,e=>{this._editors.modified.delegateScrollFromMouseWheelEvent(e)},{passive:!1})),this._register(Xve(this._rootElement,c)),this._register(Pce((e,t)=>{const i=this._diffModel.read(e),n=this._editors.original.createOverviewRuler("original diffOverviewRuler");n&&(t.add(n),t.add(Xve(c,n.getDomNode())));const o=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(o&&(t.add(o),t.add(Xve(c,o.getDomNode()))),!n||!o)return;const s=cwe("viewZoneChanged",this._editors.original.onDidChangeViewZones),r=cwe("viewZoneChanged",this._editors.modified.onDidChangeViewZones),a=cwe("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),h=cwe("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);t.add(Rce(e=>{s.read(e),r.read(e),a.read(e),h.read(e);const t=l.read(e),d=i?.diff.read(e)?.mappings;function c(e,t,i){const n=i._getViewModel();return n?e.filter(e=>e.length>0).map(e=>{const i=n.coordinatesConverter.convertModelPositionToViewPosition(new to(e.startLineNumber,1)),o=n.coordinatesConverter.convertModelPositionToViewPosition(new to(e.endLineNumberExclusive,1)),s=o.lineNumber-i.lineNumber;return new av(i.lineNumber,o.lineNumber,s,t.toString())}):[]}const u=c((d||[]).map(e=>e.lineRangeMapping.original),t.removeColor,this._editors.original),g=c((d||[]).map(e=>e.lineRangeMapping.modified),t.insertColor,this._editors.modified);n?.setZones(u),o?.setZones(g)})),t.add(Rce(e=>{const t=this._rootHeight.read(e),i=this._rootWidth.read(e),s=this._modifiedEditorLayoutInfo.read(e);if(s){const i=bT.ENTIRE_DIFF_OVERVIEW_WIDTH-2*bT.ONE_OVERVIEW_WIDTH;n.setLayout({top:0,height:t,right:i+bT.ONE_OVERVIEW_WIDTH,width:bT.ONE_OVERVIEW_WIDTH}),o.setLayout({top:0,height:t,right:0,width:bT.ONE_OVERVIEW_WIDTH});const r=this._editors.modifiedScrollTop.read(e),a=this._editors.modifiedScrollHeight.read(e),l=this._editors.modified.getOption(117),c=new vm(l.verticalHasArrows?l.arrowSize:0,l.verticalScrollbarSize,0,s.height,a,r);d.setTop(c.getSliderPosition()),d.setHeight(c.getSliderSize())}else d.setTop(0),d.setHeight(0);c.style.height=t+"px",c.style.left=i-bT.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(bT.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},bT=mT,mT.ONE_OVERVIEW_WIDTH=15,mT.ENTIRE_DIFF_OVERVIEW_WIDTH=2*mT.ONE_OVERVIEW_WIDTH,vT=mT,vT=bT=fT([_T(6,Sf)],vT),wT=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},CT=function(e,t){return function(i,n){t(i,n,e)}},yT=class extends Ie{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,o,s,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=o,this._contextKeyService=s,this._instantiationService=r,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new je),this.modifiedScrollTop=Hce(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Hce(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=bwe(this.modified),this.originalObs=bwe(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Hce(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=Nce({owner:this,equalsFn:to.equals},e=>this.modifiedSelections.read(e)[0]?.getPosition()??new to(1,1)),this.originalCursor=Hce(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new to(1,1)),this.isOriginalFocused=bwe(this.original).isFocused,this.isModifiedFocused=bwe(this.modified).isFocused,this.isFocused=Dce(this,e=>this.isOriginalFocused.read(e)||this.isModifiedFocused.read(e)),this._argCodeEditorWidgetOptions=null,this._register(Ace({changeTracker:{createChangeSummary:()=>({}),handleChange:(e,t)=>(e.didChange(i.editorOptions)&&Object.assign(t,e.change.changedOptions),!0)}},(e,t)=>{i.editorOptions.read(e),this._options.renderSideBySide.read(e),this.modified.updateOptions(this._adjustOptionsForRightHandSide(e,t)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(e,t))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t),o=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>o.set(!0))),this._register(n.onDidBlurEditorWidget(()=>o.set(!1))),n}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t),o=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>o.set(!0))),this._register(n.onDidBlurEditorWidget(()=>o.set(!1))),n}_constructInnerEditor(e,t,i,n){const o=this._createInnerEditor(e,t,i,n);return this._register(o.onDidContentSizeChange(e=>{const t=this.original.getContentWidth()+this.modified.getContentWidth()+vT.ENTIRE_DIFF_OVERVIEW_WIDTH,i=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:i,contentWidth:t,contentHeightChanged:e.contentHeightChanged,contentWidthChanged:e.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=Ec.revealHorizontalRightPadding.defaultValue+vT.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.allowVariableLineHeights=!1,t.allowVariableFonts=!1,t.allowVariableFontsInAccessibilityMode=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");const t=Vae(111," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}},yT=wT([CT(5,es),CT(6,Jn),CT(7,xw)],yT),ST=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},function(e){e.North="north",e.South="south",e.East="east",e.West="west"}(xT||(xT={})),kT=new je,LT=new je,ST([Ape],(DT=class{constructor(e){this.el=e,this.disposables=new De}get onPointerMove(){return this.disposables.add(new zm(pn(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new zm(pn(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}).prototype,"onPointerMove",null),ST([Ape],DT.prototype,"onPointerUp",null),ST([Ape],(IT=class{get onPointerMove(){return this.disposables.add(new zm(this.el,gm.Change)).event}get onPointerUp(){return this.disposables.add(new zm(this.el,gm.End)).event}constructor(e){this.el=e,this.disposables=new De}dispose(){this.disposables.dispose()}}).prototype,"onPointerMove",null),ST([Ape],IT.prototype,"onPointerUp",null),ST([Ape],(NT=class{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}).prototype,"onPointerMove",null),ST([Ape],NT.prototype,"onPointerUp",null),ET="pointer-events-disabled",MT=class e extends Ie{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}get onDidStart(){return this._onDidStart.event}get onDidChange(){return this._onDidChange.event}get onDidReset(){return this._onDidReset.event}get onDidEnd(){return this._onDidEnd.event}set orthogonalStartSash(t){if(this._orthogonalStartSash!==t){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),t){const i=i=>{this.orthogonalStartDragHandleDisposables.clear(),0!==i&&(this._orthogonalStartDragHandle=Mhe(this.el,Ahe(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Dle(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(ehe(this._orthogonalStartDragHandle,"mouseenter",()=>e.onMouseEnter(t))),this.orthogonalStartDragHandleDisposables.add(ehe(this._orthogonalStartDragHandle,"mouseleave",()=>e.onMouseLeave(t))))};this.orthogonalStartSashDisposables.add(t.onDidEnablementChange.event(i,this)),i(t.state)}this._orthogonalStartSash=t}}set orthogonalEndSash(t){if(this._orthogonalEndSash!==t){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),t){const i=i=>{this.orthogonalEndDragHandleDisposables.clear(),0!==i&&(this._orthogonalEndDragHandle=Mhe(this.el,Ahe(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Dle(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(ehe(this._orthogonalEndDragHandle,"mouseenter",()=>e.onMouseEnter(t))),this.orthogonalEndDragHandleDisposables.add(ehe(this._orthogonalEndDragHandle,"mouseleave",()=>e.onMouseLeave(t))))};this.orthogonalEndSashDisposables.add(t.onDidEnablementChange.event(i,this)),i(t.state)}this._orthogonalEndSash=t}}constructor(t,i,n){let o;super(),this.hoverDelay=300,this.hoverDelayer=this._register(new ht(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new je),this._onDidStart=this._register(new je),this._onDidChange=this._register(new je),this._onDidReset=this._register(new je),this._onDidEnd=this._register(new je),this.orthogonalStartSashDisposables=this._register(new De),this.orthogonalStartDragHandleDisposables=this._register(new De),this.orthogonalEndSashDisposables=this._register(new De),this.orthogonalEndDragHandleDisposables=this._register(new De),this.linkedSash=void 0,this.el=Mhe(t,Ahe(".monaco-sash")),n.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`),F&&this.el.classList.add("mac"),this._register(ehe(this.el,"mousedown",e=>this.onPointerStart(e,new DT(t)))),this._register(ehe(this.el,"dblclick",e=>this.onPointerDoublePress(e))),this._register(ehe(this.el,"mouseenter",()=>e.onMouseEnter(this))),this._register(ehe(this.el,"mouseleave",()=>e.onMouseLeave(this))),this._register(pm.addTarget(this.el)),this._register(ehe(this.el,gm.Start,e=>this.onPointerStart(e,new IT(this.el)))),this._register(ehe(this.el,gm.Tap,e=>{if(o)return clearTimeout(o),o=void 0,void this.onPointerDoublePress(e);clearTimeout(o),o=setTimeout(()=>o=void 0,250)})),"number"==typeof n.size?(this.size=n.size,0===n.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(kT.event(e=>{this.size=e,this.layout()}))),this._register(LT.event(e=>this.hoverDelay=e)),this.layoutProvider=i,this.orthogonalStartSash=n.orthogonalStartSash,this.orthogonalEndSash=n.orthogonalEndSash,this.orientation=n.orientation||0,1===this.orientation?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",!1),this.layout()}onPointerStart(e,t){An.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new NT(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new NT(t))),!this.state)return;const n=this.el.ownerDocument.getElementsByTagName("iframe");for(const h of n)h.classList.add(ET);const o=e.pageX,s=e.pageY,r=e.altKey,a={startX:o,currentX:o,startY:s,currentY:s,altKey:r};this.el.classList.add("active"),this._onDidStart.fire(a);const l=npe(this.el),d=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":F?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":F?"col-resize":"ew-resize",l.textContent=`* { cursor: ${e} !important; }`},c=new De;d(),i||this.onDidEnablementChange.event(d,null,c),t.onPointerMove(e=>{An.stop(e,!1);const t={startX:o,currentX:e.pageX,startY:s,currentY:e.pageY,altKey:r};this._onDidChange.fire(t)},null,c),t.onPointerUp(e=>{An.stop(e,!1),l.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),c.dispose();for(const t of n)t.classList.remove(ET)},null,c),c.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(t,i=!1){t.el.classList.contains("active")?(t.hoverDelayer.cancel(),t.el.classList.add("hover")):t.hoverDelayer.trigger(()=>t.el.classList.add("hover"),t.hoverDelay).then(void 0,()=>{}),!i&&t.linkedSash&&e.onMouseEnter(t.linkedSash,!0)}static onMouseLeave(t,i=!1){t.hoverDelayer.cancel(),t.el.classList.remove("hover"),!i&&t.linkedSash&&e.onMouseLeave(t.linkedSash,!0)}clearSashHoverState(){e.onMouseLeave(this)}layout(){if(0===this.orientation){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(t&&xhe(t))return t.classList.contains("orthogonal-drag-handle")?t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}},TT=class{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=Ice(this,e=>{const t=this._sashRatio.read(e)??this._options.splitViewDefaultRatio.read(e);return this._computeSashLeft(t,e)},(e,t)=>{const i=this.dimensions.width.get();this._sashRatio.set(e/i,t)}),this._sashRatio=Qce(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,s=100;return i<=200?n:o<s?s:o>i-s?i-s:o}},RT=class extends Ie{constructor(e,t,i,n,o,s){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=o,this._resetSash=s,this._sash=this._register(new MT(this._domNode,{getVerticalSashTop:e=>0,getVerticalSashLeft:e=>this.sashLeft.get(),getVerticalSashHeight:e=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(e=>{this.sashLeft.set(this._startSashPosition+(e.currentX-e.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(Rce(e=>{const t=this._boundarySashes.read(e);t&&(this._sash.orthogonalEndSash=t.bottom)})),this._register(Rce(e=>{const t=this._enabled.read(e);this._sash.state=t?3:0,this.sashLeft.read(e),this._dimensions.height.read(e),this._sash.layout()}))}},OT=class e extends Ie{constructor(){super(...arguments),this._id=++e.idCounter,this._onDidDispose=this._register(new je),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}},OT.idCounter=0,AT={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},PT=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},FT=function(e,t){return function(i,n){t(i,n,e)}},WT=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Qce(this,0),this._screenReaderMode=Hce(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=Dce(this,e=>this._options.read(e).renderSideBySide&&this._diffEditorWidth.read(e)<=this._options.read(e).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Dce(this,e=>this._options.read(e).renderOverviewRuler),this.renderSideBySide=Dce(this,e=>(!this.compactMode.read(e)||!this.shouldRenderInlineViewInSmartMode.read(e))&&this._options.read(e).renderSideBySide&&!(this._options.read(e).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(e)&&!this._screenReaderMode.read(e))),this.readOnly=Dce(this,e=>this._options.read(e).readOnly),this.shouldRenderOldRevertArrows=Dce(this,e=>!(!this._options.read(e).renderMarginRevertIcon||!this.renderSideBySide.read(e)||this.readOnly.read(e)||this.shouldRenderGutterMenu.read(e))),this.shouldRenderGutterMenu=Dce(this,e=>this._options.read(e).renderGutterMenu),this.renderIndicators=Dce(this,e=>this._options.read(e).renderIndicators),this.enableSplitViewResizing=Dce(this,e=>this._options.read(e).enableSplitViewResizing),this.splitViewDefaultRatio=Dce(this,e=>this._options.read(e).splitViewDefaultRatio),this.ignoreTrimWhitespace=Dce(this,e=>this._options.read(e).ignoreTrimWhitespace),this.maxComputationTimeMs=Dce(this,e=>this._options.read(e).maxComputationTime),this.showMoves=Dce(this,e=>this._options.read(e).experimental.showMoves&&this.renderSideBySide.read(e)),this.isInEmbeddedEditor=Dce(this,e=>this._options.read(e).isInEmbeddedEditor),this.diffWordWrap=Dce(this,e=>this._options.read(e).diffWordWrap),this.originalEditable=Dce(this,e=>this._options.read(e).originalEditable),this.diffCodeLens=Dce(this,e=>this._options.read(e).diffCodeLens),this.accessibilityVerbose=Dce(this,e=>this._options.read(e).accessibilityVerbose),this.diffAlgorithm=Dce(this,e=>this._options.read(e).diffAlgorithm),this.showEmptyDecorations=Dce(this,e=>this._options.read(e).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Dce(this,e=>this._options.read(e).onlyShowAccessibleDiffViewer),this.compactMode=Dce(this,e=>this._options.read(e).compactMode),this.trueInlineDiffRenderingEnabled=Dce(this,e=>this._options.read(e).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=Dce(this,e=>!this.renderSideBySide.read(e)&&this.trueInlineDiffRenderingEnabled.read(e)),this.hideUnchangedRegions=Dce(this,e=>this._options.read(e).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Dce(this,e=>this._options.read(e).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Dce(this,e=>this._options.read(e).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Dce(this,e=>this._options.read(e).hideUnchangedRegions.minimumLineCount),this._model=Qce(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,e=>{return t=t=>{const i=e?.diff.read(t);return i?(n=i,o=this.trueInlineDiffRenderingEnabled.read(t),n.mappings.every(e=>0===e.lineRangeMapping.original.length||0===e.lineRangeMapping.modified.length||o&&fwe(e.lineRangeMapping))):void 0;var n,o},qce(this,(e,i)=>i??t(e));var t}).flatten().map(this,e=>!!e),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...vwe(e,AT)};this._options=Qce(this,i)}updateOptions(e){const t=vwe(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}},WT=PT([FT(1,Fc)],WT),BT=class extends so{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new je),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Mhe(e,Ahe(".monaco-dropdown")),this._label=Mhe(this._element,Ahe(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const o of[On.CLICK,On.MOUSE_DOWN,gm.Tap])this._register(ehe(this.element,o,e=>An.stop(e,!0)));for(const o of[On.MOUSE_DOWN,gm.Tap])this._register(ehe(this._label,o,e=>{Dhe(e)&&0!==e.button||(this.visible?this.hide():this.show())}));this._register(ehe(this._label,On.KEY_DOWN,e=>{const t=new we(e);(t.equals(3)||t.equals(10))&&(An.stop(e,!0),this.visible?this.hide():this.show())}));const n=i(this._label);n&&this._register(n),this._register(pm.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}},VT=class extends BT{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}},HT=class extends LE{get onDidChangeVisibility(){return this._onDidChangeVisibility.event}constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new je),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>(this.element=Mhe(e,Ahe("a.action-label")),this.renderLabel(this.element)),menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new VT(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility(e=>{this.element?.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return e.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}renderLabel(e){let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter(e=>!!e):this.options.classNames&&(t=this.options.classNames),t.find(e=>"icon"===e)||t.push("codicon"),e.classList.add(...t),this._action.label&&this._register(Bve().setupManagedHover(this.options.hoverDelegate??$_e("mouse"),e,this._action.label)),null}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){this.dropdownMenu?.show()}updateEnabled(){const e=!this.action.enabled;this.actionItem?.classList.toggle("disabled",e),this.element?.classList.toggle("disabled",e)}},zT=class extends Ie{get onDidChangeDropdownVisibility(){return this._onDidChangeDropdownVisibility.event}constructor(e,t,i={orientation:0}){if(super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Xe),this.originalPrimaryActions=[],this.originalSecondaryActions=[],this.hiddenActions=[],this.disposables=this._register(new De),i.hoverDelegate=i.hoverDelegate??this._register(G_e()),this.options=i,this.toggleMenuAction=this._register(new UT(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new NE(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(e,n)=>{if(e.id===UT.ID)return this.toggleMenuActionViewItem=new HT(e,{getActions:()=>this.toggleMenuAction.menuActions},t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:mo.asClassNameArray(i.moreIcon??go.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const t=i.actionViewItemProvider(e,n);if(t)return t}if(e instanceof ao){const i=new HT(e,e.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:e.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return i.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(i),this.disposables.add(this._onDidChangeDropdownVisibility.add(i.onDidChangeVisibility)),i}}})),this.options.responsive){this.element.classList.add("responsive");const e=new ResizeObserver(()=>{this.setToolbarMaxWidth(this.element.getBoundingClientRect().width)});e.observe(this.element),this._store.add(Dle(()=>e.disconnect()))}}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e);for(const t of this.submenuActionViewItems)t.setActionContext(e)}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}getItemWidth(e){return this.actionBar.getWidth(e)}setActions(e,t){this.clear(),this.originalPrimaryActions=e?e.slice(0):[],this.originalSecondaryActions=t?t.slice(0):[];const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.length>0&&this.options.trailingSeparator&&i.push(new ro),i.forEach(e=>{this.actionBar.push(e,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(e)})}),this.options.responsive&&(this.hiddenActions.length=0,this.setToolbarMaxWidth(this.element.getBoundingClientRect().width))}getKeybindingLabel(e){return this.options.getKeyBinding?.(e)?.getLabel()??void 0}getItemsWidthResponsive(){return 24*this.actionBar.length()}setToolbarMaxWidth(e){if(this.actionBar.isEmpty()||this.getItemsWidthResponsive()<=e&&0===this.hiddenActions.length)return;if(this.getItemsWidthResponsive()>e)for(;this.getItemsWidthResponsive()>e&&this.actionBar.length()>0;){const e=this.originalPrimaryActions.length-this.hiddenActions.length-1;if(e<0)break;const t=Math.min(24,this.getItemWidth(e)),i=this.originalPrimaryActions[e];this.hiddenActions.unshift({action:i,size:t}),this.actionBar.pull(e),0===this.originalSecondaryActions.length&&1===this.hiddenActions.length&&this.actionBar.push(this.toggleMenuAction,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(this.toggleMenuAction)})}else for(;this.hiddenActions.length>0;){const t=this.hiddenActions.shift();if(this.getItemsWidthResponsive()+t.size>e){this.hiddenActions.unshift(t);break}this.actionBar.push(t.action,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(t.action),index:this.originalPrimaryActions.length-this.hiddenActions.length-1}),0===this.originalSecondaryActions.length&&1===this.hiddenActions.length&&(this.toggleMenuAction.menuActions=[],this.actionBar.pull(this.actionBar.length()-1))}const t=this.hiddenActions.map(e=>e.action);if(this.originalSecondaryActions.length>0||t.length>0){const e=this.originalSecondaryActions.slice(0);this.toggleMenuAction.menuActions=ro.join(t,e)}}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}},(UT=class e extends oo{constructor(t,i){i=i||Vae(17,"More Actions..."),super(e.ID,i,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=t}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}).ID="toolbar.toggle.more",KT=class{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let o=0,s=t.length;o<s;o++){const s=t[o],r=i(s);if(null===r)return null;n[o]=wwe(s,r,this.modifierLabels[e])}return n.join(" ")}},qT=new KT({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:Vae(35,"Ctrl"),shiftKey:Vae(36,"Shift"),altKey:Vae(37,"Alt"),metaKey:Vae(38,"Windows"),separator:"+"},{ctrlKey:Vae(39,"Ctrl"),shiftKey:Vae(40,"Shift"),altKey:Vae(41,"Alt"),metaKey:Vae(42,"Super"),separator:"+"}),jT=new KT({ctrlKey:Vae(43,"Control"),shiftKey:Vae(44,"Shift"),altKey:Vae(45,"Option"),metaKey:Vae(46,"Command"),separator:"+"},{ctrlKey:Vae(47,"Control"),shiftKey:Vae(48,"Shift"),altKey:Vae(49,"Alt"),metaKey:Vae(50,"Windows"),separator:"+"},{ctrlKey:Vae(51,"Control"),shiftKey:Vae(52,"Shift"),altKey:Vae(53,"Alt"),metaKey:Vae(54,"Super"),separator:"+"}),$T=new KT({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),GT=new KT({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"}),function(e){e[e.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",e[e.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"}(ZT||(ZT={})),function(e){e[e.None=0]="None",e[e.Initialized=1]="Initialized",e[e.Closed=2]="Closed"}(YT||(YT={})),QT=class e extends Ie{constructor(t,i=Object.create(null)){super(),this.database=t,this.options=i,this._onDidChangeStorage=this._register(new Ze),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=YT.None,this.cache=new Map,this.flushDelayer=this._register(new ut(e.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((e,t)=>this.acceptExternal(t,e)),e.deleted?.forEach(e=>this.acceptExternal(e,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===YT.Closed)return;let i=!1;gle(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return gle(i)?t:i}getBoolean(e,t){const i=this.get(e);return gle(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return gle(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===YT.Closed)return;if(gle(t))return this.delete(e,i);const n=rle(t)||Array.isArray(t)?(o=t,JSON.stringify(o,tve)):String(t);var o;return this.cache.get(e)!==n?(this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()):void 0}async delete(e,t=!1){if(this.state!==YT.Closed&&this.cache.delete(e))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(this.state!==YT.Closed&&!this.pendingClose)return this.doFlush(e)}async doFlush(e){return this.options.hint===ZT.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}},QT.DEFAULT_FLUSH_DELAY=100,XT=class{constructor(){this.onDidChangeItemsExternal=Be.None,this.items=new Map}async updateItems(e){e.insert?.forEach((e,t)=>this.items.set(t,e)),e.delete?.forEach(e=>this.items.delete(e))}},JT="__$__targetStorageMarker",eR=eue("storageService"),function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(tR||(tR={})),(iR=class e extends Ie{constructor(t={flushInterval:e.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new Ze),this._onDidChangeTarget=this._register(new Ze),this._onWillSaveState=this._register(new je),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new Ne),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new ft(()=>this.doFlushWhenIdle(),t.flushInterval))}onDidChangeValue(e,t,i){return Be.filter(this._onDidChangeValue.event,i=>i.scope===e&&(void 0===t||i.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=_t(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}emitDidChangeValue(e,t){const{key:i,external:n}=t;if("__$__targetStorageMarker"===i){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}store(e,t,i,n,o=!1){gle(t)?this.remove(e,i,o):this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),this.getStorage(i)?.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){const o=this.getKeyTargets(t);"number"==typeof i?o[e]!==i&&(o[e]=i,this.getStorage(t)?.set(JT,JSON.stringify(o),n)):"number"==typeof o[e]&&(delete o[e],this.getStorage(t)?.set(JT,JSON.stringify(o),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?function(e){const t=e.get(JT);if(t)try{return JSON.parse(t)}catch(i){}return Object.create(null)}(t):Object.create(null)}async flush(e=tR.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(-1),i=this.getStorage(0),n=this.getStorage(1);switch(e){case tR.NONE:await yt.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case tR.SHUTDOWN:await yt.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve()])}}}).DEFAULT_FLUSH_INTERVAL=6e4,nR=class extends iR{constructor(){super(),this.applicationStorage=this._register(new QT(new XT,{hint:ZT.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new QT(new XT,{hint:ZT.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new QT(new XT,{hint:ZT.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}shouldFlushWhenIdle(){return!1}},oR={keybindingLabelBackground:gpe(vg),keybindingLabelForeground:gpe(wg),keybindingLabelBorder:gpe(Cg),keybindingLabelBottomBorder:gpe(yg),keybindingLabelShadow:gpe(ru)},sR={buttonForeground:gpe(Ju),buttonSeparator:gpe(eg),buttonBackground:gpe(tg),buttonHoverBackground:gpe(ig),buttonSecondaryForeground:gpe(og),buttonSecondaryBackground:gpe(sg),buttonSecondaryHoverBackground:gpe(rg),buttonBorder:gpe(ng)},rR={progressBarBackground:gpe(vh)},aR={inputActiveOptionBorder:gpe(Pu),inputActiveOptionForeground:gpe(Bu),inputActiveOptionBackground:gpe(Wu)},gpe(ag),gpe(lg),gpe(dg),gpe(cg),gpe(hg),gpe(ug),gpe(gg),lR={checkboxBackground:gpe(pg),checkboxBorder:gpe(fg),checkboxForeground:gpe(mg),checkboxDisabledBackground:gpe(_g),checkboxDisabledForeground:gpe(bg)},gpe(yh),gpe(Sh),gpe(ru),gpe(au),gpe(yu),gpe(Su),gpe(xu),gpe(uh),dR={inputBackground:gpe(Ru),inputForeground:gpe(Ou),inputBorder:gpe(Au),inputValidationInfoBorder:gpe(zu),inputValidationInfoBackground:gpe(Vu),inputValidationInfoForeground:gpe(Hu),inputValidationWarningBorder:gpe(qu),inputValidationWarningBackground:gpe(Uu),inputValidationWarningForeground:gpe(Ku),inputValidationErrorBorder:gpe(Gu),inputValidationErrorBackground:gpe(ju),inputValidationErrorForeground:gpe($u)},cR={listFilterWidgetBackground:gpe(Hg),listFilterWidgetOutline:gpe(zg),listFilterWidgetNoMatchesOutline:gpe(Ug),listFilterWidgetShadow:gpe(Kg),inputBoxStyles:dR,toggleStyles:aR},hR={badgeBackground:gpe(gh),badgeForeground:gpe(ph),badgeBorder:gpe(ch)},gpe(cu),gpe(du),gpe(hu),gpe(hu),gpe(uu),uR={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:gpe(Sg),listFocusForeground:gpe(xg),listFocusOutline:gpe(kg),listActiveSelectionBackground:gpe(Dg),listActiveSelectionForeground:gpe(Ig),listActiveSelectionIconForeground:gpe(Ng),listFocusAndSelectionOutline:gpe(Lg),listFocusAndSelectionBackground:gpe(Dg),listFocusAndSelectionForeground:gpe(Ig),listInactiveSelectionBackground:gpe(Eg),listInactiveSelectionIconForeground:gpe(Tg),listInactiveSelectionForeground:gpe(Mg),listInactiveFocusBackground:gpe(Rg),listInactiveFocusOutline:gpe(Og),listHoverBackground:gpe(Ag),listHoverForeground:gpe(Pg),listDropOverBackground:gpe(Fg),listDropBetweenBackground:gpe(Wg),listSelectionOutline:gpe(hh),listHoverOutline:gpe(hh),treeIndentGuidesStroke:gpe(qg),treeInactiveIndentGuidesStroke:gpe(jg),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:gpe(mh),tableColumnsBorder:gpe($g),tableOddRowsBackgroundColor:gpe(Gg)},gR={selectBackground:gpe(Zu),selectListBackground:gpe(Yu),selectForeground:gpe(Qu),decoratorRightForeground:gpe(rp),selectBorder:gpe(Xu),focusBorder:gpe(dh),listFocusBackground:gpe(hp),listInactiveSelectionIconForeground:gpe(cp),listFocusForeground:gpe(dp),listFocusOutline:ppe(hh,eh.transparent.toString()),listHoverBackground:gpe(Ag),listHoverForeground:gpe(Pg),listHoverOutline:gpe(hh),selectListBorder:gpe(xh),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},pR={shadowColor:gpe(ru),borderColor:gpe(Yg),foregroundColor:gpe(Qg),backgroundColor:gpe(Xg),selectionForegroundColor:gpe(Jg),selectionBackgroundColor:gpe(ep),selectionBorderColor:gpe(tp),separatorColor:gpe(ip),scrollbarShadow:gpe(mh),scrollbarSliderBackground:gpe(fh),scrollbarSliderHoverBackground:gpe(_h),scrollbarSliderActiveBackground:gpe(bh)},mR=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},fR=function(e,t){return function(i,n){t(i,n,e)}},_R=class extends DE{constructor(e,t,i,n,o,s,r,a){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate,keybindingNotRenderedWithLabel:t?.keybindingNotRenderedWithLabel}),this._options=t,this._keybindingService=i,this._notificationService=n,this._contextKeyService=o,this._themeService=s,this._contextMenuService=r,this._accessibilityService=a,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Ne),this._altKey=Bn.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{const e=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);e!==this._wantsAltCommand&&(this._wantsAltCommand=e,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(ehe(e,"mouseleave",e=>{t=!1,i()})),this._register(ehe(e,"mouseenter",e=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let n=t?Vae(1644,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),o=i?Vae(1645,"{0} ({1})",e,i):e;n=Vae(1646,"{0}\n[{1}] {2}",n,qT.modifierLabels[Y].altKey,o)}return n}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&(o=e.toggled)&&void 0!==o.condition&&e.toggled.icon?e.toggled.icon:e.icon;var o;if(n)if(mo.isThemeIcon(n)){const e=mo.asClassNameArray(n);i.classList.add(...e),this._itemClassDispose.value=Dle(()=>{i.classList.remove(...e)})}else i.style.backgroundImage=Epe(this._themeService.getColorTheme().type)?X_e(n.dark):X_e(n.light),i.classList.add("icon"),this._itemClassDispose.value=Lle(Dle(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}},_R=mR([fR(2,xw),fR(3,Xv),fR(4,es),fR(5,Sf),fR(6,sT),fR(7,Fc)],_R),bR=class e extends _R{render(e){this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",this._options?.useComma??!1)}updateLabel(){const t=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!t)return super.updateLabel();if(this.label){const i=e._symbolPrintEnter(t);this._options?.conversational?this.label.textContent=Vae(1647,"{1} to {0}",this._action.label,i):this.label.textContent=Vae(1648,"{0} ({1})",this._action.label,i)}}static _symbolPrintEnter(e){return e.getLabel()?.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}},vR=class extends HT{constructor(e,t,i,n,o){const s={...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(mo.isThemeIcon(e.item.icon)?mo.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(e=>i.lookupKeybinding(e.id))};super(e,{getActions:()=>e.actions},n,s),this._keybindingService=i,this._contextMenuService=n,this._themeService=o}render(e){super.render(e),ple(this.element),e.classList.add("menu-entry");const{icon:t}=this._action.item;if(t&&!mo.isThemeIcon(t)){this.element.classList.add("icon");const e=()=>{this.element&&(this.element.style.backgroundImage=Epe(this._themeService.getColorTheme().type)?X_e(t.dark):X_e(t.light))};e(),this._register(this._themeService.onDidColorThemeChange(()=>{e()}))}}},vR=mR([fR(2,xw),fR(3,sT),fR(4,Sf)],vR),wR=class extends LE{constructor(e,t,i,n,o,s,r,a){let l;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=s,this._instaService=r,this._storageService=a,this._defaultActionDisposables=this._register(new De),this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;const d=t?.togglePrimaryAction?a.get(this._storageKey,1):void 0;d&&(l=e.actions.find(e=>d===e.id)),l||(l=e.actions[0]),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(_R,l,{keybinding:this._getDefaultActionKeybindingLabel(l)}));const c={keybindingProvider:e=>this._keybindingService.lookupKeybinding(e.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??this._register(new so)};this._dropdown=this._register(new HT(e,e.actions,this._contextMenuService,c)),t?.togglePrimaryAction&&this._register(this._dropdown.actionRunner.onDidRun(e=>{e.action instanceof ps&&this.update(e.action)}))}update(e){this._options?.togglePrimaryAction&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultActionDisposables.clear(),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(_R,e,{keybinding:this._getDefaultActionKeybindingLabel(e)})),this._defaultAction.actionRunner=this._defaultActionDisposables.add(new class extends so{async runAction(e,t){await e.run(void 0)}}),this._container&&this._defaultAction.render(The(this._container,Ahe(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){const i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}set actionRunner(e){super.actionRunner=e,this._defaultAction.actionRunner=e,this._dropdown.actionRunner=e}get actionRunner(){return super.actionRunner}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=Ahe(".action-container");this._defaultAction.render(Mhe(this._container,t)),this._register(ehe(t,On.KEY_DOWN,e=>{const t=new we(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())}));const i=Ahe(".dropdown-action-container");this._dropdown.render(Mhe(this._container,i)),this._register(ehe(i,On.KEY_DOWN,e=>{const t=new we(e);t.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),t.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}},wR=mR([fR(2,xw),fR(3,Xv),fR(4,sT),fR(5,cs),fR(6,Jn),fR(7,eR)],wR),CR=class extends IE{constructor(e,t,i){super(null,e,e.actions.map(e=>({text:e.id===ro.ID?"─────────":e.label,isDisabled:!e.enabled})),0,t,gR,{ariaLabel:e.tooltip,optionsAsChildren:!0,useCustomDrawn:!Swe(i)}),this.select(Math.max(0,e.actions.findIndex(e=>e.checked)))}render(e){super.render(e),e.style.borderColor=gpe(Xu)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}},CR=mR([fR(1,oT),fR(2,ka)],CR),SR=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},xR=function(e,t){return function(i,n){t(i,n,e)}},DR=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new IR(i)}createMenu(e,t,i){return new MR(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const n=new MR(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),o=n.getActions(i);return n.dispose(),o}resetHiddenStates(e){this._hiddenStates.reset(e)}},DR=SR([xR(0,fo),xR(1,xw),xR(2,eR)],DR),yR=class{constructor(e){this._storageService=e,this._disposables=new De,this._onDidChange=new je,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(kR._key,0,"{}");this._data=JSON.parse(t)}catch(t){this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,kR._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(kR._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){const i=this._isHiddenByDefault(e,t),n=this._data[e.id]?.includes(t)??!1;return i?!n:n}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const n=this._data[e.id];if(i)n?n.indexOf(t)<0&&n.push(t):this._data[e.id]=[t];else if(n){const i=n.indexOf(t);i>=0&&function(e,t){const i=e.length-1;t<i&&(e[t]=e[i]),e.pop()}(n,i),0===n.length&&delete this._data[e.id]}this._persist()}reset(e){if(void 0===e)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(kR._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}},kR=yR,yR._key="menu.hiddenCommands",IR=yR,IR=kR=SR([xR(0,eR)],IR),NR=class e{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=this._sort(us.getMenuItems(this._id));let t;for(const i of e){const e=i.group||"";t&&t[0]===e||(t=[e,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeysAndSubmenuIds(i)}this._allMenuIds.add(this._id)}_sort(e){return e}_collectContextKeysAndSubmenuIds(t){if(e._fillInKbExprKeys(t.when,this._structureContextKeys),pue(t)){if(t.command.precondition&&e._fillInKbExprKeys(t.command.precondition,this._preconditionContextKeys),t.command.toggled){const i=t.command.toggled.condition||t.command.toggled;e._fillInKbExprKeys(i,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(us.getMenuItems(t.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(t.submenu))}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}},ER=LR=class extends NR{constructor(e,t,i,n,o,s){super(e,i),this._hiddenStates=t,this._commandService=n,this._keybindingService=o,this._contextKeyService=s,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[n,o]=i;let s;for(const t of o)if(this._contextKeyService.contextMatchesRules(t.when)){const i=pue(t);i&&this._hiddenStates.setDefaultState(this._id,t.command.id,!!t.isHiddenByDefault);const n=Ewe(this._id,i?t.command:t,this._hiddenStates);if(i){const i=Mwe(this._commandService,this._keybindingService,t.command.id,t.when);(s??(s=[])).push(new ps(t.command,t.alt,e,n,i,this._contextKeyService,this._commandService))}else{const i=new LR(t.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),o=ro.join(...i.map(e=>e[1]));o.length>0&&(s??(s=[])).push(new gs(t,n,o))}}s&&s.length>0&&t.push([n,s])}return t}_sort(e){return e.sort(LR._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(!i)return 1;if(!n)return-1;if("navigation"===i)return-1;if("navigation"===n)return 1;const e=i.localeCompare(n);if(0!==e)return e}const o=e.order||0,s=t.order||0;return o<s?-1:o>s?1:LR._compareTitles(pue(e)?e.command.title:e.title,pue(t)?t.command.title:t.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}},ER=LR=SR([xR(3,fo),xR(4,xw),xR(5,es)],ER),MR=class{constructor(e,t,i,n,o,s){this._disposables=new De,this._menuInfo=new ER(e,t,i.emitEventsForSubmenuChanges,n,o,s);const r=new ft(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(r),this._disposables.add(us.onDidChangeMenu(e=>{for(const t of this._menuInfo.allMenuIds)if(e.has(t)){r.schedule();break}}));const a=this._disposables.add(new De);this._onDidChange=new Ye({onWillAddFirstListener:()=>{a.add(s.onDidChangeContext(e=>{const t=e.affectsSome(this._menuInfo.structureContextKeys),i=e.affectsSome(this._menuInfo.preconditionContextKeys),n=e.affectsSome(this._menuInfo.toggledContextKeys);(t||i||n)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n})})),a.add(t.onDidChange(e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))},onDidRemoveLastListener:a.clear.bind(a),delay:i.eventDebounceDelay,merge:e=>{let t=!1,i=!1,n=!1;for(const o of e)if(t=t||o.isStructuralChange,i=i||o.isEnablementChange,n=n||o.isToggleChange,t&&i&&n)break;return{menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}},MR=SR([xR(3,fo),xR(4,xw),xR(5,es)],MR),dge(TR=eue("IActionViewItemService"),class{constructor(){this._providers=new Map,this._onDidChange=new je,this.onDidChange=this._onDidChange.event}dispose(){this._onDidChange.dispose()}lookUp(e,t){return this._providers.get(this._makeKey(e,t))}_makeKey(e,t){return`${e.id}/${t instanceof ds?t.id:t}`}},1),RR=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},OR=function(e,t){return function(i,n){t(i,n,e)}},AR=class extends zT{constructor(e,t,i,n,o,s,r,a){super(e,o,{getKeyBinding:e=>s.lookupKeybinding(e.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:"string"==typeof t?.telemetrySource}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=o,this._keybindingService=s,this._commandService=r,this._sessionDisposables=this._store.add(new De);const l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(e=>a.publicLog2("workbenchActionExecuted",{id:e.action.id,from:l})))}setActions(e,t=[],i){this._sessionDisposables.clear();const n=e.slice(),o=t.slice(),s=[];let r=0;const a=[];let l=!1;if(-1!==this._options?.hiddenItemStrategy)for(let d=0;d<n.length;d++){const e=n[d];(e instanceof ps||e instanceof gs)&&e.hideActions&&(s.push(e.hideActions.toggle),e.hideActions.toggle.checked&&r++,e.hideActions.isHidden&&(l=!0,n[d]=void 0,0!==this._options?.hiddenItemStrategy&&(a[d]=e)))}if(void 0!==this._options?.overflowBehavior){const e=w_e(new Set(this._options.overflowBehavior.exempted),ke.map(n,e=>e?.id)),t=this._options.overflowBehavior.maxItems-e.size;let i=0;for(let o=0;o<n.length;o++){const s=n[o];s&&(i++,e.has(s.id)||i>=t&&(n[o]=void 0,a[o]=s))}}nce(n),nce(a),super.setActions(n,ro.join(a,o)),(s.length>0||n.length>0)&&this._sessionDisposables.add(ehe(this.getElement(),"contextmenu",e=>{const t=new Se(pn(this.getElement()),e),n=this.getItemAction(t.target);if(!n)return;t.preventDefault(),t.stopPropagation();const o=[];if(n instanceof ps&&n.menuKeybinding)o.push(n.menuKeybinding);else if(!(n instanceof gs||n instanceof UT)){const e=!!this._keybindingService.lookupKeybinding(n.id);o.push(Mwe(this._commandService,this._keybindingService,n.id,void 0,e))}if(s.length>0){let e=!1;if(1===r&&0===this._options?.hiddenItemStrategy){e=!0;for(let e=0;e<s.length;e++)if(s[e].checked){s[e]=tue({id:n.id,label:n.label,checked:!0,enabled:!1,run(){}});break}}if(!e&&(n instanceof ps||n instanceof gs)){if(!n.hideActions)return;o.push(n.hideActions.hide)}else o.push(tue({id:"label",label:Vae(1649,"Hide"),enabled:!1,run(){}}))}const a=ro.join(o,s);this._options?.resetMenu&&!i&&(i=[this._options.resetMenu]),l&&i&&(a.push(new ro),a.push(tue({id:"resetThisMenu",label:Vae(1650,"Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),0!==a.length&&this._contextMenuService.showContextMenu({getAnchor:()=>t,getActions:()=>a,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:"string"==typeof this._options?.telemetrySource,contextKeyService:this._contextKeyService})}))}},AR=RR([OR(2,cs),OR(3,es),OR(4,sT),OR(5,xw),OR(6,fo),OR(7,fs)],AR),PR=class extends AR{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(e,t,i,n,o,s,r,a,l,d,c){super(e,{resetMenu:t,...i,actionViewItemProvider:(n,o)=>{let s=d.lookUp(t,n instanceof gs?n.item.submenu.id:n.id);s||(s=i?.actionViewItemProvider);const r=s?.(n,o,c,pn(e).vscodeWindowId);return r||Nwe(c,n,o)}},n,o,s,r,a,l),this._onDidChangeMenuItems=this._store.add(new je);const h=this._store.add(n.createMenu(t,o,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:i?.eventDebounceDelay})),u=()=>{const{primary:t,secondary:n}=Lwe(h.getActions(i?.menuOptions),i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions);e.classList.toggle("has-no-actions",0===t.length&&0===n.length),super.setActions(t,n)};this._store.add(h.onDidChange(()=>{u(),this._onDidChangeMenuItems.fire(this)})),this._store.add(d.onDidChange(e=>{e===t&&u()})),u()}setActions(){throw new y("This toolbar is populated from a menu.")}},PR=RR([OR(3,cs),OR(4,es),OR(5,sT),OR(6,xw),OR(7,fo),OR(8,fs),OR(9,TR),OR(10,Jn)],PR),FR=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},WR=function(e,t){return function(i,n){t(i,n,e)}},BR=eue("hoverService"),VR=class extends Ie{get delay(){return this.isInstantlyHovering()?0:this.hoverOptions?.dynamicDelay?e=>this.hoverOptions?.dynamicDelay?.(e)??this._delay:this._delay}constructor(e,t,i={},n,o){super(),this.placement=e,this.hoverOptions=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=o,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new De),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){const i="function"==typeof this.overrideOptions?this.overrideOptions(e,t):this.overrideOptions;this.hoverDisposables.clear();const n=xhe(e.target)?[e.target]:e.target.targetElements;for(const s of n)this.hoverDisposables.add(xn(s,"keydown",e=>{e.equals(9)&&this.hoverService.hideHover()}));const o=xhe(e.content)?void 0:"string"==typeof e.content?e.content.toString():e.content.value;return this.hoverService.showInstantHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:o,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return!!this.hoverOptions?.instantHover&&Date.now()-this.lastHoverHideTime<this.timeLimit}onDidHideHover(){this.hoverDisposables.clear(),this.hoverOptions?.instantHover&&(this.lastHoverHideTime=Date.now())}},VR=FR([WR(3,ka),WR(4,BR)],VR),HR={showHover:function(){throw new Error("Native hover function not implemented.")},delay:0,showNativeHover:!0},zR=class extends oC{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}getLineLength(e){return this._textModel.getLineLength(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new eC(e-1,t)}},UR=class extends so{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}},KR=class extends Ie{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Hce(this,this._editor.onDidScrollChange,e=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(e=>0===e),this.modelAttached=Hce(this,this._editor.onDidChangeModel,e=>this._editor.hasModel()),this.editorOnDidChangeViewZones=cwe("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=cwe("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=t_e("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const n=this._domNode.appendChild(Vhe("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{Wce(e=>{this.domNodeSizeChanged.trigger(e)})});o.observe(this._domNode),this._register(Dle(()=>o.disconnect())),this._register(Rce(e=>{n.className=this.isScrollTopZero.read(e)?"":"scroll-decoration"})),this._register(Rce(e=>this.render(e)))}dispose(){super.dispose(),Rhe(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),n=new Set(this.views.keys()),o=hl.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const s of i){const i=new Qw(s.startLineNumber,s.endLineNumber+1),r=this.itemProvider.getIntersectingGutterItems(i,e);Wce(e=>{for(const s of r){if(!s.range.intersect(i))continue;n.delete(s.id);let r=this.views.get(s.id);if(r)r.item.set(s,e);else{const e=document.createElement("div");this._domNode.appendChild(e);const t=Qce("item",s);r=new qR(t,this.itemProvider.createView(t,e),e),this.views.set(s.id,r)}const a=s.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(s.range.startLineNumber,!0)-t:s.range.startLineNumber>1?this._editor.getBottomForLineNumber(s.range.startLineNumber-1,!1)-t:0,l=(1===s.range.endLineNumberExclusive?Math.max(a,this._editor.getTopForLineNumber(s.range.startLineNumber,!1)-t):Math.max(a,this._editor.getBottomForLineNumber(s.range.endLineNumberExclusive-1,!0)-t))-a;r.domNode.style.top=`${a}px`,r.domNode.style.height=`${l}px`,r.gutterItemView.layout(hl.ofStartAndLength(a,l),o)}})}for(const s of n){const e=this.views.get(s);e.gutterItemView.dispose(),e.domNode.remove(),this.views.delete(s)}}},qR=class{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}},jR=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$R=function(e,t){return function(i,n){t(i,n,e)}},GR=[],ZR=class extends Ie{constructor(e,t,i,n,o,s,r,a,l){var d,c;super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=o,this._boundarySashes=s,this._instantiationService=r,this._contextKeyService=a,this._menuService=l,this._menu=this._register(this._menuService.createMenu(ds.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Hce(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(e=>e.length>0),this._showSash=Dce(this,e=>this._options.renderSideBySide.read(e)&&this._hasActions.read(e)),this.width=Dce(this,e=>this._hasActions.read(e)?35:0),this.elements=Vhe("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:"35px"}},[]),this._currentDiff=Dce(this,e=>{const t=this._diffModel.read(e);if(!t)return;const i=t.diff.read(e)?.mappings,n=this._editors.modifiedCursor.read(e);return n?i?.find(e=>e.lineRangeMapping.modified.contains(n.lineNumber)):void 0}),this._selectedDiffs=Dce(this,e=>{const t=this._diffModel.read(e)?.diff.read(e);if(!t)return GR;const i=this._editors.modifiedSelections.read(e);if(i.every(e=>e.isEmpty()))return GR;const n=new Xw(i.map(e=>Qw.fromRangeInclusive(e))),o=t.mappings.filter(e=>e.lineRangeMapping.innerChanges&&n.intersects(e.lineRangeMapping.modified)).map(e=>({mapping:e,rangeMappings:e.lineRangeMapping.innerChanges.filter(e=>i.some(t=>mr.areIntersecting(e.modifiedRange,t)))}));return 0===o.length||o.every(e=>0===e.rangeMappings.length)?GR:o}),this._register((d=e,c=this.elements.root,d.prepend(c),Dle(()=>{c.remove()}))),this._register(ehe(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(ewe(this.elements.root,{display:this._hasActions.map(e=>e?"block":"none")})),Mce(this,t=>this._showSash.read(t)?new RT(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,Ice(this,e=>this._sashLayout.sashLeft.read(e)-35,(e,t)=>this._sashLayout.sashLeft.set(e+35,t)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store);const h=Dce(this,e=>{const t=this._diffModel.read(e);if(!t)return[];const i=t.diff.read(e);if(!i)return[];const n=this._selectedDiffs.read(e);if(n.length>0)return[new YR(BE.fromRangeMappings(n.flatMap(e=>e.rangeMappings)),!0,ds.DiffEditorSelectionToolbar,void 0,t.model.original.uri,t.model.modified.uri)];const o=this._currentDiff.read(e);return i.mappings.map(e=>new YR(e.lineRangeMapping.withInnerChangesFromLineRanges(),e.lineRangeMapping===o?.lineRangeMapping,ds.DiffEditorHunkToolbar,void 0,t.model.original.uri,t.model.modified.uri))});this._register(new KR(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(e,t)=>h.read(t),createView:(e,t)=>this._instantiationService.createInstance(QR,e,t,this)})),this._register(ehe(this.elements.gutter,On.MOUSE_WHEEL,e=>{this._editors.modified.getOption(117).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(e)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new zR(this._editors.modifiedModel.get()),n=new zR(this._editors.original.getModel());return new lC(t.map(e=>e.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}},ZR=jR([$R(6,Jn),$R(7,es),$R(8,cs)],ZR),YR=class{constructor(e,t,i,n,o,s){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=o,this.modifiedUri=s}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}},QR=class extends Ie{constructor(e,t,i,n){super(),this._item=e,this._elements=Vhe("div.gutterItem",{style:{height:"20px",width:"34px"}},[Vhe("div.background@background",{},[]),Vhe("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,e=>e.showAlways),this._menuId=this._item.map(this,e=>e.menuId),this._isSmall=Qce(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(n.createInstance(VR,"element",{instantHover:!0},{position:{hoverPosition:1}}));this._register(Xve(t,this._elements.root)),this._register(Rce(e=>{const t=this._showAlways.read(e);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",t),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(Pce((e,t)=>{this._elements.buttons.replaceChildren();const s=t.add(n.createInstance(PR,this._elements.buttons,this._menuId.read(e),{orientation:1,hoverDelegate:o,toolbarOptions:{primaryGroup:e=>e.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(e)?1:3},hiddenItemStrategy:0,actionRunner:t.add(new UR(()=>{const e=this._item.read(void 0),t=e.mapping;return{mapping:t,originalWithModifiedChanges:i.computeStagedValue(t),originalUri:e.originalUri,modifiedUri:e.modifiedUri}})),menuOptions:{shouldForwardArgs:!0}}));t.add(s.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(1===this._item.get().mapping.original.startLineNumber&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const n=e.length/2-i/2,o=i;let s=e.start+n;const r=hl.tryCreate(o,t.endExclusive-o-i),a=hl.tryCreate(e.start+o,e.endExclusive-i-o);a&&r&&a.start<a.endExclusive&&(s=r.clip(s),s=a.clip(s)),this._elements.buttons.style.top=s-e.start+"px"}},QR=jR([$R(3,Jn)],QR),JR=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},eO=function(e,t){return function(i,n){t(i,n,e)}},XR=class extends Ie{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=Mce(this,e=>{const t=this._editors.modifiedModel.read(e),i=tO._breadcrumbsSourceFactory.read(e);return t&&i?i(t,this._instantiationService):void 0}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(e=>{if(1===e.reason)return;const t=this._diffModel.get();Wce(e=>{for(const i of this._editors.original.getSelections()||[])t?.ensureOriginalLineIsVisible(i.getStartPosition().lineNumber,0,e),t?.ensureOriginalLineIsVisible(i.getEndPosition().lineNumber,0,e)})})),this._register(this._editors.modified.onDidChangeCursorPosition(e=>{if(1===e.reason)return;const t=this._diffModel.get();Wce(e=>{for(const i of this._editors.modified.getSelections()||[])t?.ensureModifiedLineIsVisible(i.getStartPosition().lineNumber,0,e),t?.ensureModifiedLineIsVisible(i.getEndPosition().lineNumber,0,e)})}));const o=this._diffModel.map((e,t)=>{const i=e?.unchangedRegions.read(t)??[];return 1===i.length&&1===i[0].modifiedLineNumber&&i[0].lineCount===this._editors.modifiedModel.read(t)?.getLineCount()?[]:i});this.viewZones=Dce(this,e=>{const t=this._modifiedOutlineSource.read(e);if(!t)return{origViewZones:[],modViewZones:[]};const i=[],n=[],s=this._options.renderSideBySide.read(e),r=this._options.compactMode.read(e),a=o.read(e);for(let o=0;o<a.length;o++){const l=a[o];if(!l.shouldHideControls(e)&&(!r||0!==o&&o!==a.length-1))if(r){{const t=new TE(Dce(this,e=>l.getHiddenOriginalRange(e).startLineNumber-1),12);i.push(t),e.store.add(new nO(this._editors.original,t,l,!s))}{const t=new TE(Dce(this,e=>l.getHiddenModifiedRange(e).startLineNumber-1),12);n.push(t),e.store.add(new nO(this._editors.modified,t,l))}}else{{const n=new TE(Dce(this,e=>l.getHiddenOriginalRange(e).startLineNumber-1),24);i.push(n),e.store.add(new oO(this._editors.original,n,l,l.originalUnchangedRange,!s,t,e=>this._diffModel.get().ensureModifiedLineIsVisible(e,2,void 0),this._options))}{const i=new TE(Dce(this,e=>l.getHiddenModifiedRange(e).startLineNumber-1),24);n.push(i),e.store.add(new oO(this._editors.modified,i,l,l.modifiedUnchangedRange,!1,t,e=>this._diffModel.get().ensureModifiedLineIsVisible(e,2,void 0),this._options))}}}return{origViewZones:i,modViewZones:n}});const s={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},r={description:"Fold Unchanged",glyphMarginHoverMessage:new pD(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(Vae(124,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+mo.asClassName(go.fold),zIndex:10001};this._register(Qve(this._editors.original,Dce(this,e=>{const t=o.read(e),i=t.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:s}));for(const n of t)n.shouldHideControls(e)&&i.push({range:mr.fromPositions(new to(n.originalLineNumber,1)),options:r});return i}))),this._register(Qve(this._editors.modified,Dce(this,e=>{const t=o.read(e),i=t.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:s}));for(const n of t)n.shouldHideControls(e)&&i.push({range:Qw.ofLength(n.modifiedLineNumber,1).toInclusiveRange(),options:r});return i}))),this._register(Rce(e=>{const t=o.read(e);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(t.map(t=>t.getHiddenOriginalRange(e).toInclusiveRange()).filter(ule)),this._editors.modified.setHiddenAreas(t.map(t=>t.getHiddenModifiedRange(e).toInclusiveRange()).filter(ule))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(e=>{if(!e.event.rightButton&&e.target.position&&e.target.element?.className.includes("fold-unchanged")){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find(e=>e.modifiedUnchangedRange.contains(t));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(e=>{if(!e.event.rightButton&&e.target.position&&e.target.element?.className.includes("fold-unchanged")){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find(e=>e.originalUnchangedRange.contains(t));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}}))}},tO=XR,XR._breadcrumbsSourceFactory=Qce(XR,()=>({dispose(){},getBreadcrumbItems:(e,t)=>[]})),iO=XR,iO=tO=JR([eO(3,Jn)],iO),nO=class extends ME{constructor(e,t,i,n=!1){const o=Vhe("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=n,this._nodes=Vhe("div.diff-hidden-lines-compact",[Vhe("div.line-left",[]),Vhe("div.text@text",[]),Vhe("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(Rce(e=>{if(!this._hide){const t=Vae(125,"{0} hidden lines",this._unchangedRegion.getHiddenModifiedRange(e).length);this._nodes.text.innerText=t}}))}},oO=class extends ME{constructor(e,t,i,n,o,s,r,a){const l=Vhe("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=o,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=r,this._options=a,this._nodes=Vhe("div.diff-hidden-lines",[Vhe("div.top@top",{title:Vae(126,"Click or drag to show more above")}),Vhe("div.center@content",{style:{display:"flex"}},[Vhe("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[Ahe("a",{title:Vae(127,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...gve("$(unfold)"))]),Vhe("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Vhe("div.bottom@bottom",{title:Vae(128,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root),this._hide?Rhe(this._nodes.first):this._register(ewe(this._nodes.first,{width:bwe(this._editor).layoutInfoContentLeft})),this._register(Rce(e=>{const t=this._unchangedRegion.visibleLineCountTop.read(e)+this._unchangedRegion.visibleLineCountBottom.read(e)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!t),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),this._nodes.top.classList.toggle("canMoveBottom",!t);const i=this._unchangedRegion.isDragged.read(e),n=this._editor.getDomNode();n&&(n.classList.toggle("draggingUnchangedRegion",!!i),"top"===i?(n.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),n.classList.toggle("canMoveBottom",!t)):"bottom"===i?(n.classList.toggle("canMoveTop",!t),n.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0)):(n.classList.toggle("canMoveTop",!1),n.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(ehe(this._nodes.top,"mousedown",e=>{if(0!==e.button)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const o=pn(this._nodes.top),s=ehe(o,"mousemove",e=>{const o=e.clientY-t;i=i||Math.abs(o)>2;const s=Math.round(o/d.getOption(75)),r=Math.max(0,Math.min(n+s,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(r,void 0)}),r=ehe(o,"mouseup",e=>{i||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),s.dispose(),r.dispose()})})),this._register(ehe(this._nodes.bottom,"mousedown",e=>{if(0!==e.button)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const o=pn(this._nodes.bottom),s=ehe(o,"mousemove",e=>{const o=e.clientY-t;i=i||Math.abs(o)>2;const s=Math.round(o/d.getOption(75)),r=Math.max(0,Math.min(n-s,this._unchangedRegion.getMaxVisibleLineCountBottom())),a=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(r,void 0);const l=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(l-a))}),r=ehe(o,"mouseup",e=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!i){const e=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const t=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(t-e))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),s.dispose(),r.dispose()})})),this._register(Rce(e=>{const t=[];if(!this._hide){const n=Vae(129,"{0} hidden lines",i.getHiddenModifiedRange(e).length),o=Ahe("span",{title:Vae(130,"Double click to unfold")},n);o.addEventListener("dblclick",e=>{0===e.button&&(e.preventDefault(),this._unchangedRegion.showAll(void 0))}),t.push(o);const s=this._unchangedRegion.getHiddenModifiedRange(e),r=this._modifiedOutlineSource.getBreadcrumbItems(s,e);if(r.length>0){t.push(Ahe("span",void 0,"  |  "));for(let e=0;e<r.length;e++){const i=r[e],n=Vhe("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[pve(xb.toIcon(i.kind))," ",i.name,...e===r.length-1?[]:[pve(go.chevronRight)]]).root;t.push(n),n.onclick=()=>{this._revealModifiedHiddenLine(i.startLineNumber)}}}}Rhe(this._nodes.others,...t)}))}},sO=[],rO=class extends Ie{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=Dce(this,e=>{const t=this._diffModel.read(e)?.diff.read(e);if(!t)return sO;const i=this._editors.modifiedSelections.read(e);if(i.every(e=>e.isEmpty()))return sO;const n=new Xw(i.map(e=>Qw.fromRangeInclusive(e))),o=t.mappings.filter(e=>e.lineRangeMapping.innerChanges&&n.intersects(e.lineRangeMapping.modified)).map(e=>({mapping:e,rangeMappings:e.lineRangeMapping.innerChanges.filter(e=>i.some(t=>mr.areIntersecting(e.modifiedRange,t)))}));return 0===o.length||o.every(e=>0===e.rangeMappings.length)?sO:o}),this._register(Pce((e,t)=>{if(!this._options.shouldRenderOldRevertArrows.read(e))return;const i=this._diffModel.read(e),n=i?.diff.read(e);if(!i||!n)return;if(i.movedTextToCompare.read(e))return;const o=[],s=this._selectedDiffs.read(e),r=new Set(s.map(e=>e.mapping));if(s.length>0){const i=this._editors.modifiedSelections.read(e),n=t.add(new aO(i[i.length-1].positionLineNumber,this._widget,s.flatMap(e=>e.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(n),o.push(n)}for(const a of n.mappings)if(!r.has(a)&&!a.lineRangeMapping.modified.isEmpty&&a.lineRangeMapping.innerChanges){const e=t.add(new aO(a.lineRangeMapping.modified.startLineNumber,this._widget,a.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(e),o.push(e)}t.add(Dle(()=>{for(const e of o)this._editors.modified.removeGlyphMarginWidget(e)}))}))}},(aO=class e extends Ie{getId(){return this._id}constructor(t,i,n,o){super(),this._lineNumber=t,this._widget=i,this._diffs=n,this._revertSelection=o,this._id="revertButton"+e.counter++,this._domNode=Vhe("div.revertButton",{title:this._revertSelection?Vae(135,"Revert Selected Changes"):Vae(136,"Revert Change")},[pve(go.arrowRight)]).root,this._register(ehe(this._domNode,On.MOUSE_DOWN,e=>{2!==e.button&&(e.stopPropagation(),e.preventDefault())})),this._register(ehe(this._domNode,On.MOUSE_UP,e=>{e.stopPropagation(),e.preventDefault()})),this._register(ehe(this._domNode,On.CLICK,e=>{this._diffs instanceof WE?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),e.stopPropagation(),e.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Yr.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}).counter=0,lO=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},dO=function(e,t){return function(i,n){t(i,n,e)}},cO=class extends OT{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,o,s,r,a){super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=o,this._codeEditorService=s,this._accessibilitySignalService=r,this._editorProgressService=a,this.elements=Vhe("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Vhe("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Vhe("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Vhe("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(Xce(this,void 0)),this._diffModel=Dce(this,e=>this._diffModelSrc.read(e)?.object),this.onDidChangeModel=Be.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new dL([es,this._contextKeyService]))),this._boundarySashes=Qce(this,void 0),this._accessibleDiffViewerShouldBeVisible=Qce(this,!1),this._accessibleDiffViewerVisible=Dce(this,e=>!!this._options.onlyShowAccessibleDiffViewer.read(e)||this._accessibleDiffViewerShouldBeVisible.read(e)),this._movedBlocksLinesPart=Qce(this,void 0),this._layoutInfo=Dce(this,e=>{const t=this._rootSizeObserver.width.read(e),i=this._rootSizeObserver.height.read(e);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=i+"px";const n=this._sash.read(e),o=this._gutter.read(e),s=o?.width.read(e)??0,r=this._overviewRulerPart.read(e)?.width??0;let a,l,d,c,h;if(n){const i=n.sashLeft.read(e);a=0,l=i-s-(this._movedBlocksLinesPart.read(e)?.width.read(e)??0),h=i-s,d=i,c=t-d-r}else h=0,a=s,l=this._options.inlineViewHideOriginalLineNumbers.read(e)?0:Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(e)),d=s+l,c=t-d-r;return this.elements.original.style.left=a+"px",this.elements.original.style.width=l+"px",this._editors.original.layout({width:l,height:i},!0),o?.layout(h),this.elements.modified.style.left=d+"px",this.elements.modified.style.width=c+"px",this._editors.modified.layout({width:c,height:i},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((e,t)=>e?.diff.read(t)),this.onDidUpdateDiff=Be.fromObservableLight(this._diffValue),this._codeEditorService.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Dle(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new EE(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(WT,t),this._register(Rce(e=>{this._options.setWidth(this._rootSizeObserver.width.read(e))})),this._contextKeyService.createKey(jl.isEmbeddedDiffEditor.key,!1),this._register(j_e(jl.isEmbeddedDiffEditor,this._contextKeyService,e=>this._options.isInEmbeddedEditor.read(e))),this._register(j_e(jl.comparingMovedCode,this._contextKeyService,e=>!!this._diffModel.read(e)?.movedTextToCompare.read(e))),this._register(j_e(jl.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,e=>this._options.couldShowInlineViewBecauseOfSize.read(e))),this._register(j_e(jl.diffEditorInlineMode,this._contextKeyService,e=>!this._options.renderSideBySide.read(e))),this._register(j_e(jl.hasChanges,this._contextKeyService,e=>(this._diffModel.read(e)?.diff.read(e)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(yT,this.elements.original,this.elements.modified,this._options,i,(e,t,i,n)=>this._createInnerEditor(e,t,i,n))),this._register(j_e(jl.diffEditorOriginalWritable,this._contextKeyService,e=>this._options.originalEditable.read(e))),this._register(j_e(jl.diffEditorModifiedWritable,this._contextKeyService,e=>!this._options.readOnly.read(e))),this._register(j_e(jl.diffEditorOriginalUri,this._contextKeyService,e=>this._diffModel.read(e)?.model.original.uri.toString()??"")),this._register(j_e(jl.diffEditorModifiedUri,this._contextKeyService,e=>this._diffModel.read(e)?.model.modified.uri.toString()??"")),this._overviewRulerPart=Mce(this,e=>this._options.renderOverviewRuler.read(e)?this._instantiationService.createInstance(U_e(vT),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(e=>e.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const l={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((e,t)=>e-(this._overviewRulerPart.read(t)?.width??0))};this._sashLayout=new TT(this._options,l),this._sash=Mce(this,e=>{const t=this._options.renderSideBySide.read(e);return this.elements.root.classList.toggle("side-by-side",t),t?new RT(this.elements.root,l,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=Mce(this,e=>this._instantiationService.createInstance(U_e(iO),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Mce(this,e=>this._instantiationService.createInstance(U_e(uT),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const c=new Set,h=new Set;let u=!1;const g=Mce(this,e=>this._instantiationService.createInstance(U_e(lT),pn(this._domElement),this._editors,this._diffModel,this._options,this,()=>u||d.read(void 0).isUpdatingHiddenAreas,c,h)).recomputeInitiallyAndOnChange(this._store),p=Dce(this,e=>{const t=g.read(e).viewZones.read(e).orig,i=d.read(e).viewZones.read(e).origViewZones;return t.concat(i)}),m=Dce(this,e=>{const t=g.read(e).viewZones.read(e).mod,i=d.read(e).viewZones.read(e).modViewZones;return t.concat(i)});let f;this._register(twe(this._editors.original,p,e=>{u=e},c)),this._register(twe(this._editors.modified,m,e=>{u=e,u?f=PL.capture(this._editors.modified):(f?.restore(this._editors.modified),f=void 0)},h)),this._accessibleDiffViewer=Mce(this,e=>this._instantiationService.createInstance(U_e(oM),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(e,t)=>this._accessibleDiffViewerShouldBeVisible.set(e,t),this._options.onlyShowAccessibleDiffViewer.map(e=>!e),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((e,t)=>e?.diff.read(t)?.mappings.map(e=>e.lineRangeMapping)),new pM(this._editors))).recomputeInitiallyAndOnChange(this._store);const _=this._accessibleDiffViewerVisible.map(e=>e?"hidden":"visible");this._register(ewe(this.elements.modified,{visibility:_})),this._register(ewe(this.elements.original,{visibility:_})),this._createDiffEditorContributions(),this._codeEditorService.addDiffEditor(this),this._register(Dle(()=>{this._codeEditorService.removeDiffEditor(this)})),this._gutter=Mce(this,e=>this._options.shouldRenderGutterMenu.read(e)?this._instantiationService.createInstance(U_e(ZR),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(Kce(this._layoutInfo)),Mce(this,e=>new(U_e(dT))(this.elements.root,this._diffModel,this._layoutInfo.map(e=>e.originalEditor),this._layoutInfo.map(e=>e.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,e=>{this._movedBlocksLinesPart.set(e,void 0)}),this._register(Be.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,e=>this._handleCursorPositionChange(e,!0))),this._register(Be.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,e=>this._handleCursorPositionChange(e,!1)));const b=this._diffModel.map(this,(e,t)=>{if(e)return void 0===e.diff.read(t)&&!e.isDiffUpToDate.read(t)});this._register(Pce((e,t)=>{if(!0===b.read(e)){const e=this._editorProgressService.show(!0,1e3);t.add(Dle(()=>e.done()))}})),this._register(Pce((e,t)=>{t.add(new(U_e(rO))(this._editors,this._diffModel,this._options,this))})),this._register(Pce((e,t)=>{const i=this._diffModel.read(e);if(i)for(const n of[i.model.original,i.model.modified])t.add(n.onWillDispose(e=>{$ae(new y("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(Rce(e=>{this._options.setModel(this._diffModel.read(e))}))}_createInnerEditor(e,t,i,n){return e.createInstance(pL,t,i,n)}_createDiffEditorContributions(){const e=dr.getDiffEditorContributions();for(const i of e)try{this._register(this._instantiationService.createInstance(i.ctor,this))}catch(t){$ae(t)}}get _targetEditor(){return this._editors.modified}getEditorType(){return ZC.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){return{original:this._editors.original.saveViewState(),modified:this._editors.modified.saveViewState(),modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){if(e&&e.original&&e.modified){const t=e;this._editors.original.restoreViewState(t.original),this._editors.modified.restoreViewState(t.modified),t.modelState&&this._diffModel.get()?.restoreSerializedState(t.modelState)}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance($M,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){const t=e?"model"in e?AE.create(e).createNewRef(this):AE.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&Vce(t,t=>{const i=e?.object;Hce.batchEventsGlobally(t,()=>{this._editors.original.setModel(i?i.model.original:null),this._editors.modified.setModel(i?i.model.modified:null)});const n=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),t),setTimeout(()=>{n?.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){const e=this._diffModel.get()?.diff.get();return e?e.mappings.map(e=>{const t=e.lineRangeMapping;let i,n,o,s,r=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,r=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,s=0,r=void 0):(o=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:o,modifiedEndLineNumber:s,charChanges:r?.map(e=>({originalStartLineNumber:e.originalRange.startLineNumber,originalStartColumn:e.originalRange.startColumn,originalEndLineNumber:e.originalRange.endLineNumber,originalEndColumn:e.originalRange.endColumn,modifiedStartLineNumber:e.modifiedRange.startLineNumber,modifiedStartColumn:e.modifiedRange.startColumn,modifiedEndLineNumber:e.modifiedRange.endLineNumber,modifiedEndColumn:e.modifiedRange.endColumn}))}}):null}getDiffComputationResult(){const e=this._diffModel.get()?.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(e=>e.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){const t=this._diffModel.get();t&&t.isDiffUpToDate.get()&&(this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}]),this._editors.modified.pushUndoStop())}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(e=>({range:e.modifiedRange,text:t.model.original.getValueInRange(e.originalRange)}));this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",i),this._editors.modified.pushUndoStop()}revertFocusedRangeMappings(){const e=this._diffModel.get();if(!e||!e.isDiffUpToDate.get())return;const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||0===t.length)return;const i=this._editors.modified;if(!i.hasTextFocus())return;const n=i.getPosition().lineNumber,o=i.getSelection(),s=Qw.fromRange(o||new mr(n,0,n,0)),r=t.filter(e=>e.lineRangeMapping.modified.intersect(s));i.pushUndoStop(),i.executeEdits("diffEditor",r.map(t=>({range:t.lineRangeMapping.modified.toExclusiveRange(),text:e.model.original.getValueInRange(t.lineRangeMapping.original.toExclusiveRange())}))),i.pushUndoStop()}_goTo(e){this._editors.modified.setPosition(new to(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){const t=this._diffModel.get()?.diff.get()?.mappings;if(!t||0===t.length)return;const i=this._editors.modified.getPosition().lineNumber;let n;n="next"===e?this._editors.modified.getModel().getLineCount()===i?t[0]:t.find(e=>e.lineRangeMapping.modified.startLineNumber>i)??t[0]:Kpe(t,e=>e.lineRangeMapping.modified.startLineNumber<i)??t[t.length-1],this._goTo(n),n.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(TL.diffLineDeleted,{source:"diffEditor.goToDiff"}):n.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(TL.diffLineInserted,{source:"diffEditor.goToDiff"}):n&&this._accessibilitySignalService.playSignal(TL.diffLineModified,{source:"diffEditor.goToDiff"})}revealFirstDiff(){const e=this._diffModel.get();e&&this.waitForDiff().then(()=>{const t=e.diff.get()?.mappings;t&&0!==t.length&&this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let n;const o=t.getSelection();if(o){const t=this._diffModel.get()?.diff.get()?.mappings.map(t=>e?t.lineRangeMapping.flip():t.lineRangeMapping);if(t){const e=iwe(o.getStartPosition(),t),i=iwe(o.getEndPosition(),t);n=mr.plusRange(e,i)}}return{destination:i,destinationSelection:n}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&Wce(t=>{for(const i of e)i.collapseAll(t)})}showAllUnchangedRegions(){const e=this._diffModel.get()?.unchangedRegions.get();e&&Wce(t=>{for(const i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(3===e?.reason){const i=this._diffModel.get()?.diff.get()?.mappings.find(i=>t?i.lineRangeMapping.modified.contains(e.position.lineNumber):i.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(TL.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(TL.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(TL.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}},cO=lO([dO(3,es),dO(4,Jn),dO(5,eo),dO(6,NL),dO(7,AL)],cO),hO=class extends ms{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:zae(85,"Toggle Collapse Unchanged Regions"),icon:go.map,toggled:Po.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Po.has("isInDiffEditor"),menu:{when:Po.has("isInDiffEditor"),id:ds.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(ka),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}},uO=class extends ms{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:zae(86,"Toggle Show Moved Code Blocks"),precondition:Po.has("isInDiffEditor")})}run(e,...t){const i=e.get(ka),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}},gO=class extends ms{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:zae(87,"Toggle Use Inline View When Space Is Limited"),precondition:Po.has("isInDiffEditor")})}run(e,...t){const i=e.get(ka),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}},pO=zae(88,"Diff Editor"),mO=class extends lr{constructor(){super({id:"diffEditor.switchSide",title:zae(89,"Switch Side"),icon:go.arrowSwap,precondition:Po.has("isInDiffEditor"),f1:!0,category:pO})}runEditorCommand(e,t,i){const n=Twe(e);if(n instanceof cO){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}},fO=class extends lr{constructor(){super({id:"diffEditor.exitCompareMove",title:zae(90,"Exit Compare Move"),icon:go.close,precondition:jl.comparingMovedCode,f1:!1,category:pO,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Twe(e);n instanceof cO&&n.exitCompareMove()}},_O=class extends lr{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:zae(91,"Collapse All Unchanged Regions"),icon:go.fold,precondition:Po.has("isInDiffEditor"),f1:!0,category:pO})}runEditorCommand(e,t,...i){const n=Twe(e);n instanceof cO&&n.collapseAllUnchangedRegions()}},bO=class extends lr{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:zae(92,"Show All Unchanged Regions"),icon:go.unfold,precondition:Po.has("isInDiffEditor"),f1:!0,category:pO})}runEditorCommand(e,t,...i){const n=Twe(e);n instanceof cO&&n.showAllUnchangedRegions()}},vO=class extends ms{constructor(){super({id:"diffEditor.revert",title:zae(93,"Revert"),f1:!0,category:pO,precondition:Po.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){const t=Twe(e);t instanceof cO&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){const i=function(e,t,i){return e.get(eo).listDiffEditors().find(e=>{const n=e.getModifiedEditor(),o=e.getOriginalEditor();return n&&n.getModel()?.uri.toString()===i.toString()&&o&&o.getModel()?.uri.toString()===t.toString()})||null}(e,t.originalUri,t.modifiedUri);i instanceof cO&&i.revertRangeMappings(t.mapping.innerChanges??[])}},wO=zae(94,"Accessible Diff Viewer"),(CO=class e extends ms{constructor(){super({id:e.id,title:zae(95,"Go to Next Difference"),category:wO,precondition:Po.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){Twe(e)?.accessibleDiffViewerNext()}}).id="editor.action.accessibleDiffViewer.next",(yO=class e extends ms{constructor(){super({id:e.id,title:zae(96,"Go to Previous Difference"),category:wO,precondition:Po.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){Twe(e)?.accessibleDiffViewerPrev()}}).id="editor.action.accessibleDiffViewer.prev",mue(hO),mue(uO),mue(gO),us.appendMenuItem(ds.EditorTitle,{command:{id:(new gO).desc.id,title:Vae(119,"Use Inline View When Space Is Limited"),toggled:Po.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Po.has("isInDiffEditor")},order:11,group:"1_diff",when:Po.and(jl.diffEditorRenderSideBySideInlineBreakpointReached,Po.has("isInDiffEditor"))}),us.appendMenuItem(ds.EditorTitle,{command:{id:(new uO).desc.id,title:Vae(120,"Show Moved Code Blocks"),icon:go.move,toggled:Vo.create("config.diffEditor.experimental.showMoves",!0),precondition:Po.has("isInDiffEditor")},order:10,group:"1_diff",when:Po.has("isInDiffEditor")}),mue(vO);for(const e of[{icon:go.arrowRight,key:jl.diffEditorInlineMode.toNegated()},{icon:go.discard,key:jl.diffEditorInlineMode}])us.appendMenuItem(ds.DiffEditorHunkToolbar,{command:{id:(new vO).desc.id,title:Vae(121,"Revert Block"),icon:e.icon},when:Po.and(jl.diffEditorModifiedWritable,e.key),order:5,group:"primary"}),us.appendMenuItem(ds.DiffEditorSelectionToolbar,{command:{id:(new vO).desc.id,title:Vae(122,"Revert Selection"),icon:e.icon},when:Po.and(jl.diffEditorModifiedWritable,e.key),order:5,group:"primary"});mue(mO),mue(fO),mue(_O),mue(bO),us.appendMenuItem(ds.EditorTitle,{command:{id:CO.id,title:Vae(123,"Open Accessible Diff Viewer"),precondition:Po.has("isInDiffEditor")},order:10,group:"2_diff",when:Po.and(jl.accessibleDiffViewerVisible.negate(),Po.has("isInDiffEditor"))}),_o.registerCommandAlias("editor.action.diffReview.next",CO.id),mue(CO),_o.registerCommandAlias("editor.action.diffReview.prev",yO.id),mue(yO),xO=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},kO=function(e,t){return function(i,n){t(i,n,e)}},DO=new Jo("selectionAnchorSet",!1),SO=class{static get(e){return e.getContribution(LO.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=DO.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(fr.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:(new pD).appendText(Vae(798,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Qhe(Vae(799,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(fr.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},LO=SO,SO.ID="editor.contrib.selectionAnchorController",IO=SO,IO=LO=xO([kO(1,es)],IO),NO=class extends rr{constructor(){super({id:"editor.action.setSelectionAnchor",label:zae(800,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2080),weight:100}})}async run(e,t){IO.get(t)?.setSelectionAnchor()}},EO=class extends rr{constructor(){super({id:"editor.action.goToSelectionAnchor",label:zae(801,"Go to Selection Anchor"),precondition:DO})}async run(e,t){IO.get(t)?.goToSelectionAnchor()}},MO=class extends rr{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:zae(802,"Select from Anchor to Cursor"),precondition:DO,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2089),weight:100}})}async run(e,t){IO.get(t)?.selectFromAnchorToCursor()}},TO=class extends rr{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:zae(803,"Cancel Selection Anchor"),precondition:DO,kbOpts:{kbExpr:jl.editorTextFocus,primary:9,weight:100}})}async run(e,t){IO.get(t)?.cancelSelectionAnchor()}},Iue(IO.ID,IO,4),kue(NO),kue(EO),kue(MO),kue(TO),OO=mpe("editorOverviewRuler.bracketMatchForeground","#A0A0A0",Vae(804,"Overview ruler marker color for matching brackets.")),AO=class extends rr{constructor(){super({id:"editor.action.jumpToBracket",label:zae(806,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:3165,weight:100}})}run(e,t){BO.get(t)?.jumpToBracket()}},PO=class extends rr{constructor(){super({id:"editor.action.selectToBracket",label:zae(807,"Select to Bracket"),precondition:void 0,metadata:{description:zae(808,"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 n=!0;i&&!1===i.selectBrackets&&(n=!1),BO.get(t)?.selectToBracket(n)}},FO=class extends rr{constructor(){super({id:"editor.action.removeBrackets",label:zae(809,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){BO.get(t)?.removeBrackets(this.id)}},WO=class{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}},BO=class e extends Ie{static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ft(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{"never"!==this._matchBrackets&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(t=>{const i=t.getStartPosition(),n=e.bracketPairs.matchBracket(i);let o=null;if(n)n[0].containsPosition(i)&&!n[1].containsPosition(i)?o=n[1].getStartPosition():n[1].containsPosition(i)&&(o=n[0].getStartPosition());else{const t=e.bracketPairs.findEnclosingBrackets(i);if(t)o=t[1].getStartPosition();else{const t=e.bracketPairs.findNextBracket(i);t&&t.range&&(o=t.range.getStartPosition())}}return o?new fr(o.lineNumber,o.column,o.lineNumber,o.column):new fr(i.lineNumber,i.column,i.lineNumber,i.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const o=n.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const e=t.bracketPairs.findNextBracket(o);e&&e.range&&(s=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let r=null,a=null;if(s){s.sort(mr.compareRangesUsingStarts);const[t,i]=s;if(r=e?t.getStartPosition():t.getEndPosition(),a=e?i.getEndPosition():i.getStartPosition(),i.containsPosition(o)){const e=r;r=a,a=e}}r&&a&&i.push(new fr(r.lineNumber,r.column,a.lineNumber,a.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let o=t.bracketPairs.matchBracket(n);o||(o=t.bracketPairs.findEnclosingBrackets(n)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if("never"===this._matchBrackets)return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return this._lastBracketsData=[],void(this._lastVersionId=0);const t=this._editor.getSelections();if(t.length>100)return this._lastBracketsData=[],void(this._lastVersionId=0);const i=this._editor.getModel(),n=i.getVersionId();let o=[];this._lastVersionId===n&&(o=this._lastBracketsData);const s=[];let r=0;for(let e=0,h=t.length;e<h;e++){const i=t[e];i.isEmpty()&&(s[r++]=i.getStartPosition())}s.length>1&&s.sort(to.compare);const a=[];let l=0,d=0;const c=o.length;for(let h=0,u=s.length;h<u;h++){const t=s[h];for(;d<c&&o[d].position.isBefore(t);)d++;if(d<c&&o[d].position.equals(t))a[l++]=o[d];else{let n=i.bracketPairs.matchBracket(t,20),o=e._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;n||"always"!==this._matchBrackets||(n=i.bracketPairs.findEnclosingBrackets(t,20),o=e._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new WO(t,n,o)}}this._lastBracketsData=a,this._lastVersionId=n}},(RO=BO).ID="editor.contrib.bracketMatchingController",RO._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Lx.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Hpe(OO),position:Zr.Center}}),RO._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Lx.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"}),Iue(BO.ID,BO,1),kue(PO),kue(AO),kue(FO),us.appendMenuItem(ds.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:Vae(805,"Go to &&Bracket")},order:2}),VO=class{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,o=this._selection.endColumn;if((!this._isMovingLeft||1!==n)&&(this._isMovingLeft||o!==e.getLineMaxColumn(i)))if(this._isMovingLeft){const s=new mr(i,n-1,i,n),r=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new mr(i,o,i,o),r)}else{const s=new mr(i,o,i,o+1),r=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new mr(i,n,i,n),r)}}computeCursorState(e,t){return this._isMovingLeft?new fr(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new fr(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}},HO=class extends rr{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const o of n)i.push(new VO(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}},zO=class extends HO{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:zae(810,"Move Selected Text Left"),precondition:jl.writable})}},UO=class extends HO{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:zae(811,"Move Selected Text Right"),precondition:jl.writable})}},kue(zO),kue(UO),KO=class extends rr{constructor(){super({id:"editor.action.transposeLetters",label:zae(812,"Transpose Letters"),precondition:jl.writable,kbOpts:{kbExpr:jl.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],o=t.getSelections();for(const s of o){if(!s.isEmpty())continue;const e=s.startLineNumber,t=s.startColumn,o=i.getLineMaxColumn(e);if(1===e&&(1===t||2===t&&2===o))continue;const r=t===o?s.getPosition():Br.rightPosition(i,s.getPosition().lineNumber,s.getPosition().column),a=Br.leftPosition(i,r),l=Br.leftPosition(i,a),d=i.getValueInRange(mr.fromPositions(l,a)),c=i.getValueInRange(mr.fromPositions(a,r)),h=mr.fromPositions(l,r);n.push(new Er(h,c+d))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}},kue(KO),qO=eue("productService"),jO=class{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return ke.some(this,([e,t])=>t.asFile())&&t.push("files"),Pwe(Owe(e),t)}get(e){return this._entries.get(this.toKey(e))?.[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return Owe(e)}},$O=Object.freeze({create:e=>rce(e.map(e=>e.toString())).join("\r\n"),split:e=>e.split("\r\n"),parse:e=>$O.split(e).filter(e=>!e.startsWith("#"))}),(GO=ZO=class e{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(t){return this.equals(t)||""===this.value||t.value.startsWith(this.value+e.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}}).sep=".",GO.None=new GO("@@none@@"),GO.Empty=new GO(""),YO={ctrlCmd:!1,alt:!1},function(e){e[e.Blur=1]="Blur",e[e.Gesture=2]="Gesture",e[e.Other=3]="Other"}(QO||(QO={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.SECOND=2]="SECOND",e[e.LAST=3]="LAST"}(XO||(XO={})),function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage",e[e.NextSeparator=8]="NextSeparator",e[e.PreviousSeparator=9]="PreviousSeparator"}(JO||(JO={})),function(e){e[e.Title=1]="Title",e[e.Inline=2]="Inline",e[e.Input=3]="Input"}(eA||(eA={})),tA=eue("quickInputService"),nA={EDITORS:"CodeEditors",FILES:"CodeFiles"},oA=class{},sA={DragAndDropContribution:"workbench.contributions.dragAndDrop"},ts.add(sA.DragAndDropContribution,new oA),(iA=rA=class e{constructor(){}static getInstance(){return e.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}).INSTANCE=new iA,aA=Object.freeze([nA.EDITORS,nA.FILES,FL.RESOURCES,FL.INTERNAL_URI_LIST]),lA=eue("IWorkspaceEditService"),dA=class{constructor(e){this.metadata=e}static convert(e){return e.edits.map(e=>{if(cA.is(e))return cA.lift(e);if(hA.is(e))return hA.lift(e);throw new Error("Unsupported edit")})}},cA=class e extends dA{static is(t){return t instanceof e||rle(t)&&_i.isUri(t.resource)&&rle(t.textEdit)}static lift(t){return t instanceof e?t:new e(t.resource,t.textEdit,t.versionId,t.metadata)}constructor(e,t,i=void 0,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}},hA=class e extends dA{static is(t){return t instanceof e||rle(t)&&(Boolean(t.newResource)||Boolean(t.oldResource))}static lift(t){return t instanceof e?t:new e(t.oldResource,t.newResource,t.options,t.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}},uA=eue("IEditorCancelService"),gA=new Jo("cancellableOperation",!1,Vae(939,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'")),dge(uA,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext(e=>({key:gA.bindTo(e.get(es)),tokens:new Ae})),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},1),pA=class extends ot{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(t=>t.get(uA).add(e,this))}dispose(){this._unregister(),super.dispose()}},xue(new class extends sr{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:gA})}runEditorCommand(e,t){e.get(uA).cancel(t)}}),mA=class e{constructor(e,t){if(this.flags=t,1&this.flags){const t=e.getModel();this.modelVersionId=t?Fle("{0}#{1}",t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;4&this.flags?this.position=e.getPosition():this.position=null,2&this.flags?this.selection=e.getSelection():this.selection=null,8&this.flags?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(t){if(!(t instanceof e))return!1;const i=t;return this.modelVersionId===i.modelVersionId&&this.scrollLeft===i.scrollLeft&&this.scrollTop===i.scrollTop&&!(!this.position&&i.position||this.position&&!i.position||this.position&&i.position&&!this.position.equals(i.position))&&!(!this.selection&&i.selection||this.selection&&!i.selection||this.selection&&i.selection&&!this.selection.equalsRange(i.selection))}validate(t){return this._equals(new e(t,this.flags))}},fA=class extends pA{constructor(e,t,i,n){super(e,n),this._listener=new De,4&t&&this._listener.add(e.onDidChangeCursorPosition(e=>{i&&mr.containsPosition(i,e.position)||this.cancel()})),2&t&&this._listener.add(e.onDidChangeCursorSelection(e=>{i&&mr.containsRange(i,e.selection)||this.cancel()})),8&t&&this._listener.add(e.onDidScrollChange(e=>this.cancel())),1&t&&(this._listener.add(e.onDidChangeModel(e=>this.cancel())),this._listener.add(e.onDidChangeModelContent(e=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}},_A=class extends ot{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}},bA=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},vA=function(e,t){return function(i,n){t(i,n,e)}},wA=Lx.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:" ",inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),CA=class e extends Ie{constructor(e,t,i,n,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=Ahe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Ahe("span.icon");this.domNode.append(t),t.classList.add(...mo.asClassNameArray(go.loading),"codicon-modifier-spin");const i=()=>{const e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};i(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&i()})),this._register(ehe(this.domNode,On.CLICK,e=>{this.delegate.cancel()}))}getId(){return e.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}},CA.baseId="editor.widget.inlineProgressWidget",yA=class extends Ie{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Ne),this._currentWidget=this._register(new Ne),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,o){const s=this._operationIdPool++;this._currentOperation=s,this.clear(),this._showPromise.value=Rle(()=>{const i=mr.fromPositions(e);this._currentDecorations.set([{range:i,options:wA}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(CA,this.id,this._editor,i,t,n))},o??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()}},yA=bA([vA(2,Jn)],yA),SA=eue("openerService"),xA=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},kA=function(e,t){return function(i,n){t(i,n,e)}},LA=eue("markdownRendererService"),DA=class{constructor(e){this._openerService=e}render(e,t,i){const n={...t};n.actionHandler||(n.actionHandler=(e,t)=>Hwe(this._openerService,e,t.isTrusted)),n.codeBlockRenderer||(n.codeBlockRenderer=(e,t)=>this._defaultCodeBlockRenderer?.renderCodeBlock(e,t,n??{})??Promise.resolve(document.createElement("span")));const o=mve(e,n,i);return o.element.classList.add("rendered-markdown"),o}setDefaultCodeBlockRenderer(e){this._defaultCodeBlockRenderer=e}},DA=xA([kA(0,SA)],DA),dge(LA,DA,1),NA=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},EA=function(e,t){return function(i,n){t(i,n,e)}},IA=class{static get(e){return e.getContribution(MA.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Ne,this._messageListeners=new De,this._mouseOverMessage=!1,this._editor=e,this._visible=MA.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(Qhe(Hbe(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Hbe(e)){const i=this._messageListeners.add(mve(e,{actionHandler:(e,t)=>{this.closeMessage(),Hwe(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new RA(this._editor,t,i.element)}else this._messageWidget.value=new RA(this._editor,t,e);let i;this._messageListeners.add(Be.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&phe(vhe(),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(ehe(this._messageWidget.value.getDomNode(),On.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ehe(this._messageWidget.value.getDomNode(),On.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0)),this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(i?i.containsPosition(e.target.position)||this.closeMessage():i=new mr(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(RA.fadeOut(this._messageWidget.value))}},MA=IA,IA.ID="editor.contrib.messageController",IA.MESSAGE_VISIBLE=new Jo("messageVisible",!1,Vae(1287,"Whether the editor is currently showing an inline message")),TA=IA,TA=MA=NA([EA(1,es),EA(2,SA)],TA),xue(new(sr.bindToContribution(TA.get))({id:"leaveEditorMessage",precondition:TA.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}})),RA=class{static fadeOut(e){const 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},n){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";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");"string"==typeof n?(s.classList.add("message"),s.textContent=n):(n.classList.add("message"),s.appendChild(n)),this._domNode.appendChild(s);const r=document.createElement("div");r.classList.add("anchor","below"),this._domNode.appendChild(r),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",2===e)}},Iue(TA.ID,TA,4),OA=class{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){return e.charCodeAt(0)-this._value.charCodeAt(this._pos)}value(){return this._value[this._pos]}},AA=class{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(46===this._value.charCodeAt(this._to)){if(!e)break;this._from++}else e=!1;return this}cmp(e){return this._caseSensitive?Yle(e,this._value,0,e.length,this._from,this._to):Xle(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},PA=class{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(47===t||this._splitOnBackslash&&92===t){if(!e)break;this._from++}else e=!1}return this}cmp(e){return this._caseSensitive?Yle(e,this._value,0,e.length,this._from,this._to):Xle(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},FA=class{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new PA(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(1===this._states[this._stateIdx])return Qle(e,this._value.scheme);if(2===this._states[this._stateIdx])return Qle(e,this._value.authority);if(3===this._states[this._stateIdx])return this._pathIterator.cmp(e);if(4===this._states[this._stateIdx])return Zle(e,this._value.query);if(5===this._states[this._stateIdx])return Zle(e,this._value.fragment);throw new Error}value(){if(1===this._states[this._stateIdx])return this._value.scheme;if(2===this._states[this._stateIdx])return this._value.authority;if(3===this._states[this._stateIdx])return this._pathIterator.value();if(4===this._states[this._stateIdx])return this._value.query;if(5===this._states[this._stateIdx])return this._value.fragment;throw new Error}},(WA=class e{static wrap(t){return void 0===t?e.Val:t}static unwrap(t){return t===e.Val?void 0:t}}).Val=Symbol("undefined_placeholder"),BA=class{constructor(){this.height=1,this.value=void 0,this.key=void 0,this.left=void 0,this.mid=void 0,this.right=void 0}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}},VA=class e{static forUris(t=()=>!1,i=()=>!1){return new e(new FA(t,i))}static forStrings(){return new e(new OA)}static forConfigKeys(){return new e(new AA)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new BA,this._root.segment=i.value());const o=[];for(n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new BA,n.left.segment=i.value()),o.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new BA,n.right.segment=i.value()),o.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new BA,n.mid.segment=i.value()),o.push([0,n]),n=n.mid}}const s=WA.unwrap(n.value);n.value=WA.wrap(t),n.key=e;for(let r=o.length-1;r>=0;r--){const e=o[r][1];e.updateHeight();const t=e.balanceFactor();if(t<-1||t>1){const t=o[r][0],i=o[r+1][0];if(1===t&&1===i)o[r][1]=e.rotateLeft();else if(-1===t&&-1===i)o[r][1]=e.rotateRight();else if(1===t&&-1===i)e.right=o[r+1][1]=o[r+1][1].rotateRight(),o[r][1]=e.rotateLeft();else{if(-1!==t||1!==i)throw new Error;e.left=o[r+1][1]=o[r+1][1].rotateLeft(),o[r][1]=e.rotateRight()}if(r>0)switch(o[r-1][0]){case-1:o[r-1][1].left=o[r][1];break;case 1:o[r-1][1].right=o[r][1];break;case 0:o[r-1][1].mid=o[r][1]}else this._root=o[0][1]}}return s}get(e){return WA.unwrap(this._getNode(e)?.value)}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===t?.value&&void 0===t?.mid)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),n=[];let o=this._root;for(;o;){const e=i.cmp(o.segment);if(e>0)n.push([-1,o]),o=o.left;else if(e<0)n.push([1,o]),o=o.right;else{if(!i.hasNext())break;i.next(),n.push([0,o]),o=o.mid}}if(o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const e=[[1,o]],t=this._min(o.right,e);if(t.key){o.key=t.key,o.value=t.value,o.segment=t.segment;const i=t.right;if(e.length>1){const[t,n]=e[e.length-1];switch(t){case-1:n.left=i;break;case 0:tle(!1);case 1:tle(!1)}}else o.right=i;const s=this._balanceByStack(e);if(n.length>0){const[e,t]=n[n.length-1];switch(e){case-1:t.left=s;break;case 0:t.mid=s;break;case 1:t.right=s}}else this._root=s}}else{const e=o.left??o.right;if(n.length>0){const[t,i]=n[n.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}this._root=this._balanceByStack(n)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const i=e[t][1];i.updateHeight();const n=i.balanceFactor();if(n>1?(i.right.balanceFactor()>=0||(i.right=i.right.rotateRight()),e[t][1]=i.rotateLeft()):n<-1&&(i.left.balanceFactor()<=0||(i.left=i.left.rotateLeft()),e[t][1]=i.rotateRight()),!(t>0))return e[0][1];switch(e[t-1][0]){case-1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1]}}}findSubstr(e){const t=this._iter.reset(e);let i,n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=WA.unwrap(n.value)||i,n=n.mid}}return n&&WA.unwrap(n.value)||i}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!i.hasNext())return n.mid?this._entries(n.mid):t?WA.unwrap(n.value):void 0;i.next(),n=n.mid}}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),void 0!==e.value&&t.push([e.key,WA.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}},HA=eue("contextService"),zA={id:"empty-window"},UA=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}},Vae(2050,"Code Workspace"),KA="4064f6ec-cb38-4ad0-af64-ee6467e63c82",qA=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jA=function(e,t){return function(i,n){t(i,n,e)}},$A=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,n,o){const s=await this.getEdit(i,o);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,n){const o=await this.getEdit(i,n);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}},(GA=class e extends $A{constructor(){super(ZO.Empty.append("text","plain")),this.id=e.id,this.dropMimeTypes=[Na.text],this.pasteMimeTypes=[Na.text]}async getEdit(e,t){const i=e.get(Na.text);if(!i)return;if(e.has(Na.uriList))return;const n=await i.asString();return{handledMimeType:Na.text,title:Vae(926,"Insert Plain Text"),insertText:n,kind:this.kind}}}).id="text",ZA=class extends $A{constructor(){super(ZO.Empty.append("uri","path","absolute")),this.dropMimeTypes=[Na.uriList],this.pasteMimeTypes=[Na.uriList]}async getEdit(e,t){const i=await qwe(e);if(!i.length||t.isCancellationRequested)return;let n=0;const o=i.map(({uri:e,originalText:t})=>e.scheme===yi.file?e.fsPath:(n++,t)).join(" ");let s;return s=n>0?i.length>1?Vae(927,"Insert Uris"):Vae(928,"Insert Uri"):i.length>1?Vae(929,"Insert Paths"):Vae(930,"Insert Path"),{handledMimeType:Na.uriList,insertText:o,title:s,kind:this.kind}}},YA=class extends $A{constructor(e){super(ZO.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[Na.uriList],this.pasteMimeTypes=[Na.uriList]}async getEdit(e,t){const i=await qwe(e);if(!i.length||t.isCancellationRequested)return;const n=ice(i.map(({uri:e})=>{const t=this._workspaceContextService.getWorkspaceFolder(e);return t?Bs(t.uri,e):void 0}));return n.length?{handledMimeType:Na.uriList,insertText:n.join(" "),title:i.length>1?Vae(931,"Insert Relative Paths"):Vae(932,"Insert Relative Path"),kind:this.kind}:void 0}},YA=qA([jA(0,HA)],YA),QA=class{constructor(){this.kind=new ZO("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Na.text}]}async provideDocumentPasteEdits(e,t,i,n,o){if(n.triggerKind!==wb.PasteAs&&!n.only?.contains(this.kind))return;const s=await(i.get("text/html")?.asString());return s&&!o.isCancellationRequested?{dispose(){},edits:[{insertText:s,yieldTo:this._yieldTo,title:Vae(933,"Insert HTML"),kind:this.kind}]}:void 0}},XA={scheme:"*",hasAccessToAllModels:!0},JA=class extends Ie{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(XA,new GA)),this._register(e.documentDropEditProvider.register(XA,new ZA)),this._register(e.documentDropEditProvider.register(XA,new YA(t)))}},JA=qA([jA(0,Tx),jA(1,HA)],JA),eP=class extends Ie{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(XA,new GA)),this._register(e.documentPasteEditProvider.register(XA,new ZA)),this._register(e.documentPasteEditProvider.register(XA,new YA(t))),this._register(e.documentPasteEditProvider.register(XA,new QA))}},eP=qA([jA(0,Tx),jA(1,HA)],eP),(tP=class e{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||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};const t=this.pos;let i,n=0,o=this.value.charCodeAt(t);if(i=e._table[o],"number"==typeof i)return this.pos+=1,{type:i,pos:t,len:1};if(e.isDigitCharacter(o)){i=8;do{n+=1,o=this.value.charCodeAt(t+n)}while(e.isDigitCharacter(o));return this.pos+=n,{type:i,pos:t,len:n}}if(e.isVariableCharacter(o)){i=9;do{o=this.value.charCodeAt(t+ ++n)}while(e.isVariableCharacter(o)||e.isDigitCharacter(o));return this.pos+=n,{type:i,pos:t,len:n}}i=10;do{n+=1,o=this.value.charCodeAt(t+n)}while(!isNaN(o)&&void 0===e._table[o]&&!e.isDigitCharacter(o)&&!e.isVariableCharacter(o));return this.pos+=n,{type:i,pos:t,len:n}}})._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13},iP=class{constructor(){this._children=[]}appendChild(e){return e instanceof nP&&this._children[this._children.length-1]instanceof nP?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function e(t,i){for(const n of t)n.parent=i,e(n.children,n)}(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 cP)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}},nP=class e extends iP{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},oP=class extends iP{},sP=class e extends oP{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 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof rP?this._children[0]:void 0}clone(){const t=new e(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},rP=class e extends iP{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof nP&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const t=new e;return this.options.forEach(t.appendChild,t),t}},aP=class e extends iP{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(e=>e instanceof lP&&Boolean(e.elseValue))&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof lP){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const t=new e;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),t._children=this.children.map(e=>e.clone()),t}},lP=class e extends iP{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":"camelcase"===this.shorthandName?e?this._toCamelCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(e=>e.charAt(0).toUpperCase()+e.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((e,t)=>0===t?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1)).join(""):e}clone(){return new e(this.index,this.shorthandName,this.ifValue,this.elseValue)}},dP=class e extends oP{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new nP(t)],!0)}clone(){const t=new e(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},cP=class e extends iP{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof sP&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return jwe([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof sP&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof dP&&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(){const t=new e;return this._children=this.children.map(e=>e.clone()),t}walk(e){jwe(this.children,e)}},hP=class{constructor(){this._scanner=new tP,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){const n=new cP;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,o=[];t.walk(e=>(e instanceof sP&&(e.isFinalTabstop?n.set(0,void 0):!n.has(e.index)&&e.children.length>0?n.set(e.index,e.children):o.push(e)),!0));const s=(e,i)=>{const o=n.get(e.index);if(!o)return;const r=new sP(e.index);r.transform=e.transform;for(const t of o){const e=t.clone();r.appendChild(e),e instanceof sP&&n.has(e.index)&&!i.has(e.index)&&(i.add(e.index),s(e,i),i.delete(e.index))}t.replace(e,[r])},r=new Set;for(const a of o)s(a,r);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(e=>0===e.index)||e.appendChild(new sP(0)))}_accept(e,t){if(void 0===e||this._token.type===e){const e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)return!1}this._token=this._scanner.next()}const 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 nP(t)),!0)}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new sP(Number(t)):new dP(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const n=new sP(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new nP("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else{if(!(n.index>0&&this._accept(7)))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);{const t=new rP;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(t),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}}}_parseChoiceElement(e){const t=this._token,i=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;i.push(e)}return 0===i.length?(this._backTo(t),!1):(e.appendChild(new nP(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const n=new dP(t);if(!this._accept(1))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);for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new nP("${"+t+":")),n.children.forEach(e.appendChild,e),!0}}_parseTransform(e){const t=new aP;let i="",n="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,i+=e;else{if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new nP(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}try{t.regexp=new RegExp(i,n)}catch(Fae){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(!n)return this._backTo(t),!1;if(!i)return e.appendChild(new lP(Number(n))),!0;if(this._accept(4))return e.appendChild(new lP(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){const i=this._accept(9,!0);return i&&this._accept(4)?(e.appendChild(new lP(Number(n),i)),!0):(this._backTo(t),!1)}if(this._accept(11)){const t=this._until(4);if(t)return e.appendChild(new lP(Number(n),void 0,t,void 0)),!0}else if(this._accept(12)){const t=this._until(4);if(t)return e.appendChild(new lP(Number(n),void 0,void 0,t)),!0}else if(this._accept(13)){const t=this._until(1);if(t){const i=this._until(4);if(i)return e.appendChild(new lP(Number(n),void 0,t,i)),!0}}else{const t=this._until(4);if(t)return e.appendChild(new lP(Number(n),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new nP(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}},eh.white.toString(),eh.white.toString(),uP=Object.freeze({allowedTags:{override:["b","i","u","code","span"]},allowedAttributes:{override:["class"]}}),gP=class extends Ie{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new je),this._onDidEscape=this._register(new je),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),"string"==typeof t.title&&this.setTitle(t.title),"string"==typeof t.ariaLabel&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this.enabled=!t.disabled,this._register(pm.addTarget(this._element)),[On.CLICK,gm.Tap].forEach(e=>{this._register(ehe(this._element,e,e=>{this.enabled?this._onDidClick.fire(e):An.stop(e)}))}),this._register(ehe(this._element,On.KEY_DOWN,e=>{const t=new we(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._onDidEscape.fire(e),this._element.blur(),i=!0),i&&An.stop(t,!0)})),this._register(ehe(this._element,On.MOUSE_OVER,e=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(ehe(this._element,On.MOUSE_OUT,e=>{this.updateBackground(!1)})),this.focusTracker=this._register(Ehe(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of gve(e))if("string"==typeof i){if(i=i.trim(),""===i)continue;const e=document.createElement("span");e.textContent=i,t.push(e)}else t.push(i);return t}updateBackground(e){let t;t=this.options.secondary?e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){if(this._label===e)return;if(Hbe(this._label)&&Hbe(e)&&((t=this._label)===(i=e)||t&&i&&t.value===i.value&&t.isTrusted===i.isTrusted&&t.supportThemeIcons===i.supportThemeIcons&&t.supportHtml===i.supportHtml&&t.supportAlertSyntax===i.supportAlertSyntax&&(t.baseUri===i.baseUri||t.baseUri&&i.baseUri&&Ts(_i.from(t.baseUri),_i.from(i.baseUri)))))return;var t,i;this._element.classList.add("monaco-text-button");const n=this.options.supportShortLabel?this._labelElement:this._element;if(Hbe(e)){const t=mve(e,void 0,document.createElement("span"));t.dispose();const i=t.element.querySelector("p")?.innerHTML;i?uve(n,i,uP):Rhe(n)}else this.options.supportIcons?Rhe(n,...this.getContentElements(e)):n.textContent=e;let o="";"string"==typeof this.options.title?o=this.options.title:this.options.title&&(o=function(e){if("string"==typeof e)return e;let t=e.value??"";return t.length>1e5&&(t=`${t.substr(0,1e5)}…`),Cve(xI(t,{async:!1,renderer:ON.value}),{isTrusted:!1},{}).toString().replace(/&(#\d+|[a-zA-Z]+);/g,e=>RN.get(e)??e).trim()}(e)),this.setTitle(o),this._setAriaLabel(),this._label=e}get label(){return this._label}_setAriaLabel(){"string"==typeof this.options.ariaLabel?this._element.setAttribute("aria-label",this.options.ariaLabel):"string"==typeof this.options.title&&this._element.setAttribute("aria-label",this.options.title)}set icon(e){this._setAriaLabel();const t=Array.from(this._element.classList).filter(e=>e.startsWith("codicon-"));this._element.classList.remove(...t),this._element.classList.add(...mo.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){this._hover||""===e?this._hover&&this._hover.update(e):this._hover=this._register(Bve().setupManagedHover(this.options.hoverDelegate??$_e("element"),this._element,e))}},pP=Ahe,mP={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0},fP=class e extends Ie{constructor(e,t,i){super(),this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const n=this.options.keybindingLabelForeground;this.domNode=Mhe(e,pP(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.hover=this._register(Bve().setupManagedHover($_e("mouse"),this.domNode,"")),this.didEverRender=!1,e.appendChild(this.domNode)}set(t,i){this.didEverRender&&this.keybinding===t&&e.areSame(this.matches,i)||(this.keybinding=t,this.matches=i,this.render())}render(){if(this.clear(),this.keybinding){const e=this.keybinding.getChords();e[0]&&this.renderChord(this.domNode,e[0],this.matches?this.matches.firstPart:null);for(let i=1;i<e.length;i++)Mhe(this.domNode,pP("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,e[i],this.matches?this.matches.chordPart:null);const t=this.options.disableTitle?void 0:this.keybinding.getAriaLabel()||void 0;this.hover.update(t),this.domNode.setAttribute("aria-label",t||"")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){Jce(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const n=qT.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,Boolean(i?.ctrlKey),n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,Boolean(i?.shiftKey),n.separator),t.altKey&&this.renderKey(e,n.altKey,Boolean(i?.altKey),n.separator),t.metaKey&&this.renderKey(e,n.metaKey,Boolean(i?.metaKey),n.separator);const o=t.keyLabel;o&&this.renderKey(e,o,Boolean(i?.keyCode),"")}renderKey(e,t,i,n){Mhe(e,this.createKeyElement(t,i?".highlight":"")),n&&Mhe(e,pP("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){Mhe(e,this.createKeyElement(Vae(15,"Unbound")))}createKeyElement(e,t=""){const i=pP("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.options.keybindingLabelBackground&&(i.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(i.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(i.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(i.style.boxShadow=`inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),i}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&Uue(e.firstPart,t.firstPart)&&Uue(e.chordPart,t.chordPart)}},_P=eue("layoutService"),bP=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},vP=function(e,t){return function(i,n){t(i,n,e)}},wP="acceptSelectedCodeAction",CP="previewSelectedCodeAction",yP=class{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const 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){}},SP=class{get templateId(){return"separator"}renderTemplate(e){e.classList.add("separator");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.label??""}disposeTemplate(e){}},xP=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const n=document.createElement("span");return n.className="description",e.append(n),{container:e,icon:t,text:i,description:n,keybinding:new fP(e,Y)}}renderElement(e,t,i){if(e.group?.icon?(i.icon.className=mo.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=gpe(e.group.icon.color.id))):(i.icon.className=mo.asClassName(go.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;!function(e,...t){e?Phe(...t):Fhe(...t)}(!e.hideIcon,i.icon),i.text.textContent=eCe(e.label),e.keybinding?(i.description.textContent=e.keybinding.getLabel(),i.description.style.display="inline",i.description.style.letterSpacing="0.5px"):e.description?(i.description.textContent=eCe(e.description),i.description.style.display="inline"):(i.description.textContent="",i.description.style.display="none");const n=this._keybindingService.lookupKeybinding(wP)?.getLabel(),o=this._keybindingService.lookupKeybinding(CP)?.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.tooltip?i.container.title=e.tooltip:e.disabled?i.container.title=e.label:n&&o?this._supportsPreview&&e.canPreview?i.container.title=Vae(1653,"{0} to Apply, {1} to Preview",n,o):i.container.title=Vae(1654,"{0} to Apply",n):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}},xP=bP([vP(1,xw)],xP),kP=class extends UIEvent{constructor(){super("acceptSelectedAction")}},LP=class extends UIEvent{constructor(){super("previewSelectedAction")}},DP=class extends Ie{constructor(e,t,i,n,o,s,r,a){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=r,this._layoutService=a,this._actionLineHeight=28,this._headerLineHeight=28,this._separatorLineHeight=8,this.cts=this._register(new ot),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList"),this._list=this._register(new bE(e,this.domNode,{getHeight:e=>{switch(e.kind){case"header":return this._headerLineHeight;case"separator":return this._separatorLineHeight;default:return this._actionLineHeight}},getTemplateId:e=>e.kind},[new xP(t,this._keybindingService),new yP,new SP],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Jwe},accessibilityProvider:{getAriaLabel:e=>{if("action"===e.kind){let t=e.label?eCe(e?.label):"";return e.description&&(t=t+", "+eCe(e.description)),e.disabled&&(t=Vae(1655,"{0}, Disabled Reason: {1}",t,e.disabled)),t}return null},getWidgetAriaLabel:()=>Vae(1656,"Action Widget"),getRole:e=>"action"===e.kind?"option":"separator",getWidgetRole:()=>"listbox",...o}})),this._list.style(uR),this._register(this._list.onMouseClick(e=>this.onListClick(e))),this._register(this._list.onMouseOver(e=>this.onListHover(e))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(e=>this.onListSelection(e))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&"action"===e.kind}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(e=>"header"===e.kind).length,i=this._allMenuItems.filter(e=>"separator"===e.kind).length,n=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight+i*this._separatorLineHeight-i*this._actionLineHeight;this._list.layout(n);let o=e;if(this._allMenuItems.length>=50)o=380;else{const t=this._allMenuItems.map((e,t)=>{const i=this.domNode.ownerDocument.getElementById(this._list.getElementID(t));if(i){i.style.width="auto";const e=i.getBoundingClientRect().width;return i.style.width="",e}return 0});o=Math.max(...t,e)}const s=Math.min(n,.7*this._layoutService.getContainer(pn(this.domNode)).clientHeight);return this._list.layout(s,o),this.domNode.style.height=`${s}px`,this._list.domFocus(),o}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(0===t.length)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const o=e?new LP:new kP;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof LP):this._list.setSelection([])}onFocus(){const e=this._list.getFocus();if(0===e.length)return;const t=e[0],i=this._list.element(t);this._delegate.onFocus?.(i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&"action"===t.kind){const e=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=e?e.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus("number"==typeof e.index?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}},DP=bP([vP(5,oT),vP(6,xw),vP(7,_P)],DP),IP=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},NP=function(e,t){return function(i,n){t(i,n,e)}},mpe("actionBar.toggledBackground",Wu,Vae(1657,"Background color for toggled action items in action bar.")),EP={Visible:new Jo("codeActionMenuVisible",!1,Vae(1658,"Whether the action widget list is visible"))},MP=eue("actionWidgetService"),TP=class extends Ie{get isVisible(){return EP.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Ne)}show(e,t,i,n,o,s,r,a){const l=EP.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(DP,e,t,i,n,a);this._contextViewService.showContextView({getAnchor:()=>o,render:e=>(l.set(!0),this._renderWidget(e,d,r??[])),onHide:e=>{l.reset(),this._onWidgetClosed(e)}},s,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}hide(e){this._list.value?.hide(e),this._list.clear()}_renderWidget(e,t,i){const n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,!this._list.value)throw new Error("List has no value");n.appendChild(this._list.value.domNode);const o=new De,s=document.createElement("div"),r=e.appendChild(s);r.classList.add("context-view-block"),o.add(ehe(r,On.MOUSE_DOWN,e=>e.stopPropagation()));const a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-pointerBlock"),o.add(ehe(l,On.POINTER_MOVE,()=>l.remove())),o.add(ehe(l,On.MOUSE_DOWN,()=>l.remove()));let d=0;if(i.length){const e=this._createActionBar(".action-widget-action-bar",i);e&&(n.appendChild(e.getContainer().parentElement),o.add(e),d=e.getContainer().offsetWidth)}const c=this._list.value?.layout(d);n.style.width=`${c}px`;const h=o.add(Ehe(e));return o.add(h.onDidBlur(()=>this.hide(!0))),o}_createActionBar(e,t){if(!t.length)return;const i=new NE(Ahe(e));return i.push(t,{icon:!1,label:!0}),i}_onWidgetClosed(e){this._list.value?.hide(e)}},TP=IP([NP(0,oT),NP(1,es),NP(2,Jn)],TP),dge(MP,TP,1),RP=1100,mue(class extends ms{constructor(){super({id:"hideCodeActionWidget",title:zae(1659,"Hide action widget"),precondition:EP.Visible,keybinding:{weight:RP,primary:9,secondary:[1033]}})}run(e){e.get(MP).hide(!0)}}),mue(class extends ms{constructor(){super({id:"selectPrevCodeAction",title:zae(1660,"Select previous action"),precondition:EP.Visible,keybinding:{weight:RP,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){const t=e.get(MP);t instanceof TP&&t.focusPrevious()}}),mue(class extends ms{constructor(){super({id:"selectNextCodeAction",title:zae(1661,"Select next action"),precondition:EP.Visible,keybinding:{weight:RP,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){const t=e.get(MP);t instanceof TP&&t.focusNext()}}),mue(class extends ms{constructor(){super({id:wP,title:zae(1662,"Accept selected action"),precondition:EP.Visible,keybinding:{weight:RP,primary:3,secondary:[2137]}})}run(e){const t=e.get(MP);t instanceof TP&&t.acceptSelected()}}),mue(class extends ms{constructor(){super({id:CP,title:zae(1663,"Preview selected action"),precondition:EP.Visible,keybinding:{weight:RP,primary:2051}})}run(e){const t=e.get(MP);t instanceof TP&&t.acceptSelected(!0)}}),AP=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},PP=function(e,t){return function(i,n){t(i,n,e)}},OP=class extends Ie{constructor(e,t,i,n,o,s,r,a,l,d,c){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=o,this.edits=s,this.onSelectNewEdit=r,this.additionalActions=a,this._keybindingService=d,this._actionWidgetService=c,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(Dle(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Dle(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(e=>{this.dispose()})),this._register(Be.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){const e=this._keybindingService.lookupKeybinding(this.showCommand.id)?.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=Ahe(".post-edit-widget"),this.button=this._register(new gP(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ehe(this.domNode,On.CLICK,()=>this.showSelector()))}getId(){return FP.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){const e=lhe(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show("postEditWidget",!1,this.edits.allEdits.map((e,t)=>({kind:"action",item:e,label:e.title,disabled:!1,canPreview:!1,group:{title:"",icon:mo.fromId(t===this.edits.activeEditIndex?go.check.id:go.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:e=>{this._actionWidgetService.hide(!1);const t=this.edits.allEdits.findIndex(t=>t===e);if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}},FP=OP,OP.baseId="editor.widget.postEditWidget",WP=OP,WP=FP=AP([PP(8,es),PP(9,xw),PP(10,MP)],WP),BP=class extends Ie{constructor(e,t,i,n,o,s,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._getAdditionalActions=o,this._instantiationService=s,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Ne),this._register(Be.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,o){if(!e.length||!this._editor.hasModel())return;const s=this._editor.getModel(),r=t.allEdits.at(t.activeEditIndex);if(!r)return;const a=async s=>{const r=this._editor.getModel();r&&(await r.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:s,allEdits:t.allEdits},i,n,o))},l=(n,o)=>{Yae(n)||(this._notificationService.error(o),i&&this.show(e[0],t,a))},d=new fA(this._editor,3,void 0,o);let c;try{c=await function(e,t){return new Promise((i,n)=>{const o=t.onCancellationRequested(()=>{o.dispose(),n(new v)});e.then(i,n).finally(()=>o.dispose())})}(n(r,d.token),d.token)}catch(Fae){return l(Fae,Vae(937,"Error resolving edit '{0}':\n{1}",r.title,Xwe(Fae)))}finally{d.dispose()}if(o.isCancellationRequested)return;const h=$we(s.uri,e,c),u=e[0],g=s.deltaDecorations([],[{range:u,options:{description:"paste-line-suffix",stickiness:0}}]);let p,m;this._editor.focus();try{p=await this._bulkEditService.apply(h,{editor:this._editor,token:o}),m=s.getDecorationRange(g[0])}catch(Fae){return l(Fae,Vae(938,"Error applying edit '{0}':\n{1}",r.title,Xwe(Fae)))}finally{s.deltaDecorations(g,[])}o.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(m??u,t,a)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(WP,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}},BP=AP([PP(5,Jn),PP(6,lA),PP(7,Xv)],BP),HP=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},zP=function(e,t){return function(i,n){t(i,n,e)}},KP="editor.changePasteType",qP=new Jo("pasteWidgetVisible",!1,Vae(917,"Whether the paste widget is showing")),jP="application/vnd.code.copymetadata",VP=class extends Ie{static get(e){return e.getContribution(UP.ID)}constructor(e,t,i,n,o,s,r,a,l,d){super(),this._logService=i,this._bulkEditService=n,this._clipboardService=o,this._commandService=s,this._configService=r,this._languageFeaturesService=a,this._quickInputService=l,this._progressService=d,this._editor=e;const c=e.getContainerDomNode();this._register(ehe(c,"copy",e=>this.handleCopy(e))),this._register(ehe(c,"cut",e=>this.handleCopy(e))),this._register(ehe(c,"paste",e=>this.handlePaste(e),!0)),this._pasteProgressManager=this._register(new yA("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(BP,"pasteIntoEditor",e,qP,{id:KP,label:Vae(918,"Show paste options...")},()=>UP._configureDefaultAction?[UP._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){let t=null;if(e.clipboardData){const[i,n]=jm.getTextData(e.clipboardData);t=(n||Km.INSTANCE.get(i))?.id||null,this._logService.trace("CopyPasteController#handleCopy for id : ",t," with text.length : ",i.length)}else this._logService.trace("CopyPasteController#handleCopy");if(!this._editor.hasTextFocus())return;if(this._clipboardService.clearInternalState?.(),!e.clipboardData||!this.isPasteAsEnabled())return;const i=this._editor.getModel(),n=this._editor.getSelections();if(!i||!n?.length)return;const o=this._editor.getOption(45);let s=n;const r=1===n.length&&n[0].isEmpty();if(r){if(!o)return;s=[new mr(s[0].startLineNumber,1,s[0].startLineNumber,1+i.getLineLength(s[0].startLineNumber))]}const a=this._editor._getViewModel()?.getPlainTextToCopy(n,o,P),l={multicursorText:Array.isArray(a)?a:null,pasteOnNewLine:r,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter(e=>!!e.prepareDocumentPaste);if(!d.length)return void this.setCopyMetadata(e.clipboardData,{defaultPastePayload:l});const c=Wwe(e.clipboardData),h=d.flatMap(e=>e.copyMimeTypes??[]),u=t??Zm();this.setCopyMetadata(e.clipboardData,{id:u,providerCopyMimeTypes:h,defaultPastePayload:l});const g=d.map(e=>({providerMimeTypes:e.copyMimeTypes,operation:Ele(t=>e.prepareDocumentPaste(i,s,c,t).catch(e=>{console.error(e)}))}));UP._currentCopyOperation?.operations.forEach(e=>e.operation.cancel()),UP._currentCopyOperation={handle:u,operations:g}}async handlePaste(e){if(e.clipboardData){const[t,i]=jm.getTextData(e.clipboardData),n=i||Km.INSTANCE.get(t);this._logService.trace("CopyPasteController#handlePaste for id : ",n?.id)}else this._logService.trace("CopyPasteController#handlePaste");if(!e.clipboardData||!this._editor.hasTextFocus())return;TA.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!i?.length||!t)return;if(this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const n=this.fetchCopyMetadata(e);this._logService.trace("CopyPasteController#handlePaste with metadata : ",n?.id," and text.length : ",e.clipboardData.getData("text/plain").length);const o=Vwe(e.clipboardData);o.delete(jP);const s=Array.from(e.clipboardData.files).map(e=>e.type),r=[...e.clipboardData.types,...s,...n?.providerCopyMimeTypes??[],Na.uriList],a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(e=>{const t=this._pasteAsActionContext?.preferred;return!(t&&!this.providerMatchesPreference(e,t))&&e.pasteMimeTypes?.some(e=>Awe(e,r))});a.length?(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,a,i,o,n):this.doPasteInline(a,i,o,n,e)):this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred),e.preventDefault(),e.stopImmediatePropagation())}showPasteAsNoEditMessage(e,t){const i="only"in t?t.only.value:"preferences"in t?t.preferences.length?t.preferences.map(e=>e.value).join(", "):Vae(919,"empty"):t.providerId;TA.get(this._editor)?.showMessage(Vae(920,"No paste edits for '{0}' found",i),e[0].getStartPosition())}doPasteInline(e,t,i,n,o){this._logService.trace("CopyPasteController#doPasteInline");const s=this._editor;if(!s.hasModel())return;const r=new fA(s,3,void 0),a=Ele(async s=>{const l=this._editor;if(!l.hasModel())return;const d=l.getModel(),c=new De,h=c.add(new ot(s));c.add(r.token.onCancellationRequested(()=>h.cancel()));const u=h.token;try{if(await this.mergeInDataFromCopy(e,i,n,u),u.isCancellationRequested)return;const s=e.filter(e=>this.isSupportedPasteProvider(e,i));if(!s.length||1===s.length&&s[0]instanceof GA)return this.applyDefaultPasteHandler(i,n,u,o);const r={triggerKind:wb.Automatic},a=await this.getPasteEdits(s,i,d,t,r,u);if(c.add(a),u.isCancellationRequested)return;if(1===a.edits.length&&a.edits[0].provider instanceof GA)return this.applyDefaultPasteHandler(i,n,u,o);if(a.edits.length){const e="afterPaste"===l.getOption(97).showPasteSelector;return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(d,a.edits),allEdits:a.edits},e,async(e,i)=>{if(!e.provider.resolveDocumentPasteEdit)return e;const n=e.provider.resolveDocumentPasteEdit(e,i),o=new Ct,s=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),Vae(921,"Resolving paste edit for '{0}'. Click to cancel",e.title),Mle(Promise.race([o.p,n]),i),{cancel:()=>o.cancel()},0);return s&&(e.insertText=s.insertText,e.additionalEdit=s.additionalEdit),e},u)}await this.applyDefaultPasteHandler(i,n,u,o)}finally{c.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),Vae(922,"Running paste handlers. Click to cancel and do basic paste"),a,{cancel:async()=>{a.cancel(),r.token.isCancellationRequested||await this.applyDefaultPasteHandler(i,n,r.token,o)}}).finally(()=>{r.dispose()}),this._currentPasteOperation=a}showPasteAsPick(e,t,i,n,o){this._logService.trace("CopyPasteController#showPasteAsPick");const s=Ele(async r=>{const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),d=new De,c=d.add(new fA(a,3,void 0,r));try{if(await this.mergeInDataFromCopy(t,n,o,c.token),c.token.isCancellationRequested)return;let s=t.filter(t=>this.isSupportedPasteProvider(t,n,e));e&&(s=s.filter(t=>this.providerMatchesPreference(t,e)));const r={triggerKind:wb.PasteAs,only:e&&"only"in e?e.only:void 0};let a,h=d.add(await this.getPasteEdits(s,n,l,i,r,c.token));if(c.token.isCancellationRequested)return;if(e&&(h={edits:h.edits.filter(t=>"only"in e?e.only.contains(t.kind):"preferences"in e?e.preferences.some(e=>e.contains(t.kind)):e.providerId===t.provider.id),dispose:h.dispose}),!h.edits.length)return void(e&&this.showPasteAsNoEditMessage(i,e));if(e)a=h.edits.at(0);else{const e={id:"editor.pasteAs.default",label:Vae(923,"Configure default paste action"),edit:void 0},t=await this._quickInputService.pick([...h.edits.map(e=>({label:e.title,description:e.kind?.value,edit:e})),...UP._configureDefaultAction?[{type:"separator"},{label:UP._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:Vae(924,"Select Paste Action")});if(t===e)return void UP._configureDefaultAction?.run();a=t?.edit}if(!a)return;const u=$we(l.uri,i,a);await this._bulkEditService.apply(u,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:Vae(925,"Running paste handlers")},()=>s)}setCopyMetadata(e,t){this._logService.trace("CopyPasteController#setCopyMetadata new id : ",t.id),e.setData(jP,JSON.stringify(t))}fetchCopyMetadata(e){if(this._logService.trace("CopyPasteController#fetchCopyMetadata"),!e.clipboardData)return;const t=e.clipboardData.getData(jP);if(t)try{return JSON.parse(t)}catch{return}const[i,n]=jm.getTextData(e.clipboardData);return n?{defaultPastePayload:{mode:n.mode,multicursorText:n.multicursorText??null,pasteOnNewLine:!!n.isFromEmptySelection}}:void 0}async mergeInDataFromCopy(e,t,i,n){if(this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ",i?.id),i?.id&&UP._currentCopyOperation?.handle===i.id){const i=UP._currentCopyOperation.operations.filter(t=>e.some(e=>e.pasteMimeTypes.some(e=>Awe(e,t.providerMimeTypes)))).map(e=>e.operation),o=await Promise.all(i);if(n.isCancellationRequested)return;for(const e of o.reverse())if(e)for(const[i,n]of e)t.replace(i,n)}if(!t.has(Na.uriList)){const e=await this._clipboardService.readResources();if(n.isCancellationRequested)return;e.length&&t.append(Na.uriList,Rwe($O.create(e)))}}async getPasteEdits(e,t,i,n,o,s){const r=new De;return{edits:Gwe(ice(await Mle(Promise.all(e.map(async e=>{try{const a=await(e.provideDocumentPasteEdits?.(i,n,t,o,s));return a&&r.add(a),a?.edits?.map(t=>({...t,provider:e}))}catch(a){return void(Yae(a)||console.error(a))}})),s)??[]).flat().filter(e=>!o.only||o.only.contains(e.kind))),dispose:()=>r.dispose()}}async applyDefaultPasteHandler(e,t,i,n){const o=await((e.get(Na.text)??e.get("text"))?.asString())??"";if(i.isCancellationRequested)return;const s={clipboardEvent:n,text:o,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",s)}isSupportedPasteProvider(e,t,i){return!!e.pasteMimeTypes?.some(e=>t.matches(e))&&(!i||this.providerMatchesPreference(e,i))}providerMatchesPreference(e,t){return"only"in t?e.providedPasteEditKinds.some(e=>t.only.contains(e)):"preferences"in t?t.preferences.some(e=>t.preferences.some(t=>t.contains(e))):e.id===t.providerId}getInitialActiveEditIndex(e,t){const i=this._configService.getValue("editor.pasteAs.preferences",{resource:e.uri});for(const n of Array.isArray(i)?i:[]){const e=new ZO(n),i=t.findIndex(t=>e.contains(t.kind));if(i>=0)return i}return 0}},UP=VP,VP.ID="editor.contrib.copyPasteActionController",$P=VP,$P=UP=HP([zP(1,Jn),zP(2,Ks),zP(3,lA),zP(4,nT),zP(5,fo),zP(6,ka),zP(7,Tx),zP(8,tA),zP(9,RL)],$P),GP="9_cutcopypaste",ZP=B||document.queryCommandSupported("cut"),YP=B||document.queryCommandSupported("copy"),QP=void 0!==navigator.clipboard&&!c||document.queryCommandSupported("paste"),XP=ZP?tCe(new nr({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:B?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:ds.MenubarEditMenu,group:"2_ccp",title:Vae(813,"Cu&&t"),order:1},{menuId:ds.EditorContext,group:GP,title:Vae(814,"Cut"),when:jl.writable,order:1},{menuId:ds.CommandPalette,group:"",title:Vae(815,"Cut"),order:1},{menuId:ds.SimpleEditorContext,group:GP,title:Vae(816,"Cut"),when:jl.writable,order:1}]})):void 0,JP=YP?tCe(new nr({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:B?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:ds.MenubarEditMenu,group:"2_ccp",title:Vae(817,"&&Copy"),order:2},{menuId:ds.EditorContext,group:GP,title:Vae(818,"Copy"),order:2},{menuId:ds.CommandPalette,group:"",title:Vae(819,"Copy"),order:1},{menuId:ds.SimpleEditorContext,group:GP,title:Vae(820,"Copy"),order:2}]})):void 0,us.appendMenuItem(ds.MenubarEditMenu,{submenu:ds.MenubarCopy,title:zae(825,"Copy As"),group:"2_ccp",order:3}),us.appendMenuItem(ds.EditorContext,{submenu:ds.EditorContextCopy,title:zae(826,"Copy As"),group:GP,order:3}),us.appendMenuItem(ds.EditorContext,{submenu:ds.EditorContextShare,title:zae(827,"Share"),group:"11_share",order:-1,when:Po.and(Po.notEquals("resourceScheme","output"),jl.editorTextFocus)}),us.appendMenuItem(ds.ExplorerContext,{submenu:ds.ExplorerContextShare,title:zae(828,"Share"),group:"11_share",order:-1}),eF=QP?tCe(new nr({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:B?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:ds.MenubarEditMenu,group:"2_ccp",title:Vae(821,"&&Paste"),order:4},{menuId:ds.EditorContext,group:GP,title:Vae(822,"Paste"),when:jl.writable,order:4},{menuId:ds.CommandPalette,group:"",title:Vae(823,"Paste"),order:1},{menuId:ds.SimpleEditorContext,group:GP,title:Vae(824,"Paste"),when:jl.writable,order:4}]})):void 0,tF=class extends rr{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:zae(829,"Copy with Syntax Highlighting"),precondition:void 0,kbOpts:{kbExpr:jl.textInputFocus,primary:0,weight:100}})}run(e,t){const i=e.get(Ks);i.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"),t.hasModel()&&(!t.getOption(45)&&t.getSelection().isEmpty()||(qm.forceCopyWithSyntaxHighlighting=!0,t.focus(),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),t.getContainerDomNode().ownerDocument.execCommand("copy"),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),qm.forceCopyWithSyntaxHighlighting=!1))}},iCe(XP,"cut"),iCe(JP,"copy"),eF&&(eF.addImplementation(1e4,"code-editor",(e,t)=>{const i=e.get(Ks);i.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");const n=e.get(eo),o=e.get(nT),s=e.get(fs),r=e.get(qO),a=n.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(170)){const e=_C.get(a.getId());e&&e.onWillPaste()}const e=Fe.create(!0);i.trace("registerExecCommandImpl (before triggerPaste)");const t=o.triggerPaste(She().vscodeWindowId);return t?(i.trace("registerExecCommandImpl (triggerPaste defined)"),t.then(async()=>{if(i.trace("registerExecCommandImpl (after triggerPaste)"),"stable"!==r.quality){const t=e.elapsed();s.publicLog2("editorAsyncPaste",{duration:t})}return $P.get(a)?.finishedPaste()??Promise.resolve()})):(i.trace("registerExecCommandImpl (triggerPaste undefined)"),!V||(i.trace("registerExecCommandImpl (Paste handling on web)"),(async()=>{const e=await o.readText();if(""!==e){const t=Km.INSTANCE.get(e);let n=!1,o=null,s=null;t&&(n=a.getOption(45)&&!!t.isFromEmptySelection,o=void 0!==t.multicursorText?t.multicursorText:null,s=t.mode),i.trace("registerExecCommandImpl (clipboardText.length : ",e.length," id : ",t?.id,")"),a.trigger("keyboard","paste",{text:e,pasteOnNewLine:n,multicursorText:o,mode:s})}})()))}return!1}),eF.addImplementation(0,"generic-dom",(e,t)=>(e.get(Ks).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"),e.get(nT).triggerPaste(She().vscodeWindowId)??!1))),YP&&kue(tF),iF=Object.freeze({id:"editor",order:5,type:"object",title:Vae(147,"Editor"),scope:6}),nF={...iF,properties:{"editor.tabSize":{type:"number",default:wd.tabSize,minimum:1,maximum:100,markdownDescription:Vae(148,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:Vae(149,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:wd.insertSpaces,markdownDescription:Vae(150,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:wd.detectIndentation,markdownDescription:Vae(151,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:wd.trimAutoWhitespace,description:Vae(152,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:wd.largeFileOptimizations,description:Vae(153,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[Vae(154,"Turn off Word Based Suggestions."),Vae(155,"Only suggest words from the active document."),Vae(156,"Suggest words from all open documents of the same language."),Vae(157,"Suggest words from all open documents.")],description:Vae(158,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[Vae(159,"Semantic highlighting enabled for all color themes."),Vae(160,"Semantic highlighting disabled for all color themes."),Vae(161,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:Vae(162,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:Vae(163,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:Vae(164,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:Vae(165,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:Vae(166,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:Vae(167,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:Vae(168,"Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.css":{type:"boolean",default:!1,markdownDescription:Vae(169,"Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.typescript":{type:"boolean",default:!1,markdownDescription:Vae(170,"Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.ini":{type:"boolean",default:!1,markdownDescription:Vae(171,"Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.regex":{type:"boolean",default:!1,markdownDescription:Vae(172,"Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),tags:["experimental"],experiment:{mode:"auto"}},"editor.language.brackets":{type:["array","null"],default:null,description:Vae(173,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:Vae(174,"The opening bracket character or string sequence.")},{type:"string",description:Vae(175,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:Vae(176,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:Vae(177,"The opening bracket character or string sequence.")},{type:"string",description:Vae(178,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:AT.maxComputationTime,description:Vae(179,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:AT.maxFileSize,description:Vae(180,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:AT.renderSideBySide,description:Vae(181,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:AT.renderSideBySideInlineBreakpoint,description:Vae(182,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:AT.useInlineViewWhenSpaceIsLimited,description:Vae(183,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:AT.renderMarginRevertIcon,description:Vae(184,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:AT.renderGutterMenu,description:Vae(185,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:AT.ignoreTrimWhitespace,description:Vae(186,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:AT.renderIndicators,description:Vae(187,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:AT.diffCodeLens,description:Vae(188,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:AT.diffWordWrap,markdownEnumDescriptions:[Vae(189,"Lines will never wrap."),Vae(190,"Lines will wrap at the viewport width."),Vae(191,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:AT.diffAlgorithm,markdownEnumDescriptions:[Vae(192,"Uses the legacy diffing algorithm."),Vae(193,"Uses the advanced diffing algorithm.")]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:AT.hideUnchangedRegions.enabled,markdownDescription:Vae(194,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:AT.hideUnchangedRegions.revealLineCount,markdownDescription:Vae(195,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:AT.hideUnchangedRegions.minimumLineCount,markdownDescription:Vae(196,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:AT.hideUnchangedRegions.contextLineCount,markdownDescription:Vae(197,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:AT.experimental.showMoves,markdownDescription:Vae(198,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:AT.experimental.showEmptyDecorations,description:Vae(199,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:AT.experimental.useTrueInlineView,description:Vae(200,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};for(const e of Nc){const t=e.schema;if(void 0!==t)if(oCe(t))nF.properties[`editor.${e.name}`]=t;else for(const e in t)Object.hasOwnProperty.call(t,e)&&(nF.properties[e]=t[e])}oF=null,ts.as(Pa.Configuration).registerConfiguration(nF),sF=new class{constructor(){this.QuickFix=new ZO("quickfix"),this.Refactor=new ZO("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 ZO("notebook"),this.Source=new ZO("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}},function(e){e.Refactor="refactor",e.RefactorPreview="refactor preview",e.Lightbulb="lightbulb",e.Default="other (default)",e.SourceAction="source action",e.QuickFix="quick fix action",e.FixAll="fix all",e.OrganizeImports="organize imports",e.AutoFix="auto fix",e.QuickFixHover="quick fix hover window",e.OnSave="save participants",e.ProblemsView="problems view"}(rF||(rF={})),aF=class e{static fromUser(t,i){return t&&"object"==typeof t?new e(e.getKindFromUser(t,i.kind),e.getApplyFromUser(t,i.apply),e.getPreferredUser(t)):new e(i.kind,i.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new ZO(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}},lF=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 i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(t){Gae(t)}i&&(this.action.edit=i.edit)}return this}},dF="editor.action.codeAction",cF="editor.action.quickFix",hF="editor.action.refactor",uF="editor.action.sourceAction",gF="editor.action.organizeImports",pF="editor.action.fixAll",mF=1e3,fF=class e extends Ie{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:t},{action:i}){return t.isAI&&!i.isAI?1:!t.isAI&&i.isAI?-1:sce(t.diagnostics)?sce(i.diagnostics)?e.codeActionsPreferredComparator(t,i):-1:sce(i.diagnostics)?1:e.codeActionsPreferredComparator(t,i)}constructor(t,i,n){super(),this.documentation=i,this._register(n),this.allActions=[...t].sort(e.codeActionsComparator),this.validActions=this.allActions.filter(({action:e})=>!e.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&sF.QuickFix.contains(new ZO(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},_F={actions:[],documentation:void 0},function(e){e.OnSave="onSave",e.FromProblemsView="fromProblemsView",e.FromCodeActions="fromCodeActions",e.FromAILightbulb="fromAILightbulb",e.FromProblemsHover="fromProblemsHover"}(bF||(bF={})),_o.registerCommand("_executeCodeActionProvider",async function(e,t,i,n,o){if(!(t instanceof _i))throw Qae();const{codeActionProvider:s}=e.get(Tx),r=e.get(io).getModel(t);if(!r)throw Qae();const a=fr.isISelection(i)?fr.liftSelection(i):mr.isIRange(i)?r.validateRange(i):void 0;if(!a)throw Qae();const l="string"==typeof n?new ZO(n):void 0,d=await aCe(s,r,a,{type:1,triggerAction:rF.Default,filter:{includeSourceActions:!0,include:l}},OL.None,it.None),c=[],h=Math.min(d.validActions.length,"number"==typeof o?o:0);for(let u=0;u<h;u++)c.push(d.validActions[u].resolve(it.None));try{return await Promise.all(c),d.validActions.map(e=>e.action)}finally{setTimeout(()=>d.dispose(),100)}}),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(vF||(vF={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=Vae(1732,"Error"),t[e.Warning]=Vae(1733,"Warning"),t[e.Info]=Vae(1734,"Info"),e.toString=function(e){return t[e]||""};const i=Object.create(null);i[e.Error]=Vae(1735,"Errors"),i[e.Warning]=Vae(1736,"Warnings"),i[e.Info]=Vae(1737,"Infos"),e.toStringPlural=function(e){return i[e]||""},e.fromSeverity=function(t){switch(t){case Yv.Error:return e.Error;case Yv.Warning:return e.Warning;case Yv.Info:return e.Info;case Yv.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return Yv.Error;case e.Warning:return Yv.Warning;case e.Info:return Yv.Info;case e.Hint:return Yv.Ignore}}}(vF||(vF={})),function(e){const t="";function i(e,i){const n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"==typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(vF.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}(wF||(wF={})),CF=eue("markerService"),SF=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},xF=function(e,t){return function(i,n){t(i,n,e)}},yF=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Nt(()=>this.keybindingService.getKeybindings().filter(e=>kF.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return"editor.action.organizeImports"===e.command?t={kind:sF.SourceOrganizeImports.value}:"editor.action.fixAll"===e.command&&(t={kind:sF.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...aF.fromUser(t,{kind:ZO.None,apply:"never"})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new ZO(e.kind);return t.filter(e=>e.kind.contains(i)).filter(t=>!t.preferred||e.isPreferred).reduceRight((e,t)=>e?e.kind.contains(t.kind)?t:e:t,void 0)}},kF=yF,yF.codeActionCommands=[hF,dF,uF,gF,pF],LF=yF,LF=kF=SF([xF(0,xw)],LF),mpe("symbolIcon.arrayForeground",rh,Vae(1495,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.booleanForeground",rh,Vae(1496,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},Vae(1497,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.colorForeground",rh,Vae(1498,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.constantForeground",rh,Vae(1499,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},Vae(1500,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},Vae(1501,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},Vae(1502,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},Vae(1503,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},Vae(1504,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.fileForeground",rh,Vae(1505,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.folderForeground",rh,Vae(1506,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},Vae(1507,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},Vae(1508,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.keyForeground",rh,Vae(1509,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.keywordForeground",rh,Vae(1510,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},Vae(1511,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.moduleForeground",rh,Vae(1512,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.namespaceForeground",rh,Vae(1513,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.nullForeground",rh,Vae(1514,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.numberForeground",rh,Vae(1515,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.objectForeground",rh,Vae(1516,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.operatorForeground",rh,Vae(1517,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.packageForeground",rh,Vae(1518,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.propertyForeground",rh,Vae(1519,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.referenceForeground",rh,Vae(1520,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.snippetForeground",rh,Vae(1521,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.stringForeground",rh,Vae(1522,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.structForeground",rh,Vae(1523,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.textForeground",rh,Vae(1524,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.typeParameterForeground",rh,Vae(1525,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.unitForeground",rh,Vae(1526,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),mpe("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},Vae(1527,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),DF=Object.freeze({kind:ZO.Empty,title:Vae(866,"More Actions...")}),IF=Object.freeze([{kind:sF.QuickFix,title:Vae(867,"Quick Fix")},{kind:sF.RefactorExtract,title:Vae(868,"Extract"),icon:go.wrench},{kind:sF.RefactorInline,title:Vae(869,"Inline"),icon:go.wrench},{kind:sF.RefactorRewrite,title:Vae(870,"Rewrite"),icon:go.wrench},{kind:sF.RefactorMove,title:Vae(871,"Move"),icon:go.wrench},{kind:sF.SurroundWith,title:Vae(872,"Surround With"),icon:go.surroundWith},{kind:sF.Source,title:Vae(873,"Source Action"),icon:go.symbolFile},DF]),NF=new Jo("supportedCodeAction",""),EF=class extends Ie{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new pt),this._register(this._markerService.onMarkerChanged(e=>this._onMarkerChanges(e))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(e=>Ts(e,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:rF.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(1===e.type)return t;const i=this._editor.getOption(73).enabled;if(i!==ec.Off){if(i===ec.On)return t;if(i===ec.OnCode){if(!t.isEmpty())return t;const e=this._editor.getModel(),{lineNumber:i,column:n}=t.getPosition(),o=e.getLineContent(i);if(0===o.length)return;if(1===n){if(/\s/.test(o[0]))return}else if(n===e.getLineMaxColumn(i)){if(/\s/.test(o[o.length-1]))return}else if(/\s/.test(o[n-2])&&/\s/.test(o[n-1]))return}return t}}},function(e){e.Empty={type:0},e.Triggered=class{constructor(e,t,i){this.trigger=e,this.position=t,this._cancellablePromise=i,this.type=1,this.actions=i.catch(e=>{if(Yae(e))return TF;throw e})}cancel(){this._cancellablePromise.cancel()}}}(MF||(MF={})),TF=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),RF=class extends Ie{constructor(e,t,i,n,o,s){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new Ne),this._state=MF.Empty,this._onDidChangeState=this._register(new je),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new Ne),this._disposed=!1,this._supportedCodeActions=NF.bindTo(n),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(MF.Empty,!0))}_settingEnabledNearbyQuickfixes(){const e=this._editor?.getModel();return!!this._configurationService&&this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e?.uri})}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(MF.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){const t=this._registry.all(e).flatMap(e=>e.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new EF(this._editor,this._markerService,t=>{if(!t)return void this.setState(MF.Empty);const i=t.selection.getStartPosition(),n=Ele(async i=>{if(this._settingEnabledNearbyQuickfixes()&&1===t.trigger.type&&(t.trigger.triggerAction===rF.QuickFix||t.trigger.filter?.include?.contains(sF.QuickFix))){const n=await aCe(this._registry,e,t.selection,t.trigger,OL.None,i);this.codeActionsDisposable.value=n;const o=[...n.allActions];if(i.isCancellationRequested)return n.dispose(),TF;const s=n.validActions?.some(e=>e.action.kind&&sF.QuickFix.contains(new ZO(e.action.kind))&&!e.action.isAI),r=this._markerService.read({resource:e.uri});if(s){for(const e of n.validActions)e.action.command?.arguments?.some(e=>"string"==typeof e&&e.includes("_typescript.applyFixAllCodeAction"))&&(e.action.diagnostics=[...r.filter(e=>e.relatedInformation)]);return{validActions:n.validActions,allActions:o,documentation:n.documentation,hasAutoFix:n.hasAutoFix,hasAIFix:n.hasAIFix,allAIFixes:n.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=n}}}if(!s&&r.length>0){const s=t.selection.getPosition();let a=s,l=Number.MAX_VALUE;const d=[...n.validActions];for(const h of r){const c=h.endColumn,u=h.endLineNumber,g=h.startLineNumber;if(u===s.lineNumber||g===s.lineNumber){a=new to(u,c);const h={type:t.trigger.type,triggerAction:t.trigger.triggerAction,filter:{include:t.trigger.filter?.include?t.trigger.filter?.include:sF.QuickFix},autoApply:t.trigger.autoApply,context:{notAvailableMessage:t.trigger.context?.notAvailableMessage||"",position:a}},g=new fr(a.lineNumber,a.column,a.lineNumber,a.column),p=await aCe(this._registry,e,g,h,OL.None,i);if(i.isCancellationRequested)return p.dispose(),TF;if(0!==p.validActions.length){for(const e of p.validActions)e.action.command?.arguments?.some(e=>"string"==typeof e&&e.includes("_typescript.applyFixAllCodeAction"))&&(e.action.diagnostics=[...r.filter(e=>e.relatedInformation)]);0===n.allActions.length&&o.push(...p.allActions),Math.abs(s.column-c)<l?d.unshift(...p.validActions):d.push(...p.validActions)}l=Math.abs(s.column-c)}}const c=d.filter((e,t,i)=>i.findIndex(t=>t.action.title===e.action.title)===t);return c.sort((e,t)=>e.action.isPreferred&&!t.action.isPreferred?-1:!e.action.isPreferred&&t.action.isPreferred||e.action.isAI&&!t.action.isAI?1:!e.action.isAI&&t.action.isAI?-1:0),{validActions:c,allActions:o,documentation:n.documentation,hasAutoFix:n.hasAutoFix,hasAIFix:n.hasAIFix,allAIFixes:n.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=n}}}}if(1===t.trigger.type){const n=await aCe(this._registry,e,t.selection,t.trigger,OL.None,i);return this.codeActionsDisposable.value=n,n}const n=await aCe(this._registry,e,t.selection,t.trigger,OL.None,i);return this.codeActionsDisposable.value=n,n});1===t.trigger.type&&this._progressService?.showWhile(n,250);const o=new MF.Triggered(t.trigger,i,n);let s=!1;1===this._state.type&&(s=1===this._state.trigger.type&&1===o.type&&2===o.trigger.type&&this._state.position!==o.position),s?setTimeout(()=>{this.setState(o)},500):this.setState(o)},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:rF.Default})}else this._supportedCodeActions.reset()}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.dispose()}setState(e,t){e!==this._state&&(1===this._state.type&&this._state.cancel(),this._state=e,t||this._disposed||this._onDidChangeState.fire(e))}},AF=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},PF=function(e,t){return function(i,n){t(i,n,e)}},WF=rwe("gutter-lightbulb",go.lightBulb,Vae(874,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),BF=rwe("gutter-lightbulb-auto-fix",go.lightbulbAutofix,Vae(875,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),VF=rwe("gutter-lightbulb-sparkle",go.lightbulbSparkle,Vae(876,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),HF=rwe("gutter-lightbulb-aifix-auto-fix",go.lightbulbSparkleAutofix,Vae(877,"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.")),zF=rwe("gutter-lightbulb-sparkle-filled",go.sparkleFilled,Vae(878,"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.")),function(e){e.Hidden={type:0},e.Showing=class{constructor(e,t,i,n){this.actions=e,this.trigger=t,this.editorPosition=i,this.widgetPosition=n,this.type=1}}}(UF||(UF={})),OF=class extends Ie{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new je),this.onClick=this._onClick.event,this._state=UF.Hidden,this._gutterState=UF.Hidden,this._iconClasses=[],this.lightbulbClasses=["codicon-"+WF.id,"codicon-"+HF.id,"codicon-"+BF.id,"codicon-"+VF.id,"codicon-"+zF.id],this.gutterDecoration=FF.GUTTER_DECORATION,this._domNode=Ahe("div.lightBulbWidget"),this._domNode.role="listbox",this._register(pm.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(e=>{const t=this._editor.getModel();(1!==this.state.type||!t||this.state.editorPosition.lineNumber>=t.getLineCount())&&this.hide(),(1!==this.gutterState.type||!t||this.gutterState.editorPosition.lineNumber>=t.getLineCount())&&this.gutterHide()})),this._register(kn(this._domNode,e=>{if(1!==this.state.type)return;this._editor.focus(),e.preventDefault();const{top:t,height:i}=lhe(this._domNode),n=this._editor.getOption(75);let o=Math.floor(n/3);null!==this.state.widgetPosition.position&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(o+=n),this._onClick.fire({x:e.posx,y:t+i+o,actions:this.state.actions,trigger:this.state.trigger})})),this._register(ehe(this._domNode,"mouseenter",e=>{1&~e.buttons||this.hide()})),this._register(Be.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel=this._keybindingService.lookupKeybinding("editor.action.autoFix")?.getLabel()??void 0,this._quickFixKbLabel=this._keybindingService.lookupKeybinding("editor.action.quickFix")?.getLabel()??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async e=>{if(!e.target.element||!this.lightbulbClasses.some(t=>e.target.element&&e.target.element.classList.contains(t)))return;if(1!==this.gutterState.type)return;this._editor.focus();const{top:t,height:i}=lhe(e.target.element),n=this._editor.getOption(75);let o=Math.floor(n/3);null!==this.gutterState.widgetPosition.position&&this.gutterState.widgetPosition.position.lineNumber<this.gutterState.editorPosition.lineNumber&&(o+=n),this._onClick.fire({x:e.event.posx,y:t+i+o,actions:this.gutterState.actions,trigger:this.gutterState.trigger})}))}dispose(){super.dispose(),this._editor.removeContentWidget(this),this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 1===this._state.type?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.gutterHide(),this.hide();if(!this._editor.hasTextFocus())return this.gutterHide(),this.hide();if(!this._editor.getOptions().get(73).enabled)return this.gutterHide(),this.hide();const n=this._editor.getModel();if(!n)return this.gutterHide(),this.hide();const{lineNumber:o,column:s}=n.validatePosition(i),r=n.getOptions().tabSize,a=this._editor.getOptions().get(59),l=Xpe(n.getLineContent(o),r),d=a.spaceWidth*l>22,c=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1),h=this._editor.getLineDecorations(o);let u=!1;if(h)for(const f of h){const e=f.options.glyphMarginClassName;if(e&&!this.lightbulbClasses.some(t=>e.includes(t))){u=!0;break}}let g=o,p=1;if(!d){const r=e=>{const t=n.getLineContent(e);return/^\s*$|^\s+/.test(t)||t.length<=p};if(o>1&&!c(o-1)){const s=o===n.getLineCount(),a=o>1&&r(o-1),l=!s&&r(o+1),d=r(o),c=!l&&!a;if(!(l||a||u))return this.gutterState=new UF.Showing(e,t,i,{position:{lineNumber:g,column:p},preference:FF._posPref}),this.renderGutterLightbub(),this.hide();a||s||a&&!d?g-=1:(l||c&&d)&&(g+=1)}else if(1!==o||o!==n.getLineCount()&&(r(o+1)||r(o))){if(o<n.getLineCount()&&!c(o+1))g+=1;else if(s*a.spaceWidth<22)return this.hide()}else{if(this.gutterState=new UF.Showing(e,t,i,{position:{lineNumber:g,column:p},preference:FF._posPref}),!u)return this.renderGutterLightbub(),this.hide();this.gutterHide()}p=/^\S\s*$/.test(n.getLineContent(g))?2:1}this.state=new UF.Showing(e,t,i,{position:{lineNumber:g,column:p},preference:FF._posPref}),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());const m=e.validActions;e.validActions[0].action.kind;m.length,this._editor.layoutContentWidget(this)}hide(){this.state!==UF.Hidden&&(this.state=UF.Hidden,this._editor.layoutContentWidget(this))}gutterHide(){this.gutterState!==UF.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this.gutterState=UF.Hidden)}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}get gutterState(){return this._gutterState}set gutterState(e){this._gutterState=e,this._updateGutterLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],1!==this.state.type)return;let e,t=!1;this.state.actions.allAIFixes?(e=go.sparkleFilled,1===this.state.actions.validActions.length&&(t=!0)):e=this.state.actions.hasAutoFix?this.state.actions.hasAIFix?go.lightbulbSparkleAutofix:go.lightbulbAutofix:this.state.actions.hasAIFix?go.lightbulbSparkle:go.lightBulb,this._updateLightbulbTitle(this.state.actions.hasAutoFix,t),this._iconClasses=mo.asClassNameArray(e),this._domNode.classList.add(...this._iconClasses)}_updateGutterLightBulbTitleAndIcon(){if(1!==this.gutterState.type)return;let e,t=!1;this.gutterState.actions.allAIFixes?(e=zF,1===this.gutterState.actions.validActions.length&&(t=!0)):e=this.gutterState.actions.hasAutoFix?this.gutterState.actions.hasAIFix?HF:BF:this.gutterState.actions.hasAIFix?VF:WF,this._updateLightbulbTitle(this.gutterState.actions.hasAutoFix,t),this.gutterDecoration=Lx.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:mo.asClassName(e),glyphMargin:{position:Yr.Left},stickiness:1})}renderGutterLightbub(){const e=this._editor.getSelection();e&&(void 0===this._gutterDecorationID?this._addGutterDecoration(e.startLineNumber):this._updateGutterDecoration(this._gutterDecorationID,e.startLineNumber))}_addGutterDecoration(e){this._editor.changeDecorations(t=>{this._gutterDecorationID=t.addDecoration(new mr(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 mr(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){1===this.state.type&&(t?this.title=Vae(879,"Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=Vae(880,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=Vae(881,"Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=Vae(882,"Show Code Actions")))}set title(e){this._domNode.title=e}},FF=OF,OF.GUTTER_DECORATION=Lx.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:mo.asClassName(go.lightBulb),glyphMargin:{position:Yr.Left},stickiness:1}),OF.ID="editor.contrib.lightbulbWidget",OF._posPref=[0],KF=OF,KF=FF=AF([PF(1,xw)],KF),jF=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$F=function(e,t){return function(i,n){t(i,n,e)}},qF=class extends Ie{static get(e){return e.getContribution(GF.ID)}constructor(e,t,i,n,o,s,r,a,l,d,c){super(),this._commandService=r,this._configurationService=a,this._actionWidgetService=l,this._instantiationService=d,this._progressService=c,this._activeCodeActions=this._register(new Ne),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new RF(this._editor,o.codeActionProvider,t,i,s,a)),this._register(this._model.onDidChangeState(e=>this.update(e))),this._lightBulbWidget=new Nt(()=>{const e=this._editor.getContribution(KF.ID);return e&&this._register(e.onClick(e=>this.showCodeActionsFromLightbulb(e.actions,e))),e}),this._resolver=n.createInstance(LF),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&1===e.validActions.length){const t=e.validActions[0],i=t.action.command;return i&&"inlineChat.start"===i.id&&i.arguments&&i.arguments.length>=1&&i.arguments[0]&&(i.arguments[0]={...i.arguments[0],autoSend:!1}),void(await this.applyCodeAction(t,!1,!1,bF.FromAILightbulb))}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,n){if(!this._editor.hasModel())return;TA.get(this._editor)?.closeMessage();const o=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,i,n){const o=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(dCe,e,n,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:rF.QuickFix,filter:{}}),o.done()}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(1!==e.type)return void this.hideLightBulbWidget();let t;try{t=await e.actions}catch(Fae){return void $ae(Fae)}if(!this._disposed&&this._editor.getSelection()?.startLineNumber===e.position.lineNumber)if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),1===e.trigger.type){if(e.trigger.filter?.include){const i=this.tryGetValidActionToApply(e.trigger,t);if(i){try{this.hideLightBulbWidget(),await this.applyCodeAction(i,!1,!1,bF.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const i=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(i&&i.action.disabled)return TA.get(this._editor)?.showMessage(i.action.disabled,e.trigger.context.position),void t.dispose()}}const i=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!i&&!t.validActions.length))return TA.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,void t.dispose();this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:i,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length)return"first"===e.autoApply&&0===t.validActions.length||"ifSingle"===e.autoApply&&1===t.allActions.length?t.allActions.find(({action:e})=>e.disabled):void 0}tryGetValidActionToApply(e,t){if(t.validActions.length)return"first"===e.autoApply&&t.validActions.length>0||"ifSingle"===e.autoApply&&1===t.validActions.length?t.validActions[0]:void 0}async showCodeActionList(e,t,i){const n=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=i.includeDisabledActions&&(this._showDisabled||0===e.validActions.length)?e.allActions:e.validActions;if(!s.length)return;const r=to.isIPosition(t)?this.toCoords(t):t;this._actionWidgetService.show("codeActionWidget",!0,function(e,t,i){if(!t)return e.map(e=>({kind:"action",item:e,group:DF,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!e.action.edit?.edits.length}));const n=IF.map(e=>({group:e,actions:[]}));for(const s of e){const e=s.action.kind?new ZO(s.action.kind):ZO.None;for(const t of n)if(t.group.kind.contains(e)){t.actions.push(s);break}}const o=[];for(const s of n)if(s.actions.length){o.push({kind:"header",group:s.group});for(const e of s.actions){const t=s.group;o.push({kind:"action",item:e,group:e.action.isAI?{title:t.title,kind:t.kind,icon:go.sparkle}:t,label:e.action.title,disabled:!!e.action.disabled,keybinding:i(e.action)})}}return o}(s,this._shouldShowHeaders(),this._resolver.getResolver()),{onSelect:async(e,t)=>{this.applyCodeAction(e,!0,!!t,i.fromLightbulb?bF.FromAILightbulb:bF.FromCodeActions),this._actionWidgetService.hide(!1),n.clear()},onHide:e=>{this._editor?.focus(),n.clear()},onHover:async(e,t)=>{if(t.isCancellationRequested)return;let i=!1;const n=e.action.kind;if(n){const e=new ZO(n);i=[sF.RefactorExtract,sF.RefactorInline,sF.RefactorRewrite,sF.RefactorMove,sF.Source].some(t=>t.contains(e))}return{canPreview:i||!!e.action.edit?.edits.length}},onFocus:e=>{if(e&&e.action){const t=e.action.ranges,i=e.action.diagnostics;if(n.clear(),t&&t.length>0){const e=i&&i?.length>1?i.map(e=>({range:e,options:GF.DECORATION})):t.map(e=>({range:e,options:GF.DECORATION}));n.set(e)}else if(i&&i.length>0){const e=i.map(e=>({range:e,options:GF.DECORATION}));n.set(e);const t=i[0];if(t.startLineNumber&&t.startColumn){const e=this._editor.getModel()?.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn})?.word;Xhe(Vae(863,"Context: {0} at line {1} and column {2}.",e,t.startLineNumber,t.startColumn))}}}else n.clear()}},r,o,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=lhe(this._editor.getDomNode());return{x:i.left+t.left,y:i.top+t.top+t.height}}_shouldShowHeaders(){const e=this._editor?.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map(e=>({id:e.id,label:e.title,tooltip:e.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(e.id,...e.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:Vae(864,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:Vae(865,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}},GF=qF,qF.ID="editor.contrib.codeActionController",qF.DECORATION=Lx.register({description:"quickfix-highlight",className:"quickfix-edit-highlight"}),ZF=qF,ZF=GF=jF([$F(1,CF),$F(2,es),$F(3,Jn),$F(4,Tx),$F(5,AL),$F(6,fo),$F(7,ka),$F(8,MP),$F(9,Jn),$F(10,AL)],ZF),Upe((e,t)=>{var i,n;i=".quickfix-edit-highlight",(n=e.getColor(Bh))&&t.addRule(`.monaco-editor ${i} { background-color: ${n}; }`);const o=e.getColor(Hh);o&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Npe(e.type)?"dotted":"solid"} ${o}; box-sizing: border-box; }`)}),YF={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:Vae(831,"Kind of the code action to run.")},apply:{type:"string",description:Vae(832,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[Vae(833,"Always apply the first returned code action."),Vae(834,"Apply the first returned code action if it is the only one."),Vae(835,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:Vae(836,"Controls if only preferred code actions should be returned.")}}},QF=class extends rr{constructor(){super({id:cF,label:zae(853,"Quick Fix..."),precondition:Po.and(jl.writable,jl.hasCodeActionsProvider),kbOpts:{kbExpr:jl.textInputFocus,primary:2137,weight:100}})}run(e,t){return hCe(t,Vae(837,"No code actions available"),void 0,void 0,rF.QuickFix)}},XF=class extends sr{constructor(){super({id:dF,precondition:Po.and(jl.writable,jl.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:YF}]}})}runEditorCommand(e,t,i){const n=aF.fromUser(i,{kind:ZO.Empty,apply:"ifSingle"});return hCe(t,"string"==typeof i?.kind?n.preferred?Vae(838,"No preferred code actions for '{0}' available",i.kind):Vae(839,"No code actions for '{0}' available",i.kind):n.preferred?Vae(840,"No preferred code actions available"):Vae(841,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}},JF=class extends rr{constructor(){super({id:hF,label:zae(854,"Refactor..."),precondition:Po.and(jl.writable,jl.hasCodeActionsProvider),kbOpts:{kbExpr:jl.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Po.and(jl.writable,cCe(sF.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:YF}]}})}run(e,t,i){const n=aF.fromUser(i,{kind:sF.Refactor,apply:"never"});return hCe(t,"string"==typeof i?.kind?n.preferred?Vae(842,"No preferred refactorings for '{0}' available",i.kind):Vae(843,"No refactorings for '{0}' available",i.kind):n.preferred?Vae(844,"No preferred refactorings available"):Vae(845,"No refactorings available"),{include:sF.Refactor.contains(n.kind)?n.kind:ZO.None,onlyIncludePreferredActions:n.preferred},n.apply,rF.Refactor)}},eW=class extends rr{constructor(){super({id:uF,label:zae(855,"Source Action..."),precondition:Po.and(jl.writable,jl.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Po.and(jl.writable,cCe(sF.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:YF}]}})}run(e,t,i){const n=aF.fromUser(i,{kind:sF.Source,apply:"never"});return hCe(t,"string"==typeof i?.kind?n.preferred?Vae(846,"No preferred source actions for '{0}' available",i.kind):Vae(847,"No source actions for '{0}' available",i.kind):n.preferred?Vae(848,"No preferred source actions available"):Vae(849,"No source actions available"),{include:sF.Source.contains(n.kind)?n.kind:ZO.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,rF.SourceAction)}},tW=class extends rr{constructor(){super({id:gF,label:zae(856,"Organize Imports"),precondition:Po.and(jl.writable,cCe(sF.SourceOrganizeImports)),kbOpts:{kbExpr:jl.textInputFocus,primary:1581,weight:100},metadata:{description:zae(857,"Organize imports in the current file. Also called 'Optimize Imports' by some tools")}})}run(e,t){return hCe(t,Vae(850,"No organize imports action available"),{include:sF.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",rF.OrganizeImports)}},iW=class extends rr{constructor(){super({id:pF,label:zae(858,"Fix All"),precondition:Po.and(jl.writable,cCe(sF.SourceFixAll))})}run(e,t){return hCe(t,Vae(851,"No fix all action available"),{include:sF.SourceFixAll,includeSourceActions:!0},"ifSingle",rF.FixAll)}},nW=class extends rr{constructor(){super({id:"editor.action.autoFix",label:zae(859,"Auto Fix..."),precondition:Po.and(jl.writable,cCe(sF.QuickFix)),kbOpts:{kbExpr:jl.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return hCe(t,Vae(852,"No auto fixes available"),{include:sF.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",rF.AutoFix)}},Iue(ZF.ID,ZF,3),Iue(KF.ID,KF,4),kue(QF),kue(JF),kue(eW),kue(tW),kue(nW),kue(iW),xue(new XF),ts.as(Pa.Configuration).registerConfiguration({...iF,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:6,description:Vae(860,"Enable/disable showing group headers in the Code Action menu."),default:!0}}}),ts.as(Pa.Configuration).registerConfiguration({...iF,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:6,description:Vae(861,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}}),ts.as(Pa.Configuration).registerConfiguration({...iF,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:6,markdownDescription:Vae(862,"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}}}),sW=class{constructor(){this.lenses=[]}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){xle(e)&&(this._store??(this._store=new De),this._store.add(e));for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}},(oW=sW).Empty=new oW,_o.registerCommand("_executeCodeLensProvider",function(e,...t){let[i,n]=t;ple(_i.isUri(i)),ple("number"==typeof n||!n);const{codeLensProvider:o}=e.get(Tx),s=e.get(io).getModel(i);if(!s)throw Qae();const r=[],a=new De;return uCe(o,s,it.None).then(e=>{a.add(e);const t=[];for(const i of e.lenses)null==n||Boolean(i.symbol.command)?r.push(i.symbol):n-- >0&&i.provider.resolveCodeLens&&t.push(Promise.resolve(i.provider.resolveCodeLens(s,i.symbol,it.None)).then(e=>r.push(e||i.symbol)));return Promise.all(t)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})}),rW=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},aW=function(e,t){return function(i,n){t(i,n,e)}},lW=eue("ICodeLensCache"),dW=class{constructor(e,t){this.lineCount=e,this.data=t}},cW=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Ls(20,.75),ohe(r,()=>e.remove("codelens/cache",1));const t="codelens/cache2",i=e.get(t,1,"{}");this._deserialize(i);const n=Be.filter(e.onWillSaveState,e=>e.reason===tR.SHUTDOWN);Be.once(n)(i=>{e.store(t,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(e=>({range:e.symbol.range,command:e.symbol.command&&{id:"",title:e.symbol.command?.title}})),n=new sW;n.add({lenses:i},this._fakeProvider);const o=new dW(e.getLineCount(),n);this._cache.set(e.uri.toString(),o)}get(e){const 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(){const e=Object.create(null);for(const[t,i]of this._cache){const n=new Set;for(const e of i.data.lenses)n.add(e.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...n.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const e in t){const i=t[e],n=[];for(const e of i.lines)n.push({range:new mr(e,1,e,11)});const o=new sW;o.add({lenses:n},this._fakeProvider),this._cache.set(e,new dW(i.lineCount,o))}}catch{}}},cW=rW([aW(0,eR)],cW),dge(lW,cW,1),hW=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){void 0===this._lastHeight?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return 0!==this._lastHeight&&this.domNode.hasAttribute("monaco-visible-view-zone")}},uW=class e{constructor(t,i){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=t,this._id="codelens.widget-"+e._idPool++,this.updatePosition(i),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(t,i){this._commands.clear();const n=[];let o=!1;for(let s=0;s<t.length;s++){const i=t[s];if(i&&(o=!0,i.command)){const o=gve(i.command.title.trim());if(i.command.id){const t="c"+e._idPool++;n.push(Ahe("a",{id:t,title:i.command.tooltip,role:"button"},...o)),this._commands.set(t,i.command)}else n.push(Ahe("span",{title:i.command.tooltip},...o));s+1<t.length&&n.push(Ahe("span",void 0," | "))}}o?(Rhe(this._domNode,...n),this._isEmpty&&i&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Rhe(this._domNode,Ahe("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){this._widgetPosition={position:{lineNumber:e,column:this._editor.getModel().getLineFirstNonWhitespaceColumn(e)},preference:[1]}}getPosition(){return this._widgetPosition||null}},uW._idPool=0,gW=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){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,n=t.length;i<n;i++)this._addDecorationsCallbacks[i](t[i])}},pW=Lx.register({collapseOnReplaceEdit:!0,description:"codelens"}),mW=class{constructor(e,t,i,n,o,s){let r;this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];const a=[];this._data.forEach((e,t)=>{e.symbol.command&&a.push(e.symbol),i.addDecoration({range:e.symbol.range,options:pW},e=>this._decorationIds[t]=e),r=r?mr.plusRange(r,e.symbol.range):mr.lift(e.symbol.range)}),this._viewZone=new hW(r.startLineNumber-1,o,s),this._viewZoneId=n.addZone(this._viewZone),a.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(a,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new uW(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)=>{const i=this._editor.getModel().getDecorationRange(e),n=this._data[t].symbol;return!(!i||mr.isEmpty(n.range)!==i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((e,i)=>{t.addDecoration({range:e.symbol.range,options:pW},e=>this._decorationIds[i]=e)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){const 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++){const i=e[t];if(i){const{symbol:e}=this._data[t];e.command=i.command||e.command}}}getCommand(e){return this._contentWidget?.getCommand(e)}getLineNumber(){const e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){const 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)))}}},fW=eue("environmentService"),_W=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},bW=function(e,t){return function(i,n){t(i,n,e)}},vW=eue("ILanguageFeatureDebounceService"),function(e){const t=new WeakMap;let i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(wW||(wW={})),CW=class{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}},yW=class{constructor(e,t,i,n,o,s){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=o,this._max=s,this._cache=new Ls(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((e,t)=>Kde(wW.of(t),e),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?Vve(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let n=this._cache.get(i);n||(n=new BN(6),this._cache.set(i,n));const o=Vve(n.update(t),this._min,this._max);return Ade(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new WN;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return Vve(0|this._overall()||this._default,this._min,this._max)}},SW=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){const n=i?.min??50,o=i?.max??n**2,s=i?.key??void 0,r=`${wW.of(e)},${n}${s?","+s:""}`;let a=this._data.get(r);return a||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),a=new CW(1.5*n)):a=new yW(this._logService,t,e,0|this._overallAverage()||1.5*n,n,o),this._data.set(r,a)),a}_overallAverage(){const e=new WN;for(const t of this._data.values())e.update(t.default());return e.value}},SW=_W([bW(0,Ks),bW(1,fW)],SW),dge(vW,SW,1),kW=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},LW=function(e,t){return function(i,n){t(i,n,e)}},xW=class{constructor(e,t,i,n,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=o,this._codeLensCache=s,this._disposables=new De,this._localToDispose=new De,this._lenses=[],this._oldCodeLensModels=new De,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new ft(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(e=>{(e.hasChanged(59)||e.hasChanged(25)||e.hasChanged(24))&&this._updateLensStyle(),e.hasChanged(23)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61));let t=this._editor.getOption(25);return(!t||t<5)&&(t=.9*this._editor.getOption(61)|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(24),n=this._editor.getOption(59),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",vd.fontFamily)),this._editor.changeViewZones(t=>{for(const i of this._lenses)i.updateHeight(e,t)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e)return;if(!this._editor.getOption(23)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e))return void(t&&Rle(()=>{t===this._codeLensCache.get(e)&&(this._codeLensCache.delete(e),this._onModelChange())},3e4,this._localToDispose));for(const n of this._languageFeaturesService.codeLensProvider.all(e))if("function"==typeof n.onDidChange){const e=n.onDidChange(()=>i.schedule());this._localToDispose.add(e)}const i=new ft(()=>{const t=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=Ele(t=>uCe(this._languageFeaturesService.codeLensProvider,e,t)),this._getCodeLensModelPromise.then(n=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=n,this._codeLensCache.put(e,n),i.delay=this._provideCodeLensDebounce.update(e,Date.now()-t),this._renderCodeLensSymbols(n),this._resolveCodeLensesInViewportSoon()},$ae)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Dle(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{const i=[];let n=-1;this._lenses.forEach(e=>{e.isValid()&&n!==e.getLineNumber()?(e.update(t),n=e.getLineNumber()):i.push(e)});const o=new gW;i.forEach(e=>{e.dispose(o,t),this._lenses.splice(this._lenses.indexOf(e),1)}),o.commit(e)})}),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(e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Dle(()=>{if(this._editor.getModel()){const e=PL.capture(this._editor);this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{this._disposeAllLenses(e,t)})}),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(e=>{if(9!==e.target.type)return;let t=e.target.element;if("SPAN"===t?.tagName&&(t=t.parentElement),"A"===t?.tagName)for(const i of this._lenses){const e=i.getCommand(t);if(e){this._commandService.executeCommand(e.id,...e.arguments||[]).catch(e=>this._notificationService.error(e));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new gW;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let n;for(const r of e.lenses){const e=r.symbol.range.startLineNumber;e<1||e>t||(n&&n[n.length-1].symbol.range.startLineNumber===e?n.push(r):(n=[r],i.push(n)))}if(!i.length&&!this._lenses.length)return;const o=PL.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{const n=new gW;let o=0,r=0;for(;r<i.length&&o<this._lenses.length;){const e=i[r][0].symbol.range.startLineNumber,a=this._lenses[o].getLineNumber();a<e?(this._lenses[o].dispose(n,t),this._lenses.splice(o,1)):a===e?(this._lenses[o].updateCodeLensSymbols(i[r],n),r++,o++):(this._lenses.splice(o,0,new mW(i[r],this._editor,n,t,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),o++,r++)}for(;o<this._lenses.length;)this._lenses[o].dispose(n,t),this._lenses.splice(o,1);for(;r<i.length;)this._lenses.push(new mW(i[r],this._editor,n,t,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),r++;n.commit(e)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(n=>{const o=n.computeIfNecessary(e);o&&(t.push(o),i.push(n))}),0===t.length)return void this._oldCodeLensModels.clear();const n=Date.now(),o=Ele(n=>{const o=t.map((t,o)=>{const s=new Array(t.length),r=t.map((t,i)=>t.symbol.command||"function"!=typeof t.provider.resolveCodeLens?(s[i]=t.symbol,Promise.resolve(void 0)):Promise.resolve(t.provider.resolveCodeLens(e,t.symbol,n)).then(e=>{s[i]=e},Gae));return Promise.all(r).then(()=>{n.isCancellationRequested||i[o].isDisposed()||i[o].updateCommands(s)})});return Promise.all(o)});this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then(()=>{const t=this._resolveCodeLensesDebounce.update(e,Date.now()-n);this._resolveCodeLensesScheduler.delay=t,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},e=>{$ae(e),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},xW.ID="css.editor.codeLens",DW=xW,Iue((DW=kW([LW(1,Tx),LW(2,vW),LW(3,fo),LW(4,Xv),LW(5,lW)],DW)).ID,DW,1),kue(class extends rr{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:jl.hasCodeLensProvider,label:zae(884,"Show CodeLens Commands for Current Line")})}async run(e,t){if(!t.hasModel())return;const i=e.get(tA),n=e.get(fo),o=e.get(Xv),s=t.getSelection().positionLineNumber,r=t.getContribution(DW.ID);if(!r)return;const a=await r.getModel();if(!a)return;const l=[];for(const u of a.lenses)u.symbol.command&&u.symbol.range.startLineNumber===s&&l.push({label:u.symbol.command.title,command:u.symbol.command});if(0===l.length)return;const d=await i.pick(l,{canPickMany:!1,placeHolder:Vae(883,"Select a command")});if(!d)return;let c=d.command;if(a.isDisposed){const e=(await r.getModel())?.lenses.find(e=>e.symbol.range.startLineNumber===s&&e.symbol.command?.title===c.title);if(!e||!e.symbol.command)return;c=e.symbol.command}try{await n.executeCommand(c.id,...c.arguments||[])}catch(h){o.error(h)}}}),IW=[],NW=class{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return 1===e.type&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return 1===e.type&&t.lineNumber===this.range.startLineNumber}},EW=class{constructor(e,t,i,n,o,s){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return 2===e.type&&this.owner===e.owner}canAdoptVisibleHover(e,t){return 2===e.type&&this.owner===e.owner}},MW=class{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(const e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}},TW=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}},RW=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},OW=function(e,t){return function(i,n){t(i,n,e)}},AW=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const n=t.range,o=t.color,s=o.alpha,r=new eh(new Qc(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),a=s?eh.Format.CSS.formatRGBA(r):eh.Format.CSS.formatRGB(r),l=s?eh.Format.CSS.formatHSLA(r):eh.Format.CSS.formatHSL(r),d=s?eh.Format.CSS.formatHexA(r):eh.Format.CSS.formatHex(r),c=[];return c.push({label:a,textEdit:{range:n,text:a}}),c.push({label:l,textEdit:{range:n,text:l}}),c.push({label:d,textEdit:{range:n,text:d}}),c}},AW=RW([OW(0,DM)],AW),PW=class extends Ie{constructor(e,t){super(),this._register(e.colorProvider.register("*",new AW(t)))}},PW=RW([OW(0,Tx),OW(1,DM)],PW),FW=class{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)n.push({colorInfo:s,provider:e});return Array.isArray(o)}},WW=class{constructor(){}async compute(e,t,i,n){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)n.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)}},BW=class{constructor(e){this.colorInfo=e}async compute(e,t,i,n){const o=await e.provideColorPresentations(t,this.colorInfo,it.None);return Array.isArray(o)&&n.push(...o),Array.isArray(o)}},HW=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},zW=function(e,t){return function(i,n){t(i,n,e)}},KW=Object.create({}),VW=class extends Ie{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new De),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new jW),this._colorDecorationClassRefs=this._register(new De),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new wp(this._editor)),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:UW.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(e=>{const t=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167);const i=t!==this._isColorDecoratorsEnabled||e.hasChanged(27),n=e.hasChanged(167);(i||n)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&"object"==typeof i){const e=i.colorDecorators;if(e&&void 0!==e.enable&&!e.enable)return e.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();e&&this._languageFeaturesService.colorProvider.has(e)&&(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new pt,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Ele(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new Fe(!1),n=await mCe(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,i.elapsed()),n});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(Fae){$ae(Fae)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:Lx.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((t,i)=>this._colorDatas.set(t,e[i]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(27);for(let o=0;o<e.length&&t.length<i;o++){const{red:i,green:n,blue:s,alpha:r}=e[o].colorInfo.color,a=new Qc(Math.round(255*i),Math.round(255*n),Math.round(255*s),r),l=`rgba(${a.r}, ${a.g}, ${a.b}, ${a.a})`,d=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:l}));t.push({range:{startLineNumber:e[o].colorInfo.range.startLineNumber,startColumn:e[o].colorInfo.range.startColumn,endLineNumber:e[o].colorInfo.range.endLineNumber,endColumn:e[o].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:" ",inlineClassName:`${d.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:KW}}})}const n=i<e.length&&i;this._decoratorLimitReporter.update(e.length,n),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(mr.fromPositions(e,e)).filter(e=>this._colorDatas.has(e.id));return 0===i.length?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},UW=VW,VW.ID="editor.contrib.colorDetector",VW.RECOMPUTE_TIME=1e3,qW=VW,qW=UW=HW([zW(1,ka),zW(2,Tx),zW(3,vW)],qW),jW=class extends Ie{constructor(){super(...arguments),this._onDidChange=this._register(new je),this._computed=0,this._limited=!1}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}},$W="editor.action.increaseHoverVerbosityLevel",GW=Vae(1102,"Increase Hover Verbosity Level"),ZW="editor.action.decreaseHoverVerbosityLevel",YW=Vae(1103,"Decrease Hover Verbosity Level"),QW="editor.action.inlineSuggest.commit",XW="editor.action.inlineSuggest.showPrevious",JW="editor.action.inlineSuggest.showNext",eB="editor.action.inlineSuggest.hide",tB="editor.action.inlineSuggest.toggleShowCollapsed",nB=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},oB=function(e,t){return function(i,n){t(i,n,e)}},rB=class extends Ie{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Hce(this,this.editor.onDidChangeConfiguration,()=>"always"===this.editor.getOption(71).showToolbar),this.sessionPosition=void 0,this.position=Dce(this,e=>{const t=this.model.read(e)?.primaryGhostText.read(e);if(!this.alwaysShowToolbar.read(e)||!t||0===t.parts.length)return this.sessionPosition=void 0,null;const i=t.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==t.lineNumber&&(this.sessionPosition=void 0);const n=new to(t.lineNumber,Math.min(i,this.sessionPosition?.column??Number.MAX_SAFE_INTEGER));return this.sessionPosition=n,n}),this._register(Pce((t,i)=>{const n=this.model.read(t);if(!n||!this.alwaysShowToolbar.read(t))return;const o=Dce(t=>{const i=t.store.add(this.instantiationService.createInstance(dB.hot.read(t),this.editor,!0,this.position,n.selectedInlineCompletionIndex,n.inlineCompletionsCount,n.activeCommands,n.warning,()=>{}));return e.addContentWidget(i),t.store.add(Dle(()=>e.removeContentWidget(i))),t.store.add(Rce(e=>{this.position.read(e)&&n.lastTriggerKind.read(e)!==mb.Explicit&&n.triggerExplicitly()})),i}),s=qce(this,(e,t)=>!!this.position.read(e)||!!t);i.add(Rce(e=>{s.read(e)&&o.read(e)}))}))}},rB=nB([oB(2,Jn)],rB),aB=rwe("inline-suggestion-hints-next",go.chevronRight,Vae(1207,"Icon for show next parameter hint.")),lB=rwe("inline-suggestion-hints-previous",go.chevronLeft,Vae(1208,"Icon for show previous parameter hint.")),iB=class extends Ie{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new oo(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=Vae(1209,"{0} ({1})",t,o.getLabel())),n.tooltip=s,n}constructor(e,t,i,n,o,s,r,a,l,d,c,h,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=o,this._extraCommands=s,this._warning=r,this._relayout=a,this._commandService=l,this.keybindingService=c,this._contextKeyService=h,this._menuService=u,this.id="InlineSuggestionHintsContentWidget"+sB.id++,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=Dce(e=>{const t=this._warning.read(e);if(t)return"string"==typeof t.message?t.message:e.store.add(mve(t.message)).element}),this._warningMessageNode=zn.div({class:"warningMessage",style:{maxWidth:400,margin:4,marginBottom:4,display:Dce(e=>this._warning.read(e)?"block":"none")}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=Vhe("div.inlineSuggestionsHints",{className:this.withBorder?"monaco-hover monaco-hover-content":""},[this._warningMessageNode.element,Vhe("div@toolBar")]),this.previousAction=this._register(this.createCommandAction(XW,Vae(1210,"Previous"),mo.asClassName(lB))),this.availableSuggestionCountAction=this._register(new oo("inlineSuggestionHints.availableSuggestionCount","",void 0,!1)),this.nextAction=this._register(this.createCommandAction(JW,Vae(1211,"Next"),mo.asClassName(aB))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(ds.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new ft(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new ft(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(Rce(e=>{this._warningMessageContentNode.read(e),this._warningMessageNode.readEffect(e),this._relayout()})),this.toolBar=this._register(d.createInstance(uB,this.nodes.toolBar,ds.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith("primary")},actionViewItemProvider:(e,t)=>{if(e instanceof ps)return d.createInstance(hB,e,void 0);if(e===this.availableSuggestionCountAction){const t=new cB(void 0,e,{label:!0,icon:!1});return t.setClass("availableSuggestionCount"),t}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(e=>{sB._dropDownVisible=e})),this._register(Rce(e=>{this._position.read(e),this.editor.layoutContentWidget(this)})),this._register(Rce(e=>{const t=this._suggestionCount.read(e),i=this._currentSuggestionIdx.read(e);void 0!==t?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${i+1}/${t}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),void 0!==t&&t>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Rce(e=>{const t=this._extraCommands.read(e).map(e=>({class:void 0,id:e.command.id,enabled:!0,tooltip:e.command.tooltip||"",label:e.command.title,run:t=>this._commandService.executeCommand(e.command.id)}));for(const[i,n]of this.inlineCompletionsActionsMenus.getActions())for(const e of n)e instanceof ps&&t.push(e);t.length>0&&t.unshift(new ro),this.toolBar.setAdditionalSecondaryActions(t)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},sB=iB,iB.hot=K_e(iB),iB._dropDownVisible=!1,iB.id=0,dB=iB,dB=sB=nB([oB(8,fo),oB(9,Jn),oB(10,xw),oB(11,es),oB(12,cs)],dB),cB=class extends DE{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}},hB=class extends _R{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){const t=Vhe("div.keybinding").root;this._register(new fP(t,Y,{disableTitle:!0,...mP})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},uB=class extends AR{constructor(e,t,i,n,o,s,r,a,l){super(e,{resetMenu:t,...i},n,o,s,r,a,l),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){const{primary:e,secondary:t}=Lwe(this.menu.getActions(this.options2?.menuOptions),this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions);t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),e.push(...this.additionalPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Zde(this.prependedPrimaryActions,e,(e,t)=>e===t)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Zde(this.additionalActions,e,(e,t)=>e===t)||(this.additionalActions=e,this.updateToolbar())}},uB=nB([oB(3,cs),oB(4,es),oB(5,sT),oB(6,xw),oB(7,fo),oB(8,fs)],uB),gB=class{constructor(e,t,i,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=i,this.options=n}},pB=class extends Ie{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new je),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new mB(e=>this._triggerAsyncComputation(e),0)),this._syncComputationScheduler=this._register(new mB(e=>this._triggerSyncComputation(e),0)),this._loadingMessageScheduler=this._register(new mB(e=>this._triggerLoadingMessage(e),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=function(e){const t=new ot,i=e(t.token);return new kt(t,async e=>{const n=t.token.onCancellationRequested(()=>{n.dispose(),t.dispose(),e.reject(new v)});try{for await(const n of i){if(t.token.isCancellationRequested)return;e.emitOne(n)}n.dispose(),t.dispose()}catch(o){n.dispose(),t.dispose(),e.reject(o)}})}(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(const t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,3!==this._state&&4!==this._state||this._setState(0,e)}catch(Fae){$ae(Fae)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){3===this._state&&this._setState(4,e)}_fireResult(e){if(1===this._state||2===this._state)return;const t=0===this._state,i=4===this._state;this._onResult.fire(new gB(this._result.slice(0),t,i,e))}start(e,t){if(0===e)0===this._state&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t)}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}},mB=class extends Ie{constructor(e,t){super(),this._scheduler=this._register(new ft(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}},fB=class{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){let e;this._onDidWillResize=new je,this._onDidResize=new je,this._sashListener=new De,this._size=new Tn(0,0),this._minSize=new Tn(0,0),this._maxSize=new Tn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new MT(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new MT(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new MT(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:xT.North}),this._southSash=new MT(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:xT.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let t=0,i=0;this._sashListener.add(Be.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{void 0===e&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(Be.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{void 0!==e&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(n=>{e&&(t=-(n.currentY-n.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(n=>{e&&(t=n.currentY-n.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Be.any(this._eastSash.onDidReset,this._westSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Be.any(this._northSash.onDidReset,this._southSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,n){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(n,Math.min(s,t));const r=new Tn(t,e);Tn.equals(r,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=r,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}},_B=class extends Ie{constructor(e,t=new Tn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new fB),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Tn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(e=>{this._resize(new Tn(e.dimension.width,e.dimension.height)),e.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){return this._contentPosition?.position?to.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(t&&i)return lhe(t).top+i.top-30}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=lhe(t),o=rhe(t.ownerDocument.body),s=n.top+i.top+i.height;return o.height-s-24}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),n=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(n,i),e),s=Math.min(e,o);let r;return r=this._editor.getOption(69).above?s<=n?1:2:s<=i?2:1,1===r?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),r}_resize(e){this._resizableNode.layout(e.height,e.width)}},bB=Ahe,vB=class extends Ie{constructor(e){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.classList.toggle("fade-in",!!e),this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new Tm(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}},wB=class e extends Ie{static render(t,i,n){return new e(t,i,n)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=Mhe(e,bB("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Mhe(this.actionContainer,bB("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Mhe(this.action,bB("span.icon")).classList.add(...t.iconClass.split(" ")),this.actionRenderedLabel=i?`${t.label} (${i})`:t.label,Mhe(this.action,bB("span")).textContent=this.actionRenderedLabel,this._store.add(new CB(this.actionContainer,t.run)),this._store.add(new yB(this.actionContainer,t.run,[3,10])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}},CB=class extends Ie{constructor(e,t){super(),this._register(ehe(e,On.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}},yB=class extends Ie{constructor(e,t,i){super(),this._register(ehe(e,On.KEY_DOWN,n=>{const o=new we(n);i.some(e=>o.equals(e))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}},xB=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},kB=function(e,t){return function(i,n){t(i,n,e)}},SB=class extends _B{get isVisibleFromKeyboard(){return 2===this._renderedHover?.source}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,n,o){const s=new Tn(150,e.getOption(75)+8);super(e,s),this._configurationService=i,this._accessibilityService=n,this._keybindingService=o,this._hover=this._register(new vB(!0)),this._onDidResize=this._register(new je),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new je),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new je),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=s,this._hoverVisibleKey=jl.hoverVisible.bindTo(t),this._hoverFocusedKey=jl.hoverFocused.bindTo(t),Mhe(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._resizableNode.domNode.className="monaco-resizable-hover",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(59)&&this._updateFont()}));const r=this._register(Ehe(this._resizableNode.domNode));this._register(r.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(r.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(e=>{this._onDidScroll.fire(e)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return LB.ID}static _applyDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,o="number"==typeof i?`${i}px`:i;e.style.width=n,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return LB._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return LB._applyDimensions(i,e,t)}_setScrollableElementDimensions(e,t){const i=this._hover.scrollbar.getDomNode();return LB._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,o="number"==typeof i?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){LB._applyMaxDimensions(this._hover.contentsDomNode,e,t),LB._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),LB._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth","number"==typeof e?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none"),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Tn(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){LB._lastDimensions=new Tn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){const e=this._renderedHover?.showAtPosition;if(e)return 1===this._positionPreference?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(e=>{t+=e.clientHeight}),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(e=>e.scrollWidth>e.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=void 0===this._contentWidth?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidth<t?rhe(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth}isMouseGettingCloser(e,t){if(!this._renderedHover)return!1;if(void 0===this._renderedHover.initialMousePosX||void 0===this._renderedHover.initialMousePosY)return this._renderedHover.initialMousePosX=e,this._renderedHover.initialMousePosY=t,!1;const i=lhe(this.getDomNode());void 0===this._renderedHover.closestMouseDistance&&(this._renderedHover.closestMouseDistance=CCe(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,i.left,i.top,i.width,i.height));const n=CCe(e,t,i.left,i.top,i.width,i.height);return!(n>this._renderedHover.closestMouseDistance+4||(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,n),0))}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(59),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=""+t/e,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(e=>this._editor.applyFontInfo(e))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,LB._lastDimensions.height),t=Math.max(.66*this._editor.getLayoutInfo().width,750,LB._lastDimensions.width);this._resizableNode.maxSize=new Tn(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=ghe(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const n=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&wCe(!0===this._configurationService.getValue("accessibility.verbosity.hover")&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel()??"");n&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+n)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new Tn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto"),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new Tn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=void 0===this._contentWidth?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Tn(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();const e=this._hover.contentsDomNode;let t=ghe(e),i=che(e)+2;if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=ghe(e),i=che(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),this._renderedHover?.showAtPosition){const e=ghe(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(e,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-30})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+30})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}},LB=SB,SB.ID="editor.contrib.resizableContentHoverWidget",SB._lastDimensions=new Tn(0,0),DB=SB,DB=LB=xB([kB(1,es),kB(2,ka),kB(3,Fc),kB(4,xw)],DB),IB=class e{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(1!==t.type&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const o=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter(e=>{if(e.options.isWholeLine)return!0;const i=e.range.startLineNumber===n?e.range.startColumn:1,s=e.range.endLineNumber===n?e.range.endColumn:o;if(e.options.showIfCollapsed){if(i>t.range.startColumn+1||t.range.endColumn-1>s)return!1}else if(i>t.range.startColumn||t.range.endColumn>s)return!1;return!0})}computeAsync(t,i){const n=t.anchor;if(!this._editor.hasModel()||!n)return xt.EMPTY;const o=e._getLineDecorations(this._editor,n);return xt.merge(this._participants.map(e=>e.computeAsync?e.computeAsync(n,o,t.source,i):xt.EMPTY))}computeSync(t){if(!this._editor.hasModel())return[];const i=t.anchor,n=e._getLineDecorations(this._editor,i);let o=[];for(const e of this._participants)o=o.concat(e.computeSync(i,n,t.source));return ice(o)}},NB=class{constructor(e,t,i){this.hoverParts=e,this.isComplete=t,this.options=i}filter(e){const t=this.hoverParts.filter(t=>t.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new EB(this,t,this.isComplete,this.options)}},EB=class extends NB{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}},MB=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},TB=function(e,t){return function(i,n){t(i,n,e)}},RB=Ahe,OB=class extends Ie{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=RB("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=Mhe(this.hoverElement,RB("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const n=this._register(wB.render(this.actionsElement,e,i));return this._register(this._hoverService.setupManagedHover($_e("element"),n.actionContainer,n.actionRenderedLabel)),this.actions.push(n),n}append(e){const t=Mhe(this.actionsElement,e);return this._hasContent=!0,t}},OB=MB([TB(0,xw),TB(1,BR)],OB),AB={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"},PB=class extends mm{get onChange(){return this._onChange.event}get onKeyDown(){return this._onKeyDown.event}constructor(e){super(),this._onChange=this._register(new je),this._onKeyDown=this._register(new je),this._opts=e,this._title=this._opts.title,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...mo.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._register(Bve().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}),this._opts.hoverLifecycleOptions)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.setTitle(this._opts.title),this.applyStyles(),this.onclick(this.domNode,e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,e=>{if(this.enabled)return 10===e.keyCode||3===e.keyCode?(this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),void e.stopPropagation()):void this._onKeyDown.fire(e)})}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...mo.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...mo.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1)),this.domNode.classList.remove("disabled")}disable(){this.domNode.setAttribute("aria-disabled",String(!0)),this.domNode.classList.add("disabled")}setTitle(e){this._title=e,this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return"none"!==this.domNode.style.display}},FB=class extends mm{constructor(e,t,i){super(),this.checkbox=e,this.domNode=t,this.styles=i,this._onChange=this._register(new je),this.onChange=this._onChange.event,this.applyStyles()}get enabled(){return this.checkbox.enabled}enable(){this.checkbox.enable(),this.applyStyles(!0)}disable(){this.checkbox.disable(),this.applyStyles(!1)}setTitle(e){this.checkbox.setTitle(e)}applyStyles(e=this.enabled){this.domNode.style.color=(e?this.styles.checkboxForeground:this.styles.checkboxDisabledForeground)||"",this.domNode.style.backgroundColor=(e?this.styles.checkboxBackground:this.styles.checkboxDisabledBackground)||"",this.domNode.style.borderColor=(e?this.styles.checkboxBorder:this.styles.checkboxDisabledBackground)||"";const t=this.styles.size||18;this.domNode.style.width=this.domNode.style.height=this.domNode.style.fontSize=`${t}px`,this.domNode.style.fontSize=t-2+"px"}},FB.CLASS_NAME="monaco-checkbox",WB=class extends FB{constructor(e,t,i){const n=new PB({title:e,isChecked:t,icon:go.check,actionClassName:FB.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...AB});super(n,n.domNode,i),this._register(n),this._register(this.checkbox.onChange(e=>{this.applyStyles(),this._onChange.fire(e)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}applyStyles(e){this.checkbox.checked?this.checkbox.setIcon(go.check):this.checkbox.setIcon(void 0),super.applyStyles(e)}},BB=class extends FB{constructor(e,t,i){let n;switch(t){case!0:n=go.check;break;case"mixed":n=go.dash;break;case!1:n=void 0}const o=new PB({title:e,isChecked:!0===t,icon:n,actionClassName:WB.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...AB});super(o,o.domNode,i),this._state=t,this._register(o),this._register(this.checkbox.onChange(e=>{this._state=this.checkbox.checked,this.applyStyles(),this._onChange.fire(e)}))}get checked(){return this._state}set checked(e){this._state!==e&&(this._state=e,this.checkbox.checked=!0===e,this.applyStyles())}applyStyles(e){switch(this._state){case!0:this.checkbox.setIcon(go.check);break;case"mixed":this.checkbox.setIcon(go.dash);break;case!1:this.checkbox.setIcon(void 0)}super.applyStyles(e)}},HB=class e{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(e=>this._editor.getModel().getDecorationRange(e)).filter(e=>!!e);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(t){const i=this._editor.getModel().getDecorationsInRange(t);for(const n of i){const t=n.options;if(t===e._FIND_MATCH_DECORATION||t===e._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(n.id)}return 0}setCurrentFindMatch(t){let i=null,n=0;if(t)for(let e=0,o=this._decorations.length;e<o;e++){const o=this._editor.getModel().getDecorationRange(this._decorations[e]);if(t.equalsRange(o)){i=this._decorations[e],n=e+1;break}}return null===this._highlightedDecorationId&&null===i||this._editor.changeDecorations(t=>{if(null!==this._highlightedDecorationId&&(t.changeDecorationOptions(this._highlightedDecorationId,e._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),null!==i&&(this._highlightedDecorationId=i,t.changeDecorationOptions(this._highlightedDecorationId,e._CURRENT_FIND_MATCH_DECORATION)),null!==this._rangeHighlightDecorationId&&(t.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),null!==i){let n=this._editor.getModel().getDecorationRange(i);if(n.startLineNumber!==n.endLineNumber&&1===n.endColumn){const e=n.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);n=new mr(n.startLineNumber,n.startColumn,e,t)}this._rangeHighlightDecorationId=t.addDecoration(n,e._RANGE_HIGHLIGHT_DECORATION)}}),n}set(t,i){this._editor.changeDecorations(n=>{let o=e._FIND_MATCH_DECORATION;const s=[];if(t.length>1e3){o=e._FIND_MATCH_NO_OVERVIEW_DECORATION;const i=this._editor.getModel().getLineCount(),n=this._editor.getLayoutInfo().height/i,r=Math.max(2,Math.ceil(3/n));let a=t[0].range.startLineNumber,l=t[0].range.endLineNumber;for(let o=1,d=t.length;o<d;o++){const i=t[o].range;l+r>=i.startLineNumber?i.endLineNumber>l&&(l=i.endLineNumber):(s.push({range:new mr(a,1,l,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),a=i.startLineNumber,l=i.endLineNumber)}s.push({range:new mr(a,1,l,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(t.length);for(let e=0,i=t.length;e<i;e++)r[e]={range:t[e].range,options:o};this._decorations=n.deltaDecorations(this._decorations,r),this._overviewRulerApproximateDecorations=n.deltaDecorations(this._overviewRulerApproximateDecorations,s),this._rangeHighlightDecorationId&&(n.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(e=>n.removeDecoration(e)),this._findScopeDecorationIds=[]),i?.length&&(this._findScopeDecorationIds=i.map(t=>n.addDecoration(t,e._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(0===this._decorations.length)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(n&&!(n.endLineNumber>e.lineNumber)){if(n.endLineNumber<e.lineNumber)return n;if(!(n.endColumn>e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(0===this._decorations.length)return null;for(let t=0,i=this._decorations.length;t<i;t++){const i=this._decorations[t],n=this._editor.getModel().getDecorationRange(i);if(n&&!(n.startLineNumber<e.lineNumber)){if(n.startLineNumber>e.lineNumber)return n;if(!(n.startColumn<e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}},(VB=HB)._CURRENT_FIND_MATCH_DECORATION=Lx.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",inlineClassName:"currentFindMatchInline",showIfCollapsed:!0,overviewRuler:{color:Hpe(wu),position:Zr.Center},minimap:{color:Hpe(ku),position:1}}),VB._FIND_MATCH_DECORATION=Lx.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",inlineClassName:"findMatchInline",showIfCollapsed:!0,overviewRuler:{color:Hpe(wu),position:Zr.Center},minimap:{color:Hpe(ku),position:1}}),VB._FIND_MATCH_NO_OVERVIEW_DECORATION=Lx.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0}),VB._FIND_MATCH_ONLY_OVERVIEW_DECORATION=Lx.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:Hpe(wu),position:Zr.Center}}),VB._RANGE_HIGHLIGHT_DECORATION=Lx.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0}),VB._FIND_SCOPE_DECORATION=Lx.register({description:"find-scope",className:"findScope",isWholeLine:!0}),zB=class{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const e=[];for(let t=0;t<this._ranges.length;t++)e.push({range:this._ranges[t],text:this._replaceStrings[t]});e.sort((e,t)=>mr.compareRangesUsingStarts(e.range,t.range));const i=[];let n=e[0];for(let t=1;t<e.length;t++)n.range.endLineNumber===e[t].range.startLineNumber&&n.range.endColumn===e[t].range.startColumn?(n.range=n.range.plusRange(e[t].range),n.text=n.text+e[t].text):(i.push(n),n=e[t]);i.push(n);for(const o of i)t.addEditOperation(o.range,o.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}},UB=class{constructor(e){this.staticValue=e,this.kind=0}},KB=class{constructor(e){this.pieces=e,this.kind=1}},qB=class e{static fromStaticValue(t){return new e([jB.staticValue(t)])}get hasReplacementPatterns(){return 1===this._state.kind}constructor(e){e&&0!==e.length?1===e.length&&null!==e[0].staticValue?this._state=new UB(e[0].staticValue):this._state=new KB(e):this._state=new UB("")}buildReplaceString(t,i){if(0===this._state.kind)return i?yCe(t,this._state.staticValue):this._state.staticValue;let n="";for(let o=0,s=this._state.pieces.length;o<s;o++){const i=this._state.pieces[o];if(null!==i.staticValue){n+=i.staticValue;continue}let s=e._substitute(i.matchIndex,t);if(null!==i.caseOps&&i.caseOps.length>0){const e=[],t=i.caseOps.length;let n=0;for(let o=0,r=s.length;o<r;o++){if(n>=t){e.push(s.slice(o));break}switch(i.caseOps[n]){case"U":e.push(s[o].toUpperCase());break;case"u":e.push(s[o].toUpperCase()),n++;break;case"L":e.push(s[o].toLowerCase());break;case"l":e.push(s[o].toLowerCase()),n++;break;default:e.push(s[o])}}s=e.join("")}n+=s}return n}static _substitute(e,t){if(null===t)return"";if(0===e)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}},jB=class e{static staticValue(t){return new e(t,-1,null)}static caseOps(t,i){return new e(null,t,i)}constructor(e,t,i){this.staticValue=e,this.matchIndex=t,i&&0!==i.length?this.caseOps=i.slice(0):this.caseOps=null}},$B=class{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){0!==e.length&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){0!==this._currentStaticPiece.length&&(this._result[this._resultLen++]=jB.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=jB.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),0!==this._currentStaticPiece.length&&(this._result[this._resultLen++]=jB.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new qB(this._result)}},(GB=new Jo("findWidgetVisible",!1)).toNegated(),ZB=new Jo("findInputFocussed",!1),YB=new Jo("replaceInputFocussed",!1),QB={primary:545,mac:{primary:2593}},XB={primary:565,mac:{primary:2613}},JB={primary:560,mac:{primary:2608}},eV={primary:554,mac:{primary:2602}},tV={primary:558,mac:{primary:2606}},iV={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",GoToMatchFindAction:"editor.action.goToMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},nV=class e{constructor(e,t){this._toDispose=new De,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new pt,this._decorations=new HB(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new ft(()=>{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(e=>{3!==e.reason&&5!==e.reason&&6!==e.reason||this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(e=>{this._ignoreModelContentChanged||(e.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(e=>this._onStateChanged(e))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,kle(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},240)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;void 0!==t?null!==t&&(i=Array.isArray(t)?t:[t]):i=this._decorations.getFindScopes(),null!==i&&(i=i.map(e=>{if(e.startLineNumber!==e.endLineNumber){let t=e.endLineNumber;return 1===e.endColumn&&(t-=1),new mr(e.startLineNumber,1,t,this._editor.getModel().getLineMaxColumn(t))}return e}));const n=this._findMatches(i,!1,19999);this._decorations.set(n,i);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(0===s&&n.length>0){const e=$pe(n.map(e=>e.range),e=>mr.compareRangesUsingStarts(e,o)>=0);s=e>0?e-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(50).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||1===n?(1===i?i=o.getLineCount():i--,n=o.getLineMaxColumn(i)):n--,new to(i,n)}_moveToPrevMatch(t,i=!1){if(!this._state.canNavigateBack()){const e=this._decorations.matchAfterPosition(t);return void(e&&this._setCurrentFindMatch(e))}if(this._decorations.getCount()<19999){let e=this._decorations.matchBeforePosition(t);return e&&e.isEmpty()&&e.getStartPosition().equals(t)&&(t=this._prevSearchPosition(t),e=this._decorations.matchBeforePosition(t)),void(e&&this._setCurrentFindMatch(e))}if(this._cannotFind())return;const n=this._decorations.getFindScope(),o=e._getSearchRange(this._editor.getModel(),n);o.getEndPosition().isBefore(t)&&(t=o.getEndPosition()),t.isBefore(o.getStartPosition())&&(t=o.getEndPosition());const{lineNumber:s,column:r}=t,a=this._editor.getModel();let l=new to(s,r),d=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,!1);return d&&d.range.isEmpty()&&d.range.getStartPosition().equals(l)&&(l=this._prevSearchPosition(l),d=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,!1)),d?i||o.containsRange(d.range)?void this._setCurrentFindMatch(d.range):this._moveToPrevMatch(d.range.getStartPosition(),!0):void 0}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const o=this._editor.getModel();return t||n===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,n=1):n++,new to(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const t=this._decorations.matchBeforePosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()<19999){let t=this._decorations.matchAfterPosition(e);return t&&t.isEmpty()&&t.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),t=this._decorations.matchAfterPosition(e)),void(t&&this._setCurrentFindMatch(t))}const t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(t,i,n,o=!1){if(this._cannotFind())return null;const s=this._decorations.getFindScope(),r=e._getSearchRange(this._editor.getModel(),s);r.getEndPosition().isBefore(t)&&(t=r.getStartPosition()),t.isBefore(r.getStartPosition())&&(t=r.getStartPosition());const{lineNumber:a,column:l}=t,d=this._editor.getModel();let c=new to(a,l),h=d.findNextMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,i);return n&&h&&h.range.isEmpty()&&h.range.getStartPosition().equals(c)&&(c=this._nextSearchPosition(c),h=d.findNextMatch(this._state.searchString,c,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,i)),h?o||r.containsRange(h.range)?h:this._getNextMatch(h.range.getEndPosition(),i,n,!0):null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_moveToMatch(e){const t=this._decorations.getDecorationRangeAt(e);t&&this._setCurrentFindMatch(t)}moveToMatch(e){this._moveToMatch(e)}_getReplacePattern(){return this._state.isRegex?function(e){if(!e||0===e.length)return new qB(null);const t=[],i=new $B(e);for(let n=0,o=e.length;n<o;n++){const s=e.charCodeAt(n);if(92===s){if(n++,n>=o)break;const s=e.charCodeAt(n);switch(s){case 92:i.emitUnchanged(n-1),i.emitStatic("\\",n+1);break;case 110:i.emitUnchanged(n-1),i.emitStatic("\n",n+1);break;case 116:i.emitUnchanged(n-1),i.emitStatic("\t",n+1);break;case 117:case 85:case 108:case 76:i.emitUnchanged(n-1),i.emitStatic("",n+1),t.push(String.fromCharCode(s))}continue}if(36===s){if(n++,n>=o)break;const s=e.charCodeAt(n);if(36===s){i.emitUnchanged(n-1),i.emitStatic("$",n+1);continue}if(48===s||38===s){i.emitUnchanged(n-1),i.emitMatchIndex(0,n+1,t),t.length=0;continue}if(49<=s&&s<=57){let r=s-48;if(n+1<o){const o=e.charCodeAt(n+1);if(48<=o&&o<=57){n++,r=10*r+(o-48),i.emitUnchanged(n-2),i.emitMatchIndex(r,n+1,t),t.length=0;continue}}i.emitUnchanged(n-1),i.emitMatchIndex(r,n+1,t),t.length=0;continue}}}return i.finalize()}(this._state.replaceString):qB.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){const n=e.buildReplaceString(i.matches,this._state.preserveCase),o=new Er(t,n);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new to(t.startLineNumber,t.startColumn+n.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(t,i,n){const o=(t||[null]).map(t=>e._getSearchRange(this._editor.getModel(),t));return this._editor.getModel().findMatches(this._state.searchString,o,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,i,n)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();null===e&&this._state.matchesCount>=19999?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const e=new Jy(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null).parseSearchRequest();if(!e)return;let t=e.regex;if(!t.multiline){let e="mu";t.ignoreCase&&(e+="i"),t.global&&(e+="g"),t=new RegExp(t.source,e)}const i=this._editor.getModel(),n=i.getValue(1),o=i.getFullModelRange(),s=this._getReplacePattern();let r;const a=this._state.preserveCase;r=s.hasReplacementPatterns||a?n.replace(t,function(){return s.buildReplaceString(arguments,a)}):n.replace(t,s.buildReplaceString(null,a));const l=new Pr(o,r,this._editor.getSelection());this._executeEditorCommand("replaceAll",l)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let s=0,r=i.length;s<r;s++)n[s]=t.buildReplaceString(i[s].matches,this._state.preserveCase);const o=new zB(this._editor.getSelection(),i.map(e=>e.range),n);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let t=this._findMatches(e,!1,1073741824).map(e=>new fr(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn));const i=this._editor.getSelection();for(let n=0,o=t.length;n<o;n++)if(t[n].equalsRange(i)){t=[i].concat(t.slice(0,n)).concat(t.slice(n+1));break}this._editor.setSelections(t)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}},oV=Vae(2,"Match Case"),sV=Vae(3,"Match Whole Word"),rV=Vae(4,"Use Regular Expression"),aV=class extends PB{constructor(e){super({icon:go.caseSensitive,title:oV+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}},lV=class extends PB{constructor(e){super({icon:go.wholeWord,title:sV+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}},dV=class extends PB{constructor(e){super({icon:go.regex,title:rV+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}},cV=class{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}},hV=class{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}},uV=class{constructor(e=new Set,t=10){this._history=e,this._limit=t,this._onChange(),this._history.onDidChange&&(this._disposable=this._history.onDidChange(()=>this._onChange()))}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return null===this._navigator.current()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new hV(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;if(e.length>this._limit){const t=e.slice(e.length-this._limit);this._history.replace?this._history.replace(t):this._history=new Set(t)}}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0)}},gV=Ahe,pV=class extends mm{get onDidChange(){return this._onDidChange.event}get onDidHeightChange(){return this._onDidHeightChange.event}constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this.hover=this._register(new Ne),this._onDidChange=this._register(new je),this._onDidHeightChange=this._register(new je),this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Mhe(e,gV(".monaco-inputbox.idle"));const n=this.options.flexibleHeight?"textarea":"input",o=Mhe(this.element,gV(".ibwrapper"));if(this.input=Mhe(o,gV(n+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Mhe(o,gV("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Em(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Mhe(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(e=>this.input.scrollTop=e.scrollTop));const t=this._register(new zm(e.ownerDocument,"selectionchange")),i=Be.filter(t.event,()=>e.ownerDocument.getSelection()?.anchorNode===o);this._register(i(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new NE(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover.value||(this.hover.value=this._register(Bve().setupDelayedHoverAtMouse(this.input,()=>({content:this.tooltip,appearance:{compact:!0}}))))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:ghe(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return whe(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;return null===e?null:{start:e,end:this.input.selectionEnd??e}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if("open"===this.state&&Uue(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${Z_e(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=che(this.element)+"px";let i;this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:i=>{if(!this.message)return null;e=Mhe(i,gV(".monaco-inputbox-container")),t();const n=gV("span.monaco-inputbox-message");this.message.formatContent?kCe(this.message.content,void 0,n):function(e,t,i){const n=i??document.createElement("div");n.textContent=e}(this.message.content,0,n),n.classList.add(this.classForType(this.message.type));const o=this.stylesForType(this.message.type);return n.style.backgroundColor=o.background??"",n.style.color=o.foreground??"",n.style.border=o.border?`1px solid ${o.border}`:"",Mhe(e,n),null},onHide:()=>{this.state="closed"},layout:t}),i=3===this.message.type?Vae(9,"Error: {0}",this.message.content):2===this.message.type?Vae(10,"Warning: {0}",this.message.content):Vae(11,"Info: {0}",this.message.content),Qhe(i),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",n=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${Z_e(n,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=ghe(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,o=t.value;null!==i&&null!==n&&(this.value=o.substr(0,i)+e+o.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}},mV=class extends pV{constructor(e,t,i){const n=Vae(12," or {0} for history","⇅"),o=Vae(13," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new je),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new je),this.onDidBlur=this._onDidBlur.event,this.history=this._register(new uV(i.history,100));const s=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?n:o,t=this.placeholder+e;i.showPlaceholderOnFocus&&!whe(this.input)?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver((e,t)=>{e.forEach(e=>{e.target.textContent||s()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>s()),this.onblur(this.input,()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(o)||e(n)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Xhe(this.value?this.value:Vae(14,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Xhe(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}},fV=Vae(1,"input"),_V=class extends mm{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onMouseDown(){return this._onMouseDown.event}get onCaseSensitiveKeyDown(){return this._onCaseSensitiveKeyDown.event}get onRegexKeyDown(){return this._onRegexKeyDown.event}constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Ne),this.additionalToggles=[],this._onDidOptionChange=this._register(new je),this._onKeyDown=this._register(new je),this._onMouseDown=this._register(new je),this._onInput=this._register(new je),this._onKeyUp=this._register(new je),this._onCaseSensitiveKeyDown=this._register(new je),this._onRegexKeyDown=this._register(new je),this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||fV,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",s=i.appendRegexLabel||"",r=!!i.flexibleHeight,a=!!i.flexibleWidth,l=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new mV(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},showHistoryHint:i.showHistoryHint,flexibleHeight:r,flexibleWidth:a,flexibleMaxHeight:l,inputBoxStyles:i.inputBoxStyles,history:i.history})),this.showCommonFindToggles){const e=i?.hoverLifecycleOptions||{groupId:"find-input"};this.regex=this._register(new dV({appendTitle:s,isChecked:!1,hoverLifecycleOptions:e,...i.toggleStyles})),this._register(this.regex.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(e=>{this._onRegexKeyDown.fire(e)})),this.wholeWords=this._register(new lV({appendTitle:o,isChecked:!1,hoverLifecycleOptions:e,...i.toggleStyles})),this._register(this.wholeWords.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new aV({appendTitle:n,isChecked:!1,hoverLifecycleOptions:e,...i.toggleStyles})),this._register(this.caseSensitive.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(e=>{this._onCaseSensitiveKeyDown.fire(e)}));const t=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){const i=t.indexOf(this.domNode.ownerDocument.activeElement);if(i>=0){let n=-1;e.equals(17)?n=(i+1)%t.length:e.equals(15)&&(n=0===i?t.length-1:i-1),e.equals(9)?(t[i].blur(),this.inputBox.focus()):n>=0&&t[n].focus(),An.stop(e,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(ehe(this.inputBox.inputElement,"compositionstart",e=>{this.imeSessionInProgress=!0})),this._register(ehe(this.inputBox.inputElement,"compositionend",e=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,e=>this._onKeyDown.fire(e)),this.onkeyup(this.inputBox.inputElement,e=>this._onKeyUp.fire(e)),this.oninput(this.inputBox.inputElement,e=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,e=>this._onMouseDown.fire(e))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex?.enable(),this.wholeWords?.enable(),this.caseSensitive?.enable();for(const e of this.additionalToggles)e.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex?.disable(),this.wholeWords?.disable(),this.caseSensitive?.disable();for(const e of this.additionalToggles)e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new De;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){this.inputBox.paddingRight=e?0:(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce((e,t)=>e+t.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){this.caseSensitive?.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}},bV=Vae(5,"input"),vV=Vae(6,"Preserve Case"),wV=class extends PB{constructor(e){super({icon:go.preserveCase,title:vV+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}},CV=class extends mm{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onPreserveCaseKeyDown(){return this._onPreserveCaseKeyDown.event}constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new je),this._onKeyDown=this._register(new je),this._onMouseDown=this._register(new je),this._onInput=this._register(new je),this._onKeyUp=this._register(new je),this._onPreserveCaseKeyDown=this._register(new je),this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||bV;const o=n.appendPreserveCaseLabel||"",s=n.history||new Set([]),r=!!n.flexibleHeight,a=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new mV(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:n.showHistoryHint,flexibleHeight:r,flexibleWidth:a,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new wV({appendTitle:o,isChecked:!1,hoverLifecycleOptions:n.hoverLifecycleOptions,...n.toggleStyles})),this._register(this.preserveCase.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(e=>{this._onPreserveCaseKeyDown.fire(e)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){const t=d.indexOf(this.domNode.ownerDocument.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%d.length:e.equals(15)&&(i=0===t?d.length-1:t-1),e.equals(9)?(d[t].blur(),this.inputBox.focus()):i>=0&&d[i].focus(),An.stop(e,!0)}}});const c=document.createElement("div");c.className="controls",c.style.display=this._showOptionButtons?"block":"none",c.appendChild(this.preserveCase.domNode),this.domNode.appendChild(c),e?.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,e=>this._onKeyDown.fire(e)),this.onkeyup(this.inputBox.inputElement,e=>this._onKeyUp.fire(e)),this.oninput(this.inputBox.inputElement,e=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,e=>this._onMouseDown.fire(e))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){this.inputBox?.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}},yV=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},SV=function(e,t){return function(i,n){t(i,n,e)}},xV=new Jo("suggestWidgetVisible",!1,Vae(1698,"Whether suggestion are visible")),kV="historyNavigationWidgetFocus",LV="historyNavigationForwardsEnabled",DV="historyNavigationBackwardsEnabled",IV=void 0,NV=[],EV=class extends _V{constructor(e,t,i,n){super(e,t,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(NCe(o,this.inputBox))}},EV=yV([SV(3,es)],EV),MV=class extends CV{constructor(e,t,i,n,o=!1){super(e,t,o,i);const s=this._register(n.createScoped(this.inputBox.element));this._register(NCe(s,this.inputBox))}},MV=yV([SV(3,es)],MV),ns.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Po.and(Po.has(kV),Po.equals(DV,!0),Po.not("isComposing"),xV.isEqualTo(!1)),primary:16,secondary:[528],handler:e=>{IV?.showPreviousValue()}}),ns.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Po.and(Po.has(kV),Po.equals(LV,!0),Po.not("isComposing"),xV.isEqualTo(!1)),primary:18,secondary:[530],handler:e=>{IV?.showNextValue()}}),TV=rwe("find-collapsed",go.chevronRight,Vae(956,"Icon to indicate that the editor find widget is collapsed.")),RV=rwe("find-expanded",go.chevronDown,Vae(957,"Icon to indicate that the editor find widget is expanded.")),OV=rwe("find-selection",go.selection,Vae(958,"Icon for 'Find in Selection' in the editor find widget.")),AV=rwe("find-replace",go.replace,Vae(959,"Icon for 'Replace' in the editor find widget.")),PV=rwe("find-replace-all",go.replaceAll,Vae(960,"Icon for 'Replace All' in the editor find widget.")),FV=rwe("find-previous-match",go.arrowUp,Vae(961,"Icon for 'Find Previous' in the editor find widget.")),WV=rwe("find-next-match",go.arrowDown,Vae(962,"Icon for 'Find Next' in the editor find widget.")),BV=Vae(963,"Find / Replace"),VV=Vae(964,"Find"),HV=Vae(965,"Find"),zV=Vae(966,"Previous Match"),UV=Vae(967,"Next Match"),KV=Vae(968,"Find in Selection"),qV=Vae(969,"Close"),jV=Vae(970,"Replace"),$V=Vae(971,"Replace"),GV=Vae(972,"Replace"),ZV=Vae(973,"Replace All"),YV=Vae(974,"Toggle Replace"),QV=Vae(975,"Only the first {0} results are highlighted, but all find operations work on the entire text.",19999),XV=Vae(976,"{0} of {1}"),JV=Vae(977,"No results"),eH=419,tH=69,iH=F?256:2048,nH=class{constructor(e){this.afterLineNumber=e,this.heightInPx=33,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}},oH=class e extends mm{constructor(e,t,i,n,o,s,r,a,l){super(),this._hoverService=r,this._findWidgetSearchHistory=a,this._replaceWidgetHistory=l,this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=n,this._keybindingService=o,this._contextKeyService=s,this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new ht(500),this._register(Dle(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(e=>this._onStateChanged(e))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(e=>{if(e.hasChanged(104)&&(this._codeEditor.getOption(104)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),e.hasChanged(165)&&this._tryUpdateWidgetWidth(),e.hasChanged(2)&&this.updateAccessibilitySupport(),e.hasChanged(50)){const e=this._codeEditor.getOption(50).loop;this._state.change({loop:e},!1);const t=this._codeEditor.getOption(50).addExtraSpaceOnTop;t&&!this._viewZone&&(this._viewZone=new nH(0),this._showViewZone()),!t&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const e=await this._controller.getGlobalBufferTerm();e&&e!==this._state.searchString&&(this._state.change({searchString:e},!1),this._findInput.select())}})),this._findInputFocused=ZB.bindTo(s),this._findFocusTracker=this._register(Ehe(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=YB.bindTo(s),this._replaceFocusTracker=this._register(Ehe(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(50).addExtraSpaceOnTop&&(this._viewZone=new nH(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(e=>{e.scrollTopChanged?this._layoutViewZone():setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return e.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?this._codeEditor.getOption(104)||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=che(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const e=this._state.searchString.length>0&&0===this._state.matchesCount;this._domNode.classList.toggle("no-results",e),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,$ae)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){let e;if(this._matchesCount.style.minWidth=tH+"px",this._state.matchesCount>=19999?this._matchesCount.title=QV:this._matchesCount.title="",this._matchesCount.firstChild?.remove(),this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=19999&&(t+="+");let i=String(this._state.matchesPosition);"0"===i&&(i="?"),e=Fle(XV,i,t)}else e=JV;this._matchesCount.appendChild(document.createTextNode(e)),Qhe(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),tH=Math.max(tH,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===JV)return""===i?Vae(978,"{0} found",e):Vae(979,"{0} found for '{1}'",e,i);if(t){const n=Vae(980,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${n}`:n}return Vae(981,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(104);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(50).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const t=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=t;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(50).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=lhe(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=n.left+(o?o.left:0),r=o?o.top:0;if(this._viewZone&&r<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const i=ahe(this._domNode).left;s>i&&(t=!1);const o=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(o?o.left:0)>i&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(50).addExtraSpaceOnTop)return void this._removeViewZone();if(!this._isVisible)return;const t=this._viewZone;void 0===this._viewZoneId&&t&&this._codeEditor.changeViewZones(i=>{t.heightInPx=this._getHeight(),this._viewZoneId=i.addZone(t),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+t.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible)return;if(!this._codeEditor.getOption(50).addExtraSpaceOnTop)return;void 0===this._viewZone&&(this._viewZone=new nH(0));const t=this._viewZone;this._codeEditor.changeViewZones(i=>{if(void 0!==this._viewZoneId){const n=this._getHeight();if(n===t.heightInPx)return;const o=n-t.heightInPx;return t.heightInPx=n,i.layoutZone(this._viewZoneId),void(e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o))}{let n=this._getHeight();if(n-=this._codeEditor.getOption(96).top,n<=0)return;t.heightInPx=n,this._viewZoneId=i.addZone(t),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+n)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{void 0!==this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible)return;if(!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0)return void this._domNode.classList.add("hiddenEditor");this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const t=e.width,i=e.minimap.minimapWidth;let n=!1,o=!1,s=!1;if(this._resized&&che(this._domNode)>eH)return this._domNode.style.maxWidth=t-28-i-15+"px",void(this._replaceInput.width=che(this._findInput.domNode));if(447+i>=t&&(o=!0),447+i-tH>=t&&(s=!0),447+i-tH>=t+50&&(n=!0),this._domNode.classList.toggle("collapsed-find-widget",n),this._domNode.classList.toggle("narrow-find-widget",s),this._domNode.classList.toggle("reduced-find-widget",o),s||n||(this._domNode.style.maxWidth=t-28-i-15+"px"),this._findInput.layout({collapsedFindWidget:n,narrowFindWidget:s,reducedFindWidget:o}),this._resized){const e=this._findInput.inputBox.element.clientWidth;e>0&&(this._replaceInput.width=e)}else this._isReplaceVisible&&(this._replaceInput.width=che(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return(null===this._cachedHeight||this._cachedHeight!==e)&&(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(e=>{1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));const t=this._state.currentMatch;return e.startLineNumber===e.endLineNumber||mr.equalsRange(e,t)?null:e}).filter(e=>!!e),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){return e.equals(3|iH)?(this._keybindingService.dispatchEvent(e,e.target)||this._findInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?MCe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?TCe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0}_onReplaceInputKeyDown(e){return e.equals(3|iH)?(this._keybindingService.dispatchEvent(e,e.target)||this._replaceInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?MCe(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?TCe(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){const e=!0,t=!0,i=this._codeEditor.getOption(50).history,n=this._codeEditor.getOption(50).replaceHistory;this._findInput=this._register(new EV(null,this._contextViewProvider,{width:221,label:VV,placeholder:HV,appendCaseSensitiveLabel:this._keybindingLabelFor(iV.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(iV.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(iV.ToggleRegexCommand),validation:e=>{if(0===e.length||!this._findInput.getRegex())return null;try{return new RegExp(e,"gu"),null}catch(Fae){return{content:Fae.message}}},flexibleHeight:e,flexibleWidth:t,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>ECe(this._keybindingService),inputBoxStyles:dR,toggleStyles:aR,history:"workspace"===i?this._findWidgetSearchHistory:new Set([])},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(e=>{e.equals(3)&&!this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0),this._onFindInputKeyDown(e)})),this._register(this._findInput.inputBox.onDidChange(()=>{!this._ignoreChangeEvent&&this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(e=>{e.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),e.preventDefault())})),this._register(this._findInput.onRegexKeyDown(e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),e.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(e=>{this._tryUpdateHeight()&&this._showViewZone()})),W&&this._register(this._findInput.onMouseDown(e=>this._onFindInputMouseDown(e))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const o={groupId:"find-widget"};this._prevBtn=this._register(new sH({label:zV+this._keybindingLabelFor(iV.PreviousMatchFindAction),icon:FV,hoverLifecycleOptions:o,onTrigger:()=>{mle(this._codeEditor.getAction(iV.PreviousMatchFindAction)).run().then(void 0,$ae)}},this._hoverService)),this._nextBtn=this._register(new sH({label:UV+this._keybindingLabelFor(iV.NextMatchFindAction),icon:WV,hoverLifecycleOptions:o,onTrigger:()=>{mle(this._codeEditor.getAction(iV.NextMatchFindAction)).run().then(void 0,$ae)}},this._hoverService));const s=document.createElement("div");s.className="find-part",s.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",s.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new PB({icon:OV,title:KV+this._keybindingLabelFor(iV.ToggleSearchScopeCommand),isChecked:!1,hoverLifecycleOptions:o,inputActiveOptionBackground:gpe(Wu),inputActiveOptionBorder:gpe(Pu),inputActiveOptionForeground:gpe(Bu)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let e=this._codeEditor.getSelections();e=e.map(e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e)).filter(e=>!!e),e.length&&this._state.change({searchScope:e},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new sH({label:qV+this._keybindingLabelFor(iV.CloseFindWidgetCommand),icon:QE,hoverLifecycleOptions:o,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),e.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new MV(null,void 0,{label:jV,placeholder:$V,appendPreserveCaseLabel:this._keybindingLabelFor(iV.TogglePreserveCaseCommand),history:"workspace"===n?this._replaceWidgetHistory:new Set([]),flexibleHeight:e,flexibleWidth:t,flexibleMaxHeight:118,showHistoryHint:()=>ECe(this._keybindingService),inputBoxStyles:dR,toggleStyles:aR,hoverLifecycleOptions:o},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(e=>this._onReplaceInputKeyDown(e))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(e=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(e=>{e.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),e.preventDefault())})),this._replaceBtn=this._register(new sH({label:GV+this._keybindingLabelFor(iV.ReplaceOneAction),icon:AV,hoverLifecycleOptions:o,onTrigger:()=>{this._controller.replace()},onKeyDown:e=>{e.equals(1026)&&(this._closeBtn.focus(),e.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new sH({label:ZV+this._keybindingLabelFor(iV.ReplaceAllAction),icon:PV,hoverLifecycleOptions:o,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const a=document.createElement("div");a.className="replace-part",a.appendChild(this._replaceInput.domNode);const l=document.createElement("div");l.className="replace-actions",a.appendChild(l),l.appendChild(this._replaceBtn.domNode),l.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new sH({label:YV,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=che(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=BV,this._domNode.role="dialog",this._domNode.style.width="419px",this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(s),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(a),this._resizeSash=this._register(new MT(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let d=eH;this._register(this._resizeSash.onDidStart(()=>{d=che(this._domNode)})),this._register(this._resizeSash.onDidChange(e=>{this._resized=!0;const t=d+e.startX-e.currentX;t<eH||t>(parseFloat(she(this._domNode).maxWidth)||0)||(this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=che(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const e=che(this._domNode);if(e<eH)return;let t=eH;if(!this._resized||e===eH){const e=this._codeEditor.getLayoutInfo();t=e.width-28-e.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=che(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(2!==e)}getViewState(){let e=!1;return this._viewZone&&this._viewZoneId&&(e=this._viewZone.heightInPx>this._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}},oH.ID="editor.contrib.findWidget",sH=class extends mm{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+mo.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupDelayedHover(this._domNode,{content:this._opts.label,style:1},e.hoverLifecycleOptions)),this.onclick(this._domNode,e=>{this._opts.onTrigger(),e.preventDefault()}),this.onkeydown(this._domNode,e=>{if(e.equals(10)||e.equals(3))return this._opts.onTrigger(),void e.preventDefault();this._opts.onKeyDown?.(e)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...mo.asClassNameArray(TV)),this._domNode.classList.add(...mo.asClassNameArray(RV))):(this._domNode.classList.remove(...mo.asClassNameArray(RV)),this._domNode.classList.add(...mo.asClassNameArray(TV)))}},Upe((e,t)=>{const i=e.getColor(Hh);i&&t.addRule(`.monaco-editor .findMatch { border: 1px ${Npe(e.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`);const n=e.getColor(zh);n&&t.addRule(`.monaco-editor .findScope { border: 1px ${Npe(e.type)?"dashed":"solid"} ${n}; }`);const o=e.getColor(ch);o&&t.addRule(`.monaco-editor .find-widget { border: 1px solid ${o}; }`);const s=e.getColor(Wh);s&&t.addRule(`.monaco-editor .findMatchInline { color: ${s}; }`);const r=e.getColor(Vh);r&&t.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)}),rH=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},aH=function(e,t){return function(i,n){t(i,n,e)}},lH=class extends Ie{constructor(e,t,i,n){super(),this._container=e,this._getContent=t,this._clipboardService=i,this._hoverService=n,this._container.classList.add("hover-row-with-copy"),this._button=this._register(new sH({label:Vae(1128,"Copy"),icon:go.copy,onTrigger:()=>this._copyContent(),className:"hover-copy-button"},this._hoverService)),this._container.appendChild(this._button.domNode)}async _copyContent(){const e=this._getContent();e&&(await this._clipboardService.writeText(e),Xhe(Vae(1129,"Copied to clipboard")))}},lH=rH([aH(2,nT),aH(3,BR)],lH),dH=class{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}},Sue("_executeHoverProvider",(e,t,i)=>OCe(e.get(Tx).hoverProvider,t,i,it.None)),Sue("_executeHoverProvider_recursive",(e,t,i)=>OCe(e.get(Tx).hoverProvider,t,i,it.None,!0)),cH=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},hH=function(e,t){return function(i,n){t(i,n,e)}},uH=Ahe,gH=rwe("hover-increase-verbosity",go.add,Vae(1130,"Icon for increaseing hover verbosity.")),pH=rwe("hover-decrease-verbosity",go.remove,Vae(1131,"Icon for decreasing hover verbosity.")),mH=class{constructor(e,t,i,n,o,s=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=o,this.source=s}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}},fH=class{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case gb.Increase:return this.hover.canIncreaseVerbosity??!1;case gb.Decrease:return this.hover.canDecreaseVerbosity??!1}}},_H=class{constructor(e,t,i,n,o,s,r){this._editor=e,this._markdownRendererService=t,this._configurationService=i,this._languageFeaturesService=n,this._keybindingService=o,this._hoverService=s,this._commandService=r,this.hoverOrdinal=3}createLoadingMessage(e){return new mH(this,e.range,[(new pD).appendText(Vae(1132,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,o=i.getLineMaxColumn(n),s=[];let r=1e3;const a=i.getLineLength(n),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(133),c=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let h=!1;d>=0&&a>d&&e.range.startColumn>=d&&(h=!0,s.push(new mH(this,e.range,[{value:Vae(1133,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,r++))),!h&&"number"==typeof c&&a>=c&&s.push(new mH(this,e.range,[{value:Vae(1134,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,r++));let u=!1;for(const g of t){const t=g.range.startLineNumber===n?g.range.startColumn:1,i=g.range.endLineNumber===n?g.range.endColumn:o,a=g.options.hoverMessage;if(!a||Vbe(a))continue;g.options.beforeContentClassName&&(u=!0);const l=new mr(e.range.startLineNumber,t,e.range.startLineNumber,i);s.push(new mH(this,l,gce(a),u,r++))}return s}computeAsync(e,t,i,n){if(!this._editor.hasModel()||1!==e.type)return xt.EMPTY;const o=this._editor.getModel(),s=this._languageFeaturesService.hoverProvider;return s.has(o)?this._getMarkdownHovers(s,o,e,n):xt.EMPTY}async*_getMarkdownHovers(e,t,i,n){const o=i.range.getStartPosition(),s=RCe(e,t,o,n);for await(const r of s)if(!Vbe(r.hover.contents)){const e=r.hover.range?mr.lift(r.hover.range):i.range,t=new fH(r.hover,r.provider,o);yield new mH(this,e,r.hover.contents,!1,r.ordinal,t)}}renderHoverParts(e,t){return this._renderedHoverParts=new vH(t,e.fragment,this,this._editor,this._commandService,this._keybindingService,this._hoverService,this._configurationService,this._markdownRendererService,e.onContentsChanged),this._renderedHoverParts}handleScroll(e){this._renderedHoverParts?.handleScroll(e)}getAccessibleContent(e){return this._renderedHoverParts?.getAccessibleContent(e)??""}updateMarkdownHoverVerbosityLevel(e,t){return Promise.resolve(this._renderedHoverParts?.updateMarkdownHoverPartVerbosityLevel(e,t))}},_H=cH([hH(1,LA),hH(2,ka),hH(3,Tx),hH(4,xw),hH(5,BR),hH(6,fo)],_H),bH=class{constructor(e,t,i,n){this.hoverPart=e,this.hoverElement=t,this.disposables=i,this.actionsContainer=n}dispose(){this.disposables.dispose()}},vH=class{constructor(e,t,i,n,o,s,r,a,l,d){this._hoverParticipant=i,this._editor=n,this._commandService=o,this._keybindingService=s,this._hoverService=r,this._configurationService=a,this._markdownRendererService=l,this._onFinishedRendering=d,this._ongoingHoverOperations=new Map,this._disposables=new De,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(Dle(()=>{this.renderedHoverParts.forEach(e=>{e.dispose()}),this._ongoingHoverOperations.forEach(e=>{e.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(fce(e=>e.ordinal,Oi)),e.map(e=>{const n=this._renderHoverPart(e,i);return t.appendChild(n.hoverElement),n})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),n=i.hoverElement,o=e.source,s=new De;if(s.add(i),!o)return new bH(e,n,s);const r=o.supportsVerbosityAction(gb.Increase),a=o.supportsVerbosityAction(gb.Decrease);if(!r&&!a)return new bH(e,n,s);const l=uH("div.verbosity-actions");n.prepend(l);const d=uH("div.verbosity-actions-inner");return l.append(d),s.add(this._renderHoverExpansionAction(d,gb.Increase,r)),s.add(this._renderHoverExpansionAction(d,gb.Decrease,a)),new bH(e,n,s,d)}_renderMarkdownHover(e,t){return ACe(this._editor,e,this._markdownRendererService,t)}_renderHoverExpansionAction(e,t,i){const n=new De,o=t===gb.Increase,s=Mhe(e,uH(mo.asCSSSelector(o?gH:pH)));s.tabIndex=0;const r=new VR("mouse",void 0,{target:e,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(n.add(this._hoverService.setupManagedHover(r,s,function(e,t){switch(t){case gb.Increase:{const t=e.lookupKeybinding($W);return t?Vae(1135,"Increase Hover Verbosity ({0})",t.getLabel()):Vae(1136,"Increase Hover Verbosity")}case gb.Decrease:{const t=e.lookupKeybinding(ZW);return t?Vae(1137,"Decrease Hover Verbosity ({0})",t.getLabel()):Vae(1138,"Decrease Hover Verbosity")}}}(this._keybindingService,t))),!i)return s.classList.add("disabled"),n;s.classList.add("enabled");const a=()=>this._commandService.executeCommand(t===gb.Increase?$W:ZW,{focus:!0});return n.add(new CB(s,a)),n.add(new yB(s,a,[3,10])),n}handleScroll(e){this.renderedHoverParts.forEach(t=>{const i=t.actionsContainer;if(!i)return;const n=t.hoverElement,o=e.scrollTop+e.height,s=n.offsetTop,r=n.clientHeight;let a;a=s+r<=o||s>=o?r-22:o-s-22,i.style.top=`${a}px`})}async updateMarkdownHoverPartVerbosityLevel(e,t){const i=this._editor.getModel();if(!i)return;const n=this._getRenderedHoverPartAtIndex(t),o=n?.hoverPart.source;if(!n||!o?.supportsVerbosityAction(e))return;const s=await this._fetchHover(o,i,e);if(!s)return;const r=new fH(s,o.hoverProvider,o.hoverPosition),a=n.hoverPart,l=new mH(this._hoverParticipant,a.range,s.contents,a.isBeforeContent,a.ordinal,r),d=this._updateRenderedHoverPart(t,l);return d?{hoverPart:l,hoverElement:d.hoverElement}:void 0}getAccessibleContent(e){const t=this.renderedHoverParts.findIndex(t=>t.hoverPart===e);if(-1===t)return;const i=this._getRenderedHoverPartAtIndex(t);return i?i.hoverElement.innerText.replace(/[^\S\n\r]+/gu," "):void 0}async _fetchHover(e,t,i){let n=i===gb.Increase?1:-1;const o=e.hoverProvider,s=this._ongoingHoverOperations.get(o);s&&(s.tokenSource.cancel(),n+=s.verbosityDelta);const r=new ot;this._ongoingHoverOperations.set(o,{verbosityDelta:n,tokenSource:r});const a={verbosityRequest:{verbosityDelta:n,previousHover:e.hover}};let l;try{l=await Promise.resolve(o.provideHover(t,e.hoverPosition,r.token,a))}catch(Fae){Gae(Fae)}return r.dispose(),this._ongoingHoverOperations.delete(o),l}_updateRenderedHoverPart(e,t){if(e>=this.renderedHoverParts.length||e<0)return;const i=this._renderHoverPart(t,this._onFinishedRendering),n=this.renderedHoverParts[e],o=n.hoverElement,s=i.hoverElement,r=Array.from(s.children);o.replaceChildren(...r);const a=new bH(t,o,i.disposables,i.actionsContainer);return n.dispose(),this.renderedHoverParts[e]=a,a}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}},wH=Ahe,CH=class extends Ie{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new je,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new je,this.onColorFlushed=this._onColorFlushed.event,this._domNode=wH(".saturation-wrap"),Mhe(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Mhe(this._domNode,this._canvas),this.selection=wH(".saturation-selection"),Mhe(this._domNode,this.selection),this.layout(),this._register(ehe(this._domNode,On.POINTER_DOWN,e=>this.onPointerDown(e))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!(e.target&&e.target instanceof Element))return;this.monitor=this._register(new Zc);const t=lhe(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>this.onDidChangePosition(e.pageX-t.left,e.pageY-t.top),()=>null);const i=ehe(e.target.ownerDocument,On.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),n=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,n),this._onDidChange.fire({s:i,v:n})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new eh(new Jc(e.h,1,1,1)),i=this._canvas.getContext("2d"),n=i.createLinearGradient(0,0,this._canvas.width,0);n.addColorStop(0,"rgba(255, 255, 255, 1)"),n.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),n.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=eh.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=e*this.width+"px",this.selection.style.top=this.height-t*this.height+"px"}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}},yH=class extends Ie{constructor(e){super(),this._onClicked=this._register(new je),this.onClicked=this._onClicked.event,this._button=Mhe(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(ehe(this._button,On.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}},SH=Ahe,xH=class extends Ie{constructor(e,t,i){super(),this.model=t,this._onDidChange=new je,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new je,this.onColorFlushed=this._onColorFlushed.event,"standalone"===i?(this.domNode=Mhe(e,SH(".standalone-strip")),this.overlay=Mhe(this.domNode,SH(".standalone-overlay"))):(this.domNode=Mhe(e,SH(".strip")),this.overlay=Mhe(this.domNode,SH(".overlay"))),this.slider=Mhe(this.domNode,SH(".slider")),this.slider.style.top="0px",this._register(ehe(this.domNode,On.POINTER_DOWN,e=>this.onPointerDown(e))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!(e.target&&e.target instanceof Element))return;const t=this._register(new Zc),i=lhe(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,e=>this.onDidChangeTop(e.pageY-i.top),()=>null);const n=ehe(e.target.ownerDocument,On.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=(1-e)*this.height+"px"}},kH=class extends xH{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:n}=e.rgba,o=new eh(new Qc(t,i,n,1)),s=new eh(new Qc(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}},LH=class extends xH{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}},DH=Ahe,IH=class extends Ie{constructor(e,t,i,n){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=DH(".colorpicker-body"),Mhe(e,this._domNode),this._saturationBox=new CH(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new kH(this._domNode,this.model,n),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new LH(this._domNode,this.model,n),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),"standalone"===n&&(this._insertButton=this._register(new yH(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new eh(new Jc(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new eh(new Jc(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=360*(1-e);this.model.color=new eh(new Jc(360===i?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}},NH=Ahe,EH=class extends Ie{constructor(e){super(),this._onClicked=this._register(new je),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Mhe(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Mhe(this._button,t),Mhe(t,NH(".button"+mo.asCSSSelector(rwe("color-picker-close",go.close,Vae(885,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(ehe(this._button,On.CLICK,()=>{this._onClicked.fire()}))}},MH=Ahe,TH=class extends Ie{constructor(e,t,i,n){super(),this.model=t,this.type=n,this._closeButton=null,this._domNode=MH(".colorpicker-header"),Mhe(e,this._domNode),this._pickedColorNode=Mhe(this._domNode,MH(".picked-color")),Mhe(this._pickedColorNode,MH("span.codicon.codicon-color-mode")),this._pickedColorPresentation=Mhe(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const o=Vae(886,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",o),this._originalColorNode=Mhe(this._domNode,MH(".original-color")),this._originalColorNode.style.backgroundColor=eh.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(Uh)||eh.white,this._register(i.onDidColorThemeChange(e=>{this.backgroundColor=e.getColor(Uh)||eh.white})),this._register(ehe(this._pickedColorNode,On.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ehe(this._originalColorNode,On.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=eh.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),"standalone"===this.type&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new EH(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=eh.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}},RH=Ahe,OH=class extends mm{constructor(e,t,i,n,o){super(),this.model=t,this.pixelRatio=i,this._register(hd.getInstance(pn(e)).onDidChange(()=>this.layout())),this._domNode=RH(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new TH(this._domNode,this.model,n,o)),this.body=this._register(new IH(this._domNode,this.model,this.pixelRatio,o))}layout(){this.body.layout()}get domNode(){return this._domNode}},AH=class{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new je,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new je,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new je,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let n=0;n<this.colorPresentations.length;n++)if(t.toLowerCase()===this.colorPresentations[n].label){i=n;break}if(-1===i){const e=t.split("(")[0].toLowerCase();for(let t=0;t<this.colorPresentations.length;t++)if(this.colorPresentations[t].label.toLowerCase().startsWith(e)){i=t;break}}-1!==i&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}},PH=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},FH=function(e,t){return function(i,n){t(i,n,e)}},WH=class e{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}static fromBaseColor(t,i){return new e(t,i.range,i.model,i.provider)}},BH=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t,i){return[]}computeAsync(e,t,i,n){return xt.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];if(!this._isValidRequest(i))return[];const n=qW.get(this._editor);if(!n)return[];for(const o of t){if(!n.isColorDecoration(o))continue;const e=n.getColorData(o.range.getStartPosition());if(e)return[WH.fromBaseColor(this,await PCe(this._editor.getModel(),e.colorInfo,e.provider))]}return[]}_isValidRequest(e){const t=this._editor.getOption(168);switch(e){case 0:return"hover"===t||"clickAndHover"===t;case 1:return"click"===t||"clickAndHover"===t;case 2:return!0}}renderHoverParts(e,t){const i=this._editor;if(0===t.length||!i.hasModel())return new MW([]);const n=i.getOption(75)+8;e.setMinimumDimensions(new Tn(302,n));const o=new De,s=t[0],r=i.getModel(),a=s.model;this._colorPicker=o.add(new OH(e.fragment,a,i.getOption(163),this._themeService,"hover"));let l=!1,d=new mr(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);return o.add(a.onColorFlushed(async e=>{await WCe(r,a,e,d,s),l=!0,d=FCe(i,d,a)})),o.add(a.onDidChangeColor(e=>{WCe(r,a,e,d,s)})),o.add(i.onDidChangeModelContent(t=>{l?l=!1:(e.hide(),i.focus())})),new MW([{hoverPart:WH.fromBaseColor(this,s),hoverElement:this._colorPicker.domNode,dispose(){o.dispose()}}])}getAccessibleContent(e){return Vae(887,"There is a color picker here.")}handleResize(){this._colorPicker?.layout()}handleContentsChanged(){this._colorPicker?.layout()}handleHide(){this._colorPicker?.dispose(),this._colorPicker=void 0}isColorPickerVisible(){return!!this._colorPicker}},BH=PH([FH(1,Sf)],BH),VH=class{static insert(e,t){return{range:new mr(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}},HH=class{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.mouseMiddleClickAction=t.mouseMiddleClickAction,this.hasTriggerModifier=BCe(e.event,t.triggerModifier),this.isMiddleClick&&"ctrlLeftClick"===t.mouseMiddleClickAction&&(this.isMiddleClick=!1,this.isLeftClick=!0,this.hasTriggerModifier=!0),this.hasSideBySideModifier=BCe(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}},zH=class{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=BCe(e,t.triggerModifier)}},UH=class{constructor(e,t,i,n,o){this.mouseMiddleClickAction=o,this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=n}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier&&this.mouseMiddleClickAction===e.mouseMiddleClickAction}},KH=class extends Ie{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new je),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new je),this.onExecute=this._onExecute.event,this._onCancel=this._register(new je),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=t?.extractLineNumberFromMouseEvent??(e=>e.target.position?e.target.position.lineNumber:0),this._opts=VCe(this._editor.getOption(86),this._editor.getOption(87)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(e=>{if(e.hasChanged(86)||e.hasChanged(87)){const e=VCe(this._editor.getOption(86),this._editor.getOption(87));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(e=>this._onEditorMouseMove(new HH(e,this._opts)))),this._register(this._editor.onMouseDown(e=>this._onEditorMouseDown(new HH(e,this._opts)))),this._register(this._editor.onMouseUp(e=>this._onEditorMouseUp(new HH(e,this._opts)))),this._register(this._editor.onKeyDown(e=>this._onEditorKeyDown(new zH(e,this._opts)))),this._register(this._editor.onKeyUp(e=>this._onEditorKeyUp(new zH(e,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(e=>this._onDidChangeCursorSelection(e))),this._register(this._editor.onDidChangeModel(e=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(e=>{(e.scrollTopChanged||e.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&(this._hasTriggerKeyOnMouseDown||e.isMiddleClick&&"openLink"===e.mouseMiddleClickAction)&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}},qH=class{constructor(e,t){this.range=e,this.direction=t}},jH=class e{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(t){const i=new e(this.hint,t.anchor,this.provider);return i._isResolved=this._isResolved,i._currentResolve=this._currentResolve,i}async resolve(e){if("function"==typeof this.provider.resolveInlayHint){if(this._currentResolve){if(await this._currentResolve,e.isCancellationRequested)return;return this.resolve(e)}this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=t?.tooltip??this.hint.tooltip,this.hint.label=t?.label??this.hint.label,this.hint.textEdits=t?.textEdits??this.hint.textEdits,this._isResolved=!0}catch(t){Gae(t),this._isResolved=!1}}},$H=class e{static async create(t,i,n,o){const s=[],r=t.ordered(i).reverse().map(t=>n.map(async n=>{try{const r=await t.provideInlayHints(i,n,o);(r?.hints.length||t.onDidChangeInlayHints)&&s.push([r??e._emptyInlayHintList,t])}catch(r){Gae(r)}}));if(await Promise.all(r.flat()),o.isCancellationRequested||i.isDisposed())throw new v;return new e(n,s,i)}constructor(t,i,n){this._disposables=new De,this.ranges=t,this.provider=new Set;const o=[];for(const[s,r]of i){this._disposables.add(s),this.provider.add(r);for(const t of s.hints){const i=n.validatePosition(t.position);let s="before";const a=e._getRangeAtPosition(n,i);let l;a.getStartPosition().isBefore(i)?(l=mr.fromPositions(a.getStartPosition(),i),s="after"):(l=mr.fromPositions(i,a.getEndPosition()),s="before"),o.push(new jH(t,new qH(l,s),r))}}this.items=o.sort((e,t)=>to.compare(e.hint.position,t.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new mr(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),s=t.column-1,r=o.findTokenIndexAtOffset(s);let a=o.getStartOffset(r),l=o.getEndOffset(r);return l-a===1&&(a===s&&r>1?(a=o.getStartOffset(r-1),l=o.getEndOffset(r-1)):l===s&&r<o.getCount()-1&&(a=o.getStartOffset(r+1),l=o.getEndOffset(r+1))),new mr(i,a+1,i,l+1)}},$H._emptyInlayHintList=Object.freeze({dispose(){},hints:[]}),GH=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ZH=function(e,t){return function(i,n){t(i,n,e)}},YH=class extends pL{constructor(e,t,i,n,o,s,r,a,l,d,c,h,u){super(e,{...n.getRawOptions(),overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()},i,o,s,r,a,l,d,c,h,u),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration(e=>this._onParentConfigurationChanged(e)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){zue(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}},YH=GH([ZH(4,Jn),ZH(5,eo),ZH(6,fo),ZH(7,es),ZH(8,Sf),ZH(9,Xv),ZH(10,Fc),ZH(11,il),ZH(12,Tx)],YH),QH=new eh(new Qc(0,122,204)),XH={showArrow:!0,showFrame:!0,className:"",frameColor:QH,arrowColor:QH,keepEditorSelection:!1},JH=class{constructor(e,t,i,n,o,s,r,a){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=r,this.ordinal=a,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}},ez=class{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}},(tz=class e{constructor(t){this._editor=t,this._ruleName=e._IdGenerator.nextId(),this._color=null,this._height=-1,this._decorations=this._editor.createDecorationsCollection()}dispose(){this.hide(),lpe(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(){lpe(this._ruleName),ape(`.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){1===e.column&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:mr.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}})._IdGenerator=new mD(".arrow-decoration-"),iz=class{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._isSashResizeHeight=!1,this._viewZone=null,this._disposables=new De,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Bue(t),zue(this.options,XH,!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(e=>{const t=this._getWidth(e);this.domNode.style.width=t+"px",this.domNode.style.left=this._getLeft(e)+"px",this._onWidth(t)}))}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 tz(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){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const 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&&0===e.minimap.minimapLeft?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){if(this.domNode.style.height=`${e}px`,this.container){const t=e-this._decoratingElementsHeight();this.container.style.height=`${t}px`;const i=this.editor.getLayoutInfo();this._doLayout(t,this._getWidth(i))}this._resizeSash?.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=mr.isIRange(e)?mr.lift(e):mr.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Lx.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(){const e=this.editor.getOption(75);let t=0;return this.options.showArrow&&(t+=2*Math.round(e/3)),this.options.showFrame&&(t+=2*(this.options.frameWidth??Math.round(e/9))),t}_getMaximumHeightInLines(){return Math.max(12,this.editor.getLayoutInfo().height/this.editor.getOption(75)*.8)}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),o=this._getWidth(n);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(n)+"px";const s=document.createElement("div");s.style.overflow="hidden";const r=this.editor.getOption(75),a=this._getMaximumHeightInLines();void 0!==a&&(t=Math.min(t,a));let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(r/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(r/9)),this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new JH(s,i.lineNumber,i.column,t,e=>this._onViewZoneTop(e),e=>this._onViewZoneHeight(e),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=e.addZone(this._viewZone),this._overlayWidget=new ez("vs.editor.contrib.zoneWidget"+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this._updateSashEnablement(),this.container&&this.options.showFrame){const e=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=e+"px",this.container.style.borderBottomWidth=e+"px"}const c=t*r-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,o),this.options.keepEditorSelection||this.editor.setSelection(e);const h=this.editor.getModel();if(h){const t=h.validateRange(new mr(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(t,t.startLineNumber===h.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){const i=this._getMaximumHeightInLines(),n=t&&void 0!==i?Math.min(i,e):e;this._viewZone&&this._viewZone.heightInLines!==n&&(this.editor.changeViewZones(e=>{this._viewZone&&(this._viewZone.heightInLines=n,e.layoutZone(this._viewZone.id))}),this._updateSashEnablement())}_initSash(){if(this._resizeSash)return;let e;this._resizeSash=this._disposables.add(new MT(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0),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){const i=(t.currentY-e.startY)/this.editor.getOption(75),n=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+n;o>e.minLines&&o<e.maxLines&&(this._isSashResizeHeight=!0,this._relayout(o))}}))}_updateSashEnablement(){if(this._resizeSash){const{minLines:e,maxLines:t}=this._getResizeBounds();this._resizeSash.state=e===t?0:3}}_getResizeBounds(){return{minLines:5,maxLines:35}}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}},oz=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},sz=function(e,t){return function(i,n){t(i,n,e)}},dge(rz=eue("IPeekViewService"),class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const i=this._widgets.get(e);i&&(i.listener.dispose(),i.widget.dispose()),this._widgets.set(e,{widget:t,listener:t.onDidClose(()=>{const i=this._widgets.get(e);i&&i.widget===t&&(i.listener.dispose(),this._widgets.delete(e))})})}},1),function(e){e.inPeekEditor=new Jo("inReferenceSearchEditor",!0,Vae(1316,"Whether the current code editor is embedded inside peek")),e.notInPeekEditor=e.inPeekEditor.toNegated()}(az||(az={})),nz=class{constructor(e,t){e instanceof YH&&az.inPeekEditor.bindTo(t)}dispose(){}},nz.ID="editor.contrib.referenceController",lz=nz,Iue((lz=oz([sz(1,es)],lz)).ID,lz,0),dz={headerBackgroundColor:eh.white,primaryHeadingColor:eh.fromHex("#333333"),secondaryHeadingColor:eh.fromHex("#6c6c6cb3")},cz=class extends iz{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new je,this.onDidClose=this._onDidClose.event,zue(this.options,dz,!1);const n=bwe(this.editor);n.openedPeekWidgets.set(n.openedPeekWidgets.get()+1,void 0)}dispose(){if(!this.disposed){this.disposed=!0,super.dispose(),this._onDidClose.fire(this);const e=bwe(this.editor);e.openedPeekWidgets.set(e.openedPeekWidgets.get()-1,void 0)}}style(e){const 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();const 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=Ahe(".head"),this._bodyElement=Ahe(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=Ahe(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),xn(this._titleElement,"click",e=>this._onTitleClick(e))),Mhe(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=Ahe("span.filename"),this._secondaryHeading=Ahe("span.dirname"),this._metaHeading=Ahe("span.meta"),Mhe(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=Ahe(".peekview-actions");Mhe(this._headElement,i),this._actionbarWidget=new NE(i,this._getActionBarOptions()),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(this._disposables.add(new oo("peekview.close",Vae(1317,"Close"),mo.asClassName(go.close),!0,()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Nwe.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:Jce(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Phe(this._metaHeading)):Fhe(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0)return void this.dispose();const i=Math.ceil(1.2*this.editor.getOption(75)),n=Math.round(e-(i+1));this._doLayoutHead(i,t),this._doLayoutBody(n,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`)}},cz=oz([sz(2,Jn)],cz),hz=mpe("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:eh.black,hcLight:eh.white},Vae(1318,"Background color of the peek view title area.")),uz=mpe("peekViewTitleLabel.foreground",{dark:eh.white,light:eh.black,hcDark:eh.white,hcLight:Ch},Vae(1319,"Color of the peek view title.")),gz=mpe("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},Vae(1320,"Color of the peek view title info.")),pz=mpe("peekView.border",{dark:Eh,light:Eh,hcDark:ch,hcLight:ch},Vae(1321,"Color of the peek view borders and arrow.")),mz=mpe("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:eh.black,hcLight:eh.white},Vae(1322,"Background color of the peek view result list.")),mpe("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:eh.white,hcLight:Ch},Vae(1323,"Foreground color for line nodes in the peek view result list.")),mpe("peekViewResult.fileForeground",{dark:eh.white,light:"#1E1E1E",hcDark:eh.white,hcLight:Ch},Vae(1324,"Foreground color for file nodes in the peek view result list.")),mpe("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},Vae(1325,"Background color of the selected entry in the peek view result list.")),mpe("peekViewResult.selectionForeground",{dark:eh.white,light:"#6C6C6C",hcDark:eh.white,hcLight:Ch},Vae(1326,"Foreground color of the selected entry in the peek view result list.")),fz=mpe("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:eh.black,hcLight:eh.white},Vae(1327,"Background color of the peek view editor.")),mpe("peekViewEditorGutter.background",fz,Vae(1328,"Background color of the gutter in the peek view editor.")),mpe("peekViewEditorStickyScroll.background",fz,Vae(1329,"Background color of sticky scroll in the peek view editor.")),mpe("peekViewEditorStickyScrollGutter.background",fz,Vae(1330,"Background color of the gutter part of sticky scroll in the peek view editor.")),mpe("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},Vae(1331,"Match highlight color in the peek view result list.")),mpe("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},Vae(1332,"Match highlight color in the peek view editor.")),mpe("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:hh,hcLight:hh},Vae(1333,"Match highlight border in the peek view editor.")),_z=class{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Ie.None}}renderElement(e,t,i,n){if(i.disposable?.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,n);const s=new ot,r=o.resolve(e,s.token);i.disposable={dispose:()=>s.cancel()},this.renderer.renderPlaceholder(e,i.data),r.then(t=>this.renderer.renderElement(t,e,i.data,n))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}},bz=class{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}},vz=class{constructor(e,t,i,n,o={}){this.modelDisposables=new De;const s=()=>this.model;this.list=new bE(e,t,i,n.map(e=>new _z(e,s)),function(e,t){return{...t,accessibilityProvider:t.accessibilityProvider&&new bz(e,t.accessibilityProvider)}}(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return Be.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return Be.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return Be.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(e=>this._model.get(e)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this.modelDisposables.clear(),this._model=e,this.list.splice(0,this.list.length,ace(e.length)),this.modelDisposables.add(e.onDidIncrementLength(e=>this.list.splice(this.list.length,0,ace(this.list.length,e))))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose(),this.modelDisposables.dispose()}},wz={separatorBorder:eh.transparent},Cz=class{set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){if(e!==this.visible){e?(this.size=Vve(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{this.view.setVisible?.(e)}catch(Fae){console.error("Splitview: Failed to set visible view"),console.error(Fae)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(Fae){console.error("Splitview: Failed to layout view"),console.error(Fae)}}dispose(){this.disposable.dispose()}},yz=class extends Cz{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}},Sz=class extends Cz{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}},function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"}(xz||(xz={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Auto=function(e){return{type:"auto",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(kz||(kz={})),Lz=class extends Ie{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=xz.Idle,this._onDidSashChange=this._register(new je),this._onDidSashReset=this._register(new je),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Mhe(this.el,Ahe(".sash-container")),this.viewContainer=Ahe(".split-view-container"),this.scrollable=this._register(new Sm({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:e=>In(pn(this.el),e)})),this.scrollableElement=this._register(new Mm(this.viewContainer,{vertical:0===this.orientation?t.scrollbarVisibility??1:2,horizontal:1===this.orientation?t.scrollbarVisibility??1:2},this.scrollable));const i=this._register(new zm(this.viewContainer,"scroll")).event;this._register(i(e=>{const t=this.scrollableElement.getScrollPosition(),i=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,n=Math.abs(this.viewContainer.scrollTop-t.scrollTop)<=1?void 0:this.viewContainer.scrollTop;void 0===i&&void 0===n||this.scrollableElement.setScrollPosition({scrollLeft:i,scrollTop:n})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)})),Mhe(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||wz),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((e,t)=>{const i=hle(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)}),this._contentSize=this.viewItems.reduce((e,t)=>e+t.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o?t+=o:e-=n.size}for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o&&t>0&&(n.size=Vve(Math.round(o*e/t),n.minimumSize,n.maximumSize))}}else{const t=ace(this.viewItems.length),n=t.filter(e=>1===this.viewItems[e].priority),o=t.filter(e=>2===this.viewItems[e].priority);this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const r of this.viewItems)r.enabled=!1;const n=this.sashItems.findIndex(t=>t.sash===e),o=Lle(ehe(this.el.ownerDocument.body,"keydown",e=>s(this.sashDragState.current,e.altKey)),ehe(this.el.ownerDocument.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(e,t)=>{const i=this.viewItems.map(e=>e.size);let s,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t)if(n===this.sashItems.length-1){const e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}if(!t){const e=ace(n,-1),t=ace(n+1,this.viewItems.length),o=e.reduce((e,t)=>e+(this.viewItems[t].minimumSize-i[t]),0),a=e.reduce((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t]),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce((e,t)=>e+(i[t]-this.viewItems[t].minimumSize),0),d=0===t.length?Number.NEGATIVE_INFINITY:t.reduce((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize),0),c=Math.max(o,d),h=Math.min(l,a),u=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"==typeof u){const e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);s={index:u,limitDelta:e.visible?c-t:c+t,size:e.size}}if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?h+t:h-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:s,snapAfter:r,disposable:o}};s(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:o,minDelta:s,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const d=e-i,c=this.resize(t,d,n,void 0,void 0,s,r,a,l);if(o){const e=t===this.sashItems.length-1,i=this.viewItems.map(e=>e.size),n=e?t:t+1,o=this.viewItems[n],s=o.size-o.maximumSize,r=o.size-o.minimumSize,a=e?t-1:t+1;this.resize(a,-c,i,void 0,void 0,s,r)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=Vve(t="number"==typeof t?t:e.size,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==xz.Idle)throw new Error("Cant modify splitview");this.state=xz.Busy;try{const i=ace(this.viewItems.length).filter(t=>t!==e),n=[...i.filter(e=>1===this.viewItems[e].priority),e],o=i.filter(e=>2===this.viewItems[e].priority),s=this.viewItems[e];t=Vve(t=Math.round(t),s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(n,o)}finally{this.state=xz.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const r of this.viewItems)r.maximumSize-r.minimumSize>0&&(e.push(r),t+=r.size);const i=Math.floor(t/e.length);for(const r of e)r.size=Vve(i,r.minimumSize,r.maximumSize);const n=ace(this.viewItems.length),o=n.filter(e=>1===this.viewItems[e].priority),s=n.filter(e=>2===this.viewItems[e].priority);this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==xz.Idle)throw new Error("Cant modify splitview");this.state=xz.Busy;try{const o=Ahe(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const s=Lle(e.onDidChange(e=>this.onViewChange(a,e)),Dle(()=>o.remove()));let r;"number"==typeof t?r=t:("auto"===t.type&&(t=this.areViewsDistributed()?{type:"distribute"}:{type:"split",index:t.index}),r="split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize);const a=0===this.orientation?new yz(o,e,r,s):new Sz(o,e,r,s);if(this.viewItems.splice(i,0,a),this.viewItems.length>1){const e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=0===this.orientation?new MT(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},{...e,orientation:1}):new MT(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},{...e,orientation:0}),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),o={sash:t,disposable:Lle(Be.map(t.onDidStart,n)(this.onSashStart,this),Be.map(t.onDidChange,n)(this.onSashChange,this),Be.map(t.onDidEnd,()=>this.sashItems.findIndex(e=>e.sash===t))(this.onSashEnd,this),t.onDidReset(()=>{const e=this.sashItems.findIndex(e=>e.sash===t),i=ace(e,-1),n=ace(e+1,this.viewItems.length),o=this.findFirstSnapIndex(i),s=this.findFirstSnapIndex(n);("number"!=typeof o||this.viewItems[o].visible)&&("number"!=typeof s||this.viewItems[s].visible)&&this._onDidSashReset.fire(e)}),t)};this.sashItems.splice(i-1,0,o)}let l;o.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(l=[t.index]),n||this.relayout([i],l),n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}finally{this.state=xz.Idle}}relayout(e,t){const i=this.viewItems.reduce((e,t)=>e+t.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(e=>e.size),n,o,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const d=ace(e,-1),c=ace(e+1,this.viewItems.length);if(o)for(const y of o)dce(d,y),dce(c,y);if(n)for(const y of n)cce(d,y),cce(c,y);const h=d.map(e=>this.viewItems[e]),u=d.map(e=>i[e]),g=c.map(e=>this.viewItems[e]),p=c.map(e=>i[e]),m=d.reduce((e,t)=>e+(this.viewItems[t].minimumSize-i[t]),0),f=d.reduce((e,t)=>e+(this.viewItems[t].maximumSize-i[t]),0),_=0===c.length?Number.POSITIVE_INFINITY:c.reduce((e,t)=>e+(i[t]-this.viewItems[t].minimumSize),0),b=0===c.length?Number.NEGATIVE_INFINITY:c.reduce((e,t)=>e+(i[t]-this.viewItems[t].maximumSize),0),v=Math.max(m,b,s),w=Math.min(_,f,r);let C=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;C=i!==e.visible,e.setVisible(i,a.size)}if(!C&&l){const e=this.viewItems[l.index],i=t<l.limitDelta;C=i!==e.visible,e.setVisible(i,l.size)}if(C)return this.resize(e,t,i,n,o,s,r);for(let y=0,S=t=Vve(t,v,w);y<h.length;y++){const e=h[y],t=Vve(u[y]+S,e.minimumSize,e.maximumSize);S-=t-u[y],e.size=t}for(let y=0,S=t;y<g.length;y++){const e=g[y],t=Vve(p[y]-S,e.minimumSize,e.maximumSize);S+=t-p[y],e.size=t}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((e,t)=>e+t.size,0);let i=this.size-t;const n=ace(this.viewItems.length-1,-1),o=n.filter(e=>1===this.viewItems[e].priority),s=n.filter(e=>2===this.viewItems[e].priority);for(const r of s)dce(n,r);for(const r of o)cce(n,r);"number"==typeof e&&cce(n,e);for(let r=0;0!==i&&r<n.length;r++){const e=this.viewItems[n[r]],t=Vve(e.size+i,e.minimumSize,e.maximumSize);i-=t-e.size,e.size=t}}layoutViews(){this._contentSize=this.viewItems.reduce((e,t)=>e+t.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(e=>e.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(t=>e=t.size-t.minimumSize>0||e);e=!1;const i=this.viewItems.map(t=>e=t.maximumSize-t.size>0||e),n=[...this.viewItems].reverse();e=!1;const o=n.map(t=>e=t.size-t.minimumSize>0||e).reverse();e=!1;const s=n.map(t=>e=t.maximumSize-t.size>0||e).reverse();let r=0;for(let a=0;a<this.sashItems.length;a++){const{sash:e}=this.sashItems[a];r+=this.viewItems[a].size;const n=!(t[a]&&s[a+1]),l=!(i[a]&&o[a+1]);if(n&&l){const i=ace(a,-1),n=ace(a+1,this.viewItems.length),s=this.findFirstSnapIndex(i),l=this.findFirstSnapIndex(n),d="number"==typeof s&&!this.viewItems[s].visible,c="number"==typeof l&&!this.viewItems[l].visible;d&&o[a]&&(r>0||this.startSnappingEnabled)?e.state=1:c&&t[a]&&(r<this._contentSize||this.endSnappingEnabled)?e.state=2:e.state=0}else e.state=n&&!l?1:!n&&l?2:3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const e=this.viewItems[t];if(e.visible&&e.snap)return t}for(const t of e){const e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=void 0===e?i.size:Math.min(e,i.size),t=void 0===t?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){this.sashDragState?.disposable.dispose(),kle(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}},Dz=class e{constructor(t,i,n){this.columns=t,this.getColumnSize=n,this.templateId=e.TemplateId,this.renderedTemplates=new Set;const o=new Map(i.map(e=>[e.templateId,e]));this.renderers=[];for(const e of t){const t=o.get(e.templateId);if(!t)throw new Error(`Table cell renderer for template id ${e.templateId} not found.`);this.renderers.push(t)}}renderTemplate(e){const t=Mhe(e,Ahe(".monaco-table-tr")),i=[],n=[];for(let s=0;s<this.columns.length;s++){const e=this.renderers[s],o=Mhe(t,Ahe(".monaco-table-td",{"data-col-index":s}));o.style.width=`${this.getColumnSize(s)}px`,i.push(o),n.push(e.renderTemplate(o))}const o={container:e,cellContainers:i,cellTemplateData:n};return this.renderedTemplates.add(o),o}renderElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.columns[o].project(e);this.renderers[o].renderElement(s,t,i.cellTemplateData[o],n)}}disposeElement(e,t,i,n){for(let o=0;o<this.columns.length;o++){const s=this.renderers[o];if(s.disposeElement){const r=this.columns[o].project(e);s.disposeElement(r,t,i.cellTemplateData[o],n)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);Jce(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}},Dz.TemplateId="row",Iz=class extends Ie{get minimumSize(){return this.column.minimumWidth??120}get maximumSize(){return this.column.maximumWidth??Number.POSITIVE_INFINITY}get onDidChange(){return this.column.onDidChangeWidthConstraints??Be.None}constructor(e,t){super(),this.column=e,this.index=t,this._onDidLayout=new je,this.onDidLayout=this._onDidLayout.event,this.element=Ahe(".monaco-table-th",{"data-col-index":t},e.label),e.tooltip&&this._register(Bve().setupManagedHover($_e("mouse"),this.element,e.tooltip))}layout(e){this._onDidLayout.fire([this.index,e])}},Nz=class e{get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onDidScroll(){return this.list.onDidScroll}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollHeight(){return this.list.scrollHeight}get renderHeight(){return this.list.renderHeight}get onDidDispose(){return this.list.onDidDispose}constructor(t,i,n,o,s,r){this.virtualDelegate=n,this.columns=o,this.domId="table_id_"+ ++e.InstanceCount,this.disposables=new De,this.cachedWidth=0,this.cachedHeight=0,this.domNode=Mhe(i,Ahe(`.monaco-table.${this.domId}`));const a=o.map((e,t)=>this.disposables.add(new Iz(e,t))),l={size:a.reduce((e,t)=>e+t.column.weight,0),views:a.map(e=>({size:e.column.weight,view:e}))};this.splitview=this.disposables.add(new Lz(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${n.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${n.headerRowHeight}px`;const d=new Dz(o,s,e=>this.splitview.getViewSize(e));var c;this.list=this.disposables.add(new bE(t,this.domNode,(c=n,{getHeight:e=>c.getHeight(e),getTemplateId:()=>Dz.TemplateId}),[d],r)),Be.any(...a.map(e=>e.onDidLayout))(([e,t])=>d.layoutColumn(e,t),null,this.disposables),this.splitview.onDidSashReset(e=>{const t=o.reduce((e,t)=>e+t.weight,0),i=o[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)},null,this.disposables),this.styleElement=npe(this.domNode),this.style(uE)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}},Nz.InstanceCount=0,function(e){e[e.Expanded=0]="Expanded",e[e.Collapsed=1]="Collapsed",e[e.PreserveOrExpanded=2]="PreserveOrExpanded",e[e.PreserveOrCollapsed=3]="PreserveOrCollapsed"}(Ez||(Ez={})),function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element",e[e.Filter=3]="Filter"}(Mz||(Mz={})),Tz=class extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}},Rz=class{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}},Oz=class{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}},Az=class{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i<n;i++)t[i]=e.charCodeAt(i);return t}},Pz=class{static Assert(e,t){if(!e)throw new Error(t)}},Fz=class{static Copy(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}static Copy2(e,t,i,n,o){for(let s=0;s<o;s++)i[n+s]=e[t+s]}},Wz=class{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new Oz(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}},Bz=class e{constructor(t,i,n=null){this.ContinueProcessingPredicate=n,this._originalSequence=t,this._modifiedSequence=i;const[o,s,r]=e._getElements(t),[a,l,d]=e._getElements(i);this._hasStrings=r&&d,this._originalStringElements=o,this._originalElementsOrHash=s,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(t){const i=t.getElements();if(e._isStringArray(i)){const e=new Int32Array(i.length);for(let t=0,n=i.length;t<n;t++)e[t]=jde(i[t],0);return[i,e,!0]}return i instanceof Int32Array?[[],i,!1]:[[],new Int32Array(i),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._modifiedStringElements[t])}ElementsAreStrictEqual(t,i){return!!this.ElementsAreEqual(t,i)&&e._getStrictElement(this._originalSequence,t)===e._getStrictElement(this._modifiedSequence,i)}static _getStrictElement(e,t){return"function"==typeof e.getStrictElement?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._originalElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._originalStringElements[t])}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._modifiedStringElements[e]===this._modifiedStringElements[t])}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,n,o){const s=[!1];let r=this.ComputeDiffRecursive(e,t,i,n,s);return o&&(r=this.PrettifyChanges(r)),{quitEarly:s[0],changes:r}}ComputeDiffRecursive(e,t,i,n,o){for(o[0]=!1;e<=t&&i<=n&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let o;return i<=n?(Pz.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new Oz(e,0,i,n-i+1)]):e<=t?(Pz.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[new Oz(e,t-e+1,i,0)]):(Pz.Assert(e===t+1,"originalStart should only be one more than originalEnd"),Pz.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}const s=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,s,r,o),l=s[0],d=r[0];if(null!==a)return a;if(!o[0]){const s=this.ComputeDiffRecursive(e,l,i,d,o);let r=[];return r=o[0]?[new Oz(l+1,t-(l+1)+1,d+1,n-(d+1)+1)]:this.ComputeDiffRecursive(l+1,t,d+1,n,o),this.ConcatenateChanges(s,r)}return[new Oz(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f,_){let b=null,v=null,w=new Wz,C=t,y=i,S=u[0]-m[0]-n,x=-1073741824,k=this.m_forwardHistory.length-1;do{const t=S+e;t===C||t<y&&l[t-1]<l[t+1]?(g=(c=l[t+1])-S-n,c<x&&w.MarkNextChange(),x=c,w.AddModifiedElement(c+1,g),S=t+1-e):(g=(c=l[t-1]+1)-S-n,c<x&&w.MarkNextChange(),x=c-1,w.AddOriginalElement(c,g+1),S=t-1-e),k>=0&&(e=(l=this.m_forwardHistory[k])[0],C=1,y=l.length-1)}while(--k>=-1);if(b=w.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==b&&b.length>0){const i=b[b.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}v=[new Oz(e,h-e+1,t,p-t+1)]}else{w=new Wz,C=s,y=r,S=u[0]-m[0]-a,x=1073741824,k=f?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+o;e===C||e<y&&d[e-1]>=d[e+1]?(g=(c=d[e+1]-1)-S-a,c>x&&w.MarkNextChange(),x=c+1,w.AddOriginalElement(c+1,g+1),S=e+1-o):(g=(c=d[e-1])-S-a,c>x&&w.MarkNextChange(),x=c,w.AddModifiedElement(c+1,g+1),S=e-1-o),k>=0&&(o=(d=this.m_reverseHistory[k])[0],C=1,y=d.length-1)}while(--k>=-1);v=w.getChanges()}return this.ConcatenateChanges(b,v)}ComputeRecursionPoint(e,t,i,n,o,s,r){let a=0,l=0,d=0,c=0,h=0,u=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),p=g+1,m=new Int32Array(p),f=new Int32Array(p),_=n-i,b=t-e,v=e-i,w=t-n,C=(b-_)%2==0;m[_]=e,f[b]=t,r[0]=!1;for(let y=1;y<=g/2+1;y++){let g=0,S=0;d=this.ClipDiagonalBound(_-y,y,_,p),c=this.ClipDiagonalBound(_+y,y,_,p);for(let e=d;e<=c;e+=2){a=e===d||e<c&&m[e-1]<m[e+1]?m[e+1]:m[e-1]+1,l=a-(e-_)-v;const i=a;for(;a<t&&l<n&&this.ElementsAreEqual(a+1,l+1);)a++,l++;if(m[e]=a,a+l>g+S&&(g=a,S=l),!C&&Math.abs(e-b)<=y-1&&a>=f[e])return o[0]=a,s[0]=l,i<=f[e]&&y<=1448?this.WALKTRACE(_,d,c,v,b,h,u,w,m,f,a,t,o,l,n,s,C,r):null}const x=(g-e+(S-i)-y)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,x))return r[0]=!0,o[0]=g,s[0]=S,x>0&&y<=1448?this.WALKTRACE(_,d,c,v,b,h,u,w,m,f,a,t,o,l,n,s,C,r):(e++,i++,[new Oz(e,t-e+1,i,n-i+1)]);h=this.ClipDiagonalBound(b-y,y,b,p),u=this.ClipDiagonalBound(b+y,y,b,p);for(let p=h;p<=u;p+=2){a=p===h||p<u&&f[p-1]>=f[p+1]?f[p+1]-1:f[p-1],l=a-(p-b)-w;const g=a;for(;a>e&&l>i&&this.ElementsAreEqual(a,l);)a--,l--;if(f[p]=a,C&&Math.abs(p-_)<=y&&a<=m[p])return o[0]=a,s[0]=l,g>=m[p]&&y<=1448?this.WALKTRACE(_,d,c,v,b,h,u,w,m,f,a,t,o,l,n,s,C,r):null}if(y<=1447){let e=new Int32Array(c-d+2);e[0]=_-d+1,Fz.Copy2(m,d,e,1,c-d+1),this.m_forwardHistory.push(e),e=new Int32Array(u-h+2),e[0]=b-h+1,Fz.Copy2(f,h,e,1,u-h+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,d,c,v,b,h,u,w,m,f,a,t,o,l,n,s,C,r)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],n=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,s=i.originalLength>0,r=i.modifiedLength>0;for(;i.originalStart+i.originalLength<n&&i.modifiedStart+i.modifiedLength<o&&(!s||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!r||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const e=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!e)break;i.originalStart++,i.modifiedStart++}const a=[null];t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],a)&&(e[t]=a[0],e.splice(t+1,1),t--)}for(let t=e.length-1;t>=0;t--){const i=e[t];let n=0,o=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,o=i.modifiedStart+i.modifiedLength}const s=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,d=i.modifiedStart-e;if(t<n||d<o)break;if(s&&!this.OriginalElementsAreEqual(t,t+i.originalLength))break;if(r&&!this.ModifiedElementsAreEqual(d,d+i.modifiedLength))break;const c=(t===n&&d===o?5:0)+this._boundaryScore(t,i.originalLength,d,i.modifiedLength);c>l&&(l=c,a=e)}i.originalStart-=a,i.modifiedStart-=a;const d=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],d)&&(e[t-1]=d[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const i=e[t-1],n=e[t],o=n.originalStart-i.originalStart-i.originalLength,s=i.originalStart,r=n.originalStart+n.originalLength,a=r-s,l=i.modifiedStart,d=n.modifiedStart+n.modifiedLength,c=d-l;if(o<5&&a<20&&c<20){const e=this._findBetterContiguousSequence(s,a,l,c,o);if(e){const[t,s]=e;t===i.originalStart+i.originalLength&&s===i.modifiedStart+i.modifiedLength||(i.originalLength=t-i.originalStart,i.modifiedLength=s-i.modifiedStart,n.originalStart=t+o,n.modifiedStart=s+o,n.originalLength=r-n.originalStart,n.modifiedLength=d-n.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,n,o){if(t<o||n<o)return null;const s=e+t-o+1,r=i+n-o+1;let a=0,l=0,d=0;for(let c=e;c<s;c++)for(let e=i;e<r;e++){const t=this._contiguousSequenceScore(c,e,o);t>0&&t>a&&(a=t,l=c,d=e)}return a>0?[l,d]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;n+=this._originalStringElements[e+o].length}return n}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){const i=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const n=new Array(e.length+t.length-1);return Fz.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],Fz.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return Fz.Copy(e,0,i,0,e.length),Fz.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(Pz.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),Pz.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const n=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Oz(n,o,s,r),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e<n)return e;const o=t%2==0;return e<0?o===(i%2==0)?0:1:o===((n-i-1)%2==0)?n-1:n-2}},Vz=class{constructor(e,t,i={}){this.user=e,this.rootRef=[],this.eventBufferer=new Je,this._onDidSpliceModel=new je,this.onDidSpliceModel=this._onDidSpliceModel.event,this._onDidSpliceRenderedNodes=new je,this.onDidSpliceRenderedNodes=this._onDidSpliceRenderedNodes.event,this._onDidChangeCollapseState=new je,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new je,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this.refilterDelayer=new ht(st),this.collapseByDefault=void 0!==i.collapseByDefault&&i.collapseByDefault,this.allowNonCollapsibleParents=i.allowNonCollapsibleParents??!1,this.filter=i.filter,this.autoExpandSingleChildren=void 0!==i.autoExpandSingleChildren&&i.autoExpandSingleChildren,this.root={parent:void 0,element:t,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=ke.empty(),n={}){if(0===e.length)throw new Tz(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n=ke.empty(),o,s=o.diffDepth??0){const{parentNode:r}=this.getParentNodeWithListIndex(t);if(!r.lastDiffIds)return this.spliceSimple(t,i,n,o);const a=[...n],l=t[t.length-1],d=new Bz({getElements:()=>r.lastDiffIds},{getElements:()=>[...r.children.slice(0,l),...a,...r.children.slice(l+i)].map(t=>e.getId(t.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return r.lastDiffIds=void 0,this.spliceSimple(t,i,a,o);const c=t.slice(0,-1),h=(t,i,n)=>{if(s>0)for(let r=0;r<n;r++)t--,i--,this.spliceSmart(e,[...c,t,0],Number.MAX_SAFE_INTEGER,a[i].children,o,s-1)};let u=Math.min(r.children.length,l+i),g=a.length;for(const p of d.changes.sort((e,t)=>t.originalStart-e.originalStart))h(u,g,u-(p.originalStart+p.originalLength)),u=p.originalStart,g=p.modifiedStart-l,this.spliceSimple([...c,u],p.originalLength,ke.slice(a,g,g+p.modifiedLength),o);h(u,g,u)}spliceSimple(e,t,i=ke.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:r,listIndex:a,revealed:l,visible:d}=this.getParentNodeWithListIndex(e),c=[],h=ke.map(i,e=>this.createTreeNode(e,r,r.visible?1:0,l,c,n)),u=e[e.length-1];let g=0;for(let w=u;w>=0&&w<r.children.length;w--){const e=r.children[w];if(e.visible){g=e.visibleChildIndex;break}}const p=[];let m=0,f=0;for(const w of h)p.push(w),f+=w.renderNodeCount,w.visible&&(w.visibleChildIndex=g+m++);const _=pce(r.children,u,t,p);s?r.lastDiffIds?pce(r.lastDiffIds,u,t,p.map(e=>s.getId(e.element).toString())):r.lastDiffIds=r.children.map(e=>s.getId(e.element).toString()):r.lastDiffIds=void 0;let b=0;for(const w of _)w.visible&&b++;if(0!==b)for(let w=u+p.length;w<r.children.length;w++){const e=r.children[w];e.visible&&(e.visibleChildIndex-=b)}if(r.visibleChildrenCount+=m-b,_.length>0&&o){const e=t=>{o(t),t.children.forEach(e)};_.forEach(e)}if(l&&d){const e=_.reduce((e,t)=>e+(t.visible?t.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(r,f-e),this._onDidSpliceRenderedNodes.fire({start:a,deleteCount:e,elements:c})}this._onDidSpliceModel.fire({insertedNodes:p,deletedNodes:_});let v=r;for(;v;){if(2===v.visibility){this.refilterDelayer.trigger(()=>this.refilter());break}v=v.parent}}rerender(e){if(0===e.length)throw new Tz(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this._onDidSpliceRenderedNodes.fire({start:i,deleteCount:1,elements:[t]})}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);void 0===t&&(t=!i.collapsible);const n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const n=this.getTreeNode(e);void 0===t&&(t=!n.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(i,n,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!GCe(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e<i.children.length;e++)if(i.children[e].visible){if(n>-1){n=-1;break}n=e}n>-1&&this._setCollapseState([...e,n],t)}return s}_setListNodeCollapseState(e,t,i,n){const o=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=s-(-1===t?0:1);return this._onDidSpliceRenderedNodes.fire({start:t+1,deleteCount:a,elements:r.slice(1)}),o}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(GCe(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!GCe(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this._onDidSpliceRenderedNodes.fire({start:0,deleteCount:e,elements:t}),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,o,s){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&o.push(r);const l=e.children||ke.empty(),d=n&&0!==a&&!r.collapsed;let c=0,h=1;for(const u of l){const e=this.createTreeNode(u,r,a,d,o,s);r.children.push(e),h+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=c++)}return this.allowNonCollapsibleParents||(r.collapsible=r.collapsible||r.children.length>0),r.visibleChildrenCount=c,r.visible=2===a?c>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=h):(r.renderNodeCount=0,n&&o.pop()),s?.(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),0===o)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===o)e.visibleChildrenCount=0;else{let t=0;for(const s of e.children)r=this._updateNodeAfterFilterChange(s,o,i,n&&!e.collapsed)||r,s.visible&&(s.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===o?r:1===o,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):jCe(i)?(e.filterData=i.data,$Ce(i.visibility)):(e.filterData=void 0,$Ce(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new Tz(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new Tz(this.user,"Invalid tree location");const r=t.children[s];return{node:r,listIndex:i,revealed:n,visible:o&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,o=!0){const[s,...r]=e;if(s<0||s>t.children.length)throw new Tz(this.user,"Invalid tree location");for(let a=0;a<s;a++)i+=t.children[a].renderNodeCount;return n=n&&!t.collapsed,o=o&&t.visible,0===r.length?{parentNode:t,listIndex:i,revealed:n,visible:o}:this.getParentNodeWithListIndex(r,t.children[s],i+1,n,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){return 0===e.length?void 0:1===e.length?[]:function(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(0!==t.children.length)return t.children[0].element}},Hz=class extends $N{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}},zz=class{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Ie.None,this.disposables=new De}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(ZCe(e),t)}onDragOver(e,t,i,n,o,s=!0){const r=this.dnd.onDragOver(ZCe(e),t&&t.element,i,n,o),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return r;if(a&&"boolean"!=typeof r&&r.autoExpand&&(this.autoExpandDisposable=Rle(()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0},500,this.disposables)),"boolean"==typeof r||!r.accept||void 0===r.bubble||r.feedback)return s?r:{accept:"boolean"==typeof r?r:r.accept,effect:"boolean"==typeof r?void 0:r.effect,feedback:[i]};if(1===r.bubble){const i=this.modelProvider(),s=i.getNodeLocation(t),r=i.getParentNodeLocation(s),a=i.getNode(r),l=r&&i.getListIndex(r);return this.onDragOver(e,a,l,n,o,!1)}const l=this.modelProvider(),d=l.getNodeLocation(t),c=l.getListIndex(d),h=l.getListRenderCount(d);return{...r,feedback:ace(c,c+h)}}drop(e,t,i,n,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(ZCe(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}},Uz=class{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight?.(e.element,t)}},function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(Kz||(Kz={})),qz=class{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new De,this.onDidChange=Be.forEach(e,e=>this._elements=e,this.disposables)}dispose(){this.disposables.dispose()}},jz=class e{constructor(t,i,n,o,s,r={}){this.renderer=t,this.model=i,this.activeNodes=o,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=e.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Ie.None,this.disposables=new De,this.templateId=t.templateId,this.updateOptions(r),Be.map(n,e=>e.node)(this.onDidChangeNodeTwistieState,this,this.disposables),t.onDidChangeTwistieState?.(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(t={}){if(void 0!==t.indent){const i=Vve(t.indent,0,40);if(i!==this.indent){this.indent=i;for(const[t,i]of this.renderedNodes)i.indentSize=e.DefaultIndent+(t.depth-1)*this.indent,this.renderTreeElement(t,i)}}if(void 0!==t.renderIndentGuides){const e=t.renderIndentGuides!==Kz.None;if(e!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=e;for(const[e,t]of this.renderedNodes)this._renderIndentGuides(e,t);if(this.indentGuidesDisposable.dispose(),e){const e=new De;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}void 0!==t.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=t.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Mhe(e,Ahe(".monaco-tl-row")),i=Mhe(t,Ahe(".monaco-tl-indent")),n=Mhe(t,Ahe(".monaco-tl-twistie")),o=Mhe(t,Ahe(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:Ie.None,indentSize:0,templateData:s}}renderElement(t,i,n,o){n.indentSize=e.DefaultIndent+(t.depth-1)*this.indent,this.renderedNodes.set(t,n),this.renderedElements.set(t.element,t),this.renderTreeElement(t,n),this.renderer.renderElement(t,i,n.templateData,{...o,indent:n.indentSize})}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,{...n,indent:i.indentSize}),"number"==typeof n?.height&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){t.twistie.style.paddingLeft=`${t.indentSize}px`,t.indent.style.width=t.indentSize+this.indent-16+"px",e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...mo.asClassNameArray(go.treeItemExpanded));let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...mo.asClassNameArray(go.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Jce(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new De;for(;;){const n=this.model.getNodeLocation(e),o=this.model.getParentNodeLocation(n);if(!o)break;const s=this.model.getNode(o),r=Ahe(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(s)&&r.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(r):t.indent.insertBefore(r,t.indent.firstElementChild),this.renderedIndentGuides.add(s,r),i.add(Dle(()=>this.renderedIndentGuides.delete(s,r))),e=s}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set;e.forEach(e=>{const i=this.model.getNodeLocation(e);try{const n=this.model.getParentNodeLocation(i);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):n&&t.add(this.model.getNode(n))}catch{}}),this.activeIndentNodes.forEach(e=>{t.has(e)||this.renderedIndentGuides.forEach(e,e=>e.classList.remove("active"))}),t.forEach(e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,e=>e.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),kle(this.disposables)}},jz.DefaultIndent=8,$z=class{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set findMatchType(e){this._findMatchType=e}get findMatchType(){return this._findMatchType}set findMode(e){this._findMode=e}get findMode(){return this._findMode}constructor(e,t,i){this._keyboardNavigationLabelProvider=e,this._filter=t,this._defaultFindVisibility=i,this._totalCount=0,this._matchCount=0,this._findMatchType=Yz.Fuzzy,this._findMode=Zz.Highlight,this._pattern="",this._lowercasePattern="",this.disposables=new De}filter(e,t){let i=1;if(this._filter){const n=this._filter.filter(e,t);if(i="boolean"==typeof n?n?1:0:jCe(n)?$Ce(n.visibility):n,0===i)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:rD.Default,visibility:i};const n=this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(n)?n:[n];for(const s of o){const e=s&&s.toString();if(void 0===e)return{data:rD.Default,visibility:i};let t;if(t=this._findMatchType===Yz.Contiguous?YCe(this._lowercasePattern,e.toLowerCase()):Tbe(this._pattern,this._lowercasePattern,0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0}),t)return this._matchCount++,1===o.length?{data:t,visibility:i}:{data:{label:e,score:t},visibility:i}}return this._findMode===Zz.Filter?"number"==typeof this._defaultFindVisibility?this._defaultFindVisibility:this._defaultFindVisibility?this._defaultFindVisibility(e):2:{data:rD.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){kle(this.disposables)}},Gz=class{constructor(e){this.stateMap=new Map(e.map(e=>[e.id,{...e}]))}get(e){const t=this.stateMap.get(e);if(void 0===t)throw new Error(`No state found for toggle id ${e}`);return t.isChecked}set(e,t){const i=this.stateMap.get(e);if(void 0===i)throw new Error(`No state found for toggle id ${e}`);return i.isChecked!==t&&(i.isChecked=t,!0)}},function(e){e[e.Highlight=0]="Highlight",e[e.Filter=1]="Filter"}(Zz||(Zz={})),function(e){e[e.Fuzzy=0]="Fuzzy",e[e.Contiguous=1]="Contiguous"}(Yz||(Yz={})),function(e){e.Mode="mode",e.MatchType="matchType"}(Qz||(Qz={})),Xz=class{get pattern(){return this._pattern}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.widget?.setPlaceHolder(e)}constructor(e,t,i,n={}){this.tree=e,this.filter=t,this.contextViewProvider=i,this.options=n,this._pattern="",this._onDidChangePattern=new je,this._onDidChangeOpenState=new je,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new De,this.disposables=new De,this.toggles=new Gz(n.toggles??[]),this._placeholder=n.placeholder??Vae(20,"Type to search")}isOpened(){return!!this.widget}updateToggleState(e,t){this.toggles.set(e,t),this.widget?.setToggleState(e,t)}renderMessage(e,t){e?this.tree.options.showNotFoundMessage??1?this.widget?.showMessage({type:2,content:t??Vae(21,"No results found.")}):this.widget?.showMessage({type:2}):this.widget?.clearMessage()}alertResults(e){Qhe(e?Vae(23,"{0} results",e):Vae(22,"No results"))}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}},Jz=class extends Xz{get mode(){return this.toggles.get(Qz.Mode)?Zz.Filter:Zz.Highlight}set mode(e){if(e===this.mode)return;const t=e===Zz.Filter;this.updateToggleState(Qz.Mode,t),this.placeholder=t?Vae(24,"Type to filter"):Vae(25,"Type to search"),this.filter.findMode=e,this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e)}get matchType(){return this.toggles.get(Qz.MatchType)?Yz.Fuzzy:Yz.Contiguous}set matchType(e){e!==this.matchType&&(this.updateToggleState(Qz.MatchType,e===Yz.Fuzzy),this.filter.findMatchType=e,this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n={}){const o=n.defaultFindMode??Zz.Highlight,s=n.defaultFindMatchType??Yz.Fuzzy,r=[{id:Qz.Mode,icon:go.listFilter,title:Vae(26,"Filter"),isChecked:o===Zz.Filter},{id:Qz.MatchType,icon:go.searchFuzzy,title:Vae(27,"Fuzzy Match"),isChecked:s===Yz.Fuzzy}];t.findMatchType=s,t.findMode=o,super(e,t,i,{...n,toggles:r}),this.filter=t,this._onDidChangeMode=new je,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new je,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this.disposables.add(this.tree.onDidChangeModel(()=>{this.isOpened()&&(0!==this.pattern.length&&this.tree.refilter(),this.render())})),this.disposables.add(this.tree.onWillRefilter(()=>this.filter.reset()))}updateOptions(e={}){void 0!==e.defaultFindMode&&(this.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.matchType=e.defaultFindMatchType)}shouldAllowFocus(e){return!this.isOpened()||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1||!rD.isDefault(e.filterData)}render(){const e=0===this.filter.matchCount&&this.filter.totalCount>0&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.filter.matchCount)}},eU=class{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Zde(this.stickyNodes,e.stickyNodes,QCe)}contains(e){return this.stickyNodes.some(t=>t.node.element===e.element)}lastNodePartiallyVisible(){if(0===this.count)return!1;const e=this.stickyNodes[this.count-1];if(1===this.count)return 0!==e.position;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Zde(this.stickyNodes,e.stickyNodes,XCe))return!1;if(0===this.count)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}},tU=class{constrainStickyScrollNodes(e,t,i){for(let n=0;n<e.length;n++){const o=e[n];if(o.position+o.height>i||n>=t)return e.slice(0,n)}return e}},iU=class extends Ie{constructor(e,t,i,n,o,s={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4,this.stickyScrollMaxItemCount=this.validateStickySettings(s).stickyScrollMaxItemCount,this.stickyScrollDelegate=s.stickyScrollDelegate??new tU,this.paddingTop=s.paddingTop??0,this._widget=this._register(new nU(i.getScrollableElement(),i,e,n,o,s.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this._register(t.onDidSpliceRenderedNodes(e=>{const t=this._widget.state;t&&(e.deleteCount>0&&t.stickyNodes.some(e=>!this.model.has(this.model.getNodeLocation(e.node)))?this.update():t.stickyNodes.some(i=>{const n=this.model.getListIndex(this.model.getNodeLocation(i.node));return n>=e.start&&n<e.start+e.deleteCount&&t.contains(i.node)})&&this._widget.rerender())})),this.update()}get height(){return this._widget.height}getNodeAtHeight(e){let t;if(t=0===e?this.view.firstVisibleIndex:this.view.indexAt(e+this.view.scrollTop),!(t<0||t>=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(this.paddingTop);if(!e||this.tree.scrollTop<=this.paddingTop)return void this._widget.setState(void 0);const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,n=0,o=this.getNextStickyNode(i,void 0,n);for(;o&&(t.push(o),n+=o.height,!(t.length<=this.stickyScrollMaxItemCount)||(i=this.getNextVisibleNode(o),i));)o=this.getNextStickyNode(i,o.node,n);const s=this.constrainStickyNodes(t);return s.length?new eU(s):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const n=this.getAncestorUnderPrevious(e,t);if(n){if(n===e){if(!this.nodeIsUncollapsedParent(e))return;if(this.nodeTopAlignsWithStickyNodesBottom(e,i))return}return this.createStickyScrollNode(n,i)}}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),n=this.view.getElementTop(i),o=t;return this.view.scrollTop===n-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:o}=this.getNodeRange(e);return{node:e,position:this.calculateStickyNodePosition(o,t,i),height:i,startIndex:n,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(void 0===t)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(null===n&&this.view.firstVisibleIndex===e&&e+1<this.view.length){const t=this.treeDelegate.getHeight(this.view.element(e)),i=this.view.getRelativeTop(e+1);n=i?i-t/this.view.renderHeight:null}if(null===n)return t;const o=this.view.element(e),s=this.treeDelegate.getHeight(o),r=n*this.view.renderHeight+s;return t+i>r&&t<=r?r-i:t}constrainStickyNodes(e){if(0===e.length)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];const o=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return n}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");return{startIndex:i,endIndex:i+this.model.getListRenderCount(t)-1}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let o=0;o<t.length&&o<this.stickyScrollMaxItemCount;o++)n+=this.treeDelegate.getHeight(t[o]);return n}domFocus(){this._widget.domFocus()}focusedLast(){return this._widget.focusedLast()}updateOptions(e={}){if(void 0!==e.paddingTop&&(this.paddingTop=e.paddingTop),void 0!==e.stickyScrollMaxItemCount){const t=this.validateStickySettings(e);this.stickyScrollMaxItemCount!==t.stickyScrollMaxItemCount&&(this.stickyScrollMaxItemCount=t.stickyScrollMaxItemCount,this.update())}}validateStickySettings(e){let t=7;return"number"==typeof e.stickyScrollMaxItemCount&&(t=Math.max(e.stickyScrollMaxItemCount,1)),{stickyScrollMaxItemCount:t}}},nU=class{get state(){return this._previousState}constructor(e,t,i,n,o,s){this.view=t,this.tree=i,this.treeRenderers=n,this.treeDelegate=o,this.accessibilityProvider=s,this._previousElements=[],this._previousStateDisposables=new De,this._rootDomNode=Ahe(".monaco-tree-sticky-container.empty"),e.appendChild(this._rootDomNode);const r=Ahe(".monaco-tree-sticky-container-shadow");this._rootDomNode.appendChild(r),this.stickyScrollFocus=new oU(this._rootDomNode,t),this.onDidChangeHasFocus=this.stickyScrollFocus.onDidChangeHasFocus,this.onContextMenu=this.stickyScrollFocus.onContextMenu}get height(){if(!this._previousState)return 0;const e=this._previousState.stickyNodes[this._previousState.count-1];return e.position+e.height}setState(e){const t=!!this._previousState&&this._previousState.count>0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i)return this._previousState=void 0,this._previousElements=[],void this._previousStateDisposables.clear();const n=e.stickyNodes[e.count-1];this._previousState&&e.animationStateChanged(this._previousState)?this._previousElements[this._previousState.count-1].style.top=`${n.position}px`:this.renderState(e),this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}renderState(e){this._previousStateDisposables.clear();const t=Array(e.count);for(let i=e.count-1;i>=0;i--){const n=e.stickyNodes[i],{element:o,disposable:s}=this.createElement(n,i,e.count);t[i]=o,this._rootDomNode.appendChild(o),this._previousStateDisposables.add(s)}this.stickyScrollFocus.updateElements(t,e),this._previousElements=t}rerender(){this._previousState&&this.renderState(this._previousState)}createElement(e,t,i){const n=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,!1!==this.tree.options.setRowHeight&&(o.style.height=`${e.height}px`),!1!==this.tree.options.setRowLineHeight&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${n}`),o.setAttribute("data-parity",n%2==0?"even":"odd"),o.setAttribute("id",this.view.getElementID(n));const s=this.setAccessibilityAttributes(o,e.node.element,t,i),r=this.treeDelegate.getTemplateId(e.node),a=this.treeRenderers.find(e=>e.templateId===r);if(!a)throw new Error(`No renderer found for template id ${r}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));const d=a.renderTemplate(o);return a.renderElement(l,e.startIndex,d,{height:e.height}),{element:o,disposable:Dle(()=>{s.dispose(),a.disposeElement(l,e.startIndex,d,{height:e.height}),a.disposeTemplate(d),o.remove()})}}setAccessibilityAttributes(e,t,i,n){if(!this.accessibilityProvider)return Ie.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const o=this.accessibilityProvider.getAriaLabel(t),s=o&&"string"!=typeof o?o:z_e(o),r=Rce(t=>{const i=t.readObservable(s);i?e.setAttribute("aria-label",i):e.removeAttribute("aria-label")});"string"==typeof o||o&&e.setAttribute("aria-label",o.get());const a=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return"number"==typeof a&&e.setAttribute("aria-level",`${a}`),e.setAttribute("aria-selected",String(!1)),r}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}},oU=class extends Ie{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new je,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new je,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(ehe(this.container,"focus",()=>this.onFocus())),this._register(ehe(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(e=>this.onKeyDown(e))),this._register(this.view.onMouseDown(e=>this.onMouseDown(e))),this._register(this.view.onContextMenu(e=>this.handleContextMenu(e)))}handleContextMenu(e){const t=e.browserEvent.target;if(!jve(t)&&!qve(t))return void(this.focusedLast()&&this.view.domFocus());if(!Ihe(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const t=this.state.stickyNodes.findIndex(t=>t.node.element===e.element?.element);if(-1===t)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");return this.container.focus(),void this.setFocus(t)}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const i=this.state.stickyNodes[this.focusedIndex].node.element,n=this.elements[this.focusedIndex];this._onContextMenu.fire({element:i,anchor:n,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state)if("ArrowUp"===e.key)this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if("ArrowDown"===e.key||"ArrowRight"===e.key){if(this.focusedIndex>=this.state.count-1){const e=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([e]),this.scrollNodeUnderWidget(e,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}onMouseDown(e){const t=e.browserEvent.target;(jve(t)||qve(t))&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&0===t.count)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const e=Vve(i,0,t.count-1);this.setFocus(e)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e<t.count-1)&&t.lastNodePartiallyVisible()){const i=t.stickyNodes[e];this.scrollNodeUnderWidget(i.endIndex+1,t)}}scrollNodeUnderWidget(e,t){const i=t.stickyNodes[t.count-1],n=t.count>1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),s=n?n.position+n.height+i.height:i.height;this.view.scrollTop=o-s}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return!!this.state&&this.view.getHTMLElement().classList.contains("sticky-scroll-focused")}removeFocus(){-1!==this.focusedIndex&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){-1!==this.focusedIndex&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||0===this.elements.length)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),-1===this.focusedIndex&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}},sU=class{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new je,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&Zde(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach(e=>tye(e,i)),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach(e=>tye(e,n));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach(e=>tye(e,s));const r=[];for(const a of this.nodes){const e=this.identityProvider.getId(a.element).toString();if(i.has(e)){const t=o.get(e);t&&t.visible&&r.push(t)}else r.push(a)}if(this.nodes.length>0&&0===r.length){const e=this.getFirstViewElementWithTrait();e&&r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}},rU=class extends cE{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if($ve(e.browserEvent.target)||zhe(e.browserEvent.target)||Kve(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=qve(e.browserEvent.target);let s=!1;if(s=!!o||("function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick),o)this.handleStickyScrollMouseEvent(e,t);else{if(s&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e)}if(t.collapsible&&(!o||n)){const i=this.tree.getNodeLocation(t),o=e.browserEvent.altKey;if(this.tree.setFocus([i]),this.tree.toggleCollapsed(i,o),n)return void(e.browserEvent.isHandledByList=!0)}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(function(e){return Uve(e,"monaco-custom-toggle")}(e.browserEvent.target)||function(e){return Uve(e,"action-item")}(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const n=this.list.indexOf(t),o=this.list.getElementTop(n),s=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-s,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&(e.browserEvent.isHandledByList||super.onDoubleClick(e))}onMouseDown(e){const t=e.browserEvent.target;jve(t)||qve(t)||super.onMouseDown(e)}onContextMenu(e){const t=e.browserEvent.target;jve(t)||qve(t)||super.onContextMenu(e)}},aU=class extends bE{constructor(e,t,i,n,o,s,r,a){super(e,t,i,n,a),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=r}createMouseController(e){return new rU(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];let s;i.forEach((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i),this.anchorTrait.has(t)&&(s=e+i)}),n.length>0&&super.setFocus(rce([...super.getFocus(),...n])),o.length>0&&super.setSelection(rce([...super.getSelection(),...o])),"number"==typeof s&&super.setAnchor(s)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(e=>this.element(e)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(e=>this.element(e)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}},lU=class{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return Be.filter(Be.map(this.view.onMouseDblClick,JCe),e=>e.target!==Mz.Filter)}get onMouseOver(){return Be.map(this.view.onMouseOver,JCe)}get onMouseOut(){return Be.map(this.view.onMouseOut,JCe)}get onContextMenu(){return Be.any(Be.filter(Be.map(this.view.onContextMenu,eye),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??Be.None)}get onPointer(){return Be.map(this.view.onPointer,JCe)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return Be.any(this.onDidChangeModelRelay.event,this.onDidSwapModel.event)}get onDidChangeCollapseState(){return this.onDidChangeCollapseStateRelay.event}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,o={}){this._user=e,this._options=o,this.eventBufferer=new Je,this.onDidChangeFindOpenState=Be.None,this.onDidChangeStickyScrollFocused=Be.None,this.disposables=new De,this.onDidSwapModel=this.disposables.add(new je),this.onDidChangeModelRelay=this.disposables.add(new et),this.onDidSpliceModelRelay=this.disposables.add(new et),this.onDidChangeCollapseStateRelay=this.disposables.add(new et),this.onDidChangeRenderNodeCountRelay=this.disposables.add(new et),this.onDidChangeActiveNodesRelay=this.disposables.add(new et),this._onWillRefilter=new je,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new je,this.modelDisposables=new De,o.keyboardNavigationLabelProvider&&(o.findWidgetEnabled??1)&&(this.findFilter=new $z(o.keyboardNavigationLabelProvider,o.filter,o.defaultFindVisibility),o={...o,filter:this.findFilter},this.disposables.add(this.findFilter)),this.model=this.createModel(e,o),this.treeDelegate=new Uz(i);const s=this.disposables.add(new qz(this.onDidChangeActiveNodesRelay.event)),r=new Is;this.renderers=n.map(e=>new jz(e,this.model,this.onDidChangeCollapseStateRelay.event,s,r,o));for(const c of this.renderers)this.disposables.add(c);var a,l,d;if(this.focus=new sU(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new sU(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new sU(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new aU(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...(a=()=>this.model,l=this.disposables,d=o,d&&{...d,identityProvider:d.identityProvider&&{getId:e=>d.identityProvider.getId(e.element)},dnd:d.dnd&&l.add(new zz(a,d.dnd)),multipleSelectionController:d.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>d.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element}),isSelectionRangeChangeEvent:e=>d.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})},accessibilityProvider:d.accessibilityProvider&&{...d.accessibilityProvider,getSetSize(e){const t=a(),i=t.getNodeLocation(e),n=t.getParentNodeLocation(i);return t.getNode(n).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:d.accessibilityProvider&&d.accessibilityProvider.isChecked?e=>d.accessibilityProvider.isChecked(e.element):void 0,getRole:d.accessibilityProvider&&d.accessibilityProvider.getRole?e=>d.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>d.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>d.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:d.accessibilityProvider&&d.accessibilityProvider.getWidgetRole?()=>d.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:d.accessibilityProvider&&d.accessibilityProvider.getAriaLevel?e=>d.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:d.accessibilityProvider.getActiveDescendantId&&(e=>d.accessibilityProvider.getActiveDescendantId(e.element))},keyboardNavigationLabelProvider:d.keyboardNavigationLabelProvider&&{...d.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:e=>d.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.setupModel(this.model),!1!==o.keyboardSupport){const e=Be.chain(this.view.onKeyDown,e=>e.filter(e=>!zhe(e.target)).map(e=>new we(e)));Be.chain(e,e=>e.filter(e=>15===e.keyCode))(this.onLeftArrow,this,this.disposables),Be.chain(e,e=>e.filter(e=>17===e.keyCode))(this.onRightArrow,this,this.disposables),Be.chain(e,e=>e.filter(e=>10===e.keyCode))(this.onSpace,this,this.disposables)}if((o.findWidgetEnabled??1)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const e={styles:o.findWidgetStyles,defaultFindMode:o.defaultFindMode,defaultFindMatchType:o.defaultFindMatchType,showNotFoundMessage:o.showNotFoundMessage};this.findController=this.disposables.add(new Jz(this,this.findFilter,o.contextViewProvider,e)),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=Be.None,this.onDidChangeFindMatchType=Be.None;o.enableStickyScroll&&(this.stickyScrollController=new iU(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=npe(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Kz.Always)}updateOptions(e={}){this._options={...this._options,...e};for(const t of this.renderers)t.updateOptions(e);this.view.updateOptions(this._options),this.findController?.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Kz.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new iU(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=Be.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),this.stickyScrollController?.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { opacity: 1; border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e.treeIndentGuidesStroke}; }`));const n=e.treeStickyScrollBackground??e.listBackground;n&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${n}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${n}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=Z_e(e.listFocusAndSelectionOutline,Z_e(e.listSelectionOutline,e.listFocusOutline??""));o&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join("\n"),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(e=>this.model.getNode(e));this.selection.set(i,t);const n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(e=>this.model.getNode(e));this.focus.set(i,t);const n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=(Ihe(i)&&i.altKey?void 0:this.focusNavigationFilter)){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=(Ihe(i)&&i.altKey?void 0:this.focusNavigationFilter)){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=(Ihe(e)&&e.altKey?void 0:this.focusNavigationFilter)){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=(Ihe(e)&&e.altKey?void 0:this.focusNavigationFilter)){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=(Ihe(e)&&e.altKey?void 0:this.focusNavigationFilter)){this.view.focusLast(e,t)}focusFirst(e,t=(Ihe(e)&&e.altKey?void 0:this.focusNavigationFilter)){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(-1!==i)if(this.stickyScrollController){const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}else this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(e=>e.visible))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}setupModel(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidSpliceRenderedNodes(({start:e,deleteCount:t,elements:i})=>this.view.splice(e,t,i)));const t=Be.forEach(e.onDidSpliceModel,e=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)})},this.modelDisposables);t(()=>null,null,this.modelDisposables);const i=this.modelDisposables.add(new je),n=this.modelDisposables.add(new ht(0));this.modelDisposables.add(Be.any(t,this.focus.onDidChange,this.selection.onDidChange)(()=>{n.trigger(()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);i.fire([...e.values()])})})),this.onDidChangeActiveNodesRelay.input=i.event,this.onDidChangeModelRelay.input=Be.signal(e.onDidSpliceModel),this.onDidChangeCollapseStateRelay.input=e.onDidChangeCollapseState,this.onDidChangeRenderNodeCountRelay.input=e.onDidChangeRenderNodeCount,this.onDidSpliceModelRelay.input=e.onDidSpliceModel}dispose(){kle(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose(),this.modelDisposables.dispose()}},dU=class{constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Vz(e,null,t),this.onDidSpliceModel=this.model.onDidSpliceModel,this.onDidSpliceRenderedNodes=this.model.onDidSpliceRenderedNodes,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,t.sorter&&(this.sorter={compare:(e,i)=>t.sorter.compare(e.element,i.element)}),this.identityProvider=t.identityProvider}setChildren(e,t=ke.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=ke.empty(),i){const n=new Set,o=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:e=>{if(null===e.element)return;const t=e;if(n.add(t.element),this.nodes.set(t.element,t),this.identityProvider){const e=this.identityProvider.getId(t.element).toString();o.add(e),this.nodesByIdentity.set(e,t)}i.onDidCreateNode?.(t)},onDidDeleteNode:e=>{if(null===e.element)return;const t=e;if(n.has(t.element)||this.nodes.delete(t.element),this.identityProvider){const e=this.identityProvider.getId(t.element).toString();o.has(e)||this.nodesByIdentity.delete(e)}i.onDidDeleteNode?.(t)}})}preserveCollapseState(e=ke.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),ke.map(e,e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t){let t;return t=void 0===e.collapsed?void 0:e.collapsed===Ez.Collapsed||e.collapsed===Ez.PreserveOrCollapsed||e.collapsed!==Ez.Expanded&&e.collapsed!==Ez.PreserveOrExpanded&&Boolean(e.collapsed),{...e,children:this.preserveCollapseState(e.children),collapsed:t}}const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible;let n;return n=void 0===e.collapsed||e.collapsed===Ez.PreserveOrCollapsed||e.collapsed===Ez.PreserveOrExpanded?t.collapsed:e.collapsed===Ez.Collapsed||e.collapsed!==Ez.Expanded&&Boolean(e.collapsed),{...e,collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}resort(e=null,t=!0){if(!this.sorter)return;const i=this.getElementLocation(e),n=this.model.getNode(i);this._setChildren(i,this.resortChildren(n,t),{})}resortChildren(e,t,i=!0){let n=[...e.children];return(t||i)&&(n=n.sort(this.sorter.compare.bind(this.sorter))),ke.map(n,e=>({element:e.element,collapsible:e.collapsible,collapsed:e.collapsed,children:this.resortChildren(e,t,!1)}))}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Tz(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new Tz(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Tz(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new Tz(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}},cU=e=>({getId:t=>t.elements.map(t=>e.getId(t).toString()).join("\0")}),hU=class{get onDidSpliceRenderedNodes(){return this.model.onDidSpliceRenderedNodes}get onDidSpliceModel(){return this.model.onDidSpliceModel}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new dU(e,t),this.enabled=void 0===t.compressionEnabled||t.compressionEnabled,this.identityProvider=t.identityProvider}setChildren(e,t=ke.empty(),i){const n=i.diffIdentityProvider&&cU(i.diffIdentityProvider);if(null===e){const e=ke.map(t,this.enabled?nye:iye);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const o=this.nodes.get(e);if(!o)throw new Tz(this.user,"Unknown compressed tree node");const s=this.model.getNode(o),r=this.model.getParentNodeLocation(o),a=this.model.getNode(r),l=rye(sye(s),e,t),d=(this.enabled?nye:iye)(l),c=i.diffIdentityProvider?(e,t)=>i.diffIdentityProvider.getId(e)===i.diffIdentityProvider.getId(t):void 0;if(Zde(d.element.elements,s.element.elements,c))return void this._setChildren(o,d.children||ke.empty(),{diffIdentityProvider:n,diffDepth:1});const h=a.children.map(e=>e===s?d:e);this._setChildren(a.element,h,{diffIdentityProvider:n,diffDepth:s.depth-a.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=ke.map(t,sye),n=ke.map(i,e?nye:iye);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,{...i,onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}resort(e=null,t=!0){const i=this.getCompressedNode(e);this.model.resort(i,t)}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new Tz(this.user,`Tree element not found: ${e}`);return t}},uU=e=>e[e.length-1],gU=class e{get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(t=>new e(this.unwrapper,t))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}},pU=class{get onDidSpliceModel(){return Be.map(this.model.onDidSpliceModel,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(e=>this.nodeMapper.map(e)),deletedNodes:t.map(e=>this.nodeMapper.map(e))}))}get onDidSpliceRenderedNodes(){return Be.map(this.model.onDidSpliceRenderedNodes,({start:e,deleteCount:t,elements:i})=>({start:e,deleteCount:t,elements:i.map(e=>this.nodeMapper.map(e))}))}get onDidChangeCollapseState(){return Be.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return Be.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t={}){this.rootRef=null,this.elementMapper=t.elementMapper||uU;const i=e=>this.elementMapper(e.elements);this.nodeMapper=new Rz(e=>new gU(i,e)),this.model=new hU(e,function(e,t){return{...t,identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter(e,i){const n=e.elements;for(let o=0;o<n.length-1;o++){const e=t.filter.filter(n[o],i);i=$Ce(jCe(e)?e.visibility:e)}return t.filter.filter(n[n.length-1],i)}}}}(i,t))}setChildren(e,t=ke.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return null==t?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}resort(e=null,t=!0){return this.model.resort(e,t)}getCompressedTreeNode(e=null){return this.model.getNode(e)}},mU=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},fU=class extends lU{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,o={}){super(e,t,i,n,o),this.user=e}setChildren(e,t=ke.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}resort(e,t=!0){this.model.resort(e,t)}hasElement(e){return this.model.has(e)}createModel(e,t){return new dU(e,t)}},mU([Ape],(_U=class{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),1===o.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement?.(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?.(e,t)??!1}}).prototype,"compressedTreeNodeProvider",null),bU=class{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),0===e.length)return[];for(let n=0;n<e.length;n++){const o=e[n],s=o.position+o.height;if(n+1<e.length&&s+e[n+1].height>i||n>=t-1&&t<e.length){const t=e.slice(0,n),i=e.slice(n);return[...t,this.compressStickyNodes(i)]}}return e}compressStickyNodes(e){if(0===e.length)throw new Error("Can't compress empty sticky nodes");const t=this.modelProvider();if(!t.isCompressionEnabled())return e[0];const i=[];for(let l=0;l<e.length;l++){const n=e[l],o=t.getCompressedTreeNode(n.node.element);if(o.element){if(0!==l&&o.element.incompressible)break;i.push(...o.element.elements)}}if(i.length<2)return e[0];const n=e[e.length-1],o={elements:i,incompressible:!1},s={...n.node,children:[],element:o},r=new Proxy(e[0].node,{}),a={node:r,startIndex:e[0].startIndex,endIndex:n.endIndex,position:e[0].position,height:e[0].height};return this.compressedStickyNodes.set(r,s),a}},vU=class extends fU{constructor(e,t,i,n,o={}){const s=()=>this,r=new bU(()=>this.model);super(e,t,i,n.map(e=>new _U(s,r,e)),{...aye(s,o),stickyScrollDelegate:r})}setChildren(e,t=ke.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t){return new pU(e,t)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}},wU=class e{get element(){return this.node.element.element}get children(){return this.node.children.map(t=>new e(t))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}},CU=class{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...mo.asClassNameArray(go.treeItemLoading)),!0):(t.classList.remove(...mo.asClassNameArray(go.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}},yU=class extends $N{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}},SU=class{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(uye(e),t)}onDragOver(e,t,i,n,o,s=!0){return this.dnd.onDragOver(uye(e),t&&t.element,i,n,o)}drop(e,t,i,n,o){this.dnd.drop(uye(e),t&&t.element,i,n,o)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}},xU=class extends $z{constructor(e,t,i){super(t,i),this.findProvider=e,this.isFindSessionActive=!1}filter(e,t){const i=super.filter(e,t);return this.isFindSessionActive&&this.findMode!==Zz.Highlight&&this.findProvider.isVisible?0===$Ce(jCe(i)?i.visibility:i)?0:this.findProvider.isVisible(e)?i:0:i}},kU=class extends Jz{constructor(e,t,i,n,o){super(e,i,n,o),this.findProvider=t,this.filter=i,this.activeSession=!1,this.asyncWorkInProgress=!1,this.disposables.add(Dle(async()=>{this.activeSession&&await(this.findProvider.endSession?.())}))}render(){if(this.asyncWorkInProgress||!this.activeFindMetadata)return;const e=0===this.activeFindMetadata.matchCount&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.activeFindMetadata.matchCount)}shouldAllowFocus(e){return this.shouldFocusWhenNavigating(e)}shouldFocusWhenNavigating(e){if(!this.activeSession||!this.activeFindMetadata)return!0;const t=e.element?.element;return!(!t||!this.activeFindMetadata.isMatch(t))||!rD.isDefault(e.filterData)}},LU=class{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return Be.map(this.tree.onDidChangeFocus,cye)}get onDidChangeSelection(){return Be.map(this.tree.onDidChangeSelection,cye)}get onMouseDblClick(){return Be.map(this.tree.onMouseDblClick,hye)}get onPointer(){return Be.map(this.tree.onPointer,hye)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new je,this._onDidChangeNodeSlowState=new je,this.nodeMapper=new Rz(e=>new wU(e)),this.disposables=new De,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=void 0!==s.autoExpandSingleChildren&&s.autoExpandSingleChildren,this.sorter=s.sorter,this.getDefaultCollapseState=e=>s.collapseByDefault?s.collapseByDefault(e)?Ez.PreserveOrCollapsed:Ez.PreserveOrExpanded:void 0;let r,a=!1;if(s.findProvider&&(s.findWidgetEnabled??1)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider&&(a=!0,r=new xU(s.findProvider,s.keyboardNavigationLabelProvider,s.filter)),this.tree=this.createTree(e,t,i,n,{...s,findWidgetEnabled:!a,filter:r??s.filter}),this.root=lye({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables),a){const e={styles:s.findWidgetStyles,showNotFoundMessage:s.showNotFoundMessage,defaultFindMatchType:s.defaultFindMatchType,defaultFindMode:s.defaultFindMode};this.findController=this.disposables.add(new kU(this.tree,s.findProvider,r,this.tree.options.contextViewProvider,e)),this.focusNavigationFilter=e=>this.findController.shouldFocusWhenNavigating(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindOpenState=this.tree.onDidChangeFindOpenState,this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType}createTree(e,t,i,n,o){return new fU(e,t,new Uz(i),n.map(e=>new CU(e,this.nodeMapper,this._onDidChangeNodeSlowState.event)),gye(o)||{})}updateOptions(e={}){this.findController&&(void 0!==e.defaultFindMode&&(this.findController.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.findController.matchType=e.defaultFindMatchType)),this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.cancelAllRefreshPromises(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}cancelAllRefreshPromises(e=!1){this.refreshPromises.forEach(e=>e.cancel()),this.refreshPromises.clear(),e&&(this.subTreeRefreshPromises.forEach(e=>e.cancel()),this.subTreeRefreshPromises.clear())}async _updateChildren(e=this.root.element,t=!0,i=!1,n,o){if(void 0===this.root.element)throw new Tz(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await Be.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(await this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch{}}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(void 0===this.root.element)throw new Tz(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await Be.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(await i.refreshPromise,await Be.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i))return!1;const n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await i.refreshPromise,await Be.toPromise(this._onDidRender.event)),n}setSelection(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(e=>e.element)}setFocus(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(e=>e.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t){const t=this.identityProvider?.getId(e).toString();throw new Tz(this.user,"Data tree node not found"+(t?`: ${t}`:""))}return t}async refreshAndRenderNode(e,t,i,n){this.disposables.isDisposed||(await this.refreshNode(e,t,i),this.disposables.isDisposed||this.render(e,i,n))}async refreshNode(e,t,i){let n;return this.subTreeRefreshPromises.forEach((o,s)=>{!n&&function(e,t){return e===t||dye(e,t)||dye(t,e)}(s,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n||(e!==this.root&&this.tree.getNode(e).collapsed?(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,void this.setChildren(e,[],t,i)):this.doRefreshSubTree(e,t,i))}async doRefreshSubTree(e,t,i){const n=Ele(async()=>{const n=await this.doRefreshNode(e,t,i);e.stale=!1,await yt.settled(n.map(e=>this.doRefreshSubTree(e,t,i)))});return e.refreshPromise=n,this.subTreeRefreshPromises.set(e,n),n.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}),n}async doRefreshNode(e,t,i){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if(dle(t))n=Promise.resolve(t);else{const i=Tle(800);i.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},e=>null),n=t.finally(()=>i.cancel())}}else n=Promise.resolve(ke.empty());try{const o=await n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Yae(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return dle(i)?this.processChildren(i):(t=Ele(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch($ae))}setChildren(e,t,i,n){const o=[...t];if(0===e.children.length&&0===o.length)return[];const s=new Map,r=new Map;for(const d of e.children)s.set(d.element,d),this.identityProvider&&r.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const a=[],l=o.map(t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=lye({element:t,parent:e,hasChildren:o,defaultCollapseState:this.getDefaultCollapseState(t)});return o&&i.defaultCollapseState===Ez.PreserveOrExpanded&&a.push(i),i}const l=this.identityProvider.getId(t).toString(),d=r.get(l);if(d){const e=d.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?d.collapsed?(e.children.forEach(e=>pye(e,e=>this.nodes.delete(e.element))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):o&&!d.collapsed&&a.push(e),e}const c=lye({element:t,parent:e,id:l,hasChildren:o,defaultCollapseState:this.getDefaultCollapseState(t)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(c),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(c),(n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1||o&&c.defaultCollapseState===Ez.PreserveOrExpanded)&&a.push(c),c});for(const d of s.values())pye(d,e=>this.nodes.delete(e.element));for(const d of l)this.nodes.set(d.element,d);return pce(e.children,0,e.children.length,l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].forceExpanded=!0,a.push(l[0])),a}render(e,t,i){const n=e.children.map(e=>this.asTreeElement(e,t)),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}};this.tree.setChildren(e===this.root?null:e,n,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?ke.map(e.children,e=>this.asTreeElement(e,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}},DU=class e{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(t=>new e(t))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}},IU=class{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...mo.asClassNameArray(go.treeItemLoading)),!0):(t.classList.remove(...mo.asClassNameArray(go.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=kle(this.disposables)}},NU=class extends LU{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new Rz(e=>new DU(e)),this.filter=r.filter}createTree(e,t,i,n,o){return new vU(e,t,new Uz(i),n.map(e=>new IU(e,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),function(e){const t=e&&gye(e);return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(e=>e.element))},stickyScrollDelegate:t.stickyScrollDelegate}}(o)||{})}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const n=e=>this.identityProvider.getId(e).toString(),o=e=>{const t=new Set;for(const i of e){const e=this.tree.getCompressedTreeNode(i===this.root?null:i);if(e.element)for(const i of e.element.elements)t.add(n(i.element))}return t},s=o(this.tree.getSelection()),r=o(this.tree.getFocus());super.render(e,t,i);const a=this.getSelection();let l=!1;const d=this.getFocus();let c=!1;const h=e=>{const t=e.element;if(t)for(let i=0;i<t.elements.length;i++){const e=n(t.elements[i].element),o=t.elements[t.elements.length-1].element;s.has(e)&&-1===a.indexOf(o)&&(a.push(o),l=!0),r.has(e)&&-1===d.indexOf(o)&&(d.push(o),c=!0)}e.children.forEach(h)};h(this.tree.getCompressedTreeNode(e===this.root?null:e)),l&&this.setSelection(a),c&&this.setFocus(d)}processChildren(e){return this.filter&&(e=ke.filter(e,e=>{const t="boolean"==typeof(i=this.filter.filter(e,1))?i?1:0:jCe(i)?$Ce(i.visibility):$Ce(i);var i;if(2===t)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===t})),super.processChildren(e)}},EU=class extends lU{constructor(e,t,i,n,o,s={}){super(e,t,i,n,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t){return new dU(e,t)}},new Jo("isMac",F,Vae(1684,"Whether the operating system is macOS")),new Jo("isLinux",W,Vae(1685,"Whether the operating system is Linux")),MU=new Jo("isWindows",P,Vae(1686,"Whether the operating system is Windows")),TU=new Jo("isWeb",V,Vae(1687,"Whether the platform is a web browser")),new Jo("isMacNative",F&&!V,Vae(1688,"Whether the operating system is macOS on a non-browser platform")),new Jo("isIOS",U,Vae(1689,"Whether the operating system is iOS")),new Jo("isMobile",K,Vae(1690,"Whether the platform is a mobile web browser")),new Jo("isDevelopment",!1,!0),new Jo("productQualityType","",Vae(1691,"Quality type of VS Code")),OU=new Jo(RU="inputFocus",!1,Vae(1692,"Whether keyboard focus is inside an input box")),AU=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},PU=function(e,t){return function(i,n){t(i,n,e)}},FU=eue("listService"),WU=class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new De,this.lists=[],this._lastFocusedWidget=void 0}setLastFocusedList(e){e!==this._lastFocusedWidget&&(this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this.lists.some(t=>t.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),whe(e.getHTMLElement())&&this.setLastFocusedList(e),Lle(e.onDidFocus(()=>this.setLastFocusedList(e)),Dle(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(e=>e!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}},BU=new Jo("listScrollAtBoundary","none"),Po.or(BU.isEqualTo("top"),BU.isEqualTo("both")),Po.or(BU.isEqualTo("bottom"),BU.isEqualTo("both")),VU=new Jo("listFocus",!0),HU=new Jo("treestickyScrollFocused",!1),zU=new Jo("listSupportsMultiselect",!0),UU=Po.and(VU,Po.not(RU),HU.negate()),KU=new Jo("listHasSelectionOrFocus",!1),qU=new Jo("listDoubleSelection",!1),jU=new Jo("listMultiSelection",!1),$U=new Jo("listSelectionNavigation",!1),GU=new Jo("listSupportsFind",!0),ZU=new Jo("treeElementCanCollapse",!1),YU=new Jo("treeElementHasParent",!1),QU=new Jo("treeElementCanExpand",!1),XU=new Jo("treeElementHasChild",!1),JU=new Jo("treeFindOpen",!1),eK="listTypeNavigationMode",tK="listAutomaticKeyboardNavigation",iK="workbench.list.multiSelectModifier",nK="workbench.list.openMode",oK="workbench.list.horizontalScrolling",sK="workbench.list.defaultFindMode",rK="workbench.list.typeNavigationMode",aK="workbench.list.keyboardNavigation",lK="workbench.list.scrollByPage",dK="workbench.list.defaultFindMatchType",cK="workbench.tree.indent",hK="workbench.tree.renderIndentGuides",uK="workbench.list.smoothScrolling",gK="workbench.list.mouseWheelScrollSensitivity",pK="workbench.list.fastScrollSensitivity",mK="workbench.tree.expandMode",fK="workbench.tree.enableStickyScroll",_K="workbench.tree.stickyScrollMaxItemCount",bK=class extends Ie{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=_ye(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(iK)&&(this.useAltAsMultipleSelectionModifier=_ye(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Gve(e)}isSelectionRangeChangeEvent(e){return Zve(e)}},vK=class extends bE{constructor(e,t,i,n,o,s,r,a,l){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(oK)),[c,h]=l.invokeFunction(bye,o);super(e,t,i,n,{keyboardSupport:!1,...c,horizontalScrolling:d}),this.disposables.add(h),this.contextKeyService=mye(s,this),this.disposables.add(fye(this.contextKeyService,this)),this.listSupportsMultiSelect=zU.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),$U.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=KU.bindTo(this.contextKeyService),this.listDoubleSelection=qU.bindTo(this.contextKeyService),this.listMultiSelection=jU.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=_ye(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)})})),this.disposables.add(this.onDidChangeFocus(()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)})),this.disposables.add(a.onDidChangeConfiguration(e=>{e.affectsConfiguration(iK)&&(this._useAltAsMultipleSelectionModifier=_ye(a));let t={};if(e.affectsConfiguration(oK)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(oK));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(lK)){const e=Boolean(a.getValue(lK));t={...t,scrollByPage:e}}if(e.affectsConfiguration(uK)){const e=Boolean(a.getValue(uK));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(gK)){const e=a.getValue(gK);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(pK)){const e=a.getValue(pK);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new SK(this,{configurationService:a,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ywe(e):uR)}},vK=AU([PU(5,es),PU(6,FU),PU(7,ka),PU(8,Jn)],vK),wK=class extends vz{constructor(e,t,i,n,o,s,r,a,l){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(a.getValue(oK)),[c,h]=l.invokeFunction(bye,o);super(e,t,i,n,{keyboardSupport:!1,...c,horizontalScrolling:d}),this.disposables=new De,this.disposables.add(h),this.contextKeyService=mye(s,this),this.disposables.add(fye(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=zU.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport),$U.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this._useAltAsMultipleSelectionModifier=_ye(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(a.onDidChangeConfiguration(e=>{e.affectsConfiguration(iK)&&(this._useAltAsMultipleSelectionModifier=_ye(a));let t={};if(e.affectsConfiguration(oK)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(oK));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(lK)){const e=Boolean(a.getValue(lK));t={...t,scrollByPage:e}}if(e.affectsConfiguration(uK)){const e=Boolean(a.getValue(uK));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(gK)){const e=a.getValue(gK);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(pK)){const e=a.getValue(pK);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new SK(this,{configurationService:a,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ywe(e):uR)}dispose(){this.disposables.dispose(),super.dispose()}},wK=AU([PU(5,es),PU(6,FU),PU(7,ka),PU(8,Jn)],wK),CK=class extends Nz{constructor(e,t,i,n,o,s,r,a,l,d){const c=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(l.getValue(oK)),[h,u]=d.invokeFunction(bye,s);super(e,t,i,n,o,{keyboardSupport:!1,...h,horizontalScrolling:c}),this.disposables.add(u),this.contextKeyService=mye(r,this),this.disposables.add(fye(this.contextKeyService,this)),this.listSupportsMultiSelect=zU.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport),$U.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=KU.bindTo(this.contextKeyService),this.listDoubleSelection=qU.bindTo(this.contextKeyService),this.listMultiSelection=jU.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=_ye(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)})})),this.disposables.add(this.onDidChangeFocus(()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)})),this.disposables.add(l.onDidChangeConfiguration(e=>{e.affectsConfiguration(iK)&&(this._useAltAsMultipleSelectionModifier=_ye(l));let t={};if(e.affectsConfiguration(oK)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(oK));t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(lK)){const e=Boolean(l.getValue(lK));t={...t,scrollByPage:e}}if(e.affectsConfiguration(uK)){const e=Boolean(l.getValue(uK));t={...t,smoothScrolling:e}}if(e.affectsConfiguration(gK)){const e=l.getValue(gK);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(pK)){const e=l.getValue(pK);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new xK(this,{configurationService:l,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ywe(e):uR)}dispose(){this.disposables.dispose(),super.dispose()}},CK=AU([PU(6,es),PU(7,FU),PU(8,ka),PU(9,Jn)],CK),yK=class extends Ie{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new je),this.onDidOpen=this._onDidOpen.event,this._register(Be.filter(this.widget.onDidChangeSelection,e=>Ihe(e.browserEvent))(e=>this.onSelectionFromKeyboard(e))),this._register(this.widget.onPointer(e=>this.onPointer(e.element,e.browserEvent))),this._register(this.widget.onMouseDblClick(e=>this.onMouseDblClick(e.element,e.browserEvent))),"boolean"!=typeof t?.openOnSingleClick&&t?.configurationService?(this.openOnSingleClick="doubleClick"!==t?.configurationService.getValue(nK),this._register(t?.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(nK)&&(this.openOnSingleClick="doubleClick"!==t?.configurationService.getValue(nK))}))):this.openOnSingleClick=t?.openOnSingleClick??!0}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:o})}},SK=class extends yK{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}},xK=class extends yK{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}},kK=class extends yK{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}},LK=class extends fU{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,s,r,a,l){const{options:d,getTypeNavigationMode:c,disposable:h}=s.invokeFunction(yye,o);super(e,t,i,n,d),this.disposables.add(h),this.internals=new MK(this,o,c,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}},LK=AU([PU(5,Jn),PU(6,es),PU(7,FU),PU(8,ka)],LK),DK=class extends vU{constructor(e,t,i,n,o,s,r,a,l){const{options:d,getTypeNavigationMode:c,disposable:h}=s.invokeFunction(yye,o);super(e,t,i,n,d),this.disposables.add(h),this.internals=new MK(this,o,c,o.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}},DK=AU([PU(5,Jn),PU(6,es),PU(7,FU),PU(8,ka)],DK),IK=class extends EU{constructor(e,t,i,n,o,s,r,a,l,d){const{options:c,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(yye,s);super(e,t,i,n,o,c),this.disposables.add(u),this.internals=new MK(this,s,h,s.overrideStyles,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),void 0!==e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}},IK=AU([PU(6,Jn),PU(7,es),PU(8,FU),PU(9,ka)],IK),NK=class extends LU{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,o,s,r,a,l,d){const{options:c,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(yye,s);super(e,t,i,n,o,c),this.disposables.add(u),this.internals=new MK(this,s,h,s.overrideStyles,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}},NK=AU([PU(6,Jn),PU(7,es),PU(8,FU),PU(9,ka)],NK),EK=class extends NU{constructor(e,t,i,n,o,s,r,a,l,d,c){const{options:h,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(yye,r);super(e,t,i,n,o,s,h),this.disposables.add(g),this.internals=new MK(this,r,u,r.overrideStyles,l,d,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}},EK=AU([PU(7,Jn),PU(8,es),PU(9,FU),PU(10,ka)],EK),MK=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,o,s,r){this.tree=e,this.disposables=[],this.contextKeyService=mye(o,e),this.disposables.push(fye(this.contextKeyService,e)),this.listSupportsMultiSelect=zU.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport),$U.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=GU.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=KU.bindTo(this.contextKeyService),this.hasDoubleSelection=qU.bindTo(this.contextKeyService),this.hasMultiSelection=jU.bindTo(this.contextKeyService),this.treeElementCanCollapse=ZU.bindTo(this.contextKeyService),this.treeElementHasParent=YU.bindTo(this.contextKeyService),this.treeElementCanExpand=QU.bindTo(this.contextKeyService),this.treeElementHasChild=XU.bindTo(this.contextKeyService),this.treeFindOpen=JU.bindTo(this.contextKeyService),this.treeStickyScrollFocused=HU.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=_ye(r),this.updateStyleOverrides(n);const a=()=>{const t=e.getFocus()[0];if(!t)return;const i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},l=new Set;l.add(eK),l.add(tK),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)})}),e.onDidChangeFocus(()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),a()}),e.onDidChangeCollapseState(a),e.onDidChangeModel(a),e.onDidChangeFindOpenState(e=>this.treeFindOpen.set(e)),e.onDidChangeStickyScrollFocused(e=>this.treeStickyScrollFocused.set(e)),r.onDidChangeConfiguration(n=>{let o={};if(n.affectsConfiguration(iK)&&(this._useAltAsMultipleSelectionModifier=_ye(r)),n.affectsConfiguration(cK)){const e=r.getValue(cK);o={...o,indent:e}}if(n.affectsConfiguration(hK)&&void 0===t.renderIndentGuides){const e=r.getValue(hK);o={...o,renderIndentGuides:e}}if(n.affectsConfiguration(uK)){const e=Boolean(r.getValue(uK));o={...o,smoothScrolling:e}}if(n.affectsConfiguration(sK)||n.affectsConfiguration(aK)){const e=wye(r);o={...o,defaultFindMode:e}}if(n.affectsConfiguration(rK)||n.affectsConfiguration(aK)){const e=i();o={...o,typeNavigationMode:e}}if(n.affectsConfiguration(dK)){const e=Cye(r);o={...o,defaultFindMatchType:e}}if(n.affectsConfiguration(oK)&&void 0===t.horizontalScrolling){const e=Boolean(r.getValue(oK));o={...o,horizontalScrolling:e}}if(n.affectsConfiguration(lK)){const e=Boolean(r.getValue(lK));o={...o,scrollByPage:e}}if(n.affectsConfiguration(mK)&&void 0===t.expandOnlyOnTwistieClick&&(o={...o,expandOnlyOnTwistieClick:"doubleClick"===r.getValue(mK)}),n.affectsConfiguration(fK)){const e=r.getValue(fK);o={...o,enableStickyScroll:e}}if(n.affectsConfiguration(_K)){const e=Math.max(1,r.getValue(_K));o={...o,stickyScrollMaxItemCount:e}}if(n.affectsConfiguration(gK)){const e=r.getValue(gK);o={...o,mouseWheelScrollSensitivity:e}}if(n.affectsConfiguration(pK)){const e=r.getValue(pK);o={...o,fastScrollSensitivity:e}}Object.keys(o).length>0&&e.updateOptions(o)}),this.contextKeyService.onDidChangeContext(t=>{t.affectsSome(l)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new kK(e,{configurationService:r,...t}),this.disposables.push(this.navigator)}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?ywe(e):uR)}dispose(){this.disposables=kle(this.disposables)}},MK=AU([PU(4,es),PU(5,FU),PU(6,ka)],MK),ts.as(Pa.Configuration).registerConfiguration({id:"workbench",order:7,title:Vae(1705,"Workbench"),type:"object",properties:{[iK]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[Vae(1706,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),Vae(1707,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:Vae(1708,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[nK]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:Vae(1709,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[oK]:{type:"boolean",default:!1,description:Vae(1710,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[lK]:{type:"boolean",default:!1,description:Vae(1711,"Controls whether clicks in the scrollbar scroll page by page.")},[cK]:{type:"number",default:8,minimum:4,maximum:40,description:Vae(1712,"Controls tree indentation in pixels.")},[hK]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:Vae(1713,"Controls whether the tree should render indent guides.")},[uK]:{type:"boolean",default:!1,description:Vae(1714,"Controls whether lists and trees have smooth scrolling.")},[gK]:{type:"number",default:1,markdownDescription:Vae(1715,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[pK]:{type:"number",default:5,markdownDescription:Vae(1716,"Scrolling speed multiplier when pressing `Alt`.")},[sK]:{type:"string",enum:["highlight","filter"],enumDescriptions:[Vae(1717,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),Vae(1718,"Filter elements when searching.")],default:"highlight",description:Vae(1719,"Controls the default find mode for lists and trees in the workbench.")},[aK]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[Vae(1720,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),Vae(1721,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),Vae(1722,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:Vae(1723,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:Vae(1724,"Please use 'workbench.list.defaultFindMode' and\t'workbench.list.typeNavigationMode' instead.")},[dK]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[Vae(1725,"Use fuzzy matching when searching."),Vae(1726,"Use contiguous matching when searching.")],default:"fuzzy",description:Vae(1727,"Controls the type of matching used when searching lists and trees in the workbench.")},[mK]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:Vae(1728,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[fK]:{type:"boolean",default:!0,description:Vae(1729,"Controls whether sticky scrolling is enabled in trees.")},[_K]:{type:"number",minimum:1,default:7,markdownDescription:Vae(1730,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[rK]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:Vae(1731,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}}),TK=class{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=fD.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(){const e=this.parent.getPreview(this)?.preview(this.range);return e?Vae(1088,"{0} in {1} on line {2} at column {3}",e.value,Os(this.uri),this.range.startLineNumber,this.range.startColumn):Vae(1087,"in {0} on line {1} at column {2}",Os(this.uri),this.range.startLineNumber,this.range.startColumn)}},RK=class{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:n,startColumn:o,endLineNumber:s,endColumn:r}=e,a=new mr(n,i.getWordUntilPosition({lineNumber:n,column:o-t}).startColumn,n,o),l=new mr(s,r,s,1073741824),d=i.getValueInRange(a).replace(/^\s+/,""),c=i.getValueInRange(e);return{value:d+c+i.getValueInRange(l).replace(/\s+$/,""),highlight:{start:d.length,end:d.length+c.length}}}},OK=class{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new ys}dispose(){kle(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return 1===e?Vae(1089,"1 symbol in {0}, full path {1}",Os(this.uri),this.uri.fsPath):Vae(1090,"{0} symbols in {1}, full path {2}",e,Os(this.uri),this.uri.fsPath)}async resolve(e){if(0!==this._previews.size)return this;for(const i of this.children)if(!this._previews.has(i.uri))try{const t=await e.createModelReference(i.uri);this._previews.set(i.uri,new RK(t))}catch(t){$ae(t)}return this}},AK=class e{constructor(t,i){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new je,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=t,this._title=i;const[n]=t;let o;t.sort(e._compareReferences);for(const s of t)if(o&&Ms.isEqual(o.uri,s.uri,!0)||(o=new OK(this,s.uri),this.groups.push(o)),0===o.children.length||0!==e._compareReferences(s,o.children[o.children.length-1])){const e=new TK(n===s,o,s,e=>this._onDidChangeReferenceRange.fire(e));this.references.push(e),o.children.push(e)}}dispose(){kle(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new e(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?Vae(1091,"No results found"):1===this.references.length?Vae(1092,"Found 1 symbol in {0}",this.references[0].uri.fsPath):1===this.groups.length?Vae(1093,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):Vae(1094,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let n=i.children.indexOf(e);const o=i.children.length,s=i.parent.groups.length;return 1===s||t&&n+1<o||!t&&n>0?(n=t?(n+1)%o:(n+o-1)%o,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%s,i.parent.groups[n].children[0]):(n=(n+s-1)%s,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map((i,n)=>({idx:n,prefixLen:sde(i.uri.toString(),e.toString()),offsetDist:100*Math.abs(i.range.startLineNumber-t.lineNumber)+Math.abs(i.range.startColumn-t.column)})).sort((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLen<t.prefixLen?1:e.offsetDist<t.offsetDist?-1:e.offsetDist>t.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&mr.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Ms.compare(e.uri,t.uri)||mr.compareRangesUsingStarts(e.range,t.range)}},PK=class extends Ie{constructor(e,t,i){super(),this.options=t,this.styles=i,this.count=0,this.hover=this._register(new Ne),this.element=Mhe(e,Ahe(".monaco-count-badge")),this._register(Dle(()=>e.removeChild(this.element))),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0),this.updateHover()}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.updateHover(),this.render()}updateHover(){""===this.titleFormat||this.hover.value?""===this.titleFormat&&this.hover.value&&(this.hover.value=void 0):this.hover.value=Bve().setupDelayedHoverAtMouse(this.element,()=>({content:Fle(this.titleFormat,this.count),appearance:{compact:!0}}))}render(){this.element.textContent=Fle(this.countFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}},FK=class e extends Ie{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=Mhe(e,Ahe("span.monaco-highlighted-label"))}get element(){return this.domNode}set(t,i=[],n="",o,s){t||(t=""),o&&(t=e.escapeNewLines(t,i)),this.didEverRender&&this.text===t&&this.title===n&&Uue(this.highlights,i)||(this.text=t,this.title=n,this.highlights=i,this.render(s))}render(e){const t=[];let i=0;for(const n of this.highlights){if(n.end===n.start)continue;if(i<n.start){const o=this.text.substring(i,n.start);e?t.push(...gve(o)):t.push(o),i=n.start}const o=this.text.substring(i,n.end),s=Ahe("span.highlight",void 0,...e?gve(o):[o]);n.extraClasses&&s.classList.add(...n.extraClasses),t.push(s),i=n.end}if(i<this.text.length){const n=this.text.substring(i);e?t.push(...gve(n)):t.push(n)}if(Rhe(this.domNode,...t),this.customHover||""===this.title)this.customHover&&this.customHover.update(this.title);else{const e=this.options?.hoverDelegate??$_e("mouse");this.customHover=this._register(Bve().setupManagedHover(e,this.domNode,this.title))}this.didEverRender=!0}static escapeNewLines(e,t){let i=0,n=0;return e.replace(/\r\n|\r|\n/g,(e,o)=>{n="\r\n"===e?-1:0,o+=i;for(const i of t)i.end<=o||(i.start>=o&&(i.start+=n),i.end>=o&&(i.end+=n));return i+=n,"⏎"})}},WK=class{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||Uue(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}},BK=class extends Ie{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new WK(Mhe(e,Ahe(".monaco-icon-label")))),this.labelContainer=Mhe(this.domNode.element,Ahe(".monaco-icon-label-container")),this.nameContainer=Mhe(this.labelContainer,Ahe("span.monaco-icon-name-container")),this.nameNode=t?.supportHighlights||t?.supportIcons?this._register(new HK(this.nameContainer,!!t.supportIcons)):new VK(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??$_e("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],o=["monaco-icon-label-container"];let s="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.bold&&n.push("bold"),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&("string"==typeof i.title?s+=i.title:s+=e));const r=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let e;if(r&&xhe(r)?e=r:(e=Ahe(".monaco-icon-label-iconpath"),this.domNode.element.prepend(e)),mo.isThemeIcon(i.iconPath)){const t=mo.asClassName(i.iconPath);e.className=`monaco-icon-label-iconpath ${t}`,e.style.backgroundImage=""}else e.style.backgroundImage=X_e(i?.iconPath);e.style.backgroundRepeat="no-repeat",e.style.backgroundPosition="center",e.style.backgroundSize="contain"}else r&&r.remove();if(this.domNode.classNames=n,this.domNode.element.setAttribute("aria-label",s),this.labelContainer.classList.value="",this.labelContainer.classList.add(...o),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const e=this.getOrCreateDescriptionNode();if(e instanceof FK){const n=i?.supportIcons??this.creationOptions?.supportIcons;e.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines,n),this.setupHover(e.element,i?.descriptionTitle)}else e.textContent=t&&i?.labelEscapeNewLines?FK.escapeNewLines(t,[]):t||"",this.setupHover(e.element,i?.descriptionTitle||""),e.empty=!t}(i?.suffix||this.suffixNode)&&(this.getOrCreateSuffixNode().textContent=i?.suffix??"")}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t)return void e.removeAttribute("title");let n=e;if(this.creationOptions?.hoverTargetOverride){if(!phe(e,this.creationOptions.hoverTargetOverride))throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");n=this.creationOptions.hoverTargetOverride}const o=Bve().setupManagedHover(this.hoverDelegate,n,t);o&&this.customHovers.set(e,o)}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const i=this._register(new WK((e=this.nameContainer,t=Ahe("span.monaco-icon-suffix-container"),e.after(t),t)));this.suffixNode=this._register(new WK(Mhe(i.element,Ahe("span.label-suffix"))))}var e,t;return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){const e=this._register(new WK(Mhe(this.labelContainer,Ahe("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new FK(Mhe(e.element,Ahe("span.label-description")))):this.descriptionNode=this._register(new WK(Mhe(e.element,Ahe("span.label-description"))))}return this.descriptionNode}},VK=class{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!Uue(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=Mhe(this.container,Ahe("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const n=e[i],o=t?.domId&&`${t?.domId}_${i}`;Mhe(this.container,Ahe("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&Mhe(this.container,Ahe("span.label-separator",void 0,t?.separator||"/"))}}}},HK=class extends Ie{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label===e&&Uue(this.options,t))return;this.label=e,this.options=t;const i=t?.supportIcons??this.supportIcons;if("string"==typeof e)this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new FK(Mhe(this.container,Ahe("a.label-name",{id:t?.domId}))))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines,i);else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;const n=t?.separator||"/",o=function(e,t,i){if(!i)return;let n=0;return e.map(e=>{const o={start:n,end:n+e.length},s=i.map(e=>HN.intersect(o,e)).filter(e=>!HN.isEmpty(e)).map(({start:e,end:t})=>({start:e-n,end:t-n}));return n=o.end+t.length,s})}(e,n,t?.matches);for(let s=0;s<e.length;s++){const r=e[s],a=o?o[s]:void 0,l=Ahe("a.label-name",{id:t?.domId&&`${t?.domId}_${s}`,"data-icon-label-count":e.length,"data-icon-label-index":s,role:"treeitem"});this._register(new FK(Mhe(this.container,l))).set(r,a,void 0,t?.labelEscapeNewLines,i),s<e.length-1&&Mhe(l,Ahe("span.label-separator",void 0,n))}}}},zK=eue("labelService"),KK=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},qK=function(e,t){return function(i,n){t(i,n,e)}},$K=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof AK||e instanceof OK}getChildren(e){if(e instanceof AK)return e.groups;if(e instanceof OK)return e.resolve(this._resolverService).then(e=>e.children);throw new Error("bad tree")}},$K=KK([qK(0,no)],$K),GK=class{getHeight(){return 23}getTemplateId(e){return e instanceof OK?XK.id:eq.id}},ZK=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){if(e instanceof TK){const t=e.parent.getPreview(e)?.preview(e.range);if(t)return t.value}return Os(e.uri)}},ZK=KK([qK(0,xw)],ZK),YK=class{getId(e){return e instanceof TK?e.id:e.uri}},QK=class extends Ie{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new BK(i,{supportHighlights:!0})),this.badge=this._register(new PK(Mhe(i,Ahe(".count")),{},hR)),e.appendChild(i)}set(e,t){const i=Ps(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const n=e.children.length;this.badge.setCount(n),n>1?this.badge.setTitleFormat(Vae(1081,"{0} references",n)):this.badge.setTitleFormat(Vae(1082,"{0} reference",n))}},QK=KK([qK(1,zK)],QK),jK=UK=class{constructor(e){this._instantiationService=e,this.templateId=jK.id}renderTemplate(e){return this._instantiationService.createInstance(QK,e)}renderElement(e,t,i){i.set(e.element,Lbe(e.filterData))}disposeTemplate(e){e.dispose()}},UK.id="FileReferencesRenderer",XK=UK,XK=jK=KK([qK(0,Jn)],XK),JK=class extends Ie{constructor(e){super(),this.label=this._register(new FK(e))}set(e,t){const i=e.parent.getPreview(e)?.preview(e.range);if(i&&i.value){const{value:e,highlight:n}=i;t&&!rD.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(e,Lbe(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(e,[n]))}else this.label.set(`${Os(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`)}},(eq=class e{constructor(){this.templateId=e.id}renderTemplate(e){return new JK(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}}).id="OneReferenceRenderer",tq=class{getWidgetAriaLabel(){return Vae(1083,"References")}getAriaLabel(e){return e.ariaMessage}},iq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},nq=function(e,t){return function(i,n){t(i,n,e)}},oq=class e{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new De,this._callOnModelChange=new De,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e)for(const t of this._model.references)if(t.uri.toString()===e.uri.toString())return void this._addDecorations(t.parent)}_addDecorations(t){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const i=[],n=[];for(let o=0,s=t.children.length;o<s;o++){const s=t.children[o];this._decorationIgnoreSet.has(s.id)||s.uri.toString()===this._editor.getModel().uri.toString()&&(i.push({range:s.range,options:e.DecorationOptions}),n.push(o))}this._editor.changeDecorations(e=>{const o=e.deltaDecorations([],i);for(let i=0;i<o.length;i++)this._decorations.set(o[i],t.children[n[i]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,n]of this._decorations){const o=t.getDecorationRange(i);if(!o)continue;let s=!1;mr.equalsRange(o,n.range)||((mr.spansMultipleLines(o)||n.range.endColumn-n.range.startColumn!==o.endColumn-o.startColumn)&&(s=!0),s?(this._decorationIgnoreSet.add(n.id),e.push(i)):n.range=o)}for(let t=0,i=e.length;t<i;t++)this._decorations.delete(e[t]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}},oq.DecorationOptions=Lx.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"}),sq=class{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const n=JSON.parse(e);t=n.ratio,i=n.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}},rq=class extends NK{},aq=class{constructor(e){this.labelService=e,this.disposables=new De}getDragURI(e){return e instanceof OK?e.uri.toString():e instanceof TK?(t=e.uri,i=e.range,t.with({fragment:`${i.startLineNumber},${i.startColumn}${i.endLineNumber?`-${i.endLineNumber}${i.endColumn?`,${i.endColumn}`:""}`:""}`})).toString():null;var t,i}getDragLabel(e){if(0!==e.length)return e.map(e=>this.labelService.getUriBasenameLabel(e.uri)).join(", ")}onDragStart(e,t){if(!t.dataTransfer)return;const i=e.elements.map(e=>this.getDragURI(e)).filter(Boolean);i.length&&(t.dataTransfer.setData(FL.RESOURCES,JSON.stringify(i)),t.dataTransfer.setData(FL.TEXT,i.join("\n")))}onDragOver(){return!1}drop(){}dispose(){this.disposables.dispose()}},aq=iq([nq(0,zK)],aq),lq=class extends cz{constructor(e,t,i,n,o,s,r,a,l){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},s),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=s,this._peekViewService=r,this._uriLabel=a,this._keybindingService=l,this._disposeOnNewModel=new De,this._callOnDispose=new De,this._onDidSelectReference=new je,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new Tn(0,0),this._isClosing=!1,this._applyTheme(n.getColorTheme()),this._callOnDispose.add(n.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}get isClosing(){return this._isClosing}dispose(){this._isClosing=!0,this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),kle(this._preview),kle(this._previewNotAvailableMessage),kle(this._tree),kle(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(pz)||eh.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(hz)||eh.transparent,primaryHeadingColor:e.getColor(uz),secondaryHeadingColor:e.getColor(gz)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=Mhe(e,Ahe("div.messages")),Fhe(this._messageContainer),this._splitView=new Lz(e,{orientation:1}),this._previewContainer=Mhe(e,Ahe("div.preview.inline")),this._preview=this._instantiationService.createInstance(YH,this._previewContainer,{scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}},{},this.editor),Fhe(this._previewContainer),this._previewNotAvailableMessage=this._instantiationService.createInstance(vx,Vae(1084,"no preview available"),Ga,vx.DEFAULT_CREATION_OPTIONS,null),this._treeContainer=Mhe(e,Ahe("div.ref-tree.inline"));const t={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new tq,keyboardNavigationLabelProvider:this._instantiationService.createInstance(ZK),identityProvider:new YK,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:mz},dnd:this._instantiationService.createInstance(aq)};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(xn(this._treeContainer,"keydown",e=>{e.equals(9)&&(this._keybindingService.dispatchEvent(e,e.target),e.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(rq,"ReferencesWidget",this._treeContainer,new GK,[this._instantiationService.createInstance(XK),this._instantiationService.createInstance(eq)],this._instantiationService.createInstance($K),t),this._splitView.addView({onDidChange:Be.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:e=>{this._preview.layout({height:this._dim.height,width:e})}},kz.Distribute),this._splitView.addView({onDidChange:Be.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:e=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${e}px`,this._tree.layout(this._dim.height,e)}},kz.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const i=(e,t)=>{e instanceof TK&&("show"===t&&this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:t,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(e=>{e.sideBySide?i(e.element,"side"):e.editorOptions.pinned?i(e.element,"goto"):i(e.element,"show")})),Fhe(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Tn(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=Vae(1085,"No results"),Phe(this._messageContainer),Promise.resolve(void 0)):(Fhe(this._messageContainer),this._decorationsManager=new oq(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(2!==t.detail)return;const n=this._getFocusedReference();n&&this._onDidSelectReference.fire({element:{uri:n.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Phe(this._treeContainer),Phe(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(1===this._model.groups.length?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();return e instanceof TK?e:e instanceof OK&&e.children.length>0?e.children[0]:void 0}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==yi.inMemory?this.setTitle(Rs(e.uri),this._uriLabel.getUriLabel(Ps(e.uri))):this.setTitle(Vae(1086,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent||(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent)),this._tree.reveal(e);const n=await i;if(!this._model)return void n.dispose();kle(this._previewModelReference);const o=n.object;if(o){const t=this._preview.getModel()===o.textEditorModel?0:1,i=mr.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(o.textEditorModel),this._preview.setSelection(i),this._preview.revealRangeInCenter(i,t)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}},lq=iq([nq(3,Sf),nq(4,no),nq(5,Jn),nq(6,rz),nq(7,zK),nq(8,xw)],lq),cq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},hq=function(e,t){return function(i,n){t(i,n,e)}},gq=new Jo("referenceSearchVisible",!1,Vae(1078,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'")),dq=class{static get(e){return e.getContribution(uq.ID)}constructor(e,t,i,n,o,s,r,a){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=o,this._instantiationService=s,this._storageService=r,this._configurationService=a,this._disposables=new De,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=gq.bindTo(i)}dispose(){this._referenceSearchVisible.reset(),this._disposables.dispose(),this._widget?.dispose(),this._model?.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let n;if(this._widget&&(n=this._widget.position),this.closeWidget(),n&&e.containsPosition(n))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",s=sq.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(lq,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(Vae(1079,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget?(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget.isClosing||this.closeWidget(),this._widget=void 0):this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(e=>{const{element:t,kind:n}=e;if(t)switch(n){case"open":"editor"===e.source&&this._configurationService.getValue("editor.stablePeek")||this.openReference(t,!1,!1);break;case"side":this.openReference(t,!0,!1);break;case"goto":i?this._gotoReference(t,!0):this.openReference(t,!1,!0)}}));const r=++this._requestIdPool;t.then(t=>{if(r===this._requestIdPool&&this._widget)return this._model?.dispose(),this._model=t,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(Vae(1080,"{0} ({1})",this._model.title,this._model.references.length));const t=this._editor.getModel().uri,i=new to(e.startLineNumber,e.startColumn),n=this._model.nearestReference(t,i);if(n)return this._widget.setSelection(n).then(()=>{this._widget&&"editor"===this._editor.getOption(99)&&this._widget.focusOnPreviewEditor()})}});t.dispose()},e=>{this._notificationService.error(e)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const n=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(n),await this._gotoReference(n,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(e){this._editor.hasModel()&&this._model&&this._widget&&await this._widget.revealReference(e)}closeWidget(e=!0){this._widget?.dispose(),this._model?.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){this._widget?.hide(),this._ignoreModelChangeEvent=!0;const i=mr.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:"code.jump",pinned:t}},this._editor).then(e=>{if(this._ignoreModelChangeEvent=!1,e&&this._widget)if(this._editor===e)this._widget.show(i),this._widget.focusOnReferenceTree();else{const t=uq.get(e),n=this._model.clone();this.closeWidget(),e.focus(),t?.toggleWidget(i,Ele(e=>Promise.resolve(n)),this._peekMode??!1)}else this.closeWidget()},e=>{this._ignoreModelChangeEvent=!1,$ae(e)})}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:o}=e;this._editorService.openCodeEditor({resource:n,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}},uq=dq,dq.ID="editor.contrib.referencesController",pq=dq,pq=uq=cq([hq(2,es),hq(3,eo),hq(4,Xv),hq(5,Jn),hq(6,eR),hq(7,ka)],pq),ns.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:vle(2089,60),when:Po.or(gq,az.inPeekEditor),handler(e){Sye(e,e=>{e.changeFocusBetweenPreviewAndReferences()})}}),ns.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:Po.or(gq,az.inPeekEditor),handler(e){Sye(e,e=>{e.goToNextOrPreviousReference(!0)})}}),ns.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:Po.or(gq,az.inPeekEditor),handler(e){Sye(e,e=>{e.goToNextOrPreviousReference(!1)})}}),_o.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),_o.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),_o.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),_o.registerCommand("closeReferenceSearch",e=>Sye(e,e=>e.closeWidget())),ns.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:Po.and(az.inPeekEditor,Po.not("config.editor.stablePeek"))}),ns.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:Po.and(gq,Po.not("config.editor.stablePeek"),Po.or(jl.editorTextFocus,OU.negate()))}),ns.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Po.and(gq,UU,ZU.negate(),QU.negate()),handler(e){const t=e.get(FU).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof TK&&Sye(e,e=>e.revealReference(t[0]))}}),ns.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Po.and(gq,UU,ZU.negate(),QU.negate()),handler(e){const t=e.get(FU).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof TK&&Sye(e,e=>e.openReference(t[0],!0,!0))}}),_o.registerCommand("openReference",e=>{const t=e.get(FU).lastFocusedList?.getFocus();Array.isArray(t)&&t[0]instanceof TK&&Sye(e,e=>e.openReference(t[0],!1,!0))}),mq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},fq=function(e,t){return function(i,n){t(i,n,e)}},_q=new Jo("hasSymbols",!1,Vae(1095,"Whether there are symbol locations that can be navigated via keyboard-only.")),bq=eue("ISymbolNavigationService"),vq=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=_q.bindTo(e)}reset(){this._ctxHasSymbols.reset(),this._currentState?.dispose(),this._currentMessage?.close(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1)return void this.reset();this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new wq(this._editorService);this._currentState=Lle(i,i.onDidChange(e=>{if(this._ignoreEditorChange)return;const i=this._editorService.getActiveCodeEditor();if(!i)return;const n=i.getModel(),o=i.getPosition();if(!n||!o)return;let s=!1,r=!1;for(const a of t.references)if(Ts(a.uri,n.uri))s=!0,r=r||mr.containsPosition(a.range,o);else if(s)break;s&&r||this.reset()}))}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:mr.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){this._currentMessage?.close();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?Vae(1096,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):Vae(1097,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}},vq=mq([fq(0,es),fq(1,eo),fq(2,Xv),fq(3,xw)],vq),dge(bq,vq,1),xue(new class extends sr{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:_q,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,t){return e.get(bq).revealNext(t)}}),ns.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:_q,primary:9,handler(e){e.get(bq).reset()}}),wq=class{constructor(e){this._listener=new Map,this._disposables=new De,this._onDidChange=new je,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),kle(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Lle(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){this._listener.get(e)?.dispose(),this._listener.delete(e)}},wq=mq([fq(0,eo)],wq),Sue("_executeDefinitionProvider",(e,t,i)=>{const n=Lye(e.get(Tx).definitionProvider,t,i,!1,it.None);return Mye(()=>n)}),Sue("_executeDefinitionProvider_recursive",(e,t,i)=>{const n=Lye(e.get(Tx).definitionProvider,t,i,!0,it.None);return Mye(()=>n)}),Sue("_executeTypeDefinitionProvider",(e,t,i)=>{const n=Nye(e.get(Tx).typeDefinitionProvider,t,i,!1,it.None);return Mye(()=>n)}),Sue("_executeTypeDefinitionProvider_recursive",(e,t,i)=>{const n=Nye(e.get(Tx).typeDefinitionProvider,t,i,!0,it.None);return Mye(()=>n)}),Sue("_executeDeclarationProvider",(e,t,i)=>{const n=Dye(e.get(Tx).declarationProvider,t,i,!1,it.None);return Mye(()=>n)}),Sue("_executeDeclarationProvider_recursive",(e,t,i)=>{const n=Dye(e.get(Tx).declarationProvider,t,i,!0,it.None);return Mye(()=>n)}),Sue("_executeReferenceProvider",(e,t,i)=>{const n=Eye(e.get(Tx).referenceProvider,t,i,!1,!1,it.None);return Mye(()=>n)}),Sue("_executeReferenceProvider_recursive",(e,t,i)=>{const n=Eye(e.get(Tx).referenceProvider,t,i,!1,!0,it.None);return Mye(()=>n)}),Sue("_executeImplementationProvider",(e,t,i)=>{const n=Iye(e.get(Tx).implementationProvider,t,i,!1,it.None);return Mye(()=>n)}),Sue("_executeImplementationProvider_recursive",(e,t,i)=>{const n=Iye(e.get(Tx).implementationProvider,t,i,!0,it.None);return Mye(()=>n)}),us.appendMenuItem(ds.EditorContext,{submenu:ds.EditorContextPeek,title:Vae(1038,"Peek"),group:"navigation",order:100}),Eq=class e{static is(t){return!(!t||"object"!=typeof t)&&(t instanceof e||!(!to.isIPosition(t.position)||!t.model))}constructor(e,t){this.model=e,this.position=t}},Mq=class e extends lr{static all(){return e._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of ke.wrap(t.menu))i.id!==ds.EditorContext&&i.id!==ds.EditorContextPeek||(i.when=Po.and(e.precondition,i.when));return t}constructor(t,i){super(e._patchConfig(i)),this.configuration=t,e._allSymbolNavigationCommands.set(i.id,this)}runEditorCommand(t,i,n,o){if(!i.hasModel())return Promise.resolve(void 0);const s=t.get(Xv),r=t.get(eo),a=t.get(AL),l=t.get(bq),d=t.get(Tx),c=t.get(Jn),h=i.getModel(),u=i.getPosition(),g=Eq.is(n)?n:new Eq(h,u),p=new fA(i,5),m=Mle(this._getLocationModel(d,g.model,g.position,p.token),p.token).then(async t=>{if(!t||p.token.isCancellationRequested)return;let s;if(Qhe(t.ariaMessage),t.referenceAt(h.uri,u)){const t=this._getAlternativeCommand(i);void 0!==t&&!e._activeAlternativeCommands.has(t)&&e._allSymbolNavigationCommands.has(t)&&(s=e._allSymbolNavigationCommands.get(t))}const a=t.references.length;if(0===a){if(!this.configuration.muteMessage){const e=h.getWordAtPosition(u);TA.get(i)?.showMessage(this._getNoResultFoundMessage(e),u)}}else{if(1!==a||!s)return this._onResult(r,l,i,t,o);e._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(t=>s.runEditorCommand(t,i,n,o).finally(()=>{e._activeAlternativeCommands.delete(this.desc.id)}))}},e=>{s.error(e)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}async _onResult(e,t,i,n,o){const s=this._getGoToPreference(i);if(i instanceof YH||!(this.configuration.openInPeek||"peek"===s&&n.references.length>1)){const r=n.firstReference(),a=n.references.length>1&&"gotoAndPeek"===s,l=await this._openReference(i,e,r,this.configuration.openToSide,!a);a&&l?this._openInPeek(l,n,o):n.dispose(),"goto"===s&&t.put(r)}else this._openInPeek(i,n,o)}async _openReference(e,t,i,n,o){let s;var r;if((r=i)&&_i.isUri(r.uri)&&mr.isIRange(r.range)&&(mr.isIRange(r.originSelectionRange)||mr.isIRange(r.targetSelectionRange))&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:mr.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(o){const e=a.getModel(),t=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===e&&t.clear()},350)}return a}}_openInPeek(e,t,i){const n=pq.get(e);n&&e.hasModel()?n.toggleWidget(i??e.getSelection(),Ele(e=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}},(Cq=Mq)._allSymbolNavigationCommands=new Map,Cq._activeAlternativeCommands=new Set,Tq=class extends Mq{async _getLocationModel(e,t,i,n){return new AK(await Lye(e.definitionProvider,t,i,!1,n),Vae(1039,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?Vae(1040,"No definition found for '{0}'",e.word):Vae(1041,"No definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleDefinitions}},mue(((yq=class e extends Tq{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,title:{...zae(1065,"Go to Definition"),mnemonicTitle:Vae(1042,"Go to &&Definition")},precondition:jl.hasDefinitionProvider,keybinding:[{when:jl.editorTextFocus,primary:70,weight:100},{when:Po.and(jl.editorTextFocus,TU),primary:2118,weight:100}],menu:[{id:ds.EditorContext,group:"navigation",order:1.1},{id:ds.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),_o.registerCommandAlias("editor.action.goToDeclaration",e.id)}}).id="editor.action.revealDefinition",yq)),mue(((Sq=class e extends Tq{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:e.id,title:zae(1066,"Open Definition to the Side"),precondition:Po.and(jl.hasDefinitionProvider,jl.isInEmbeddedEditor.toNegated()),keybinding:[{when:jl.editorTextFocus,primary:vle(2089,70),weight:100},{when:Po.and(jl.editorTextFocus,TU),primary:vle(2089,2118),weight:100}]}),_o.registerCommandAlias("editor.action.openDeclarationToTheSide",e.id)}}).id="editor.action.revealDefinitionAside",Sq)),mue(((xq=class e extends Tq{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.id,title:zae(1067,"Peek Definition"),precondition:Po.and(jl.hasDefinitionProvider,az.notInPeekEditor,jl.isInEmbeddedEditor.toNegated()),keybinding:{when:jl.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:ds.EditorContextPeek,group:"peek",order:2}}),_o.registerCommandAlias("editor.action.previewDeclaration",e.id)}}).id="editor.action.peekDefinition",xq)),Rq=class extends Mq{async _getLocationModel(e,t,i,n){return new AK(await Dye(e.declarationProvider,t,i,!1,n),Vae(1043,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?Vae(1044,"No declaration found for '{0}'",e.word):Vae(1045,"No declaration found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(67).multipleDeclarations}},mue(((kq=class e extends Rq{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.id,title:{...zae(1068,"Go to Declaration"),mnemonicTitle:Vae(1046,"Go to &&Declaration")},precondition:Po.and(jl.hasDeclarationProvider,jl.isInEmbeddedEditor.toNegated()),menu:[{id:ds.EditorContext,group:"navigation",order:1.3},{id:ds.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?Vae(1047,"No declaration found for '{0}'",e.word):Vae(1048,"No declaration found")}}).id="editor.action.revealDeclaration",kq)),mue(class extends Rq{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:zae(1069,"Peek Declaration"),precondition:Po.and(jl.hasDeclarationProvider,az.notInPeekEditor,jl.isInEmbeddedEditor.toNegated()),menu:{id:ds.EditorContextPeek,group:"peek",order:3}})}}),Oq=class extends Mq{async _getLocationModel(e,t,i,n){return new AK(await Nye(e.typeDefinitionProvider,t,i,!1,n),Vae(1049,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?Vae(1050,"No type definition found for '{0}'",e.word):Vae(1051,"No type definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleTypeDefinitions}},mue(((Lq=class e extends Oq{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,title:{...zae(1070,"Go to Type Definition"),mnemonicTitle:Vae(1052,"Go to &&Type Definition")},precondition:jl.hasTypeDefinitionProvider,keybinding:{when:jl.editorTextFocus,primary:0,weight:100},menu:[{id:ds.EditorContext,group:"navigation",order:1.4},{id:ds.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}}).ID="editor.action.goToTypeDefinition",Lq)),mue(((Dq=class e extends Oq{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,title:zae(1071,"Peek Type Definition"),precondition:Po.and(jl.hasTypeDefinitionProvider,az.notInPeekEditor,jl.isInEmbeddedEditor.toNegated()),menu:{id:ds.EditorContextPeek,group:"peek",order:4}})}}).ID="editor.action.peekTypeDefinition",Dq)),Aq=class extends Mq{async _getLocationModel(e,t,i,n){return new AK(await Iye(e.implementationProvider,t,i,!1,n),Vae(1053,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?Vae(1054,"No implementation found for '{0}'",e.word):Vae(1055,"No implementation found")}_getAlternativeCommand(e){return e.getOption(67).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(67).multipleImplementations}},mue(((Iq=class e extends Aq{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:e.ID,title:{...zae(1072,"Go to Implementations"),mnemonicTitle:Vae(1056,"Go to &&Implementations")},precondition:jl.hasImplementationProvider,keybinding:{when:jl.editorTextFocus,primary:2118,weight:100},menu:[{id:ds.EditorContext,group:"navigation",order:1.45},{id:ds.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}}).ID="editor.action.goToImplementation",Iq)),mue(((Nq=class e extends Aq{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:e.ID,title:zae(1073,"Peek Implementations"),precondition:Po.and(jl.hasImplementationProvider,az.notInPeekEditor,jl.isInEmbeddedEditor.toNegated()),keybinding:{when:jl.editorTextFocus,primary:3142,weight:100},menu:{id:ds.EditorContextPeek,group:"peek",order:5}})}}).ID="editor.action.peekImplementation",Nq)),Pq=class extends Mq{_getNoResultFoundMessage(e){return e?Vae(1057,"No references found for '{0}'",e.word):Vae(1058,"No references found")}_getAlternativeCommand(e){return e.getOption(67).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(67).multipleReferences}},mue(class extends Pq{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...zae(1074,"Go to References"),mnemonicTitle:Vae(1059,"Go to &&References")},precondition:Po.and(jl.hasReferenceProvider,az.notInPeekEditor,jl.isInEmbeddedEditor.toNegated()),keybinding:{when:jl.editorTextFocus,primary:1094,weight:100},menu:[{id:ds.EditorContext,group:"navigation",order:1.45},{id:ds.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,n){return new AK(await Eye(e.referenceProvider,t,i,!0,!1,n),Vae(1060,"References"))}}),mue(class extends Pq{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:zae(1075,"Peek References"),precondition:Po.and(jl.hasReferenceProvider,az.notInPeekEditor,jl.isInEmbeddedEditor.toNegated()),menu:{id:ds.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,n){return new AK(await Eye(e.referenceProvider,t,i,!1,!1,n),Vae(1061,"References"))}}),Fq=class extends Mq{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:zae(1076,"Go to Any Symbol"),precondition:Po.and(az.notInPeekEditor,jl.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,n){return new AK(this._references,Vae(1062,"Locations"))}_getNoResultFoundMessage(e){return e&&Vae(1063,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(67).multipleReferences}_getAlternativeCommand(){}},_o.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:_i},{name:"position",description:"The position at which to start",constraint:to.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(e,t,i,n,o,s,r)=>{ple(_i.isUri(t)),ple(to.isIPosition(i)),ple(Array.isArray(n)),ple(void 0===o||"string"==typeof o),ple(void 0===r||"boolean"==typeof r);const a=e.get(eo),l=await a.openCodeEditor({resource:t},a.getFocusedCodeEditor());if(HCe(l))return l.setPosition(i),l.revealPositionInCenterIfOutsideViewport(i,0),l.invokeWithinContext(e=>{const t=new class extends Fq{_getNoResultFoundMessage(e){return s||super._getNoResultFoundMessage(e)}}({muteMessage:!Boolean(s),openInPeek:Boolean(r),openToSide:!1},n,o);e.get(Jn).invokeFunction(t.run.bind(t),l)})}}),_o.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:_i},{name:"position",description:"The position at which to start",constraint:to.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(e,t,i,n,o)=>{e.get(fo).executeCommand("editor.action.goToLocations",t,i,n,o,void 0,!0)}}),_o.registerCommand({id:"editor.action.findReferences",handler:(e,t,i)=>{ple(_i.isUri(t)),ple(to.isIPosition(i));const n=e.get(Tx),o=e.get(eo);return o.openCodeEditor({resource:t},o.getFocusedCodeEditor()).then(e=>{if(!HCe(e)||!e.hasModel())return;const t=pq.get(e);if(!t)return;const o=Ele(t=>Eye(n.referenceProvider,e.getModel(),to.lift(i),!1,!1,t).then(e=>new AK(e,Vae(1064,"References")))),s=new mr(i.lineNumber,i.column,i.lineNumber,i.column);return Promise.resolve(t.toggleWidget(s,o,!1))})}}),_o.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations"),Bq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Vq=function(e,t){return function(i,n){t(i,n,e)}},zq=class e{constructor(){this._entries=new Ls(50)}get(t){const i=e._key(t);return this._entries.get(i)}set(t,i){const n=e._key(t);this._entries.set(n,i)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}},dge(Uq=eue("IInlayHintsCache"),zq,1),Kq=class{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return"string"==typeof e?{label:e}:e[this.index]}},qq=class{constructor(e,t){this.part=e,this.hasTriggerModifier=t}},jq=class{constructor(){this._store=new Ne,this._tokenSource=new ot}dispose(){this._store.dispose(),this._tokenSource.dispose(!0)}reset(){return this._tokenSource.dispose(!0),this._tokenSource=new ot,this._store.value=new De,{store:this._store.value,token:this._tokenSource.token}}},Wq=class{static get(e){return e.getContribution(Hq.ID)??void 0}constructor(e,t,i,n,o,s,r){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=o,this._notificationService=s,this._instaService=r,this._disposables=new De,this._sessionDisposables=new De,this._decorationsMetadata=new Map,this._activeRenderMode=0,this._ruleFactory=this._disposables.add(new wp(this._editor)),this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(e=>{e.hasChanged(159)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(159);if("off"===e.enabled)return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if("on"===e.enabled)this._activeRenderMode=0;else{let t,i;"onUnlessPressed"===e.enabled?(t=0,i=1):(t=1,i=0),this._activeRenderMode=t,this._sessionDisposables.add(Bn.getInstance().event(e=>{if(!this._editor.hasModel())return;const n=e.altKey&&e.ctrlKey&&!e.shiftKey&&!e.metaKey?i:t;if(n!==this._activeRenderMode){this._activeRenderMode=n;const e=this._editor.getModel(),t=this._copyInlayHintsWithCurrentAnchor(e);this._updateHintsDecorators([e.getFullModelRange()],t),s.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Dle(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));const n=new Set;this._sessionDisposables.add(t.onWillDispose(()=>{}));const o=this._sessionDisposables.add(new jq),s=new ft(async()=>{const e=Date.now(),{store:i,token:r}=o.reset();try{const o=await $H.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),r);if(s.delay=this._debounceInfo.update(t,Date.now()-e),r.isCancellationRequested)return void o.dispose();for(const e of o.provider)"function"!=typeof e.onDidChangeInlayHints||n.has(e)||(n.add(e),i.add(e.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));i.add(o),this._updateHintsDecorators(o.ranges,o.items),this._cacheHintsForFastRestore(t)}catch(a){$ae(a)}},this._debounceInfo.get(t));this._sessionDisposables.add(s),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(e=>{!e.scrollTopChanged&&s.isScheduled()||s.schedule()}));const r=this._sessionDisposables.add(new Ne);this._sessionDisposables.add(this._editor.onDidChangeModelContent(e=>{const t=Math.max(s.delay,800);this._cursorInfo={position:this._editor.getPosition(),notEarlierThan:Date.now()+t},r.value=Rle(()=>s.schedule(0),t),s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(159)&&s.schedule()})),this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new De,t=e.add(new KH(this._editor)),i=new De;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(e=>{const[t]=e,n=this._getInlayHintLabelPart(t),o=this._editor.getModel();if(!n||!o)return void i.clear();const s=new ot;i.add(Dle(()=>s.dispose(!0))),n.item.resolve(s.token),this._activeInlayHintPart=n.part.command||n.part.location?new qq(n,t.hasTriggerModifier):void 0;const r=o.validatePosition(n.item.hint.position).lineNumber,a=new mr(r,1,r,o.getLineMaxColumn(r)),l=this._getInlineHintsForRange(a);this._updateHintsDecorators([a],l),i.add(Dle(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([a],l)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async e=>{const t=this._getInlayHintLabelPart(e);if(t){const i=t.part;i.location?this._instaService.invokeFunction(Rye,e,this._editor,i.location):Ib.is(i.command)&&await this._invokeCommand(i.command,t.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(2!==t.event.detail)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(it.None),sce(i.item.hint.textEdits))){const t=i.item.hint.textEdits.map(e=>VH.replace(mr.lift(e.range),e.text));this._editor.executeEdits("inlayHint.default",t),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!xhe(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(Tye,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){if(6!==e.target.type)return;const t=e.target.detail.injectedText?.options;return t instanceof kx&&t?.attachedData instanceof Kq?t.attachedData:void 0}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:Qv.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,n]of this._decorationsMetadata){if(t.has(n.item))continue;const o=e.getDecorationRange(i);if(o){const e=new qH(o,n.item.anchor.direction),i=n.item.with({anchor:e});t.set(n.item,i)}}return Array.from(t.values())}_getHintsRanges(){const e=this._editor.getModel(),t=this._editor.getVisibleRangesPlusViewportAboveBelow(),i=[];for(const n of t.sort(mr.compareRangesUsingStarts)){const t=e.validateRange(new mr(n.startLineNumber-30,n.startColumn,n.endLineNumber+30,n.endColumn));0!==i.length&&mr.areIntersectingOrTouching(i[i.length-1],t)?i[i.length-1]=mr.plusRange(i[i.length-1],t):i.push(t)}return i}_updateHintsDecorators(e,t){const i=new Map;if(this._cursorInfo&&this._cursorInfo.notEarlierThan>Date.now()&&e.some(e=>e.containsPosition(this._cursorInfo.position))){const{position:e}=this._cursorInfo;this._cursorInfo=void 0;const n=new Map;for(const t of this._editor.getLineDecorations(e.lineNumber)??[]){const i=this._decorationsMetadata.get(t.id);if(t.range.startColumn>e.column)continue;const o=i?.decoration.options[i.item.anchor.direction];if(o&&o.attachedData!==Hq._whitespaceData){const e=n.get(i.item)??0;n.set(i.item,e+o.content.length)}}const o=t.filter(t=>t.anchor.range.startLineNumber===e.lineNumber&&t.anchor.range.endColumn<=e.column),s=Array.from(n.values());let r;for(;;){const e=o.shift(),t=s.shift();if(!t&&!e)break;if(e)i.set(e,t??0),r=e;else if(r&&t){let e=i.get(r);e+=t,e+=s.reduce((e,t)=>e+t,0),s.length=0;break}}}const n=[],o=(e,t,i,o,s)=>{const r={content:i,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:t.className,cursorStops:o,attachedData:s};n.push({item:e,classNameRef:t,decoration:{range:e.anchor.range,options:{description:"InlayHint",showIfCollapsed:e.anchor.range.isEmpty(),collapseOnReplaceEdit:!e.anchor.range.isEmpty(),stickiness:0,[e.anchor.direction]:0===this._activeRenderMode?r:void 0}}})},s=(e,t)=>{o(e,this._ruleFactory.createClassNameRef({width:(r/3|0)+"px",display:"inline-block"}),"",t?Xr.Right:Xr.None,Hq._whitespaceData)},{fontSize:r,fontFamily:a,padding:l,isUniform:d}=this._getLayoutInfo(),c=this._editor.getOption(159).maximumLength,h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,a);let u={line:0,totalLen:0};for(let m=0;m<t.length;m++){const e=t[m];if(u.line!==e.anchor.range.startLineNumber&&(u={line:e.anchor.range.startLineNumber,totalLen:0}),c&&u.totalLen>c)continue;e.hint.paddingLeft&&s(e,!1);const a="string"==typeof e.hint.label?[{label:e.hint.label}]:e.hint.label,g=i.get(e);let p=0;for(let t=0;t<a.length;t++){const i=a[t],n=0===t,s=t===a.length-1,m={fontSize:`${r}px`,fontFamily:`var(${h}), ${vd.fontFamily}`,verticalAlign:d?"baseline":"middle",unicodeBidi:"isolate"};sce(e.hint.textEdits)&&(m.cursor="default"),this._fillInColors(m,e.hint),(i.command||i.location)&&this._activeInlayHintPart?.part.item===e&&this._activeInlayHintPart.part.index===t&&(m.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(m.color=Hpe(Rh),m.cursor="pointer"));let f=i.label;u.totalLen+=f.length;let _=!1;const b=0!==c?u.totalLen-c:0;if(b>0&&(f=f.slice(0,-b)+"…",_=!0),p+=f.length,void 0!==g){const e=p-g;e>=0&&(p-=e,f=f.slice(0,-(1+e))+"…",_=!0)}if(l&&(n&&(s||_)?(m.padding=`1px ${0|Math.max(1,r/4)}px`,m.borderRadius=(r/4|0)+"px"):n?(m.padding=`1px 0 1px ${0|Math.max(1,r/4)}px`,m.borderRadius=`${r/4|0}px 0 0 ${r/4|0}px`):s||_?(m.padding=`1px ${0|Math.max(1,r/4)}px 1px 0`,m.borderRadius=`0 ${r/4|0}px ${r/4|0}px 0`):m.padding="1px 0 1px 0"),o(e,this._ruleFactory.createClassNameRef(m),Oye(f),s&&!e.hint.paddingRight?Xr.Right:Xr.None,new Kq(e,t)),_)break}if(void 0!==g&&p<g){const t=g-p;o(e,this._ruleFactory.createClassNameRef({}),"".repeat(t),Xr.None)}if(e.hint.paddingRight&&s(e,!0),n.length>Hq._MAX_DECORATORS)break}const g=[];for(const[m,f]of this._decorationsMetadata){const t=this._editor.getModel()?.getDecorationRange(m);t&&e.some(e=>e.containsRange(t))&&(g.push(m),f.classNameRef.dispose(),this._decorationsMetadata.delete(m))}const p=PL.capture(this._editor);this._editor.changeDecorations(e=>{const t=e.deltaDecorations(g,n.map(e=>e.decoration));for(let i=0;i<t.length;i++){const e=n[i];this._decorationsMetadata.set(t[i],e)}}),p.restore(this._editor)}_fillInColors(e,t){t.kind===Nb.Parameter?(e.backgroundColor=Hpe(Qh),e.color=Hpe(Yh)):t.kind===Nb.Type?(e.backgroundColor=Hpe(Zh),e.color=Hpe(Gh)):(e.backgroundColor=Hpe($h),e.color=Hpe(jh))}_getLayoutInfo(){const e=this._editor.getOption(159),t=e.padding,i=this._editor.getOption(61),n=this._editor.getOption(58);let o=e.fontSize;(!o||o<5||o>i)&&(o=i);const s=e.fontFamily||n;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===n&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}},Hq=Wq,Wq.ID="editor.contrib.InlayHints",Wq._MAX_DECORATORS=1500,Wq._whitespaceData={},$q=Wq,$q=Hq=Bq([Vq(1,Tx),Vq(2,vW),Vq(3,Uq),Vq(4,fo),Vq(5,Xv),Vq(6,Jn)],$q),_o.registerCommand("_executeInlayHintProvider",async(e,...t)=>{const[i,n]=t;ple(_i.isUri(i)),ple(mr.isIRange(n));const{inlayHintsProvider:o}=e.get(Tx),s=await e.get(no).createModelReference(i);try{const e=await $H.create(o,s.object.textEditorModel,[mr.lift(n)],it.None),t=e.items.map(e=>e.hint);return setTimeout(()=>e.dispose(),0),t}finally{s.dispose()}}),Gq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Zq=function(e,t){return function(i,n){t(i,n,e)}},Yq=class extends EW{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}},Qq=class extends _H{constructor(e,t,i,n,o,s,r,a){super(e,t,o,r,i,n,a),this._resolverService=s,this.hoverOrdinal=6}suggestHoverAnchor(e){if(!$q.get(this._editor))return null;if(6!==e.target.type)return null;const t=e.target.detail.injectedText?.options;return t instanceof kx&&t.attachedData instanceof Kq?new Yq(t.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i,n){return e instanceof Yq?new xt(async t=>{const{part:i}=e;if(await i.item.resolve(n),n.isCancellationRequested)return;let o,s;if("string"==typeof i.item.hint.tooltip?o=(new pD).appendText(i.item.hint.tooltip):i.item.hint.tooltip&&(o=i.item.hint.tooltip),o&&t.emitOne(new mH(this,e.range,[o],!1,0)),sce(i.item.hint.textEdits)&&t.emitOne(new mH(this,e.range,[(new pD).appendText(Vae(1164,"Double-click to insert"))],!1,10001)),"string"==typeof i.part.tooltip?s=(new pD).appendText(i.part.tooltip):i.part.tooltip&&(s=i.part.tooltip),s&&t.emitOne(new mH(this,e.range,[s],!1,1)),i.part.location||i.part.command){let n;const o="altKey"===this._editor.getOption(86)?F?Vae(1165,"cmd + click"):Vae(1166,"ctrl + click"):F?Vae(1167,"option + click"):Vae(1168,"alt + click");i.part.location&&i.part.command?n=(new pD).appendText(Vae(1169,"Go to Definition ({0}), right click for more",o)):i.part.location?n=(new pD).appendText(Vae(1170,"Go to Definition ({0})",o)):i.part.command&&(n=new pD(`[${Vae(1171,"Execute Command")}](${r=i.part.command,Kbe(r.id,...r.arguments??[]).toString()} "${i.part.command.title}") (${o})`,{isTrusted:!0})),n&&t.emitOne(new mH(this,e.range,[n],!1,1e4))}var r;const a=this._resolveInlayHintLabelPartHover(i,n);for await(const e of a)t.emitOne(e)}):xt.EMPTY}async*_resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return;const{uri:i,range:n}=e.part.location,o=await this._resolverService.createModelReference(i);try{const i=o.object.textEditorModel;if(!this._languageFeaturesService.hoverProvider.has(i))return;for await(const o of RCe(this._languageFeaturesService.hoverProvider,i,new to(n.startLineNumber,n.startColumn),t))Vbe(o.hover.contents)||(yield new mH(this,e.item.anchor.range,o.hover.contents,!1,2+o.ordinal))}finally{o.dispose()}}},Qq=Gq([Zq(1,LA),Zq(2,xw),Zq(3,BR),Zq(4,ka),Zq(5,no),Zq(6,Tx),Zq(7,fo)],Qq),Xq=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Jq=function(e,t){return function(i,n){t(i,n,e)}},ej=class{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}},tj=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new je,this.onDidChange=this._onDidChange.event,this._dispoables=new De,this._markers=[],this._nextIdx=-1,_i.isUri(e)?this._resourceFilter=t=>t.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),o=(e,t)=>{let i=Zle(e.resource.toString(),t.resource.toString());return 0===i&&(i="position"===n?mr.compareRangesUsingStarts(e,t)||vF.compare(e.severity,t.severity):vF.compare(e.severity,t.severity)||mr.compareRangesUsingStarts(e,t)),i},s=()=>{let t=this._markerService.read({resource:_i.isUri(e)?e:void 0,severities:vF.Error|vF.Warning|vF.Info});return"function"==typeof e&&(t=t.filter(e=>this._resourceFilter(e.resource))),t.sort(o),!Zde(t,this._markers,(e,t)=>e.resource.toString()===t.resource.toString()&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn&&e.severity===t.severity&&e.message===t.message)&&(this._markers=t,!0)};s(),this._dispoables.add(t.onMarkerChanged(e=>{this._resourceFilter&&!e.some(e=>this._resourceFilter(e))||s()&&(this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e||!(!this._resourceFilter||!e)&&this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new ej(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=this._markers.findIndex(t=>Ts(t.resource,e.uri));if(n<0)n=Qde(this._markers.length,t=>Zle(this._markers[t].resource.toString(),e.uri.toString())),n<0&&(n=~n),this._nextIdx=i?n:(this._markers.length+n-1)%this._markers.length;else{let o=!1,s=!1;for(let i=n;i<this._markers.length;i++){let n=mr.lift(this._markers[i]);if(n.isEmpty()){const t=e.getWordAtPosition(n.getStartPosition());t&&(n=new mr(n.startLineNumber,t.startColumn,n.startLineNumber,t.endColumn))}if(t&&(n.containsPosition(t)||t.isBeforeOrEqual(n.getStartPosition()))){this._nextIdx=i,o=!0,s=!n.containsPosition(t);break}if(this._markers[i].resource.toString()!==e.uri.toString())break}o?s&&!i&&(this._nextIdx-=1):this._nextIdx=i?0:this._markers.length-1}this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(0===this._markers.length)return!1;const n=this._nextIdx;return-1===this._nextIdx?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),n!==this._nextIdx}find(e,t){let i=this._markers.findIndex(t=>t.resource.toString()===e.toString());if(!(i<0))for(;i<this._markers.length;i++)if(mr.containsPosition(this._markers[i],t))return new ej(this._markers[i],i+1,this._markers.length)}},tj=Xq([Jq(1,CF),Jq(2,ka)],tj),ij=eue("IMarkerNavigationService"),nj=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new Ae}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new tj(e,this._markerService,this._configService)}},nj=Xq([Jq(0,CF),Jq(1,ka)],nj),dge(ij,nj,1),function(e){e.className=function(e){switch(e){case Yv.Ignore:return"severity-ignore "+mo.asClassName(go.info);case Yv.Info:return mo.asClassName(go.info);case Yv.Warning:return mo.asClassName(go.warning);case Yv.Error:return mo.asClassName(go.error);default:return""}}}(oj||(oj={})),rj=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},aj=function(e,t){return function(i,n){t(i,n,e)}},dj=class{constructor(e,t,i,n,o){this._openerService=n,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new De,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(xn(this._relatedBlock,"click",e=>{e.preventDefault();const t=this._relatedDiagnostics.get(e.target);t&&i(t)})),this._scrollable=new Em(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(e=>{s.style.left=`-${e.scrollLeft}px`,s.style.top=`-${e.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){kle(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:o}=e;let s=(t?.length||0)+2;o&&(s+="string"==typeof o?o.length:o.value.length);const r=qle(i);this._lines=r.length,this._longestLineLength=0;for(const h of r)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Jce(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let a=this._messageBlock;for(const h of r)a=document.createElement("div"),a.innerText=h,""===h&&(a.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(a);if(t||o){const e=document.createElement("span");if(e.classList.add("details"),a.appendChild(e),t){const i=document.createElement("span");i.innerText=t,i.classList.add("source"),e.appendChild(i)}if(o)if("string"==typeof o){const t=document.createElement("span");t.innerText=`(${o})`,t.classList.add("code"),e.appendChild(t)}else this._codeLink=Ahe("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=e=>{this._openerService.open(o.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()},Mhe(this._codeLink,Ahe("span")).innerText=o.value,e.appendChild(this._codeLink)}if(Jce(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),sce(n)){const e=this._relatedBlock.appendChild(document.createElement("div"));e.style.paddingTop=`${Math.floor(.66*this._editor.getOption(75))}px`,this._lines+=1;for(const t of n){const i=document.createElement("div"),n=document.createElement("a");n.classList.add("filename"),n.innerText=`${this._labelService.getUriBasenameLabel(t.resource)}(${t.startLineNumber}, ${t.startColumn}): `,n.title=this._labelService.getUriLabel(t.resource),this._relatedDiagnostics.set(n,t);const o=document.createElement("span");o.innerText=t.message,i.appendChild(n),i.appendChild(o),this._lines+=1,e.appendChild(i)}}const l=this._editor.getOption(59),d=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),c=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:c})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case vF.Error:t=Vae(1024,"Error");break;case vF.Warning:t=Vae(1025,"Warning");break;case vF.Info:t=Vae(1026,"Info");break;case vF.Hint:t=Vae(1027,"Hint")}let i=Vae(1028,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();return n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1&&(i=`${n.getLineContent(e.startLineNumber)}, ${i}`),i}},sj=class extends cz{constructor(e,t,i,n,o,s,r){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=s,this._labelService=r,this._callOnDispose=new De,this._onDidSelectRelatedInformation=new je,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=vF.Warning,this._backgroundColor=eh.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(wj);let t=pj,i=mj;this._severity===vF.Warning?(t=fj,i=_j):this._severity===vF.Info&&(t=bj,i=vj);const n=e.getColor(t),o=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:o,primaryHeadingColor:e.getColor(uz),secondaryHeadingColor:e.getColor(gz)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(e=>this.editor.focus()));const t=function(e,t,i,n){const o=[];return Dwe(e,o,t,i,n),o}(this._menuService.getMenuActions(lj.TitleMenu,this._contextKeyService));this._actionbarWidget.push(t,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=Mhe(e,Ahe(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new dj(this._container,this.editor,e=>this._onDidSelectRelatedInformation.fire(e),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const n=mr.lift(e),o=this.editor.getPosition(),s=o&&n.containsPosition(o)?o:n.getStartPosition();super.show(s,this.computeRequiredHeight());const r=this.editor.getModel();if(r){const e=i>1?Vae(1029,"{0} of {1} problems",t,i):Vae(1030,"{0} of {1} problem",t,i);this.setTitle(Os(r.uri),e)}this._icon.className=`codicon ${oj.className(vF.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}},lj=sj,sj.TitleMenu=new ds("gotoErrorTitleMenu"),cj=sj,cj=lj=rj([aj(1,Sf),aj(2,SA),aj(3,cs),aj(4,Jn),aj(5,es),aj(6,zK)],cj),hj=vpe(kh,Lh),uj=vpe(Ih,Nh),gj=vpe(Eh,Mh),pj=mpe("editorMarkerNavigationError.background",{dark:hj,light:hj,hcDark:ch,hcLight:ch},Vae(1031,"Editor marker navigation widget error color.")),mj=mpe("editorMarkerNavigationError.headerBackground",{dark:bpe(pj,.1),light:bpe(pj,.1),hcDark:null,hcLight:null},Vae(1032,"Editor marker navigation widget error heading background.")),fj=mpe("editorMarkerNavigationWarning.background",{dark:uj,light:uj,hcDark:ch,hcLight:ch},Vae(1033,"Editor marker navigation widget warning color.")),_j=mpe("editorMarkerNavigationWarning.headerBackground",{dark:bpe(fj,.1),light:bpe(fj,.1),hcDark:"#0C141F",hcLight:bpe(fj,.2)},Vae(1034,"Editor marker navigation widget warning heading background.")),bj=mpe("editorMarkerNavigationInfo.background",{dark:gj,light:gj,hcDark:ch,hcLight:ch},Vae(1035,"Editor marker navigation widget info color.")),vj=mpe("editorMarkerNavigationInfo.headerBackground",{dark:bpe(bj,.1),light:bpe(bj,.1),hcDark:null,hcLight:null},Vae(1036,"Editor marker navigation widget info heading background.")),wj=mpe("editorMarkerNavigation.background",wh,Vae(1037,"Editor marker navigation widget background.")),xj=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},kj=function(e,t){return function(i,n){t(i,n,e)}},Cj=class{static get(e){return e.getContribution(Lj.ID)}constructor(e,t,i,n,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=o,this._sessionDispoables=new De,this._editor=e,this._widgetVisible=Rj.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(cj,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(e=>{this._model?.selected&&mr.containsPosition(this._model?.selected.marker,e.position)||this._model?.resetIndex()})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const e=this._model.find(this._editor.getModel().uri,this._widget.position);e?this._widget.updateMarker(e.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(e=>{this._editorService.openCodeEditor({resource:e.resource,options:{pinned:!0,revealIfOpened:!0,selection:mr.lift(e).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._getOrCreateModel(t.uri);i.resetIndex(),i.move(!0,t,new to(e.startLineNumber,e.startColumn)),i.selected&&this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}async navigate(e,t){if(!this._editor.hasModel())return;const i=this._editor.getModel(),n=this._getOrCreateModel(t?void 0:i.uri);if(n.move(e,i,this._editor.getPosition()),n.selected)if(n.selected.marker.resource.toString()!==i.uri.toString()){this._cleanUp();const i=await this._editorService.openCodeEditor({resource:n.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:n.selected.marker}},this._editor);i&&(Lj.get(i)?.close(),Lj.get(i)?.navigate(e,t))}else this._widget.showAtMarker(n.selected.marker,n.selected.index,n.selected.total)}},Lj=Cj,Cj.ID="editor.contrib.markerController",Dj=Cj,Dj=Lj=xj([kj(1,ij),kj(2,es),kj(3,eo),kj(4,Jn)],Dj),Ij=class extends rr{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){t.hasModel()&&await(Dj.get(t)?.navigate(this._next,this._multiFile))}},(yj=Nj=class e extends Ij{constructor(){super(!0,!1,{id:e.ID,label:e.LABEL,precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:578,weight:100},menuOpts:{menuId:cj.TitleMenu,title:e.LABEL.value,icon:rwe("marker-navigation-next",go.arrowDown,Vae(1016,"Icon for goto next marker.")),group:"navigation",order:1}})}}).ID="editor.action.marker.next",yj.LABEL=zae(1020,"Go to Next Problem (Error, Warning, Info)"),(Sj=Ej=class e extends Ij{constructor(){super(!1,!1,{id:e.ID,label:e.LABEL,precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:1602,weight:100},menuOpts:{menuId:cj.TitleMenu,title:e.LABEL.value,icon:rwe("marker-navigation-previous",go.arrowUp,Vae(1017,"Icon for goto previous marker.")),group:"navigation",order:2}})}}).ID="editor.action.marker.prev",Sj.LABEL=zae(1021,"Go to Previous Problem (Error, Warning, Info)"),Mj=class extends Ij{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:zae(1022,"Go to Next Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:66,weight:100},menuOpts:{menuId:ds.MenubarGoMenu,title:Vae(1018,"Next &&Problem"),group:"6_problem_nav",order:1}})}},Tj=class extends Ij{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:zae(1023,"Go to Previous Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:1090,weight:100},menuOpts:{menuId:ds.MenubarGoMenu,title:Vae(1019,"Previous &&Problem"),group:"6_problem_nav",order:2}})}},Iue(Dj.ID,Dj,4),kue(Nj),kue(Ej),kue(Mj),kue(Tj),Rj=new Jo("markersNavigationVisible",!1),xue(new(sr.bindToContribution(Dj.get))({id:"closeMarkersNavigation",precondition:Rj,handler:e=>e.close(),kbOpts:{weight:150,kbExpr:jl.focus,primary:9,secondary:[1033]}})),Oj=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Aj=function(e,t){return function(i,n){t(i,n,e)}},Pj=Ahe,Fj=class{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}},Wj={type:1,filter:{include:sF.QuickFix},triggerAction:rF.QuickFixHover},Bj=class{constructor(e,t,i,n){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=n,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range;if(!i.isValidRange(e.range))return[];const o=n.startLineNumber,s=i.getLineMaxColumn(o),r=[];for(const a of t){const t=a.range.startLineNumber===o?a.range.startColumn:1,n=a.range.endLineNumber===o?a.range.endColumn:s,l=this._markerDecorationsService.getMarker(i.uri,a);if(!l)continue;const d=new mr(e.range.startLineNumber,t,e.range.startLineNumber,n);r.push(new Fj(this,d,l))}return r}renderHoverParts(e,t){if(!t.length)return new MW([]);const i=[];t.forEach(t=>{const n=this._renderMarkerHover(t);e.fragment.appendChild(n.hoverElement),i.push(n)});const n=1===t.length?t[0]:t.sort((e,t)=>vF.compare(e.marker.severity,t.marker.severity))[0];return new MW(i,this._renderMarkerStatusbar(e,n))}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new De,i=Pj("div.hover-row"),n=Mhe(i,Pj("div.marker.hover-contents")),{source:o,message:s,code:r,relatedInformation:a}=e.marker;this._editor.applyFontInfo(n);const l=Mhe(n,Pj("span"));if(l.style.whiteSpace="pre-wrap",l.innerText=s,o||r)if(r&&"string"!=typeof r){const e=Pj("span");o&&(Mhe(e,Pj("span")).innerText=o);const i=Mhe(e,Pj("a.code-link"));i.setAttribute("href",r.target.toString(!0)),t.add(ehe(i,"click",e=>{this._openerService.open(r.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()})),Mhe(i,Pj("span")).innerText=r.value;const s=Mhe(n,e);s.style.opacity="0.6",s.style.paddingLeft="6px"}else{const e=Mhe(n,Pj("span"));e.style.opacity="0.6",e.style.paddingLeft="6px",e.innerText=o&&r?`${o}(${r})`:o||`(${r})`}if(sce(a))for(const{message:d,resource:c,startLineNumber:h,startColumn:u}of a){const e=Mhe(n,Pj("div"));e.style.marginTop="8px";const i=Mhe(e,Pj("a"));i.innerText=`${Os(c)}(${h}, ${u}): `,i.style.cursor="pointer",t.add(ehe(i,"click",e=>{if(e.stopPropagation(),e.preventDefault(),this._openerService){const e={selection:{startLineNumber:h,startColumn:u}};this._openerService.open(c,{fromUserGesture:!0,editorOptions:e}).catch($ae)}}));const o=Mhe(e,Pj("span"));o.innerText=d,this._editor.applyFontInfo(o)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}_renderMarkerStatusbar(e,t){const i=new De;if(t.marker.severity===vF.Error||t.marker.severity===vF.Warning||t.marker.severity===vF.Info){const i=Dj.get(this._editor);i&&e.statusBar.addAction({label:Vae(1139,"View Problem"),commandId:Nj.ID,run:()=>{e.hide(),i.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(104)){const n=e.statusBar.append(Pj("div"));this.recentMarkerCodeActionsInfo&&(wF.makeKey(this.recentMarkerCodeActionsInfo.marker)===wF.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=Vae(1140,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Ie.None:Rle(()=>n.textContent=Vae(1141,"Checking for quick fixes..."),200,i);n.textContent||(n.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);i.add(Dle(()=>s.cancel())),s.then(s=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:s.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions)return s.dispose(),void(n.textContent=Vae(1142,"No quick fixes available"));n.style.display="none";let r=!1;i.add(Dle(()=>{r||s.dispose()})),e.statusBar.addAction({label:Vae(1143,"Quick Fix..."),commandId:cF,run:t=>{r=!0;const i=ZF.get(this._editor),n=lhe(t);e.hide(),i?.showCodeActions(Wj,s,{x:n.left,y:n.top,width:n.width,height:n.height})}});const a=s.validActions.find(e=>e.action.isAI);a&&e.statusBar.addAction({label:a.action.title,commandId:a.action.command?.id??"",iconClass:mo.asClassName(go.sparkle),run:()=>{ZF.get(this._editor)?.applyCodeAction(a,!1,!1,bF.FromProblemsHover)}}),e.onContentsChanged()},$ae)}return i}getCodeActions(e){return Ele(t=>aCe(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new mr(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Wj,OL.None,t))}},Bj=Oj([Aj(1,id),Aj(2,SA),Aj(3,Tx)],Bj),Hj=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},zj=function(e,t){return function(i,n){t(i,n,e)}},qj=Uj=class extends Ie{constructor(e,t,i,n,o,s,r){super();const a=t.hoverParts;this._renderedHoverParts=this._register(new $j(e,i,a,n,o,s,r));const l=t.options,d=l.anchor,{showAtPosition:c,showAtSecondaryPosition:h}=Uj.computeHoverPositions(e,d.range,a);this.shouldAppearBeforeContent=a.some(e=>e.isBeforeContent),this.showAtPosition=c,this.showAtSecondaryPosition=h,this.initialMousePosX=d.initialMousePosX,this.initialMousePosY=d.initialMousePosY,this.shouldFocus=l.shouldFocus,this.source=l.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}get hoverPartsCount(){return this._renderedHoverParts.hoverPartsCount}focusHoverPartWithIndex(e){this._renderedHoverParts.focusHoverPartWithIndex(e)}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let n=1;if(e.hasModel()){const i=e._getViewModel(),o=i.coordinatesConverter,s=o.convertModelRangeToViewRange(t),r=i.getLineMinColumn(s.startLineNumber),a=new to(s.startLineNumber,r);n=o.convertViewPositionToModelPosition(a).column}const o=t.startLineNumber;let s,r,a,l=t.startColumn;for(const d of i){const e=d.range,t=e.startLineNumber===o,i=e.endLineNumber===o;if(t&&i){const t=e.startColumn,i=Math.min(l,t);l=Math.max(i,n)}d.forceShowAtRange&&(s=e)}if(s){const e=s.getStartPosition();r=e,a=e}else r=t.getStartPosition(),a=new to(o,l);return{showAtPosition:r,showAtSecondaryPosition:a}}},qj=Uj=Hj([zj(4,xw),zj(5,BR),zj(6,nT)],qj),jj=class{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}},Vj=class extends Ie{constructor(e,t,i,n,o,s,r){super(),this._hoverService=s,this._clipboardService=r,this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=n,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,n,o,this._hoverService)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(0===t.length)return Ie.None;let i=t[0].range;for(const o of t){const e=o.range;i=mr.plusRange(i,e)}const n=e.createDecorationsCollection();return n.set([{range:i,options:Kj._DECORATION_OPTIONS}]),Dle(()=>{n.clear()})}_renderParts(e,t,i,n,o){const s=new OB(n,o),r={fragment:this._fragment,statusBar:s,...i},a=new De;a.add(s);for(const d of e){const e=this._renderHoverPartsForParticipant(t,d,r);a.add(e);for(const t of e.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:d,hoverPart:t.hoverPart,hoverElement:t.hoverElement})}const l=this._renderStatusBar(this._fragment,s);return l&&(a.add(l),this._renderedParts.push({type:"statusBar",hoverElement:l.hoverElement,actions:l.actions})),a}_renderHoverPartsForParticipant(e,t,i){const n=e.filter(e=>e.owner===t);return n.length>0?t.renderHoverParts(i,n):new MW([])}_renderStatusBar(e,t){if(t.hasContent)return new jj(e,t)}_registerListenersOnRenderedParts(){const e=new De;return this._renderedParts.forEach((t,i)=>{const n=t.hoverElement;n.tabIndex=0,e.add(ehe(n,On.FOCUS_IN,e=>{e.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(ehe(n,On.FOCUS_OUT,e=>{e.stopPropagation(),this._focusedHoverPartIndex=-1})),"hoverPart"===t.type&&t.hoverPart instanceof Fj&&e.add(new lH(n,()=>t.participant.getAccessibleContent(t.hoverPart),this._clipboardService,this._hoverService))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(e=>e instanceof _H&&!(e instanceof Qq));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(e=>e instanceof BH)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;let n;n=t>=0?{start:t,endExclusive:t+1}:this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);for(let o=n.start;o<n.endExclusive;o++){const t=this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant,o);if(void 0===t)continue;const i=await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(e,t);i&&(this._renderedParts[o]={type:"hoverPart",participant:this._markdownHoverParticipant,hoverPart:i.hoverPart,hoverElement:i.hoverElement})}i&&(t>=0?this.focusHoverPartWithIndex(t):this._context.focus()),this._context.onContentsChanged()}isColorPickerVisible(){return this._colorHoverParticipant?.isColorPickerVisible()??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||"hoverPart"!==i.type)return;if(i.participant!==e)return;const n=this._renderedParts.findIndex(t=>"hoverPart"===t.type&&t.participant===e);if(-1===n)throw new y;return t-n}_findRangeOfMarkdownHoverParts(e){const t=this._renderedParts.slice(),i=t.findIndex(t=>"hoverPart"===t.type&&t.participant===e),n=t.reverse().findIndex(t=>"hoverPart"===t.type&&t.participant===e);return{start:i,endExclusive:(n>=0?t.length-n:n)+1}}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}get hoverPartsCount(){return this._renderedParts.length}},Kj=Vj,Vj._DECORATION_OPTIONS=Lx.register({description:"content-hover-highlight",className:"hoverHighlight"}),$j=Vj,$j=Kj=Hj([zj(4,xw),zj(5,BR),zj(6,nT)],$j),Gj=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Zj=function(e,t){return function(i,n){t(i,n,e)}},Yj=class extends Ie{constructor(e,t,i,n,o){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._hoverService=n,this._clipboardService=o,this._currentResult=null,this._renderedContentHover=this._register(new Ne),this._onContentsChanged=this._register(new je),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(DB,this._editor)),this._participants=this._initializeHoverParticipants(),this._hoverOperation=this._register(new pB(this._editor,new IB(this._editor,this._participants))),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of TW.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((e,t)=>e.hoverOrdinal-t.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(e=>e.handleResize?.())})),this._register(this._contentHoverWidget.onDidScroll(e=>{this._participants.forEach(t=>t.handleScroll?.(e))})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._participants.forEach(e=>e.handleContentsChanged?.())})),e}_registerListeners(){this._register(this._hoverOperation.onResult(e=>{const t=e.hasLoadingMessage?this._addLoadingMessage(e):e.value;this._withResult(new NB(t,e.isComplete,e.options))}));const e=this._contentHoverWidget.getDomNode();this._register(xn(e,"keydown",e=>{e.equals(9)&&this.hide()})),this._register(xn(e,"mouseleave",e=>{this._onMouseLeave(e)})),this._register(Mb.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._onContentsChanged.fire()}))}_startShowingOrUpdateHover(e,t,i,n,o){if(!this._contentHoverWidget.position||!this._currentResult)return!!e&&(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0);const s=this._editor.getOption(69).sticky,r=o&&this._contentHoverWidget.isMouseGettingCloser(o.event.posx,o.event.posy);return s&&r?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?!(!this._currentResult||!this._currentResult.options.anchor.equals(e))||(this._currentResult&&e.canAdoptVisibleHover(this._currentResult.options.anchor,this._contentHoverWidget.position)?(this._currentResult&&this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,n,!1),!0)):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,n,o){if(this._hoverOperation.options&&this._hoverOperation.options.anchor.equals(e))return;this._hoverOperation.cancel();const s={anchor:e,source:i,shouldFocus:n,insistOnKeepingHoverVisible:o};this._hoverOperation.start(t,s)}_setCurrentResult(e){let t=e;this._currentResult!==t&&(t&&0===t.hoverParts.length&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover())}_addLoadingMessage(e){for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(e.options.anchor);if(i)return e.value.slice(0).concat([i])}return e.value}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const t=0===e.hoverParts.length,i=e.options.insistOnKeepingHoverVisible;t&&i||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover.value=new qj(this._editor,e,this._participants,t,this._keybindingService,this._hoverService,this._clipboardService),this._renderedContentHover.value.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover.value):this._renderedContentHover.clear()}_hideHover(){this._contentHoverWidget.hide(),this._participants.forEach(e=>e.handleHide?.())}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._contentHoverWidget.handleContentsChanged()},setMinimumDimensions:e=>{this._contentHoverWidget.setMinimumDimensions(e)},focus:()=>this.focus()}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const t=this._findHoverAnchorCandidates(e);if(!(t.length>0))return this._startShowingOrUpdateHover(null,0,0,!1,e);const i=t[0];return this._startShowingOrUpdateHover(i,0,0,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const n of this._participants){if(!n.suggestHoverAnchor)continue;const i=n.suggestHoverAnchor(e);i&&t.push(i)}const i=e.target;switch(i.type){case 6:t.push(new NW(0,i.range,e.event.posx,e.event.posy));break;case 7:{const n=this._editor.getOption(59).typicalHalfwidthCharacterWidth/2;if(i.detail.isAfterLines||"number"!=typeof i.detail.horizontalDistanceToText||!(i.detail.horizontalDistanceToText<n))break;t.push(new NW(0,i.range,e.event.posx,e.event.posy));break}}return t.sort((e,t)=>t.priority-e.priority),t}_onMouseLeave(e){const t=this._editor.getDomNode();t&&vCe(t,e.x,e.y)||this.hide()}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new NW(0,e,void 0,void 0),t,i,n,null)}async updateHoverVerbosityLevel(e,t,i){this._renderedContentHover.value?.updateHoverVerbosityLevel(e,t,i)}focusedHoverPartIndex(){return this._renderedContentHover.value?.focusedHoverPartIndex??-1}containsNode(e){return!!e&&this._contentHoverWidget.getDomNode().contains(e)}focus(){1!==this._renderedContentHover.value?.hoverPartsCount?this._contentHoverWidget.focus():this.focusHoverPartWithIndex(0)}focusHoverPartWithIndex(e){this._renderedContentHover.value?.focusHoverPartWithIndex(e)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._hoverOperation.cancel(),this._setCurrentResult(null)}getDomNode(){return this._contentHoverWidget.getDomNode()}get isColorPickerVisible(){return this._renderedContentHover.value?.isColorPickerVisible()??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}},Yj=Gj([Zj(1,Jn),Zj(2,xw),Zj(3,BR),Zj(4,nT)],Yj),Xj=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Jj=function(e,t){return function(i,n){t(i,n,e)}},Qj=class extends Ie{constructor(e,t,i,n){super(),this._editor=e,this._instantiationService=i,this._keybindingService=n,this._onHoverContentsChanged=this._register(new je),this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new De,this._isMouseDown=!1,this._ignoreMouseEvents=!1,this._reactToEditorMouseMoveRunner=this._register(new ft(()=>{this._mouseMoveEvent&&this._reactToEditorMouseMove(this._mouseMoveEvent)},0)),this._register(t.onDidShowContextMenu(()=>{this.hideContentHover(),this._ignoreMouseEvents=!0})),this._register(t.onDidHideContextMenu(()=>{this._ignoreMouseEvents=!1})),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(e$.ID)}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled||this._cancelSchedulerAndHide(),this._listenersStore.add(this._editor.onMouseDown(e=>this._onEditorMouseDown(e))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(e=>this._onEditorMouseMove(e))),this._listenersStore.add(this._editor.onKeyDown(e=>this._onKeyDown(e))),this._listenersStore.add(this._editor.onMouseLeave(e=>this._onEditorMouseLeave(e))),this._listenersStore.add(this._editor.onDidChangeModel(()=>this._cancelSchedulerAndHide())),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(e=>this._onEditorScrollChanged(e)))}_unhookListeners(){this._listenersStore.clear()}_cancelSchedulerAndHide(){this._cancelScheduler(),this.hideContentHover()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){this._ignoreMouseEvents||(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideContentHover()}_onEditorMouseDown(e){this._ignoreMouseEvents||(this._isMouseDown=!0,this._shouldKeepHoverWidgetVisible(e)||this.hideContentHover())}_shouldKeepHoverWidgetVisible(e){return this._isMouseOnContentHoverWidget(e)||this._isContentWidgetResizing()||Aye(e)}_isMouseOnContentHoverWidget(e){return!!this._contentWidget&&vCe(this._contentWidget.getDomNode(),e.event.posx,e.event.posy)}_onEditorMouseUp(){this._ignoreMouseEvents||(this._isMouseDown=!1)}_onEditorMouseLeave(e){this._ignoreMouseEvents||this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldKeepHoverWidgetVisible(e)||this.hideContentHover())}_shouldKeepCurrentHover(e){const t=this._contentWidget;if(!t)return!1;const i=this._hoverSettings.sticky,n=t.isFocused,o=t.isResizing,s=this._hoverSettings.sticky&&t.isVisibleFromKeyboard;return this.shouldKeepOpenOnEditorMouseMoveOrLeave||n||o||s||((e,t)=>{const i=this._isMouseOnContentHoverWidget(e);return t&&i})(e,i)||(e=>{const i=t.isColorPickerVisible,n=this._isMouseOnContentHoverWidget(e),o=i&&n,s=i&&this._isMouseDown;return o||s})(e)||((e,i)=>{const n=e.event.browserEvent.view;return!!n&&i&&t.containsNode(n.document.activeElement)&&!n.getSelection()?.isCollapsed})(e,i)}_onEditorMouseMove(e){this._ignoreMouseEvents||(this._mouseMoveEvent=e,this._shouldKeepCurrentHover(e)?this._reactToEditorMouseMoveRunner.cancel():this._shouldRescheduleHoverComputation()?this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay):this._reactToEditorMouseMove(e))}_shouldRescheduleHoverComputation(){const e=this._hoverSettings.hidingDelay;return(this._contentWidget?.isVisible??!1)&&this._hoverSettings.sticky&&e>0}_reactToEditorMouseMove(e){this._hoverSettings.enabled&&this._getOrCreateContentWidget().showsOrWillShow(e)||this.hideContentHover()}_onKeyDown(e){if(this._ignoreMouseEvents)return;if(!this._contentWidget)return;const t=this._isPotentialKeyboardShortcut(e),i=this._isModifierKeyPressed(e);t||i||this._contentWidget.isFocused&&2===e.keyCode||this.hideContentHover()}_isPotentialKeyboardShortcut(e){if(!this._editor.hasModel()||!this._contentWidget)return!1;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=1===t.kind,n=2===t.kind&&("editor.action.showHover"===t.commandId||"editor.action.increaseHoverVerbosityLevel"===t.commandId||"editor.action.decreaseHoverVerbosityLevel"===t.commandId)&&this._contentWidget.isVisible;return i||n}_isModifierKeyPressed(e){return 5===e.keyCode||6===e.keyCode||57===e.keyCode||4===e.keyCode}hideContentHover(){dB.dropDownVisible||this._contentWidget?.hide()}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Yj,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}showContentHover(e,t,i,n){this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}_isContentWidgetResizing(){return this._contentWidget?.widget.isResizing||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){this._contentWidget?.focus()}scrollUp(){this._contentWidget?.scrollUp()}scrollDown(){this._contentWidget?.scrollDown()}scrollLeft(){this._contentWidget?.scrollLeft()}scrollRight(){this._contentWidget?.scrollRight()}pageUp(){this._contentWidget?.pageUp()}pageDown(){this._contentWidget?.pageDown()}goToTop(){this._contentWidget?.goToTop()}goToBottom(){this._contentWidget?.goToBottom()}get isColorPickerVisible(){return this._contentWidget?.isColorPickerVisible}get isHoverVisible(){return this._contentWidget?.isVisible}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._contentWidget?.dispose()}},e$=Qj,Qj.ID="editor.contrib.contentHover",t$=Qj,t$=e$=Xj([Jj(1,sT),Jj(2,Jn),Jj(3,xw)],t$),i$=class extends Ie{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(e=>this.onMouseDown(e)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(168);if("click"!==t&&"clickAndHover"!==t)return;if(!Aye(e))return;const i=this._editor.getContribution(t$.ID);if(!i)return;if(i.isColorPickerVisible)return;const n=e.target.range;if(!n)return;const o=new mr(n.startLineNumber,n.startColumn+1,n.endLineNumber,n.endColumn+1);i.showContentHover(o,1,1,!1)}},i$.ID="editor.contrib.colorContribution",n$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},o$=function(e,t){return function(i,n){t(i,n,e)}},s$=class e{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}static fromBaseColor(t,i){return new e(t,i.range,i.model,i.provider)}},r$=class extends Ie{constructor(e,t,i,n){super();const o=e.getModel(),s=i.model;this.color=i.model.color,this.colorPicker=this._register(new OH(t.fragment,s,e.getOption(163),n,"standalone")),this._register(s.onColorFlushed(e=>{this.color=e})),this._register(s.onDidChangeColor(e=>{WCe(o,s,e,i.range,i)})),this._register(e.onDidChangeModelContent(i=>{t.hide(),e.focus()})),WCe(o,s,this.color,i.range,i)}},a$=class{constructor(e,t){this._editor=e,this._themeService=t}async createColorHover(e,t,i){if(!this._editor.hasModel())return null;if(!qW.get(this._editor))return null;const n=await mCe(i,this._editor.getModel(),it.None);let o=null,s=null;for(const d of n){const t=d.colorInfo;mr.containsRange(t.range,e.range)&&(o=t,s=d.provider)}const r=o??e,a=s??t,l=!!o;return{colorHover:s$.fromBaseColor(this,await PCe(this._editor.getModel(),r,a)),foundInEditor:l}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new mr(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await WCe(this._editor.getModel(),t,this._color,i,e),i=FCe(this._editor,i,t))}renderHoverParts(e,t){if(0!==t.length&&this._editor.hasModel())return this._setMinimumDimensions(e),this._renderedParts=new r$(this._editor,e,t[0],this._themeService),this._renderedParts}_setMinimumDimensions(e){const t=this._editor.getOption(75)+8;e.setMinimumDimensions(new Tn(302,t))}get _color(){return this._renderedParts?.color}},a$=n$([o$(1,Sf)],a$),d$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},c$=function(e,t){return function(i,n){t(i,n,e)}},u$=class{constructor(e,t){this.value=e,this.foundInEditor=t}},l$=class extends Ie{constructor(e,t,i,n,o,s,r,a){super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._keybindingService=o,this._languageFeaturesService=s,this._editorWorkerService=r,this._hoverService=a,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new je),this.onResult=this._onResult.event,this._renderedHoverParts=this._register(new Ne),this._renderedStatusBar=this._register(new Ne),this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(a$,this._editor),this._position=this._editor._getViewModel()?.getPrimaryCursorState().modelState.position;const l=this._editor.getSelection(),d=l?{startLineNumber:l.startLineNumber,startColumn:l.startColumn,endLineNumber:l.endLineNumber,endColumn:l.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},c=this._register(Ehe(this._body));this._register(c.onDidBlur(e=>{this.hide()})),this._register(c.onDidFocus(e=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(e=>{const t=e.target.element?.classList;t&&t.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(e=>{this._render(e.value,e.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return h$.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(69).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new u$(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new AW(this._editorWorkerService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment();this._renderedStatusBar.value=this._register(new OB(this._keybindingService,this._hoverService));const n={fragment:i,statusBar:this._renderedStatusBar.value,onContentsChanged:()=>{},setMinimumDimensions:()=>{},hide:()=>this.hide(),focus:()=>this.focus()};if(this._colorHover=e,this._renderedHoverParts.value=this._standaloneColorPickerParticipant.renderHoverParts(n,[e]),!this._renderedHoverParts.value)return this._renderedStatusBar.clear(),void this._renderedHoverParts.clear();const o=this._renderedHoverParts.value.colorPicker;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(.66*this._editor.getLayoutInfo().width,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const s=o.body,r=s.saturationBox.domNode.clientWidth,a=s.domNode.clientWidth-r-22-8,l=o.body.enterButton;l?.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header;d.pickedColorNode.style.width=r+8+"px",d.originalColorNode.style.width=a+"px",o.header.closeButton?.onClicked(()=>{this.hide()}),t&&(l&&(l.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},h$=l$,l$.ID="editor.contrib.standaloneColorPickerWidget",g$=l$,g$=h$=d$([c$(3,Jn),c$(4,xw),c$(5,Tx),c$(6,DM),c$(7,BR)],g$),m$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},f$=function(e,t){return function(i,n){t(i,n,e)}},p$=class extends Ie{constructor(e,t,i){super(),this._editor=e,this._instantiationService=i,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=jl.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=jl.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||this._standaloneColorPickerWidget?.focus():this._standaloneColorPickerWidget=this._instantiationService.createInstance(g$,this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused))}hide(){this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerWidget?.hide(),this._editor.focus()}insertColor(){this._standaloneColorPickerWidget?.updateEditor(),this.hide()}static get(e){return e.getContribution(_$.ID)}},_$=p$,p$.ID="editor.contrib.standaloneColorPickerController",b$=p$,b$=_$=m$([f$(1,es),f$(2,Jn)],b$),v$=class extends lr{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...zae(889,"Show or Focus Standalone Color Picker"),mnemonicTitle:Vae(888,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:ds.CommandPalette}],metadata:{description:zae(890,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){b$.get(t)?.showOrFocus()}},w$=class extends rr{constructor(){super({id:"editor.action.hideColorPicker",label:zae(891,"Hide the Color Picker"),precondition:jl.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:zae(892,"Hide the standalone color picker.")}})}run(e,t){b$.get(t)?.hide()}},C$=class extends rr{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:zae(893,"Insert Color with Standalone Color Picker"),precondition:jl.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:zae(894,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){b$.get(t)?.insertColor()}},kue(w$),kue(C$),mue(v$),Iue(i$.ID,i$,2),Iue(b$.ID,b$,1),Iue(qW.ID,qW,1),gCe(PW),TW.register(BH),_o.registerCommand("_executeDocumentColorProvider",function(e,...t){const[i]=t;if(!(i instanceof _i))throw Qae();const{model:n,colorProviderRegistry:o,defaultColorDecoratorsEnablement:s}=bCe(e,i);return _Ce(new WW,o,n,it.None,s)}),_o.registerCommand("_executeColorPresentationProvider",function(e,...t){const[i,n]=t;if(!n)return;const{uri:o,range:s}=n;if(!(o instanceof _i&&Array.isArray(i)&&4===i.length&&mr.isIRange(s)))throw Qae();const{model:r,colorProviderRegistry:a,defaultColorDecoratorsEnablement:l}=bCe(e,o),[d,c,h,u]=i;return _Ce(new BW({range:s,color:{red:d,green:c,blue:h,alpha:u}}),a,r,it.None,l)}),y$=class e{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const n=t.length;if(i+n>e.length)return!1;for(let o=0;o<n;o++){const n=e.charCodeAt(i+o),s=t.charCodeAt(o);if(n!==s&&!(n>=65&&n<=90&&n+32===s||s>=65&&s<=90&&s+32===n))return!1}return!0}_createOperationsForBlockComment(t,i,n,o,s,r){const a=t.startLineNumber,l=t.startColumn,d=t.endLineNumber,c=t.endColumn,h=s.getLineContent(a),u=s.getLineContent(d);let g,p=h.lastIndexOf(i,l-1+i.length),m=u.indexOf(n,c-1-n.length);if(-1!==p&&-1!==m)if(a===d)h.substring(p+i.length,m).indexOf(n)>=0&&(p=-1,m=-1);else{const e=h.substring(p+i.length),t=u.substring(0,m);(e.indexOf(n)>=0||t.indexOf(n)>=0)&&(p=-1,m=-1)}-1!==p&&-1!==m?(o&&p+i.length<h.length&&32===h.charCodeAt(p+i.length)&&(i+=" "),o&&m>0&&32===u.charCodeAt(m-1)&&(n=" "+n,m-=1),g=e._createRemoveBlockCommentOperations(new mr(a,p+i.length+1,d,m+1),i,n)):(g=e._createAddBlockCommentOperations(t,i,n,this._insertSpace),this._usedEndToken=1===g.length?n:null);for(const e of g)r.addTrackedEditOperation(e.range,e.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return mr.isEmpty(e)?n.push(VH.delete(new mr(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(VH.delete(new mr(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(VH.delete(new mr(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const o=[];return mr.isEmpty(e)?o.push(VH.replace(new mr(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(VH.insert(new to(e.startLineNumber,e.startColumn),t+(n?" ":""))),o.push(VH.insert(new to(e.endLineNumber,e.endColumn),(n?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,n),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;s&&s.blockCommentStartToken&&s.blockCommentEndToken&&this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(2===i.length){const e=i[0],t=i[1];return new fr(e.range.endLineNumber,e.range.endColumn,t.range.startLineNumber,t.range.startColumn)}{const e=i[0].range,t=this._usedEndToken?-this._usedEndToken.length-1:0;return new fr(e.endLineNumber,e.endColumn+t,e.endLineNumber,e.endColumn+t)}}},S$=class e{constructor(e,t,i,n,o,s,r){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=n,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=r||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=n.getLanguageConfiguration(o).comments,r=s?s.lineCommentToken:null;if(!r)return null;const a=[];for(let l=0,d=i-t+1;l<d;l++)a[l]={ignore:!1,commentStr:r,commentStrOffset:0,commentStrLength:r.length};return a}static _analyzeLines(e,t,i,n,o,s,r,a,l){let d=!0;const c=a.getLanguageConfiguration(l).comments?.lineCommentNoIndent??!1;let h;h=0===e||1!==e;for(let u=0,g=n.length;u<g;u++){const a=n[u],l=o+u;if(l===o&&r){a.ignore=!0;continue}const g=i.getLineContent(l),p=jle(g);if(-1===p){a.ignore=s,a.commentStrOffset=c?0:g.length;continue}d=!1;const m=c?0:p;if(a.ignore=!1,a.commentStrOffset=m,h&&!y$._haystackHasNeedleAtOffset(g,a.commentStr,m)&&(0===e?h=!1:1===e||(a.ignore=!0)),h&&t){const e=p+a.commentStrLength;e<g.length&&32===g.charCodeAt(e)&&(a.commentStrLength+=1)}}if(0===e&&d){h=!1;for(let e=0,t=n.length;e<t;e++)n[e].ignore=!1}return{supported:!0,shouldRemoveComments:h,lines:n}}static _gatherPreflightData(t,i,n,o,s,r,a,l){const d=e._gatherPreflightCommentStrings(n,o,s,l),c=n.getLanguageIdAtPosition(o,1);return null===d?{supported:!1}:e._analyzeLines(t,i,n,d,o,r,a,l,c)}_executeLineComments(t,i,n,o){let s;n.shouldRemoveComments?s=e._createRemoveLineCommentsOperations(n.lines,o.startLineNumber):(e._normalizeInsertionPoint(t,n.lines,o.startLineNumber,this._indentSize),s=this._createAddLineCommentsOperations(n.lines,o.startLineNumber));const r=new to(o.positionLineNumber,o.positionColumn);for(let e=0,a=s.length;e<a;e++)i.addEditOperation(s[e].range,s[e].text),mr.isEmpty(s[e].range)&&mr.getStartPosition(s[e].range).equals(r)&&t.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(s[e].text||"").length);this._selectionId=i.trackSelection(o)}_attemptRemoveBlockComment(e,t,i,n){let o=t.startLineNumber,s=t.endLineNumber;const r=n.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let a=e.getLineContent(o).lastIndexOf(i,r-1),l=e.getLineContent(s).indexOf(n,t.endColumn-1-i.length);return-1!==a&&-1===l&&(l=e.getLineContent(o).indexOf(n,a+i.length),s=o),-1===a&&-1!==l&&(a=e.getLineContent(s).lastIndexOf(i,l),o=s),!t.isEmpty()||-1!==a&&-1!==l||(a=e.getLineContent(o).indexOf(i),-1!==a&&(l=e.getLineContent(o).indexOf(n,a+i.length))),-1!==a&&32===e.getLineContent(o).charCodeAt(a+i.length)&&(i+=" "),-1!==l&&32===e.getLineContent(s).charCodeAt(l-1)&&(n=" "+n,l-=1),-1!==a&&-1!==l?y$._createRemoveBlockCommentOperations(new mr(o,a+i.length+1,s,l+1),i,n):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const n=e.getLanguageIdAtPosition(i.startLineNumber,1),o=this.languageConfigurationService.getLanguageConfiguration(n).comments;if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const s=o.blockCommentStartToken,r=o.blockCommentEndToken;let a=this._attemptRemoveBlockComment(e,i,s,r);if(!a){if(i.isEmpty()){const t=e.getLineContent(i.startLineNumber);let n=jle(t);-1===n&&(n=t.length),a=y$._createAddBlockCommentOperations(new mr(i.startLineNumber,n+1,i.startLineNumber,t.length+1),s,r,this._insertSpace)}else a=y$._createAddBlockCommentOperations(new mr(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),s,r,this._insertSpace);1===a.length&&(this._deltaColumn=s.length+1)}this._selectionId=t.trackSelection(i);for(const l of a)t.addEditOperation(l.range,l.text)}getEditOperations(t,i){let n=this._selection;if(this._moveEndPositionDown=!1,n.startLineNumber===n.endLineNumber&&this._ignoreFirstLine)return i.addEditOperation(new mr(n.startLineNumber,t.getLineMaxColumn(n.startLineNumber),n.startLineNumber+1,1),n.startLineNumber===t.getLineCount()?"":"\n"),void(this._selectionId=i.trackSelection(n));n.startLineNumber<n.endLineNumber&&1===n.endColumn&&(this._moveEndPositionDown=!0,n=n.setEndPosition(n.endLineNumber-1,t.getLineMaxColumn(n.endLineNumber-1)));const o=e._gatherPreflightData(this._type,this._insertSpace,t,n.startLineNumber,n.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return o.supported?this._executeLineComments(t,i,o,n):this._executeBlockComment(t,i,n)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new fr(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];o.ignore||i.push(VH.delete(new mr(t+n,o.commentStrOffset+1,t+n,o.commentStrOffset+o.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let o=0,s=e.length;o<s;o++){const s=e[o];s.ignore||i.push(VH.insert(new to(t+o,s.commentStrOffset+1),s.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(t,i,n,o){let s,r,a=1073741824;for(let l=0,d=i.length;l<d;l++){if(i[l].ignore)continue;const s=t.getLineContent(n+l);let r=0;for(let t=0,n=i[l].commentStrOffset;r<a&&t<n;t++)r=e.nextVisibleColumn(r,o,9===s.charCodeAt(t),1);r<a&&(a=r)}a=Math.floor(a/o)*o;for(let l=0,d=i.length;l<d;l++){if(i[l].ignore)continue;const d=t.getLineContent(n+l);let c=0;for(s=0,r=i[l].commentStrOffset;c<a&&s<r;s++)c=e.nextVisibleColumn(c,o,9===d.charCodeAt(s),1);i[l].commentStrOffset=c>a?s-1:s}}},x$=class extends rr{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(il);if(!t.hasModel())return;const n=[],o=t.getModel().getOptions(),s=t.getOption(29),r=t.getSelections().map((e,t)=>({selection:e,index:t,ignoreFirstLine:!1}));r.sort((e,t)=>mr.compareRangesUsingStarts(e.selection,t.selection));let a=r[0];for(let l=1;l<r.length;l++){const e=r[l];a.selection.endLineNumber===e.selection.startLineNumber&&(a.index<e.index?e.ignoreFirstLine=!0:(a.ignoreFirstLine=!0,a=e))}for(const l of r)n.push(new S$(i,l.selection,o.indentSize,this._type,s.insertSpace,s.ignoreEmptyLines,l.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}},k$=class extends x${constructor(){super(0,{id:"editor.action.commentLine",label:zae(897,"Toggle Line Comment"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:ds.MenubarEditMenu,group:"5_insert",title:Vae(895,"&&Toggle Line Comment"),order:1},canTriggerInlineEdits:!0})}},L$=class extends x${constructor(){super(1,{id:"editor.action.addCommentLine",label:zae(898,"Add Line Comment"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2081),weight:100},canTriggerInlineEdits:!0})}},D$=class extends x${constructor(){super(2,{id:"editor.action.removeCommentLine",label:zae(899,"Remove Line Comment"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2099),weight:100},canTriggerInlineEdits:!0})}},I$=class extends rr{constructor(){super({id:"editor.action.blockComment",label:zae(900,"Toggle Block Comment"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:ds.MenubarEditMenu,group:"5_insert",title:Vae(896,"Toggle &&Block Comment"),order:2},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(il);if(!t.hasModel())return;const n=t.getOption(29),o=[],s=t.getSelections();for(const r of s)o.push(new y$(r,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}},kue(k$),kue(L$),kue(D$),kue(I$),E$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},M$=function(e,t){return function(i,n){t(i,n,e)}},N$=class{static get(e){return e.getContribution(T$.ID)}constructor(e,t,i,n,o,s,r,a){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=o,this._menuService=s,this._configurationService=r,this._workspaceContextService=a,this._toDispose=new De,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(e=>this._onContextMenu(e))),this._toDispose.add(this._editor.onMouseWheel(e=>{if(this._contextMenuIsBeingShownCount>0){const t=this._contextViewService.getContextViewElement(),i=e.srcElement;i.shadowRoot&&bhe(t)===i.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(e=>{this._editor.getOption(30)&&58===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(30))return this._editor.focus(),void(e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position));if(12===e.target.type)return;if(6===e.target.type&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),11===e.target.type)return this._showScrollbarContextMenu(e.event);if(6!==e.target.type&&7!==e.target.type&&1!==e.target.type)return;if(this._editor.focus(),e.target.position){let t=!1;for(const i of this._editor.getSelections())if(i.containsPosition(e.target.position)){t=!0;break}t||this._editor.setPosition(e.target.position)}let t=null;1!==e.target.type&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(30))return;if(!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const o of n){const[,t]=o;let n=0;for(const o of t)if(o instanceof gs){const t=this._getMenuActions(e,o.item.submenu);t.length>0&&(i.push(new ao(o.id,o.label,t)),n++)}else i.push(o),n++;n&&i.push(new ro)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;let i=t;if(!i){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const e=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),t=lhe(this._editor.getDomNode());i={x:t.left+e.left,y:t.top+e.top+e.height}}const n=this._editor.getOption(144)&&!U;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:n?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>i,getActions:()=>e,getActionViewItem:e=>{const t=this._keybindingFor(e);if(t)return new DE(e,e,{label:!0,keybinding:t.getLabel(),isMenu:!0});const i=e;return"function"==typeof i.getActionViewItem?i.getActionViewItem():new DE(e,e,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:e=>this._keybindingFor(e),onHide:e=>{this._contextMenuIsBeingShownCount--}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel())return;if(this._workspaceContextService.getWorkspace().id===KA)return;const t=this._editor.getOption(81);let i=0;const n=e=>({id:"menu-action-"+ ++i,label:e.label,tooltip:"",class:void 0,enabled:void 0===e.enabled||e.enabled,checked:e.checked,run:e.run}),o=(e,t,o,s,r)=>{if(!t)return n({label:e,enabled:t,run:()=>{}});const a=e=>()=>{this._configurationService.updateValue(o,e)},l=[];for(const i of r)l.push(n({label:i.label,checked:s===i.value,run:a(i.value)}));return((e,t)=>new ao("menu-action-"+ ++i,e,t,void 0))(e,l)},s=[];s.push(n({label:Vae(901,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),s.push(new ro),s.push(n({label:Vae(902,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),s.push(o(Vae(903,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:Vae(904,"Proportional"),value:"proportional"},{label:Vae(905,"Fill"),value:"fill"},{label:Vae(906,"Fit"),value:"fit"}])),s.push(o(Vae(907,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:Vae(908,"Mouse Over"),value:"mouseover"},{label:Vae(909,"Always"),value:"always"}]));const r=this._editor.getOption(144)&&!U;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>s,onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},T$=N$,N$.ID="editor.contrib.contextmenu",R$=N$,R$=T$=E$([M$(1,sT),M$(2,oT),M$(3,es),M$(4,xw),M$(5,cs),M$(6,ka),M$(7,HA)],R$),O$=class extends rr{constructor(){super({id:"editor.action.showContextMenu",label:zae(910,"Show Editor Context Menu"),precondition:void 0,kbOpts:{kbExpr:jl.textInputFocus,primary:1092,weight:100}})}run(e,t){R$.get(t)?.showContextMenu()}},Iue(R$.ID,R$,2),kue(O$),A$=class{constructor(e){this.selections=e}equals(e){const t=this.selections.length;if(t!==e.selections.length)return!1;for(let i=0;i<t;i++)if(!this.selections[i].equalsSelection(e.selections[i]))return!1;return!0}},P$=class{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}},F$=class e extends Ie{static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(e=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(e=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo)return;if(!t.oldSelections)return;if(t.oldModelVersionId!==t.modelVersionId)return;const i=new A$(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new P$(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){this._editor.hasModel()&&0!==this._undoStack.length&&(this._redoStack.push(new P$(new A$(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){this._editor.hasModel()&&0!==this._redoStack.length&&(this._undoStack.push(new P$(new A$(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}},F$.ID="editor.contrib.cursorUndoRedoController",W$=class extends rr{constructor(){super({id:"cursorUndo",label:zae(911,"Cursor Undo"),precondition:void 0,kbOpts:{kbExpr:jl.textInputFocus,primary:2099,weight:100}})}run(e,t,i){F$.get(t)?.cursorUndo()}},B$=class extends rr{constructor(){super({id:"cursorRedo",label:zae(912,"Cursor Redo"),precondition:void 0})}run(e,t,i){F$.get(t)?.cursorRedo()}},Iue(F$.ID,F$,0),kue(W$),kue(B$),V$=class{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new mr(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),!this.selection.containsPosition(this.targetPosition)||this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition))?this.copy?this.targetSelection=new fr(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber>this.selection.endLineNumber?this.targetSelection=new fr(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.targetPosition.lineNumber<this.selection.endLineNumber?this.targetSelection=new fr(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn):this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new fr(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,(this.selection.startLineNumber,this.selection.endLineNumber,this.targetPosition.column-this.selection.endColumn+this.selection.startColumn),this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new fr(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn):this.targetSelection=this.selection}computeCursorState(e,t){return this.targetSelection}},z$=class e extends Ie{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown(e=>this._onEditorMouseDown(e))),this._register(this._editor.onMouseUp(e=>this._onEditorMouseUp(e))),this._register(this._editor.onMouseDrag(e=>this._onEditorMouseDrag(e))),this._register(this._editor.onMouseDrop(e=>this._onEditorMouseDrop(e))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(e=>this.onEditorKeyDown(e))),this._register(this._editor.onKeyUp(e=>this.onEditorKeyUp(e))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){this._editor.getOption(42)&&!this._editor.getOption(28)&&(Pye(e)&&(this._modifierPressed=!0),this._mouseDown&&Pye(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(t){this._editor.getOption(42)&&!this._editor.getOption(28)&&(Pye(t)&&(this._modifierPressed=!1),this._mouseDown&&t.keyCode===e.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(null===this._dragSelection){const e=(this._editor.getSelections()||[]).filter(e=>t.position&&e.containsPosition(t.position));if(1!==e.length)return;this._dragSelection=e[0]}Pye(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(t){if(t.target&&(this._hitContent(t.target)||this._hitMargin(t.target))&&t.target.position){const i=new to(t.target.position.lineNumber,t.target.position.column);if(null===this._dragSelection){let e=null;if(t.event.shiftKey){const t=this._editor.getSelection();if(t){const{selectionStartLineNumber:n,selectionStartColumn:o}=t;e=[new fr(n,o,i.lineNumber,i.column)]}}else e=(this._editor.getSelections()||[]).map(e=>e.containsPosition(i)?new fr(i.lineNumber,i.column,i.lineNumber,i.column):e);this._editor.setSelections(e||[],"mouse",3)}else(!this._dragSelection.containsPosition(i)||(Pye(t.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(i)||this._dragSelection.getStartPosition().equals(i)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(e.ID,new V$(this._dragSelection,i,Pye(t.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(t){this._dndDecorationIds.set([{range:new mr(t.lineNumber,t.column,t.lineNumber,t.column),options:e._DECORATION_OPTIONS}]),this._editor.revealPosition(t,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return 6===e.type||7===e.type}_hitMargin(e){return 2===e.type||3===e.type||4===e.type}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}},(H$=z$).ID="editor.contrib.dragAndDrop",H$.TRIGGER_KEY_VALUE=F?6:5,H$._DECORATION_OPTIONS=Lx.register({description:"dnd-target",className:"dnd-target"}),Iue(z$.ID,z$,2),Iue($P.ID,$P,0),gCe(eP),xue(new class extends sr{constructor(){super({id:KP,precondition:qP,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t){return $P.get(t)?.changePasteType()}}),xue(new class extends sr{constructor(){super({id:"editor.hidePasteWidget",precondition:qP,kbOpts:{weight:100,primary:9}})}runEditorCommand(e,t){$P.get(t)?.clearWidgets()}}),kue((U$=class e extends rr{constructor(){super({id:"editor.action.pasteAs",label:zae(915,"Paste As..."),precondition:jl.writable,metadata:{description:"Paste as",args:[{name:"args",schema:e.argsSchema}]},canTriggerInlineEdits:!0})}run(e,t,i){let n;return i&&("kind"in i?n={only:new ZO(i.kind)}:"preferences"in i&&(n={preferences:i.preferences.map(e=>new ZO(e))})),$P.get(t)?.pasteAs(n)}},U$.argsSchema={oneOf:[{type:"object",required:["kind"],properties:{kind:{type:"string",description:Vae(913,"The kind of the paste edit to try pasting with.\nIf there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.")}}},{type:"object",required:["preferences"],properties:{preferences:{type:"array",description:Vae(914,"List of preferred paste edit kind to try applying.\nThe first edit matching the preferences will be applied."),items:{type:"string"}}}}]},U$)),kue(class extends rr{constructor(){super({id:"editor.action.pasteAsText",label:zae(916,"Paste as Text"),precondition:jl.writable,canTriggerInlineEdits:!0})}run(e,t){return $P.get(t)?.pasteAs({providerId:GA.id})}}),K$=class{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}},q$=class{constructor(e){this.identifier=e}},dge(j$=eue("treeViewsDndService"),K$,1),G$=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Z$=function(e,t){return function(i,n){t(i,n,e)}},Q$="editor.changeDropType",X$=new Jo("dropWidgetVisible",!1,Vae(934,"Whether the drop widget is showing")),$$=class extends Ie{static get(e){return e.getContribution(Y$.ID)}constructor(e,t,i,n,o){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=rA.getInstance(),this._dropProgressManager=this._register(t.createInstance(yA,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(BP,"dropIntoEditor",e,X$,{id:Q$,label:Vae(935,"Show drop options...")},()=>Y$._configureDefaultAction?[Y$._configureDefaultAction]:[])),this._register(e.onDropIntoEditor(t=>this.onDropIntoEditor(e,t.position,t.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){if(!i.dataTransfer||!e.hasModel())return;Y$._currentDropOperation?.cancel(),e.focus(),e.setPosition(t);const n=Ele(async o=>{const s=new De,r=s.add(new fA(e,1,void 0,o));try{const n=await this.extractDataTransferData(i);if(0===n.size||r.token.isCancellationRequested)return;const a=e.getModel();if(!a)return;const l=this._languageFeaturesService.documentDropEditProvider.ordered(a).filter(e=>!e.dropMimeTypes||e.dropMimeTypes.some(e=>n.matches(e))),d=s.add(await this.getDropEdits(l,a,t,n,r.token));if(r.token.isCancellationRequested)return;if(d.edits.length){const i=this.getInitialActiveEditIndex(a,d.edits),n="afterDrop"===e.getOption(43).showDropSelector;await this._postDropWidgetManager.applyEditAndShowIfNeeded([mr.fromPositions(t)],{activeEditIndex:i,allEdits:d.edits},n,async e=>e,o)}}finally{s.dispose(),Y$._currentDropOperation===n&&(Y$._currentDropOperation=void 0)}});this._dropProgressManager.showWhile(t,Vae(936,"Running drop handlers. Click to cancel"),n,{cancel:()=>n.cancel()}),Y$._currentDropOperation=n}async getDropEdits(e,t,i,n,o){const s=new De;return{edits:Gwe(ice(await Mle(Promise.all(e.map(async e=>{try{const r=await e.provideDocumentDropEdits(t,i,n,o);return r&&s.add(r),r?.edits.map(t=>({...t,providerId:e.id}))}catch(r){Yae(r)||console.error(r),console.error(r)}})),o)??[]).flat()),dispose:()=>s.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue("editor.dropIntoEditor.preferences",{resource:e.uri});for(const n of Array.isArray(i)?i:[]){const e=new ZO(n),i=t.findIndex(t=>t.kind&&e.contains(t.kind));if(i>=0)return i}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new jO;const t=Vwe(e.dataTransfer);if(this.treeItemsTransfer.hasData(q$.prototype)){const e=this.treeItemsTransfer.getData(q$.prototype);if(Array.isArray(e))for(const i of e){const e=await this._treeViewsDragAndDropService.removeDragOperationTransfer(i.identifier);if(e)for(const[i,n]of e)t.replace(i,n)}}return t}},Y$=$$,$$.ID="editor.contrib.dropIntoEditorController",J$=$$,Iue((J$=Y$=G$([Z$(1,Jn),Z$(2,ka),Z$(3,Tx),Z$(4,j$)],J$)).ID,J$,2),gCe(JA),xue(new class extends sr{constructor(){super({id:Q$,precondition:X$,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t,i){J$.get(t)?.changeDropType()}}),xue(new class extends sr{constructor(){super({id:"editor.hideDropWidget",precondition:X$,kbOpts:{weight:100,primary:9}})}runEditorCommand(e,t,i){J$.get(t)?.clearWidgets()}}),eG=class e extends mm{constructor(e,t,i){super(),this._hideSoon=this._register(new ft(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const n={inputActiveOptionBorder:gpe(Pu),inputActiveOptionForeground:gpe(Bu),inputActiveOptionBackground:gpe(Wu)},o={groupId:"find-options-widget"};this.caseSensitive=this._register(new aV({appendTitle:this._keybindingLabelFor(iV.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverLifecycleOptions:o,...n})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new lV({appendTitle:this._keybindingLabelFor(iV.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverLifecycleOptions:o,...n})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new dV({appendTitle:this._keybindingLabelFor(iV.ToggleRegexCommand),isChecked:this._state.isRegex,hoverLifecycleOptions:o,...n})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(e=>{let t=!1;e.isRegex&&(this.regex.checked=this._state.isRegex,t=!0),e.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,t=!0),e.matchCase&&(this.caseSensitive.checked=this._state.matchCase,t=!0),!this._state.isRevealed&&t&&this._revealTemporarily()})),this._register(ehe(this._domNode,On.MOUSE_LEAVE,e=>this._onMouseLeave())),this._register(ehe(this._domNode,"mouseover",e=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return e.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}},eG.ID="editor.contrib.findOptionsWidget",tG=class extends Ie{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return Fye(this._isRegexOverride,this._isRegex)}get wholeWord(){return Fye(this._wholeWordOverride,this._wholeWord)}get matchCase(){return Fye(this._matchCaseOverride,this._matchCase)}get preserveCase(){return Fye(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new je),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const n={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;0===t&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,o=!0),void 0!==i&&(mr.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){const n={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const s=this.isRegex,r=this.wholeWord,a=this.matchCase,l=this.preserveCase;void 0!==e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,n.searchString=!0,o=!0),void 0!==e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,n.replaceString=!0,o=!0),void 0!==e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,n.isRevealed=!0,o=!0),void 0!==e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,n.isReplaceRevealed=!0,o=!0),void 0!==e.isRegex&&(this._isRegex=e.isRegex),void 0!==e.wholeWord&&(this._wholeWord=e.wholeWord),void 0!==e.matchCase&&(this._matchCase=e.matchCase),void 0!==e.preserveCase&&(this._preserveCase=e.preserveCase),void 0!==e.searchScope&&(e.searchScope?.every(e=>this._searchScope?.some(t=>!mr.equalsRange(t,e)))||(this._searchScope=e.searchScope,n.searchScope=!0,o=!0)),void 0!==e.loop&&this._loop!==e.loop&&(this._loop=e.loop,n.loop=!0,o=!0),void 0!==e.isSearching&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,n.isSearching=!0,o=!0),void 0!==e.filters&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,n.filters=!0,o=!0),this._isRegexOverride=void 0!==e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride=void 0!==e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride=void 0!==e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride=void 0!==e.preserveCaseOverride?e.preserveCaseOverride:0,s!==this.isRegex&&(o=!0,n.isRegex=!0),r!==this.wholeWord&&(o=!0,n.wholeWord=!0),a!==this.matchCase&&(o=!0,n.matchCase=!0),l!==this.preserveCase&&(o=!0,n.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(n)}canNavigateBack(){return this.canNavigateInLoop()||1!==this.matchesPosition}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=19999}},nG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},oG=function(e,t){return function(i,n){t(i,n,e)}},iG=class{static getOrCreate(e){return sG._instance||(sG._instance=new sG(e)),sG._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new je,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(sG.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch(Fae){}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(sG.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}},sG=iG,iG.FIND_HISTORY_KEY="workbench.find.history",iG._instance=null,rG=iG,rG=sG=nG([oG(0,eR)],rG),lG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},dG=function(e,t){return function(i,n){t(i,n,e)}},aG=class{static getOrCreate(e){return cG._instance||(cG._instance=new cG(e)),cG._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new je,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(cG.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch(Fae){}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(cG.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}},cG=aG,aG.FIND_HISTORY_KEY="workbench.replace.history",aG._instance=null,hG=aG,hG=cG=lG([dG(0,eR)],hG),gG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},pG=function(e,t){return function(i,n){t(i,n,e)}},fG=524288,uG=class extends Ie{get editor(){return this._editor}static get(e){return e.getContribution(mG.ID)}constructor(e,t,i,n,o,s){super(),this._editor=e,this._findWidgetVisible=GB.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=o,this._hoverService=s,this._updateHistoryDelayer=new ht(500),this._state=this._register(new tG),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(e=>this._onStateChanged(e))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const e=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),e&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(50).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!ZB.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e)).filter(e=>!!e),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=Ble(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if("single"===e.seedSearchStringFromSelection){const t=Wye(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);t&&(this._state.isRegex?i.searchString=Ble(t):i.searchString=t)}else if("multiple"===e.seedSearchStringFromSelection&&!e.updateSearchScope){const t=Wye(this._editor,e.seedSearchStringFromSelection);t&&(i.searchString=t)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const e=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;e&&(i.searchString=e)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const e=this._editor.getSelections();e.some(e=>!e.isEmpty())&&(i.searchScope=e)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new nV(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return!!this._model&&(this._model.moveToNextMatch(),!0)}moveToPrevMatch(){return!!this._model&&(this._model.moveToPrevMatch(),!0)}goToMatch(e){return!!this._model&&(this._model.moveToMatch(e),!0)}replace(){return!!this._model&&(this._model.replace(),!0)}replaceAll(){return!!this._model&&(this._editor.getModel()?.isTooLargeForHeapOperation()?(this._notificationService.warn(Vae(940,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0))}selectAllMatches(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)}async getGlobalBufferTerm(){return this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}},mG=uG,uG.ID="editor.contrib.findController",_G=uG,_G=mG=gG([pG(1,es),pG(2,eR),pG(3,nT),pG(4,Xv),pG(5,BR)],_G),bG=class extends _G{constructor(e,t,i,n,o,s,r,a){super(e,i,s,r,o,a),this._contextViewService=t,this._keybindingService=n,this._widget=null,this._findOptionsWidget=null,this._findWidgetSearchHistory=rG.getOrCreate(s),this._replaceWidgetHistory=hG.getOrCreate(s)}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let n=!1;switch(this._editor.getOption(50).autoFindInSelection){case"always":n=!0;break;case"never":n=!1;break;case"multiline":n=!!i&&i.startLineNumber!==i.endLineNumber}e.updateSearchScope=e.updateSearchScope||n,await super._start(e,t),this._widget&&(2===e.shouldFocus?this._widget.focusReplaceInput():1===e.shouldFocus&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new oH(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._hoverService,this._findWidgetSearchHistory,this._replaceWidgetHistory)),this._findOptionsWidget=this._register(new eG(this._editor,this._state,this._keybindingService))}saveViewState(){return this._widget?.getViewState()}restoreViewState(e){this._widget?.setViewState(e)}},bG=gG([pG(1,oT),pG(2,es),pG(3,xw),pG(4,Xv),pG(5,eR),pG(6,nT),pG(7,BR)],bG),Lue(new ar({id:iV.StartFindAction,label:zae(947,"Find"),precondition:Po.or(jl.focus,Po.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:ds.MenubarEditMenu,group:"3_find",title:Vae(941,"&&Find"),order:1}})).addImplementation(0,(e,t,i)=>{const n=_G.get(t);return!!n&&n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"never"!==t.getOption(50).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(50).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getOption(50).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop})}),vG={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]},wG=class extends rr{constructor(){super({id:iV.StartFindWithArgs,label:zae(948,"Find with Arguments"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:vG})}async run(e,t,i){const n=_G.get(t);if(n){const e=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:void 0!==i.replaceString,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await n.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===n.getState().searchString.length&&"never"!==t.getOption(50).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(50).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(50).loop},e),n.setGlobalBufferTerm(n.getState().searchString)}}},CG=class extends rr{constructor(){super({id:iV.StartFindWithSelection,label:zae(949,"Find with Selection"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=_G.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),i.setGlobalBufferTerm(i.getState().searchString))}},Lue(new ar({id:iV.NextMatchFindAction,label:zae(950,"Find Next"),precondition:void 0,kbOpts:[{kbExpr:jl.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Po.and(jl.focus,ZB),primary:3,weight:100}]})).addImplementation(0,async(e,t,i)=>Bye(t,!0)),Lue(new ar({id:iV.PreviousMatchFindAction,label:zae(951,"Find Previous"),precondition:void 0,kbOpts:[{kbExpr:jl.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Po.and(jl.focus,ZB),primary:1027,weight:100}]})).addImplementation(0,async(e,t,i)=>Bye(t,!1)),yG=class extends rr{constructor(){super({id:iV.GoToMatchFindAction,label:zae(952,"Go to Match..."),precondition:GB}),this._highlightDecorations=[]}run(e,t,i){const n=_G.get(t);if(!n)return;const o=n.getState().matchesCount;if(o<1)return void e.get(Xv).notify({severity:Qv.Warning,message:Vae(942,"No matches. Try searching for something else.")});const s=e.get(tA),r=new De,a=r.add(s.createInputBox());a.placeholder=Vae(943,"Type a number to go to a specific match (between 1 and {0})",o);const l=e=>{const t=parseInt(e);if(isNaN(t))return;const i=n.getState().matchesCount;return t>0&&t<=i?t-1:t<0&&t>=-i?i+t:void 0},d=e=>{const i=l(e);if("number"==typeof i){a.validationMessage=void 0,n.goToMatch(i);const e=n.getState().currentMatch;e&&this.addDecorations(t,e)}else a.validationMessage=Vae(944,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};r.add(a.onDidChangeValue(e=>{d(e)})),r.add(a.onDidAccept(()=>{const e=l(a.value);"number"==typeof e?(n.goToMatch(e),a.hide()):a.validationMessage=Vae(945,"Please type a number between 1 and {0}",n.getState().matchesCount)})),r.add(a.onDidHide(()=>{this.clearDecorations(t),r.dispose()})),a.show()}clearDecorations(e){e.changeDecorations(e=>{this._highlightDecorations=e.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(e=>{this._highlightDecorations=e.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:Hpe(n_),position:Zr.Full}}}])})}},SG=class extends rr{async run(e,t){const i=_G.get(t);if(!i)return;const n=Wye(t,"single",!1);n&&i.setSearchString(n),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),this._run(i))}},xG=class extends SG{constructor(){super({id:iV.NextSelectionMatchFindAction,label:zae(953,"Find Next Selection"),precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}},kG=class extends SG{constructor(){super({id:iV.PreviousSelectionMatchFindAction,label:zae(954,"Find Previous Selection"),precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}},Lue(new ar({id:iV.StartFindReplaceAction,label:zae(955,"Replace"),precondition:Po.or(jl.focus,Po.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:ds.MenubarEditMenu,group:"3_find",title:Vae(946,"&&Replace"),order:2}})).addImplementation(0,(e,t,i)=>{if(!t.hasModel()||t.getOption(104))return!1;const n=_G.get(t);if(!n)return!1;const o=t.getSelection(),s=n.isFindInputFocused(),r=!o.isEmpty()&&o.startLineNumber===o.endLineNumber&&"never"!==t.getOption(50).seedSearchStringFromSelection&&!s,a=s||r?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(50).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:"never"!==t.getOption(50).seedSearchStringFromSelection,shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop})}),Iue(_G.ID,bG,0),kue(wG),kue(CG),kue(yG),kue(xG),kue(kG),xue(new(LG=sr.bindToContribution(_G.get))({id:iV.CloseFindWidgetCommand,precondition:GB,handler:e=>e.closeFindWidget(),kbOpts:{weight:105,kbExpr:Po.and(jl.focus,Po.not("isComposing")),primary:9,secondary:[1033]}})),xue(new LG({id:iV.ToggleCaseSensitiveCommand,precondition:void 0,handler:e=>e.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:jl.focus,primary:QB.primary,mac:QB.mac,win:QB.win,linux:QB.linux}})),xue(new LG({id:iV.ToggleWholeWordCommand,precondition:void 0,handler:e=>e.toggleWholeWords(),kbOpts:{weight:105,kbExpr:jl.focus,primary:XB.primary,mac:XB.mac,win:XB.win,linux:XB.linux}})),xue(new LG({id:iV.ToggleRegexCommand,precondition:void 0,handler:e=>e.toggleRegex(),kbOpts:{weight:105,kbExpr:jl.focus,primary:JB.primary,mac:JB.mac,win:JB.win,linux:JB.linux}})),xue(new LG({id:iV.ToggleSearchScopeCommand,precondition:void 0,handler:e=>e.toggleSearchScope(),kbOpts:{weight:105,kbExpr:jl.focus,primary:eV.primary,mac:eV.mac,win:eV.win,linux:eV.linux}})),xue(new LG({id:iV.TogglePreserveCaseCommand,precondition:void 0,handler:e=>e.togglePreserveCase(),kbOpts:{weight:105,kbExpr:jl.focus,primary:tV.primary,mac:tV.mac,win:tV.win,linux:tV.linux}})),xue(new LG({id:iV.ReplaceOneAction,precondition:GB,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:jl.focus,primary:3094}})),xue(new LG({id:iV.ReplaceOneAction,precondition:GB,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:Po.and(jl.focus,YB),primary:3}})),xue(new LG({id:iV.ReplaceAllAction,precondition:GB,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:jl.focus,primary:2563}})),xue(new LG({id:iV.ReplaceAllAction,precondition:GB,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:Po.and(jl.focus,YB),primary:void 0,mac:{primary:2051}}})),xue(new LG({id:iV.SelectAllMatchesAction,precondition:GB,handler:e=>e.selectAllMatches(),kbOpts:{weight:105,kbExpr:jl.focus,primary:515}})),DG={0:" ",1:"u",2:"r"},IG=16777215,NG=4278190080,EG=class{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return!!(this._states[t]&1<<i)}set(e,t){const i=e/32|0,n=e%32,o=this._states[i];this._states[i]=t?o|1<<n:o&~(1<<n)}},MG=class e{constructor(e,t,i){if(e.length!==t.length||e.length>65535)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new EG(e.length),this._userDefinedStates=new EG(e.length),this._recoveredStates=new EG(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(t,i)=>{const n=e[e.length-1];return this.getStartLineNumber(n)<=t&&this.getEndLineNumber(n)>=i};for(let i=0,n=this._startIndexes.length;i<n;i++){const n=this._startIndexes[i],o=this._endIndexes[i];if(n>16777215||o>16777215)throw new Error("startLineNumber or endLineNumber must not exceed "+IG);for(;e.length>0&&!t(n,o);)e.pop();const s=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=n+((255&s)<<24),this._endIndexes[i]=o+((65280&s)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&IG}getEndLineNumber(e){return this._endIndexes[e]&IG}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){1===t?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):2===t?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let n=0;n<this._types.length;n++)this._types[n]===e&&(this.setCollapsed(n,t),i=!0);return i}toRegion(e){return new TG(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&NG)>>>24)+((this._endIndexes[e]&NG)>>>16);return 65535===t?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(0===i)return-1;for(;t<i;){const n=Math.floor((t+i)/2);e<this.getStartLineNumber(n)?i=n:t=n+1}return t-1}findRange(e){let t=this.findIndex(e);if(t>=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${DG[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&IG,endLineNumber:this._endIndexes[e]&IG,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(t){const i=t.length,n=new Uint32Array(i),o=new Uint32Array(i);let s=[],r=!1;for(let e=0;e<i;e++){const i=t[e];n[e]=i.startLineNumber,o[e]=i.endLineNumber,s.push(i.type),i.type&&(r=!0)}r||(s=void 0);const a=new e(n,o,s);for(let e=0;e<i;e++)t[e].isCollapsed&&a.setCollapsed(e,!0),a.setSource(e,t[e].source);return a}static sanitizeAndMerge(e,t,i,n){i=i??Number.MAX_VALUE;const o=(e,t)=>Array.isArray(e)?i=>i<t?e[i]:void 0:i=>i<t?e.toFoldRange(i):void 0,s=o(e,e.length),r=o(t,t.length);let a=0,l=0,d=s(0),c=r(0);const h=[];let u,g=0;const p=[];for(;d||c;){let e;if(c&&(!d||d.startLineNumber>=c.startLineNumber))d&&d.startLineNumber===c.startLineNumber?(1===c.source?e=c:(e=d,e.isCollapsed=c.isCollapsed&&(d.endLineNumber===c.endLineNumber||!n?.startsInside(d.startLineNumber+1,d.endLineNumber+1)),e.source=0),d=s(++a)):(e=c,c.isCollapsed&&0===c.source&&(e.source=2)),c=r(++l);else{let t=l,i=c;for(;;){if(!i||i.startLineNumber>d.endLineNumber){e=d;break}if(1===i.source&&i.endLineNumber>d.endLineNumber)break;i=r(++t)}d=s(++a)}if(e){for(;u&&u.endLineNumber<e.startLineNumber;)u=h.pop();e.endLineNumber>e.startLineNumber&&e.startLineNumber>g&&e.endLineNumber<=i&&(!u||u.endLineNumber>=e.endLineNumber)&&(p.push(e),g=e.startLineNumber,u&&h.push(u),u=e)}}return p}},TG=class{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}},RG=class{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new je,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new MG(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((e,t)=>e.regionIndex-t.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let n=0,o=-1,s=-1;const r=e=>{for(;n<e;){const e=this._regions.getEndLineNumber(n),t=this._regions.isCollapsed(n);if(e<=o){const o=0!==this.regions.getSource(n);i.changeDecorationOptions(this._editorDecorationIds[n],this._decorationProvider.getDecorationOption(t,e<=s,o))}t&&e>s&&(s=e),n++}};for(const a of e){const e=a.regionIndex,i=this._editorDecorationIds[e];if(i&&!t[i]){t[i]=!0,r(e);const n=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,n),o=Math.max(o,this._regions.getEndLineNumber(e))}}r(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=t=>{for(const i of e)if(!(i.startLineNumber>t.endLineNumber||t.startLineNumber>i.endLineNumber))return!0;return!1};for(let n=0;n<this._regions.length;n++){const e=this._regions.toFoldRange(n);0!==e.source&&i(e)||t.push(e)}this.updatePost(MG.fromFoldRanges(t))}update(e,t){const i=this._currentFoldedOrManualRanges(t),n=MG.sanitizeAndMerge(e,i,this._textModel.getLineCount(),t);this.updatePost(MG.fromFoldRanges(n))}updatePost(e){const t=[];let i=-1;for(let n=0,o=e.length;n<o;n++){const o=e.getStartLineNumber(n),s=e.getEndLineNumber(n),r=e.isCollapsed(n),a=0!==e.getSource(n),l={startLineNumber:o,startColumn:this._textModel.getLineMaxColumn(o),endLineNumber:s,endColumn:this._textModel.getLineMaxColumn(s)+1};t.push({range:l,options:this._decorationProvider.getDecorationOption(r,s<=i,a)}),r&&s>i&&(i=s)}this._decorationProvider.changeDecorations(e=>this._editorDecorationIds=e.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,n=this._regions.length;i<n;i++){let n=this.regions.isCollapsed(i);const o=this.regions.getSource(i);if(n||0!==o){const s=this._regions.toFoldRange(i),r=this._textModel.getDecorationRange(this._editorDecorationIds[i]);r&&(n&&e?.startsInside(r.startLineNumber+1,r.endLineNumber)&&(n=!1),t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:s.type,isCollapsed:n,source:o}))}}return t}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let n=0,o=e.length;n<o;n++){const o=e[n];if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const s=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,isCollapsed:o.isCollapsed,source:o.source,checksum:s})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const o of e){if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const e=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);o.checksum&&e!==o.checksum||t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,type:void 0,isCollapsed:o.isCollapsed??!0,source:o.source??0})}const n=MG.sanitizeAndMerge(this._regions,t,i);this.updatePost(MG.fromFoldRanges(n))}_getLinesChecksum(e,t){return Ude(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let n=this._regions.findRange(e),o=1;for(;n>=0;){const e=this._regions.toRegion(n);t&&!t(e,o)||i.push(e),o++,n=e.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],n=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let s=n,r=this._regions.length;s<r;s++){const n=this._regions.toRegion(s);if(!(this._regions.getStartLineNumber(s)<o))break;for(;e.length>0&&!n.containedBy(e[e.length-1]);)e.pop();e.push(n),t(n,e.length)&&i.push(n)}}else for(let s=n,r=this._regions.length;s<r;s++){const e=this._regions.toRegion(s);if(!(this._regions.getStartLineNumber(s)<o))break;t&&!t(e)||i.push(e)}return i}},OG=class{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new je,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(e=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(e=>e.range.endLineNumber!==e.range.startLineNumber||0!==Rme(e.text)[0]))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,o=Number.MAX_VALUE,s=-1;const r=this._foldingModel.regions;for(;i<r.length;i++){if(!r.isCollapsed(i))continue;const a=r.getStartLineNumber(i)+1,l=r.getEndLineNumber(i);o<=a&&l<=s||(!e&&n<this._hiddenRanges.length&&this._hiddenRanges[n].startLineNumber===a&&this._hiddenRanges[n].endLineNumber===l?(t.push(this._hiddenRanges[n]),n++):(e=!0,t.push(new mr(a,1,l,1))),o=a,s=l)}(this._hasLineChanges||e||n<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return null!==jye(this._hiddenRanges,e)}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const o=e=>(n&&function(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}(e,n)||(n=jye(this._hiddenRanges,e)),n?n.startLineNumber-1:null);for(let s=0,r=e.length;s<r;s++){let n=e[s];const r=o(n.startLineNumber);r&&(n=n.setStartPosition(r,i.getLineMaxColumn(r)),t=!0);const a=o(n.endLineNumber);a&&(n=n.setEndPosition(a,i.getLineMaxColumn(a)),t=!0),e[s]=n}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}},AG=class{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id="indent"}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(function(e,t,i,n=FG){const o=e.getOptions().tabSize,s=new PG(n);let r;i&&(r=new RegExp(`(${i.start.source})|(?:${i.end.source})`));const a=[],l=e.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let d=e.getLineCount();d>0;d--){const i=e.getLineContent(d),n=Xpe(i,o);let l,c=a[a.length-1];if(-1!==n){if(r&&(l=i.match(r))){if(!l[1]){a.push({indent:-2,endAbove:d,line:d});continue}{let e=a.length-1;for(;e>0&&-2!==a[e].indent;)e--;if(e>0){a.length=e+1,c=a[e],s.insertFirst(d,c.line,n),c.line=d,c.indent=n,c.endAbove=d;continue}}}if(c.indent>n){do{a.pop(),c=a[a.length-1]}while(c.indent>n);const e=c.endAbove-1;e-d>=1&&s.insertFirst(d,e,n)}c.indent===n?c.endAbove=d:a.push({indent:n,endAbove:d,line:d})}else t&&(c.endAbove=d)}return s.toIndentRanges(e)}(this.editorModel,i,n,this.foldingRangesLimit))}},PG=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>16777215||t>16777215)return;const n=this._length;this._startIndexes[n]=e,this._endIndexes[n]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=this._length-1,n=0;i>=0;i--,n++)e[n]=this._startIndexes[i],t[n]=this._endIndexes[i];return new MG(e,t)}{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let e=0;e<this._indentOccurrences.length;e++){const o=this._indentOccurrences[e];if(o){if(o+i>t){n=e;break}i+=o}}const o=e.getOptions().tabSize,s=new Uint32Array(t),r=new Uint32Array(t);for(let a=this._length-1,l=0;a>=0;a--){const d=this._startIndexes[a],c=Xpe(e.getLineContent(d),o);(c<n||c===n&&i++<t)&&(s[l]=d,r[l]=this._endIndexes[a],l++)}return new MG(s,r)}}},FG={limit:5e3,update:()=>{}},BG=mpe("editor.foldBackground",{light:bpe(Oh,.3),dark:bpe(Oh,.3),hcDark:null,hcLight:null},Vae(1002,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},Vae(1003,"Color of the collapsed text after the first line of a folded range.")),mpe("editorGutter.foldingControlForeground",lh,Vae(1004,"Color of the folding control in the editor gutter.")),VG=rwe("folding-expanded",go.chevronDown,Vae(1005,"Icon for expanded ranges in the editor glyph margin.")),HG=rwe("folding-collapsed",go.chevronRight,Vae(1006,"Icon for collapsed ranges in the editor glyph margin.")),zG=rwe("folding-manual-collapsed",HG,Vae(1007,"Icon for manually collapsed ranges in the editor glyph margin.")),UG=rwe("folding-manual-expanded",VG,Vae(1008,"Icon for manually expanded ranges in the editor glyph margin.")),KG={color:Hpe(BG),position:1},qG=Vae(1009,"Click to expand the range."),jG=Vae(1010,"Click to collapse the range."),$G=class e{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(t,i,n){return i?e.HIDDEN_RANGE_DECORATION:"never"===this.showFoldingControls?t?this.showFoldingHighlights?e.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:e.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:e.NO_CONTROLS_EXPANDED_RANGE_DECORATION:t?n?this.showFoldingHighlights?e.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:e.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?e.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:e.COLLAPSED_VISUAL_DECORATION:"mouseover"===this.showFoldingControls?n?e.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:e.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:n?e.MANUALLY_EXPANDED_VISUAL_DECORATION:e.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}},(WG=$G).COLLAPSED_VISUAL_DECORATION=Lx.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:qG,firstLineDecorationClassName:mo.asClassName(HG)}),WG.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Lx.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:KG,isWholeLine:!0,linesDecorationsTooltip:qG,firstLineDecorationClassName:mo.asClassName(HG)}),WG.MANUALLY_COLLAPSED_VISUAL_DECORATION=Lx.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:qG,firstLineDecorationClassName:mo.asClassName(zG)}),WG.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Lx.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:KG,isWholeLine:!0,linesDecorationsTooltip:qG,firstLineDecorationClassName:mo.asClassName(zG)}),WG.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Lx.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:qG}),WG.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Lx.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:KG,isWholeLine:!0,linesDecorationsTooltip:qG}),WG.EXPANDED_VISUAL_DECORATION=Lx.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+mo.asClassName(VG),linesDecorationsTooltip:jG}),WG.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Lx.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:mo.asClassName(VG),linesDecorationsTooltip:jG}),WG.MANUALLY_EXPANDED_VISUAL_DECORATION=Lx.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+mo.asClassName(UG),linesDecorationsTooltip:jG}),WG.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Lx.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:mo.asClassName(UG),linesDecorationsTooltip:jG}),WG.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Lx.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),WG.HIDDEN_RANGE_DECORATION=Lx.register({description:"folding-hidden-range-decoration",stickiness:1}),GG={},ZG=class{constructor(e,t,i,n,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=o,this.id="syntax",this.disposables=new De,o&&this.disposables.add(o);for(const s of t)"function"==typeof s.onDidChange&&this.disposables.add(s.onDidChange(i))}compute(e){return function(e,t,i){let n=null;const o=e.map((e,o)=>Promise.resolve(e.provideFoldingRanges(t,GG,i)).then(e=>{if(!i.isCancellationRequested&&Array.isArray(e)){Array.isArray(n)||(n=[]);const i=t.getLineCount();for(const t of e)t.start>0&&t.end>t.start&&t.end<=i&&n.push({start:t.start,end:t.end,rank:o,kind:t.kind})}},Gae));return Promise.all(o).then(e=>n)}(this.providers,this.editorModel,e).then(t=>this.editorModel.isDisposed()?null:t?function(e,t){const i=e.sort((e,t)=>{let i=e.start-t.start;return 0===i&&(i=e.rank-t.rank),i}),n=new YG(t);let o;const s=[];for(const r of i)if(o){if(r.start>o.start)if(r.end<=o.end)s.push(o),o=r,n.add(r.start,r.end,r.kind&&r.kind.value,s.length);else{if(r.start>o.end){do{o=s.pop()}while(o&&r.start>o.end);o&&s.push(o),o=r}n.add(r.start,r.end,r.kind&&r.kind.value,s.length)}}else o=r,n.add(r.start,r.end,r.kind&&r.kind.value,s.length);return n.toIndentRanges()}(t,this.foldingRangesLimit):this.fallbackRangeProvider?.compute(e)??null)}dispose(){this.disposables.dispose()}},YG=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,n){if(e>16777215||t>16777215)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=n,this._types[o]=i,this._length++,n<30&&(this._nestingLevelCounts[n]=(this._nestingLevelCounts[n]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;i<this._length;i++)e[i]=this._startIndexes[i],t[i]=this._endIndexes[i];return new MG(e,t,this._types)}{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let r=0;r<this._nestingLevelCounts.length;r++){const n=this._nestingLevelCounts[r];if(n){if(n+t>e){i=r;break}t+=n}}const n=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let r=0,a=0;r<this._length;r++){const l=this._nestingLevels[r];(l<i||l===i&&t++<e)&&(n[a]=this._startIndexes[r],o[a]=this._endIndexes[r],s[a]=this._types[r],a++)}return new MG(n,o,s)}}},JG=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},eZ=function(e,t){return function(i,n){t(i,n,e)}},iZ=new Jo("foldingEnabled",!1),QG=class extends Ie{static get(e){return e.getContribution(tZ.ID)}static getFoldingRangeProviders(e,t){const i=e.foldingRangeProvider.ordered(t);return tZ._foldingRangeSelector?.(i,t)??i}constructor(e,t,i,n,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=s,this.localToDispose=this._register(new De),this.editor=e,this._foldingLimitReporter=this._register(new oZ(e));const r=this.editor.getOptions();this._isEnabled=r.get(52),this._useFoldingProviders="indentation"!==r.get(53),this._unfoldOnClickAfterEndOfLine=r.get(57),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=r.get(55),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new $G(e),this.foldingDecorationProvider.showFoldingControls=r.get(126),this.foldingDecorationProvider.showFoldingHighlights=r.get(54),this.foldingEnabled=iZ.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(e=>{if(e.hasChanged(52)&&(this._isEnabled=this.editor.getOptions().get(52),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),e.hasChanged(56)&&this.onModelChanged(),e.hasChanged(126)||e.hasChanged(54)){const e=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=e.get(126),this.foldingDecorationProvider.showFoldingHighlights=e.get(54),this.triggerFoldingModelChanged()}e.hasChanged(53)&&(this._useFoldingProviders="indentation"!==this.editor.getOptions().get(53),this.onFoldingStrategyChanged()),e.hasChanged(57)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(57)),e.hasChanged(55)&&(this._foldingImportsByDefault=this.editor.getOptions().get(55))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(t&&this._isEnabled&&!t.isTooLargeForTokenization()&&this.hiddenRangeModel&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();this._isEnabled&&e&&!e.isTooLargeForTokenization()&&(this._currentModelHasFoldedImports=!1,this.foldingModel=new RG(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new OG(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(e=>this.onHiddenRangesChanges(e))),this.updateScheduler=new ht(this.updateDebounceInfo.get(e)),this.localToDispose.add(this.updateScheduler),this.cursorChangedScheduler=new ft(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(e=>this.onDidChangeModelContent(e))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(e=>this.onEditorMouseDown(e))),this.localToDispose.add(this.editor.onMouseUp(e=>this.onEditorMouseUp(e))),this.localToDispose.add({dispose:()=>{this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.updateScheduler?.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,this.rangeProvider?.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){this.rangeProvider?.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new AG(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=tZ.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new ZG(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){this.hiddenRangeModel?.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Fe,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Ele(e=>i.compute(e));return n.then(i=>{if(i&&n===this.foldingRegionPromise){let n;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const e=i.setCollapsedAllOfType(kb.Imports.value,!0);e&&(n=PL.capture(this.editor),this._currentModelHasFoldedImports=e)}const o=this.editor.getSelections();e.update(i,function(e){return e&&0!==e.length?{startsInside(t,i){for(const n of e){const e=n.startLineNumber;if(e>=t&&e<=i)return!0}return!1}}:{startsInside:()=>!1}}(o)),n?.restore(this.editor);const s=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=s)}return e})}).then(void 0,e=>($ae(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const e=this.editor.getSelections();e&&this.hiddenRangeModel.adjustSelections(e)&&this.editor.setSelections(e)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(e=>{if(e){const t=this.editor.getSelections();if(t&&t.length>0){const i=[];for(const n of t){const t=n.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(t)&&i.push(...e.getAllRegionsAtLine(t,e=>e.isCollapsed&&t>e.startLineNumber))}i.length&&(e.toggleCollapseState(i),this.reveal(t[0].getPosition()))}}}).then(void 0,$ae)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range)return;if(!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const t=e.target.detail,n=e.target.element.offsetLeft;if(t.offsetX-n<4)return;i=!0;break}case 7:if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return;case 6:if(this.hiddenRangeModel.hasRanges()){const e=this.editor.getModel();if(e&&t.startColumn===e.getLineMaxColumn(t.startLineNumber))break}return;default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,n=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(n){if(4!==e.target.type)return}else{const e=this.editor.getModel();if(!e||o.startColumn!==e.getLineMaxColumn(i))return}const s=t.getRegionAtLine(i);if(s&&s.startLineNumber===i){const o=s.isCollapsed;if(n||o){let n=[];if(e.event.altKey){const e=e=>!e.containedBy(s)&&!s.containedBy(e),i=t.getRegionsInside(null,e);for(const t of i)t.isCollapsed&&n.push(t);0===n.length&&(n=i)}else{const i=e.event.middleButton||e.event.shiftKey;if(i)for(const e of t.getRegionsInside(s))e.isCollapsed===o&&n.push(e);!o&&i&&0!==n.length||n.push(s)}t.toggleCollapseState(n),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}},tZ=QG,QG.ID="editor.contrib.folding",nZ=QG,nZ=tZ=JG([eZ(1,es),eZ(2,il),eZ(3,Xv),eZ(4,vW),eZ(5,Tx)],nZ),oZ=class extends Ie{constructor(e){super(),this.editor=e,this._onDidChange=this._register(new je),this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(56)}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}},sZ=class extends rr{runEditorCommand(e,t,i){const n=e.get(il),o=nZ.get(t);if(!o)return;const s=o.getFoldingModel();return s?(this.reportTelemetry(e,t),s.then(e=>{if(e){this.invoke(o,e,t,i,n);const s=t.getSelection();s&&o.reveal(s.getStartPosition())}})):void 0}getSelectedLines(e){const t=e.getSelections();return t?t.map(e=>e.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(e=>e+1):this.getSelectedLines(t)}run(e,t){}},rZ=class extends sZ{constructor(){super({id:"editor.unfold",label:zae(982,"Unfold"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t",constraint:$ye,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=n&&n.levels||1,s=this.getLineNumbers(n,i);n&&"up"===n.direction?zye(t,!1,o,s):Hye(t,!1,o,s)}},aZ=class extends sZ{constructor(){super({id:"editor.unfoldRecursively",label:zae(983,"Unfold Recursively"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2142),weight:100}})}invoke(e,t,i,n){Hye(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}},lZ=class extends sZ{constructor(){super({id:"editor.fold",label:zae(984,"Fold"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t",constraint:$ye,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const o=this.getLineNumbers(n,i),s=n&&n.levels,r=n&&n.direction;"number"!=typeof s&&"string"!=typeof r?function(e,t,i){const n=[];for(const o of i){const i=e.getAllRegionsAtLine(o,e=>e.isCollapsed!==t);i.length>0&&n.push(i[0])}e.toggleCollapseState(n)}(t,!0,o):"up"===r?zye(t,!0,s||1,o):Hye(t,!0,s||1,o)}},dZ=class extends sZ{constructor(){super({id:"editor.toggleFold",label:zae(985,"Toggle Fold"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2090),weight:100}})}invoke(e,t,i){Vye(t,1,this.getSelectedLines(i))}},cZ=class extends sZ{constructor(){super({id:"editor.foldRecursively",label:zae(986,"Fold Recursively"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);Hye(t,!0,Number.MAX_VALUE,n)}},hZ=class extends sZ{constructor(){super({id:"editor.toggleFoldRecursively",label:zae(987,"Toggle Fold Recursively"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,3114),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);Vye(t,Number.MAX_VALUE,n)}},uZ=class extends sZ{constructor(){super({id:"editor.foldAllBlockComments",label:zae(988,"Fold All Block Comments"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2138),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())qye(t,kb.Comment.value,!0);else{const e=i.getModel();if(!e)return;const n=o.getLanguageConfiguration(e.getLanguageId()).comments;n&&n.blockCommentStartToken&&Kye(t,new RegExp("^\\s*"+Ble(n.blockCommentStartToken)),!0)}}},gZ=class extends sZ{constructor(){super({id:"editor.foldAllMarkerRegions",label:zae(989,"Fold All Regions"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2077),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())qye(t,kb.Region.value,!0);else{const e=i.getModel();if(!e)return;const n=o.getLanguageConfiguration(e.getLanguageId()).foldingRules;n&&n.markers&&n.markers.start&&Kye(t,new RegExp(n.markers.start),!0)}}},pZ=class extends sZ{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:zae(990,"Unfold All Regions"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2078),weight:100}})}invoke(e,t,i,n,o){if(t.regions.hasTypes())qye(t,kb.Region.value,!1);else{const e=i.getModel();if(!e)return;const n=o.getLanguageConfiguration(e.getLanguageId()).foldingRules;n&&n.markers&&n.markers.start&&Kye(t,new RegExp(n.markers.start),!1)}}},mZ=class extends sZ{constructor(){super({id:"editor.foldAllExcept",label:zae(991,"Fold All Except Selected"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2136),weight:100}})}invoke(e,t,i){Uye(t,!0,this.getSelectedLines(i))}},fZ=class extends sZ{constructor(){super({id:"editor.unfoldAllExcept",label:zae(992,"Unfold All Except Selected"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2134),weight:100}})}invoke(e,t,i){Uye(t,!1,this.getSelectedLines(i))}},_Z=class extends sZ{constructor(){super({id:"editor.foldAll",label:zae(993,"Fold All"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2069),weight:100}})}invoke(e,t,i){Hye(t,!0)}},bZ=class extends sZ{constructor(){super({id:"editor.unfoldAll",label:zae(994,"Unfold All"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2088),weight:100}})}invoke(e,t,i){Hye(t,!1)}},vZ=class e extends sZ{getFoldingLevel(){return parseInt(this.id.substr(e.ID_PREFIX.length))}invoke(e,t,i){!function(e,t,i,n){const o=e.getRegionsInside(null,(e,o)=>o===t&&e.isCollapsed!==i&&!n.some(t=>e.containsLine(t)));e.toggleCollapseState(o)}(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}},(XG=vZ).ID_PREFIX="editor.foldLevel",XG.ID=e=>XG.ID_PREFIX+e,wZ=class extends sZ{constructor(){super({id:"editor.gotoParentFold",label:zae(995,"Go to Parent Fold"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=null;const n=t.getRegionAtLine(e);if(null!==n&&(i=n.startLineNumber,e===i)){const e=n.parentIndex;i=-1!==e?t.regions.getStartLineNumber(e):null}return i}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}},CZ=class extends sZ{constructor(){super({id:"editor.gotoPreviousFold",label:zae(996,"Go to Previous Folding Range"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){if(e!==i.startLineNumber)return i.startLineNumber;{const e=i.parentIndex;let n=0;for(-1!==e&&(n=t.regions.getStartLineNumber(i.parentIndex));null!==i;){if(!(i.regionIndex>0))return null;if(i=t.regions.toRegion(i.regionIndex-1),i.startLineNumber<=n)return null;if(i.parentIndex===e)return i.startLineNumber}}}else if(t.regions.length>0)for(i=t.regions.toRegion(t.regions.length-1);null!==i;){if(i.startLineNumber<e)return i.startLineNumber;i=i.regionIndex>0?t.regions.toRegion(i.regionIndex-1):null}return null}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}},yZ=class extends sZ{constructor(){super({id:"editor.gotoNextFold",label:zae(997,"Go to Next Folding Range"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){const e=i.parentIndex;let n=0;if(-1!==e)n=t.regions.getEndLineNumber(i.parentIndex);else{if(0===t.regions.length)return null;n=t.regions.getEndLineNumber(t.regions.length-1)}for(;null!==i;){if(!(i.regionIndex<t.regions.length))return null;if(i=t.regions.toRegion(i.regionIndex+1),i.startLineNumber>=n)return null;if(i.parentIndex===e)return i.startLineNumber}}else if(t.regions.length>0)for(i=t.regions.toRegion(0);null!==i;){if(i.startLineNumber>e)return i.startLineNumber;i=i.regionIndex<t.regions.length?t.regions.toRegion(i.regionIndex+1):null}return null}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}},SZ=class extends sZ{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:zae(998,"Create Folding Range from Selection"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2135),weight:100}})}invoke(e,t,i){const n=[],o=i.getSelections();if(o){for(const e of o){let t=e.endLineNumber;1===e.endColumn&&--t,t>e.startLineNumber&&(n.push({startLineNumber:e.startLineNumber,endLineNumber:t,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:e.startLineNumber,startColumn:1,endLineNumber:e.startLineNumber,endColumn:1}))}if(n.length>0){n.sort((e,t)=>e.startLineNumber-t.startLineNumber);const e=MG.sanitizeAndMerge(t.regions,n,i.getModel()?.getLineCount());t.updatePost(MG.fromFoldRanges(e))}}}},xZ=class extends sZ{constructor(){super({id:"editor.removeManualFoldingRanges",label:zae(999,"Remove Manual Folding Ranges"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2137),weight:100}})}invoke(e,t,i){const n=i.getSelections();if(n){const i=[];for(const e of n){const{startLineNumber:t,endLineNumber:n}=e;i.push(n>=t?{startLineNumber:t,endLineNumber:n}:{endLineNumber:n,startLineNumber:t})}t.removeManualRanges(i),e.triggerFoldingModelChanged()}}},kZ=class extends sZ{constructor(){super({id:"editor.toggleImportFold",label:zae(1e3,"Toggle Import Fold"),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,weight:100}})}async invoke(e,t){const i=[],n=t.regions;for(let o=n.length-1;o>=0;o--)n.getType(o)===kb.Imports.value&&i.push(n.toRegion(o));t.toggleCollapseState(i),e.triggerFoldingModelChanged()}},Iue(nZ.ID,nZ,0),kue(rZ),kue(aZ),kue(lZ),kue(cZ),kue(hZ),kue(_Z),kue(bZ),kue(uZ),kue(gZ),kue(pZ),kue(mZ),kue(fZ),kue(dZ),kue(wZ),kue(CZ),kue(yZ),kue(SZ),kue(xZ),kue(kZ);for(let e=1;e<=7;e++)Due(new vZ({id:vZ.ID(e),label:zae(1001,"Fold Level {0}",e),precondition:iZ,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2048|21+e),weight:100}}));_o.registerCommand("_executeFoldingRangeProvider",async function(e,...t){const[i]=t;if(!(i instanceof _i))throw Qae();const n=e.get(Tx),o=e.get(io).getModel(i);if(!o)throw Qae();const s=e.get(ka);if(!s.getValue("editor.folding",{resource:i}))return[];const r=e.get(il),a=s.getValue("editor.foldingStrategy",{resource:i}),l={get limit(){return s.getValue("editor.foldingMaximumRegions",{resource:i})},update:(e,t)=>{}},d=new AG(o,r,l);let c=d;if("indentation"!==a){const e=nZ.getFoldingRangeProviders(n,o);e.length&&(c=new ZG(o,e,()=>{},l,d))}const h=await c.compute(it.None),u=[];try{if(h)for(let e=0;e<h.length;e++){const t=h.getType(e);u.push({start:h.getStartLineNumber(e),end:h.getEndLineNumber(e),kind:t?kb.fromValue(t):void 0})}return u}finally{c.dispose()}}),LZ=class extends rr{constructor(){super({id:"editor.action.fontZoomIn",label:zae(1011,"Increase Editor Font Size"),precondition:void 0})}run(e,t){pd.setZoomLevel(pd.getZoomLevel()+1)}},DZ=class extends rr{constructor(){super({id:"editor.action.fontZoomOut",label:zae(1012,"Decrease Editor Font Size"),precondition:void 0})}run(e,t){pd.setZoomLevel(pd.getZoomLevel()-1)}},IZ=class extends rr{constructor(){super({id:"editor.action.fontZoomReset",label:zae(1013,"Reset Editor Font Size"),precondition:void 0})}run(e,t){pd.setZoomLevel(0)}},kue(LZ),kue(DZ),kue(IZ),NZ=class e{static _handleEolEdits(e,t){let i;const n=[];for(const o of t)"number"==typeof o.eol&&(i=o.eol),o.range&&"string"==typeof o.text&&n.push(o);return"number"==typeof i&&e.hasModel()&&e.getModel().pushEOL(i),n}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),n=i.validateRange(t.range);return i.getFullModelRange().equalsRange(n)}static execute(t,i,n){n&&t.pushUndoStop();const o=PL.capture(t),s=e._handleEolEdits(t,i);1===s.length&&e._isFullModelReplaceEdit(t,s[0])?t.executeEdits("formatEditsCommand",s.map(e=>VH.replace(mr.lift(e.range),e.text))):t.executeEdits("formatEditsCommand",s.map(e=>VH.replaceMove(mr.lift(e.range),e.text))),n&&t.pushUndoStop(),o.restoreRelativeVerticalPositionOfCursor(t)}},EZ=class{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}},MZ=class{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(EZ.toKey(e))}has(e){return this._set.has(EZ.toKey(e))}},(TZ=class e{static setFormatterSelector(t){return{dispose:e._selectors.unshift(t)}}static async select(t,i,n,o){if(0===t.length)return;const s=ke.first(e._selectors);return s?await s(t,i,n,o):void 0}})._selectors=new Ae,_o.registerCommand("_executeFormatRangeProvider",async function(e,...t){const[i,n,o]=t;ple(_i.isUri(i)),ple(mr.isIRange(n));const s=e.get(no),r=e.get(DM),a=e.get(Tx),l=await s.createModelReference(i);try{return async function(e,t,i,n,o,s){const r=t.documentRangeFormattingEditProvider.ordered(i);for(const a of r){const t=await Promise.resolve(a.provideDocumentRangeFormattingEdits(i,n,o,s)).catch(Gae);if(sce(t))return await e.computeMoreMinimalEdits(i.uri,t)}}(r,a,l.object.textEditorModel,mr.lift(n),o,it.None)}finally{l.dispose()}}),_o.registerCommand("_executeFormatDocumentProvider",async function(e,...t){const[i,n]=t;ple(_i.isUri(i));const o=e.get(no),s=e.get(DM),r=e.get(Tx),a=await o.createModelReference(i);try{return async function(e,t,i,n,o){const s=Gye(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i);for(const r of s){const t=await Promise.resolve(r.provideDocumentFormattingEdits(i,n,o)).catch(Gae);if(sce(t))return await e.computeMoreMinimalEdits(i.uri,t)}}(s,r,a.object.textEditorModel,n,it.None)}finally{a.dispose()}}),_o.registerCommand("_executeFormatOnTypeProvider",async function(e,...t){const[i,n,o,s]=t;ple(_i.isUri(i)),ple(to.isIPosition(n)),ple("string"==typeof o);const r=e.get(no),a=e.get(DM),l=e.get(Tx),d=await r.createModelReference(i);try{return Jye(a,l,d.object.textEditorModel,to.lift(n),o,s,it.None)}finally{d.dispose()}}),AZ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},PZ=function(e,t){return function(i,n){t(i,n,e)}},RZ=class{constructor(e,t,i,n){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=n,this._disposables=new De,this._sessionDisposables=new De,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(e=>{e.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(65))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new Ur;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(e=>{const t=e.charCodeAt(e.length-1);i.has(t)&&this._trigger(String.fromCharCode(t))}))}_trigger(e){if(!this._editor.hasModel())return;if(this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new ot,o=this._editor.onDidChangeModelContent(e=>{if(e.isFlush)return n.cancel(),void o.dispose();for(let t=0,s=e.changes.length;t<s;t++)if(e.changes[t].range.endLineNumber<=i.lineNumber)return n.cancel(),void o.dispose()});Jye(this._workerService,this._languageFeaturesService,t,i,e,t.getFormattingOptions(),n.token).then(e=>{n.token.isCancellationRequested||sce(e)&&(this._accessibilitySignalService.playSignal(TL.format,{userGesture:!1}),NZ.execute(this._editor,e,!0))}).finally(()=>{o.dispose()})}},RZ.ID="editor.contrib.autoFormat",FZ=RZ,FZ=AZ([PZ(1,Tx),PZ(2,DM),PZ(3,NL)],FZ),OZ=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new De,this._callOnModel=new De,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(64)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(Zye,this.editor,e,2,OL.None,it.None,!1).catch($ae))}},OZ.ID="editor.contrib.formatOnPaste",WZ=OZ,WZ=AZ([PZ(1,Tx),PZ(2,Jn)],WZ),BZ=class extends rr{constructor(){super({id:"editor.action.formatDocument",label:zae(1014,"Format Document"),precondition:Po.and(jl.notInCompositeEditor,jl.writable,jl.hasDocumentFormattingProvider),kbOpts:{kbExpr:jl.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(Jn);await e.get(AL).showWhile(i.invokeFunction(Qye,t,1,OL.None,it.None,!0),250)}}},VZ=class extends rr{constructor(){super({id:"editor.action.formatSelection",label:zae(1015,"Format Selection"),precondition:Po.and(jl.writable,jl.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2084),weight:100},contextMenuOpts:{when:jl.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(Jn),n=t.getModel(),o=t.getSelections().map(e=>e.isEmpty()?new mr(e.startLineNumber,1,e.startLineNumber,n.getLineMaxColumn(e.startLineNumber)):e);await e.get(AL).showWhile(i.invokeFunction(Zye,t,o,1,OL.None,it.None,!0),250)}},Iue(FZ.ID,FZ,2),Iue(WZ.ID,WZ,2),kue(BZ),kue(VZ),_o.registerCommand("editor.action.format",async e=>{const t=e.get(eo).getFocusedCodeEditor();if(!t||!t.hasModel())return;const i=e.get(fo);t.getSelection().isEmpty()?await i.executeCommand("editor.action.formatDocument"):await i.executeCommand("editor.action.formatSelection")}),HZ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},zZ=function(e,t){return function(i,n){t(i,n,e)}},UZ=class{remove(){this.parent?.children.delete(this.id)}static findId(e,t){let i;"string"==typeof e?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,void 0!==t.children.get(i)&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let o=0;void 0!==t.children.get(n);o++)n=`${i}_${o}`;return n}static empty(e){return 0===e.children.size}},KZ=class extends UZ{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}},qZ=class extends UZ{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}},jZ=class e extends UZ{static create(t,i,n){const o=new ot(n),s=new e(i.uri),r=t.ordered(i),a=r.map((t,n)=>{const r=UZ.findId(`provider_${n}`,s),a=new qZ(r,s,t.displayName??"Unknown Outline Provider",n);return Promise.resolve(t.provideDocumentSymbols(i,o.token)).then(t=>{for(const i of t||[])e._makeOutlineElement(i,a);return a},e=>(Gae(e),a)).then(e=>{UZ.empty(e)?e.remove():s._groups.set(r,e)})}),l=t.onDidChange(()=>{Zde(t.ordered(i),r)||o.cancel()});return Promise.all(a).then(()=>o.token.isCancellationRequested&&!n.isCancellationRequested?e.create(t,i,n):s._compact()).finally(()=>{o.dispose(),l.dispose(),o.dispose()})}static _makeOutlineElement(t,i){const n=new KZ(UZ.findId(t,i),i,t);if(t.children)for(const o of t.children)e._makeOutlineElement(o,n);i.children.set(n.id,n)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)0===i.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{const e=ke.first(this._groups.values());for(const[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof KZ?e.push(t.symbol):e.push(...ke.map(t.children.values(),e=>e.symbol));return e.sort((e,t)=>mr.compareRangesUsingStarts(e.range,t.range))}asListOfDocumentSymbols(){const t=this.getTopLevelSymbols(),i=[];return e._flattenDocumentSymbols(i,t,""),i.sort((e,t)=>to.compare(mr.getStartPosition(e.range),mr.getStartPosition(t.range))||to.compare(mr.getEndPosition(t.range),mr.getEndPosition(e.range)))}static _flattenDocumentSymbols(t,i,n){for(const o of i)t.push({kind:o.kind,tags:o.tags,name:o.name,detail:o.detail,containerName:o.containerName||n,range:o.range,selectionRange:o.selectionRange,children:void 0}),o.children&&e._flattenDocumentSymbols(t,o.children,o.name)}},$Z=eue("IOutlineModelService"),GZ=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new De,this._cache=new Ls(15,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(e=>{this._cache.delete(e.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Zde(o.provider,n)){const t=new ot;o={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:t,promise:jZ.create(i,e,t.token),model:void 0},this._cache.set(e.id,o);const s=Date.now();o.promise.then(t=>{o.model=t,this._debounceInformation.update(e,Date.now()-s)}).catch(t=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested(()=>{0===--o.promiseCnt&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{s.dispose()}}},GZ=HZ([zZ(0,Tx),zZ(1,vW),zZ(2,io)],GZ),dge($Z,GZ,1),_o.registerCommand("_executeDocumentSymbolProvider",async function(e,...t){const[i]=t;ple(_i.isUri(i));const n=e.get($Z),o=await e.get(no).createModelReference(i);try{return(await n.getOrCreate(o.object.textEditorModel,it.None)).getTopLevelSymbols()}finally{o.dispose()}}),ZZ=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);-1!==t&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}},YZ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},QZ=function(e,t){return function(i,n){t(i,n,e)}},XZ=class{constructor(e){this.instantiationService=e}init(...e){}},JZ=class extends XZ{constructor(e,t){super(t),this.init(e)}},JZ=YZ([QZ(1,Jn)],JZ),eY=class{validateOrThrow(e){const t=this.validate(e);if(t.error)throw new Error(t.error.message);return t.content}},iY=new(tY=class extends eY{constructor(e){super(),this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}getJSONSchema(){return{type:this.type}}})("string"),new tY("number"),nY=new tY("boolean"),new tY("object"),oY=class extends eY{validate(e){return void 0!==e?{content:void 0,error:{message:"Expected undefined, but got "+typeof e}}:{content:void 0,error:void 0}}getJSONSchema(){return{}}},sY=class{constructor(e){this.validator=e}},rY=class extends eY{constructor(e){super(),this.properties=e}validate(e){if("object"!=typeof e||null===e)return{content:void 0,error:{message:"Expected object"}};const t={};for(const i in this.properties){const n=this.properties[i],o=e[i],s=n instanceof sY,r=s?n.validator:n;if(s&&void 0===o)continue;const{content:a,error:l}=r.validate(o);if(l)return{content:void 0,error:{message:`Error in property '${i}': ${l.message}`}};t[i]=a}return{content:t,error:void 0}}getJSONSchema(){const e=[],t={};for(const[i,n]of Object.entries(this.properties)){const o=n instanceof sY;t[i]=(o?n.validator:n).getJSONSchema(),o||e.push(i)}return{type:"object",properties:t,...e.length>0?{required:e}:{}}}},aY=class extends eY{constructor(e){super(),this.validators=e}validate(e){let t;for(const i of this.validators){const{content:n,error:o}=i.validate(e);if(!o)return{content:n,error:void 0};t=o}return{content:void 0,error:t}}getJSONSchema(){return{oneOf:uce(this.validators,e=>{if(!(e instanceof oY))return e.getJSONSchema()})}}},lY=class extends eY{constructor(e,t){super(),this._ref=e,this._validator=t}validate(e){return this._validator.validate(e)}getJSONSchema(){return{$ref:this._ref}}},cY={Visible:xV,HasFocusedSuggestion:new Jo("suggestWidgetHasFocusedSuggestion",!1,Vae(1455,"Whether any suggestion is focused")),DetailsVisible:new Jo("suggestWidgetDetailsVisible",!1,Vae(1456,"Whether suggestion details are visible")),MultipleSuggestions:new Jo("suggestWidgetMultipleSuggestions",!1,Vae(1457,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Jo("suggestionMakesTextEdit",!0,Vae(1458,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Jo("acceptSuggestionOnEnter",!0,Vae(1459,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Jo("suggestionHasInsertAndReplaceRange",!1,Vae(1460,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Jo("suggestionInsertMode",void 0,{type:"string",description:Vae(1461,"Whether the default behaviour is to insert or replace")}),CanResolve:new Jo("suggestionCanResolve",!1,Vae(1462,"Whether the current suggestion supports to resolve further details"))},hY=new ds("suggestWidgetStatusBar"),uY=class{constructor(e,t,i,n){this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=rD.Default,this.distance=0,this.textLabel="string"==typeof t.label?t.label:t.label?.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,mr.isIRange(t.range)?(this.editStart=new to(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new to(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new to(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||mr.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new to(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new to(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new to(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||mr.spansMultipleLines(t.range.insert)||mr.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),"function"!=typeof n.resolveCompletionItem&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return void 0!==this._resolveDuration}get resolveDuration(){return void 0!==this._resolveDuration?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new Fe(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(e=>{Object.assign(this.completion,e),this._resolveDuration=i.elapsed()},e=>{Yae(e)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}},(dY=gY=class{constructor(e=2,t=new Set,i=new Set,n=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=o}}).default=new dY,pY=class{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}},(mY=new Map).set(0,oSe),mY.set(2,sSe),mY.set(1,nSe),_o.registerCommand("_executeCompletionItemProvider",async(e,...t)=>{const[i,n,o,s]=t;ple(_i.isUri(i)),ple(to.isIPosition(n)),ple("string"==typeof o||!o),ple("number"==typeof s||!s);const{completionProvider:r}=e.get(Tx),a=await e.get(no).createModelReference(i);try{const e={incomplete:!1,suggestions:[]},t=[],i=a.object.textEditorModel.validatePosition(n),l=await iSe(r,a.object.textEditorModel,i,void 0,{triggerCharacter:o??void 0,triggerKind:o?1:0});for(const n of l.items)t.length<(s??0)&&t.push(n.resolve(it.None)),e.incomplete=e.incomplete||n.container.incomplete,e.suggestions.push(n.completion);try{return await Promise.all(t),e}finally{setTimeout(()=>l.disposable.dispose(),100)}}finally{a.dispose()}}),fY=class{static isAllOff(e){return"off"===e.other&&"off"===e.comments&&"off"===e.strings}static isAllOn(e){return"on"===e.other&&"on"===e.comments&&"on"===e.strings}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}},(_Y=bY=class{}).inlineSuggestionVisible=new Jo("inlineSuggestionVisible",!1,Vae(1192,"Whether an inline suggestion is visible")),_Y.inlineSuggestionHasIndentation=new Jo("inlineSuggestionHasIndentation",!1,Vae(1193,"Whether the inline suggestion starts with whitespace")),_Y.inlineSuggestionHasIndentationLessThanTabSize=new Jo("inlineSuggestionHasIndentationLessThanTabSize",!0,Vae(1194,"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")),_Y.suppressSuggestions=new Jo("inlineSuggestionSuppressSuggestions",void 0,Vae(1195,"Whether suggestions should be suppressed for the current suggestion")),_Y.cursorBeforeGhostText=new Jo("cursorBeforeGhostText",!1,Vae(1196,"Whether the cursor is at ghost text")),_Y.cursorInIndentation=new Jo("cursorInIndentation",!1,Vae(1197,"Whether the cursor is in indentation")),_Y.hasSelection=new Jo("editor.hasSelection",!1,Vae(1198,"Whether the editor has a selection")),_Y.cursorAtInlineEdit=new Jo("cursorAtInlineEdit",!1,Vae(1199,"Whether the cursor is at an inline edit")),_Y.inlineEditVisible=new Jo("inlineEditIsVisible",!1,Vae(1200,"Whether an inline edit is visible")),_Y.tabShouldJumpToInlineEdit=new Jo("tabShouldJumpToInlineEdit",!1,Vae(1201,"Whether tab should jump to an inline edit.")),_Y.tabShouldAcceptInlineEdit=new Jo("tabShouldAcceptInlineEdit",!1,Vae(1202,"Whether tab should accept the inline edit.")),_Y.inInlineEditsPreviewEditor=new Jo("inInlineEditsPreviewEditor",!0,Vae(1203,"Whether the current code editor is showing an inline edits preview")),vY=class{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=function(e,t,i){t.sort((e,t)=>e.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber);for(let a=t.length-2;a>=0;a--)t[a].lineNumber===t[a+1].lineNumber&&t.splice(a,1);const n=[];let o=0,s=0;const r=t.length;for(let a=1,l=e.getLineCount();a<=l;a++){const l=e.getLineContent(a),d=l.length+1;let c=0;if(s<r&&t[s].lineNumber===a&&(c=t[s].column,s++,c===d))continue;if(0===l.length)continue;const h=Gle(l);let u=0;if(-1===h)u=1;else{if(h===l.length-1)continue;u=h+2}if(!i){if(!e.tokenization.hasAccurateTokensForLine(a))continue;const t=e.tokenization.getLineTokens(a),i=t.getStandardTokenType(t.findTokenIndexAtOffset(u));if(2===i||3===i)continue}u=Math.max(c,u),n[o++]=VH.delete(new mr(a,u,a,d))}return n}(e,this._cursors,this._trimInRegexesAndStrings);for(let n=0,o=i.length;n<o;n++){const e=i[n];t.addEditOperation(e.range,e.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}},wY=class{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&1===i.endColumn&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=[];for(let s=i.startLineNumber;s<=i.endLineNumber;s++)n.push(e.getLineContent(s));const o=n.join("\n");""===o&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new mr(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":"\n"):this._isCopyingDown?t.addEditOperation(new mr(i.startLineNumber,1,i.startLineNumber,1),o+"\n"):t.addEditOperation(new mr(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),"\n"+o),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(0!==this._startLineNumberDelta||0!==this._endLineNumberDelta){let e=i.startLineNumber,t=i.startColumn,n=i.endLineNumber,o=i.endColumn;0!==this._startLineNumberDelta&&(e+=this._startLineNumberDelta,t=1),0!==this._endLineNumberDelta&&(n+=this._endLineNumberDelta,o=1),i=fr.createWithDirection(e,t,n,o,this._selectionDirection)}return i}},CY=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},yY=function(e,t){return function(i,n){t(i,n,e)}},SY=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),n=(t,i)=>e.getLanguageIdAtPosition(t,i),o=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===o)return void(this._selectionId=t.trackSelection(this._selection));if(!this._isMovingDown&&1===this._selection.startLineNumber)return void(this._selectionId=t.trackSelection(this._selection));this._moveEndPositionDown=!1;let s=this._selection;s.startLineNumber<s.endLineNumber&&1===s.endColumn&&(this._moveEndPositionDown=!0,s=s.setEndPosition(s.endLineNumber-1,e.getLineMaxColumn(s.endLineNumber-1)));const{tabSize:r,indentSize:a,insertSpaces:l}=e.getOptions(),d=this.buildIndentConverter(r,a,l);if(s.startLineNumber===s.endLineNumber&&1===e.getLineMaxColumn(s.startLineNumber)){const i=s.startLineNumber,n=this._isMovingDown?i+1:i-1;1===e.getLineMaxColumn(n)?t.addEditOperation(new mr(1,1,1,1),null):(t.addEditOperation(new mr(i,1,i,1),e.getLineContent(n)),t.addEditOperation(new mr(n,1,n,e.getLineMaxColumn(n)),null)),s=new fr(n,1,n,1)}else{let o,a;if(this._isMovingDown){o=s.endLineNumber+1,a=e.getLineContent(o),t.addEditOperation(new mr(o-1,e.getLineMaxColumn(o-1),o,e.getLineMaxColumn(o)),null);let c=a;if(this.shouldAutoIndent(e,s)){const h=this.matchEnterRule(e,d,r,o,s.startLineNumber-1);if(null!==h)c=aSe(h+rSe($le(e.getLineContent(o)),r),r,l)+this.trimStart(a);else{const t={tokenization:{getLineTokens:t=>t===s.startLineNumber?e.tokenization.getLineTokens(o):e.tokenization.getLineTokens(t),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:t=>t===s.startLineNumber?e.getLineContent(o):e.getLineContent(t)},h=yge(this._autoIndent,t,e.getLanguageIdAtPosition(o,1),s.startLineNumber,d,this._languageConfigurationService);if(null!==h){const t=$le(e.getLineContent(o)),i=rSe(h,r);i!==rSe(t,r)&&(c=aSe(i,r,l)+this.trimStart(a))}}t.addEditOperation(new mr(s.startLineNumber,1,s.startLineNumber,1),c+"\n");const u=this.matchEnterRuleMovingDown(e,d,r,s.startLineNumber,o,c);if(null!==u)0!==u&&this.getIndentEditsOfMovingBlock(e,t,s,r,l,u);else{const a={tokenization:{getLineTokens:t=>t===s.startLineNumber?e.tokenization.getLineTokens(o):t>=s.startLineNumber+1&&t<=s.endLineNumber+1?e.tokenization.getLineTokens(t-1):e.tokenization.getLineTokens(t),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:t=>t===s.startLineNumber?c:t>=s.startLineNumber+1&&t<=s.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t)},h=yge(this._autoIndent,a,e.getLanguageIdAtPosition(o,1),s.startLineNumber+1,d,this._languageConfigurationService);if(null!==h){const i=$le(e.getLineContent(s.startLineNumber)),n=rSe(h,r),o=rSe(i,r);if(n!==o){const i=n-o;this.getIndentEditsOfMovingBlock(e,t,s,r,l,i)}}}}else t.addEditOperation(new mr(s.startLineNumber,1,s.startLineNumber,1),c+"\n")}else if(o=s.startLineNumber-1,a=e.getLineContent(o),t.addEditOperation(new mr(o,1,o+1,1),null),t.addEditOperation(new mr(s.endLineNumber,e.getLineMaxColumn(s.endLineNumber),s.endLineNumber,e.getLineMaxColumn(s.endLineNumber)),"\n"+a),this.shouldAutoIndent(e,s)){const a={tokenization:{getLineTokens:t=>t===o?e.tokenization.getLineTokens(s.startLineNumber):e.tokenization.getLineTokens(t),getLanguageId:i,getLanguageIdAtPosition:n},getLineContent:t=>t===o?e.getLineContent(s.startLineNumber):e.getLineContent(t)},c=this.matchEnterRule(e,d,r,s.startLineNumber,s.startLineNumber-2);if(null!==c)0!==c&&this.getIndentEditsOfMovingBlock(e,t,s,r,l,c);else{const i=yge(this._autoIndent,a,e.getLanguageIdAtPosition(s.startLineNumber,1),o,d,this._languageConfigurationService);if(null!==i){const n=$le(e.getLineContent(s.startLineNumber)),o=rSe(i,r),a=rSe(n,r);if(o!==a){const i=o-a;this.getIndentEditsOfMovingBlock(e,t,s,r,l,i)}}}}}this._selectionId=t.trackSelection(s)}buildIndentConverter(e,t,i){return{shiftIndent:n=>kl.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>kl.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,o){if(o){let s=o.indentation;o.indentAction===ra.None||o.indentAction===ra.Indent?s=o.indentation+o.appendText:o.indentAction===ra.IndentOutdent?s=o.indentation:o.indentAction===ra.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const r=e.getLineContent(n);if(this.trimStart(r).indexOf(this.trimStart(s))>=0){const o=$le(e.getLineContent(n));let r=$le(s);const a=Sge(e,n,this._languageConfigurationService);return null!==a&&2&a&&(r=t.unshiftIndent(r)),rSe(r,i)-rSe(o,i)}}return null}matchEnterRuleMovingDown(e,t,i,n,o,s){if(Gle(s)>=0){const s=e.getLineMaxColumn(o),r=vge(this._autoIndent,e,new mr(o,s,o,s),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}{let o=n-1;for(;o>=1&&!(Gle(e.getLineContent(o))>=0);)o--;if(o<1||n>e.getLineCount())return null;const s=e.getLineMaxColumn(o),r=vge(this._autoIndent,e,new mr(o,s,o,s),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}}matchEnterRule(e,t,i,n,o,s){let r=o;for(;r>=1;){let t;if(t=r===o&&void 0!==s?s:e.getLineContent(r),Gle(t)>=0)break;r--}if(r<1||n>e.getLineCount())return null;const a=e.getLineMaxColumn(r),l=vge(this._autoIndent,e,new mr(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4)return!1;if(!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1);return i===e.getLanguageIdAtPosition(t.endLineNumber,1)&&null!==this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport}getIndentEditsOfMovingBlock(e,t,i,n,o,s){for(let r=i.startLineNumber;r<=i.endLineNumber;r++){const a=$le(e.getLineContent(r)),l=aSe(rSe(a,n)+s,n,o);l!==a&&(t.addEditOperation(new mr(r,1,r,a.length+1),l),r===i.endLineNumber&&i.endColumn<=a.length+1&&""===l&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}},SY=CY([yY(3,il)],SY),xY=class{constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=function(e,t,i){const n=lSe(e,t,i);return n?VH.replace(new mr(n.startLineNumber,1,n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),n.after.join("\n")):null}(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(null===e)return!1;const n=lSe(e,t,i);if(!n)return!1;for(let o=0,s=n.before.length;o<s;o++)if(n.before[o]!==n.after[o])return!0;return!1}},xY._COLLATOR=Hr.Collator(),NY=class extends rr{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((e,t)=>({selection:e,index:t,ignore:!1}));i.sort((e,t)=>mr.compareRangesUsingStarts(e.selection,t.selection));let n=i[0];for(let s=1;s<i.length;s++){const e=i[s];n.selection.endLineNumber===e.selection.startLineNumber&&(n.index<e.index?e.ignore=!0:(n.ignore=!0,n=e))}const o=[];for(const s of i)o.push(new wY(s.selection,this.down,s.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}},EY=class extends NY{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:zae(1249,"Copy Line Up"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"2_line",title:Vae(1244,"&&Copy Line Up"),order:1},canTriggerInlineEdits:!0})}},MY=class extends NY{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:zae(1250,"Copy Line Down"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"2_line",title:Vae(1245,"Co&&py Line Down"),order:2},canTriggerInlineEdits:!0})}},TY=class extends rr{constructor(){super({id:"editor.action.duplicateSelection",label:zae(1251,"Duplicate Selection"),precondition:jl.writable,menuOpts:{menuId:ds.MenubarSelectionMenu,group:"2_line",title:Vae(1246,"&&Duplicate Selection"),order:5},canTriggerInlineEdits:!0})}run(e,t,i){if(!t.hasModel())return;const n=[],o=t.getSelections(),s=t.getModel();for(const r of o)if(r.isEmpty())n.push(new wY(r,!0));else{const e=new fr(r.endLineNumber,r.endColumn,r.endLineNumber,r.endColumn);n.push(new Tr(e,s.getValueInRange(r)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}},RY=class extends rr{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(il),n=[],o=t.getSelections()||[],s=t.getOption(16);for(const r of o)n.push(new SY(r,this.down,s,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}},OY=class extends RY{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:zae(1252,"Move Line Up"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"2_line",title:Vae(1247,"Mo&&ve Line Up"),order:3},canTriggerInlineEdits:!0})}},AY=class extends RY{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:zae(1253,"Move Line Down"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"2_line",title:Vae(1248,"Move &&Line Down"),order:4},canTriggerInlineEdits:!0})}},PY=class extends rr{constructor(e,t){super(t),this.descending=e}run(e,t){if(!t.hasModel())return;const i=t.getModel();let n=t.getSelections();1===n.length&&n[0].isEmpty()&&(n=[new fr(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);for(const s of n)if(!xY.canRun(t.getModel(),s,this.descending))return;const o=[];for(let s=0,r=n.length;s<r;s++)o[s]=new xY(n[s],this.descending);t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}},FY=class extends PY{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:zae(1254,"Sort Lines Ascending"),precondition:jl.writable,canTriggerInlineEdits:!0})}},WY=class extends PY{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:zae(1255,"Sort Lines Descending"),precondition:jl.writable,canTriggerInlineEdits:!0})}},BY=class extends rr{constructor(){super({id:"editor.action.removeDuplicateLines",label:zae(1256,"Delete Duplicate Lines"),precondition:jl.writable,canTriggerInlineEdits:!0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(1===i.getLineCount()&&1===i.getLineMaxColumn(1))return;const n=[],o=[];let s=0,r=!0,a=t.getSelections();1===a.length&&a[0].isEmpty()&&(a=[new fr(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))],r=!1);for(const l of a){const e=new Set,t=[];for(let n=l.startLineNumber;n<=l.endLineNumber;n++){const o=i.getLineContent(n);e.has(o)||(t.push(o),e.add(o))}const r=new fr(l.startLineNumber,1,l.endLineNumber,i.getLineMaxColumn(l.endLineNumber)),a=l.startLineNumber-s,d=new fr(a,1,a+t.length-1,t[t.length-1].length);n.push(VH.replace(r,t.join("\n"))),o.push(d),s+=l.endLineNumber-l.startLineNumber+1-t.length}t.pushUndoStop(),t.executeEdits(this.id,n,r?o:void 0),t.pushUndoStop()}},VY=class extends rr{constructor(){super({id:"editor.action.reverseLines",label:zae(1257,"Reverse lines"),precondition:jl.writable,canTriggerInlineEdits:!0})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections();let o=n;1===o.length&&o[0].isEmpty()&&(o=[new fr(1,1,i.getLineCount(),i.getLineMaxColumn(i.getLineCount()))]);const s=[],r=[];for(let a=0;a<o.length;a++){const e=o[a],t=n[a];let l=e.endLineNumber;e.startLineNumber<e.endLineNumber&&1===e.endColumn&&l--;let d=new mr(e.startLineNumber,1,l,i.getLineMaxColumn(l));l===i.getLineCount()&&""===i.getLineContent(d.endLineNumber)&&(d=d.setEndPosition(d.endLineNumber-1,i.getLineMaxColumn(d.endLineNumber-1)));const c=[];for(let n=d.endLineNumber;n>=d.startLineNumber;n--)c.push(i.getLineContent(n));const h=VH.replace(d,c.join("\n"));s.push(h);const u=function(e){return e<=d.endLineNumber?d.endLineNumber-e+d.startLineNumber:e},g=function(e){if(e.isEmpty())return new fr(u(e.positionLineNumber),e.positionColumn,u(e.positionLineNumber),e.positionColumn);{const t=u(e.selectionStartLineNumber),i=u(e.positionLineNumber),n=e.selectionStartColumn,o=e.positionColumn;return new fr(t,n,i,o)}};r.push(g(t))}t.pushUndoStop(),t.executeEdits(this.id,s,r),t.pushUndoStop()}},HY=class e extends rr{constructor(){super({id:e.ID,label:zae(1258,"Trim Trailing Whitespace"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2102),weight:100}})}run(e,t,i){let n=[];"auto-save"===i.reason&&(n=(t.getSelections()||[]).map(e=>new to(e.positionLineNumber,e.positionColumn)));const o=t.getSelection();if(null===o)return;const s=e.get(ka),r=t.getModel(),a=s.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:r?.getLanguageId(),resource:r?.uri}),l=new vY(o,n,a);t.pushUndoStop(),t.executeCommands(this.id,[l]),t.pushUndoStop()}},HY.ID="editor.action.trimTrailingWhitespace",zY=class extends rr{constructor(){super({id:"editor.action.deleteLines",label:zae(1259,"Delete Line"),precondition:jl.writable,kbOpts:{kbExpr:jl.textInputFocus,primary:3113,weight:100},canTriggerInlineEdits:!0})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(1===n.getLineCount()&&1===n.getLineMaxColumn(1))return;let o=0;const s=[],r=[];for(let a=0,l=i.length;a<l;a++){const e=i[a];let t=e.startLineNumber,l=e.endLineNumber,d=1,c=n.getLineMaxColumn(l);l<n.getLineCount()?(l+=1,c=1):t>1&&(t-=1,d=n.getLineMaxColumn(t)),s.push(VH.replace(new fr(t,d,l,c),"")),r.push(new fr(t-o,e.positionColumn,t-o,e.positionColumn)),o+=e.endLineNumber-e.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,r),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(e=>{let t=e.endLineNumber;return e.startLineNumber<e.endLineNumber&&1===e.endColumn&&(t-=1),{startLineNumber:e.startLineNumber,selectionStartColumn:e.selectionStartColumn,endLineNumber:t,positionColumn:e.positionColumn}});t.sort((e,t)=>e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber);const i=[];let n=t[0];for(let o=1;o<t.length;o++)n.endLineNumber+1>=t[o].startLineNumber?n.endLineNumber=t[o].endLineNumber:(i.push(n),n=t[o]);return i.push(n),i}},UY=class extends rr{constructor(){super({id:"editor.action.indentLines",label:zae(1260,"Indent Line"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:2142,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Kl.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}},KY=class extends rr{constructor(){super({id:"editor.action.outdentLines",label:zae(1261,"Outdent Line"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:2140,weight:100},canTriggerInlineEdits:!0})}run(e,t){ed.Outdent.runEditorCommand(e,t,null)}},qY=class e extends rr{constructor(){super({id:e.ID,label:zae(1262,"Insert Line Above"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:3075,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Pl.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}},qY.ID="editor.action.insertLineBefore",jY=class e extends rr{constructor(){super({id:e.ID,label:zae(1263,"Insert Line Below"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:2051,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Pl.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}},jY.ID="editor.action.insertLineAfter",$Y=class extends rr{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),o=[];for(let a=0,l=n.length-1;a<l;a++){const e=n[a],t=n[a+1];null===mr.intersectRanges(e,t)?o.push(e):n[a+1]=mr.plusRange(e,t)}o.push(n[n.length-1]);const s=this._getEndCursorState(i,o),r=o.map(e=>VH.replace(e,""));t.pushUndoStop(),t.executeEdits(this.id,r,s),t.pushUndoStop()}},GY=class extends $Y{constructor(){super({id:"deleteAllLeft",label:zae(1264,"Delete All Left"),precondition:jl.writable,kbOpts:{kbExpr:jl.textInputFocus,primary:0,mac:{primary:2049},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const n=[];let o=0;return t.forEach(t=>{let s;if(1===t.endColumn&&o>0){const e=t.startLineNumber-o;s=new fr(e,t.startColumn,e,t.startColumn)}else s=new fr(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn);o+=t.endLineNumber-t.startLineNumber,t.intersectRanges(e)?i=s:n.push(s)}),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(null===t)return[];let i=t;const n=e.getModel();return null===n?[]:(i.sort(mr.compareRangesUsingStarts),i=i.map(e=>{if(e.isEmpty()){if(1===e.startColumn){const t=Math.max(1,e.startLineNumber-1);return new mr(t,1===e.startLineNumber?1:n.getLineLength(t)+1,e.startLineNumber,1)}return new mr(e.startLineNumber,1,e.startLineNumber,e.startColumn)}return new mr(e.startLineNumber,1,e.endLineNumber,e.endColumn)}),i)}},ZY=class extends $Y{constructor(){super({id:"deleteAllRight",label:zae(1265,"Delete All Right"),precondition:jl.writable,kbOpts:{kbExpr:jl.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const n=[];for(let o=0,s=t.length,r=0;o<s;o++){const s=t[o],a=new fr(s.startLineNumber-r,s.startColumn,s.startLineNumber-r,s.startColumn);s.intersectRanges(e)?i=a:n.push(a)}return i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getModel();if(null===t)return[];const i=e.getSelections();if(null===i)return[];const n=i.map(e=>{if(e.isEmpty()){const i=t.getLineMaxColumn(e.startLineNumber);return e.startColumn===i?new mr(e.startLineNumber,e.startColumn,e.startLineNumber+1,1):new mr(e.startLineNumber,e.startColumn,e.startLineNumber,i)}return e});return n.sort(mr.compareRangesUsingStarts),n}},YY=class extends rr{constructor(){super({id:"editor.action.joinLines",label:zae(1266,"Join Lines"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:0,mac:{primary:296},weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(null===i)return;let n=t.getSelection();if(null===n)return;i.sort(mr.compareRangesUsingStarts);const o=[],s=i.reduce((e,t)=>e.isEmpty()?e.endLineNumber===t.startLineNumber?(n.equalsSelection(e)&&(n=t),t):t.startLineNumber>e.endLineNumber+1?(o.push(e),t):new fr(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(o.push(e),t):new fr(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn));o.push(s);const r=t.getModel();if(null===r)return;const a=[],l=[];let d=n,c=0;for(let h=0,u=o.length;h<u;h++){const e=o[h],t=e.startLineNumber,i=1;let s,u,g=0;const p=r.getLineLength(e.endLineNumber)-e.endColumn;if(e.isEmpty()||e.startLineNumber===e.endLineNumber){const i=e.getStartPosition();i.lineNumber<r.getLineCount()?(s=t+1,u=r.getLineMaxColumn(s)):(s=i.lineNumber,u=r.getLineMaxColumn(i.lineNumber))}else s=e.endLineNumber,u=r.getLineMaxColumn(s);let m=r.getLineContent(t);for(let n=t+1;n<=s;n++){const e=r.getLineContent(n),t=r.getLineFirstNonWhitespaceColumn(n);if(t>=1){let i=!0;""===m&&(i=!1),!i||" "!==m.charAt(m.length-1)&&"\t"!==m.charAt(m.length-1)||(i=!1,m=m.replace(/[\s\uFEFF\xA0]+$/g," "));const n=e.substr(t-1);m+=(i?" ":"")+n,g=i?n.length+1:n.length}else g=0}const f=new mr(t,i,s,u);if(!f.isEmpty()){let i;e.isEmpty()?(a.push(VH.replace(f,m)),i=new fr(f.startLineNumber-c,m.length-g+1,t-c,m.length-g+1)):e.startLineNumber===e.endLineNumber?(a.push(VH.replace(f,m)),i=new fr(e.startLineNumber-c,e.startColumn,e.endLineNumber-c,e.endColumn)):(a.push(VH.replace(f,m)),i=new fr(e.startLineNumber-c,e.startColumn,e.startLineNumber-c,m.length-p)),null!==mr.intersectRanges(f,n)?d=i:l.push(i)}c+=f.endLineNumber-f.startLineNumber}l.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,a,l),t.pushUndoStop()}},QY=class extends rr{constructor(){super({id:"editor.action.transpose",label:zae(1267,"Transpose Characters around the Cursor"),precondition:jl.writable,canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const o=[];for(let s=0,r=i.length;s<r;s++){const e=i[s];if(!e.isEmpty())continue;const t=e.getStartPosition(),r=n.getLineMaxColumn(t.lineNumber);if(t.column>=r){if(t.lineNumber===n.getLineCount())continue;const e=new mr(t.lineNumber,Math.max(1,t.column-1),t.lineNumber+1,1),i=n.getValueInRange(e).split("").reverse().join("");o.push(new Er(new fr(t.lineNumber,Math.max(1,t.column-1),t.lineNumber+1,1),i))}else{const e=new mr(t.lineNumber,Math.max(1,t.column-1),t.lineNumber,t.column+1),i=n.getValueInRange(e).split("").reverse().join("");o.push(new Pr(e,i,new fr(t.lineNumber,t.column+1,t.lineNumber,t.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}},XY=class extends rr{run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const o=t.getOption(148),s=[];for(const r of i)if(r.isEmpty()){const e=r.getStartPosition(),i=t.getConfiguredWordAtPosition(e);if(!i)continue;const a=new mr(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),l=n.getValueInRange(a);s.push(VH.replace(a,this._modifyText(l,o)))}else{const e=n.getValueInRange(r);s.push(VH.replace(r,this._modifyText(e,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}},JY=class extends XY{constructor(){super({id:"editor.action.transformToUppercase",label:zae(1268,"Transform to Uppercase"),precondition:jl.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleUpperCase()}},eQ=class extends XY{constructor(){super({id:"editor.action.transformToLowercase",label:zae(1269,"Transform to Lowercase"),precondition:jl.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleLowerCase()}},tQ=class{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch(e){}}return this._actual}isSupported(){return null!==this.get()}},iQ=class e extends XY{constructor(){super({id:"editor.action.transformToTitlecase",label:zae(1270,"Transform to Title Case"),precondition:jl.writable,canTriggerInlineEdits:!0})}_modifyText(t,i){const n=e.titleBoundary.get();return n?t.toLocaleLowerCase().replace(n,e=>e.toLocaleUpperCase()):t}},iQ.titleBoundary=new tQ("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu"),nQ=class e extends XY{constructor(){super({id:"editor.action.transformToSnakecase",label:zae(1271,"Transform to Snake Case"),precondition:jl.writable,canTriggerInlineEdits:!0})}_modifyText(t,i){const n=e.caseBoundary.get(),o=e.singleLetters.get();return n&&o?t.replace(n,"$1_$2").replace(o,"$1_$2$3").toLocaleLowerCase():t}},(kY=nQ).caseBoundary=new tQ("(\\p{Ll})(\\p{Lu})","gmu"),kY.singleLetters=new tQ("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu"),oQ=class e extends XY{constructor(){super({id:"editor.action.transformToCamelcase",label:zae(1272,"Transform to Camel Case"),precondition:jl.writable,canTriggerInlineEdits:!0})}_modifyText(t,i){const n=/\r\n|\r|\n/.test(t)?e.multiLineWordBoundary.get():e.singleLineWordBoundary.get(),o=e.validWordStart.get();if(!n||!o)return t;const s=t.split(n);return s.shift()?.replace(o,e=>e.toLocaleLowerCase())+s.map(e=>e.substring(0,1).toLocaleUpperCase()+e.substring(1)).join("")}},(LY=oQ).singleLineWordBoundary=new tQ("[_\\s-]+","gm"),LY.multiLineWordBoundary=new tQ("[_-]+","gm"),LY.validWordStart=new tQ("^(\\p{Lu}[^\\p{Lu}])","gmu"),sQ=class e extends XY{constructor(){super({id:"editor.action.transformToPascalcase",label:zae(1273,"Transform to Pascal Case"),precondition:jl.writable,canTriggerInlineEdits:!0})}_modifyText(t,i){const n=e.wordBoundary.get(),o=e.wordBoundaryToMaintain.get(),s=e.upperCaseWordMatcher.get();return n&&o&&s?t.split(o).map(e=>e.split(n)).flat().map(e=>{const t=e.charAt(0).toLocaleUpperCase()+e.slice(1);return t.length>1&&s.test(t)?t.charAt(0)+t.slice(1).toLocaleLowerCase():t}).join(""):t}},(DY=sQ).wordBoundary=new tQ("[_ \\t-]","gm"),DY.wordBoundaryToMaintain=new tQ("(?<=\\.)","gm"),DY.upperCaseWordMatcher=new tQ("^\\p{Lu}+$","mu"),rQ=class e extends XY{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(e=>e.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:zae(1274,"Transform to Kebab Case"),precondition:jl.writable,canTriggerInlineEdits:!0})}_modifyText(t,i){const n=e.caseBoundary.get(),o=e.singleLetters.get(),s=e.underscoreBoundary.get();return n&&o&&s?t.replace(s,"$1-$3").replace(n,"$1-$2").replace(o,"$1-$2").toLocaleLowerCase():t}},(IY=rQ).caseBoundary=new tQ("(\\p{Ll})(\\p{Lu})","gmu"),IY.singleLetters=new tQ("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),IY.underscoreBoundary=new tQ("(\\S)(_)(\\S)","gm"),kue(EY),kue(MY),kue(TY),kue(OY),kue(AY),kue(FY),kue(WY),kue(BY),kue(HY),kue(zY),kue(UY),kue(KY),kue(qY),kue(jY),kue(GY),kue(ZY),kue(YY),kue(QY),kue(JY),kue(eQ),kue(VY),nQ.caseBoundary.isSupported()&&nQ.singleLetters.isSupported()&&kue(nQ),oQ.singleLineWordBoundary.isSupported()&&oQ.multiLineWordBoundary.isSupported()&&kue(oQ),sQ.wordBoundary.isSupported()&&kue(sQ),iQ.titleBoundary.isSupported()&&kue(iQ),rQ.isSupported()&&kue(rQ),aQ=eue("dataChannelService"),lQ=class{getDataChannel(e){return{sendData:()=>{}}}},dQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},cQ=function(e,t){return function(i,n){t(i,n,e)}},hQ=class extends Ie{static cast(){return this}constructor(e,t,i){var n,o;super(),this._key=e,this._contextKeyService=t,this._dataChannelService=i,this._isEnabledContextKeyValue=(n="structuredLogger.enabled:"+this._key,o=this._contextKeyService,Hce(o.onDidChangeContext,()=>o.getContextKeyValue(n))).recomputeInitiallyAndOnChange(this._store),this.isEnabled=this._isEnabledContextKeyValue.map(e=>void 0!==e)}log(e){return!!this._isEnabledContextKeyValue.get()&&(this._dataChannelService.getDataChannel("structuredLogger:"+this._key).sendData(e),!0)}},hQ=dQ([cQ(1,es),cQ(2,aQ)],hQ),uQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},gQ=function(e,t){return function(i,n){t(i,n,e)}},pQ=class extends Ie{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._loggerService=i,this._structuredLogger=this._register(this._instantiationService.createInstance(hQ.cast(),"editor.inlineSuggest.logChangeReason.commandId"));const n=this._loggerService?.createLogger("textModelChanges",{hidden:!1,name:"Text Model Changes Reason"}),o=Hce(this,n.onDidChangeLogLevel,()=>n.getLevel());this._register(Rce(e=>{yue(o.read(e),js.Trace)&&e.store.add(this._editor.onDidChangeModelContent(e=>{"output"!==this._editor.getModel()?.uri.scheme&&n.trace("onDidChangeModelContent: "+e.detailedReasons.map(e=>e.toKey(Number.MAX_VALUE)).join(", "))}))})),this._register(Rce(e=>{this._editor instanceof pL&&this._structuredLogger.isEnabled.read(e)&&e.store.add(this._editor.onDidChangeModelContent(e=>{const t=this._editor.getModel();if(!t)return;const i=e.detailedReasons[0],n={...i.metadata,sourceId:"TextModel.setChangeReason",source:i.metadata.source,time:Date.now(),modelUri:t.uri,modelVersion:t.getVersionId()};setTimeout(()=>{this._structuredLogger.log(n)},0)}))}))}},pQ=uQ([gQ(1,Jn),gQ(2,qs)],pQ),fQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_Q=function(e,t){return function(i,n){t(i,n,e)}},bQ=class{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(void 0!==i)return i}}},vQ=class{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if("SELECTION"===t||"TM_SELECTED_TEXT"===t){let t=this._model.getValueInRange(this._selection)||void 0,i=this._selection.startLineNumber!==this._selection.endLineNumber;if(!t&&this._overtypingCapturer){const e=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);e&&(t=e.value,i=e.multiline)}if(t&&i&&e.snippet){const i=$le(this._model.getLineContent(this._selection.startLineNumber),0,this._selection.startColumn-1);let n=i;e.snippet.walk(t=>t!==e&&(t instanceof nP&&(n=$le(qle(t.value).pop())),!0));const o=sde(n,i);t=t.replace(/(\r\n|\r|\n)(.*)/g,(e,t,i)=>`${t}${n.substr(o)}${i}`)}return t}if("TM_CURRENT_LINE"===t)return this._model.getLineContent(this._selection.positionLineNumber);if("TM_CURRENT_WORD"===t){const e=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return e&&e.word||void 0}return"TM_LINE_INDEX"===t?String(this._selection.positionLineNumber-1):"TM_LINE_NUMBER"===t?String(this._selection.positionLineNumber):"CURSOR_INDEX"===t?String(this._selectionIdx):"CURSOR_NUMBER"===t?String(this._selectionIdx+1):void 0}},wQ=class{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if("TM_FILENAME"===t)return li(this._model.uri.fsPath);if("TM_FILENAME_BASE"===t){const e=li(this._model.uri.fsPath),t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}return"TM_DIRECTORY"===t?"."===ai(this._model.uri.fsPath)?"":this._labelService.getUriLabel(Ps(this._model.uri)):"TM_DIRECTORY_BASE"===t?"."===ai(this._model.uri.fsPath)?"":li(ai(this._model.uri.fsPath)):"TM_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri):"RELATIVE_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0}):void 0}},CQ=class{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if("CLIPBOARD"!==e.name)return;const t=this._readClipboardText();if(t){if(this._spread){const e=t.split(/\r\n|\n|\r/).filter(e=>!Ple(e));if(e.length===this._selectionCount)return e[this._selectionIdx]}return t}}},yQ=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),n=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(n)return"LINE_COMMENT"===t?n.lineCommentToken||void 0:"BLOCK_COMMENT_START"===t?n.blockCommentStartToken||void 0:"BLOCK_COMMENT_END"===t&&n.blockCommentEndToken||void 0}},yQ=fQ([_Q(2,il)],yQ),(mQ=SQ=class e{constructor(){this._date=new Date}resolve(t){const{name:i}=t;if("CURRENT_YEAR"===i)return String(this._date.getFullYear());if("CURRENT_YEAR_SHORT"===i)return String(this._date.getFullYear()).slice(-2);if("CURRENT_MONTH"===i)return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if("CURRENT_DATE"===i)return String(this._date.getDate().valueOf()).padStart(2,"0");if("CURRENT_HOUR"===i)return String(this._date.getHours().valueOf()).padStart(2,"0");if("CURRENT_MINUTE"===i)return String(this._date.getMinutes().valueOf()).padStart(2,"0");if("CURRENT_SECOND"===i)return String(this._date.getSeconds().valueOf()).padStart(2,"0");if("CURRENT_DAY_NAME"===i)return e.dayNames[this._date.getDay()];if("CURRENT_DAY_NAME_SHORT"===i)return e.dayNamesShort[this._date.getDay()];if("CURRENT_MONTH_NAME"===i)return e.monthNames[this._date.getMonth()];if("CURRENT_MONTH_NAME_SHORT"===i)return e.monthNamesShort[this._date.getMonth()];if("CURRENT_SECONDS_UNIX"===i)return String(Math.floor(this._date.getTime()/1e3));if("CURRENT_TIMEZONE_OFFSET"===i){const e=this._date.getTimezoneOffset(),t=e>0?"-":"+",i=Math.trunc(Math.abs(e/60)),n=i<10?"0"+i:i,o=Math.abs(e)-60*i;return t+n+":"+(o<10?"0"+o:o)}}}).dayNames=[Vae(1406,"Sunday"),Vae(1407,"Monday"),Vae(1408,"Tuesday"),Vae(1409,"Wednesday"),Vae(1410,"Thursday"),Vae(1411,"Friday"),Vae(1412,"Saturday")],mQ.dayNamesShort=[Vae(1413,"Sun"),Vae(1414,"Mon"),Vae(1415,"Tue"),Vae(1416,"Wed"),Vae(1417,"Thu"),Vae(1418,"Fri"),Vae(1419,"Sat")],mQ.monthNames=[Vae(1420,"January"),Vae(1421,"February"),Vae(1422,"March"),Vae(1423,"April"),Vae(1424,"May"),Vae(1425,"June"),Vae(1426,"July"),Vae(1427,"August"),Vae(1428,"September"),Vae(1429,"October"),Vae(1430,"November"),Vae(1431,"December")],mQ.monthNamesShort=[Vae(1432,"Jan"),Vae(1433,"Feb"),Vae(1434,"Mar"),Vae(1435,"Apr"),Vae(1436,"May"),Vae(1437,"Jun"),Vae(1438,"Jul"),Vae(1439,"Aug"),Vae(1440,"Sep"),Vae(1441,"Oct"),Vae(1442,"Nov"),Vae(1443,"Dec")],xQ=class{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=function(e){if("string"==typeof e||void 0===e)return"string"==typeof e?{id:li(e)}:zA;const t=e;return t.configuration?{id:t.id,configPath:t.configuration}:1===t.folders.length?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}(this._workspaceService.getWorkspace());return Kwe(t)?void 0:"WORKSPACE_NAME"===e.name?this._resolveWorkspaceName(t):"WORKSPACE_FOLDER"===e.name?this._resoveWorkspacePath(t):void 0}_resolveWorkspaceName(e){if(Uwe(e))return li(e.uri.path);let t=li(e.configPath.path);return t.endsWith("code-workspace")&&(t=t.substr(0,t.length-14-1)),t}_resoveWorkspacePath(e){if(Uwe(e))return dSe(e.uri.fsPath);const t=li(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?dSe(i):"/"}},kQ=class{resolve(e){const{name:t}=e;return"RANDOM"===t?Math.random().toString().slice(-6):"RANDOM_HEX"===t?Math.random().toString(16).slice(-6):"UUID"===t?Zm():void 0}},LQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},DQ=function(e,t){return function(i,n){t(i,n,e)}},NQ=class e{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Jde(t.placeholders,sP.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(-1===this._offset)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const t=this._editor.getModel();this._editor.changeDecorations(i=>{for(const n of this._snippet.placeholders){const o=this._snippet.offset(n),s=this._snippet.fullLen(n),r=mr.fromPositions(t.getPositionAt(this._offset+o),t.getPositionAt(this._offset+o+s)),a=n.isFinalTabstop?e._decor.inactiveFinal:e._decor.inactive,l=i.addDecoration(r,a);this._placeholderDecorations.set(n,l)}})}move(t){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const e=[];for(const t of this._placeholderGroups[this._placeholderGroupsIdx])if(t.transform){const i=this._placeholderDecorations.get(t),n=this._editor.getModel().getDecorationRange(i),o=this._editor.getModel().getValueInRange(n),s=t.transform.resolve(o).split(/\r\n|\r|\n/);for(let e=1;e<s.length;e++)s[e]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+s[e]);e.push(VH.replace(n,s.join(this._editor.getModel().getEOL())))}e.length>0&&this._editor.executeEdits("snippet.placeholderTransform",e)}let i=!1;!0===t&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,i=!0):!1===t&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,i=!0);const n=this._editor.getModel().changeDecorations(t=>{const n=new Set,o=[];for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const r=this._placeholderDecorations.get(s),a=this._editor.getModel().getDecorationRange(r);o.push(new fr(a.startLineNumber,a.startColumn,a.endLineNumber,a.endColumn)),i=i&&this._hasPlaceholderBeenCollapsed(s),t.changeDecorationOptions(r,s.isFinalTabstop?e._decor.activeFinal:e._decor.active),n.add(s);for(const i of this._snippet.enclosingPlaceholders(s)){const o=this._placeholderDecorations.get(i);t.changeDecorationOptions(o,i.isFinalTabstop?e._decor.activeFinal:e._decor.active),n.add(i)}}for(const[i,s]of this._placeholderDecorations)n.has(i)||t.changeDecorationOptions(s,i.isFinalTabstop?e._decor.inactiveFinal:e._decor.inactive);return o});return i?this.move(t):n??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof sP){const e=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(e).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||0===this._placeholderGroups.length}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(0===this._snippet.placeholders.length)return!0;if(1===this._snippet.placeholders.length){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const n of t){if(n.isFinalTabstop)break;i||(i=[],e.set(n.index,i));const t=this._placeholderDecorations.get(n),o=this._editor.getModel().getDecorationRange(t);if(!o){e.delete(n.index);break}i.push(o)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!e?.choice)return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);return i?{range:i,choice:e.choice}:void 0}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof rP,!e)),e}merge(t){const i=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(n=>{for(const o of this._placeholderGroups[this._placeholderGroupsIdx]){const s=t.shift();console.assert(-1!==s._offset),console.assert(!s._placeholderDecorations);const r=s._snippet.placeholderInfo.last.index;for(const e of s._snippet.placeholderInfo.all)e.isFinalTabstop?e.index=o.index+(r+1)/this._nestingLevel:e.index=o.index+e.index/this._nestingLevel;this._snippet.replace(o,s._snippet.children);const a=this._placeholderDecorations.get(o);n.removeDecoration(a),this._placeholderDecorations.delete(o);for(const t of s._snippet.placeholders){const o=s._snippet.offset(t),r=s._snippet.fullLen(t),a=mr.fromPositions(i.getPositionAt(s._offset+o),i.getPositionAt(s._offset+o+r)),l=n.addDecoration(a,e._decor.inactive);this._placeholderDecorations.set(t,l)}}this._placeholderGroups=Jde(this._snippet.placeholders,sP.compareByIndex)})}},NQ._decor={active:Lx.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Lx.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Lx.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Lx.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})},EQ={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0},MQ=IQ=class{static adjustWhitespace(e,t,i,n,o){const s=$le(e.getLineContent(t.lineNumber),0,t.column-1);let r;return n.walk(t=>{if(!(t instanceof nP)||t.parent instanceof rP)return!0;if(o&&!o.has(t))return!0;const a=t.value.split(/\r\n|\r|\n/);if(i){const i=n.offset(t);if(0===i)a[0]=e.normalizeIndentation(a[0]);else{r=r??n.toString();const t=r.charCodeAt(i-1);10!==t&&13!==t||(a[0]=e.normalizeIndentation(s+a[0]))}for(let t=1;t<a.length;t++)a[t]=e.normalizeIndentation(s+a[t])}const l=a.join(e.getEOL());return l!==t.value&&(t.parent.replace(t,[new nP(l)]),r=void 0),!0}),s}static adjustSelection(e,t,i,n){if(0!==i||0!==n){const{positionLineNumber:o,positionColumn:s}=t,r=s-i,a=s+n,l=e.validateRange({startLineNumber:o,startColumn:r,endLineNumber:o,endColumn:a});t=fr.createWithDirection(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn,t.getDirection())}return t}static createEditsAndSnippetsFromSelections(e,t,i,n,o,s,r,a,l){const d=[],c=[];if(!e.hasModel())return{edits:d,snippets:c};const h=e.getModel(),u=e.invokeWithinContext(e=>e.get(HA)),g=e.invokeWithinContext(e=>new wQ(e.get(zK),h)),p=()=>r,m=h.getValueInRange(IQ.adjustSelection(h,e.getSelection(),i,0)),f=h.getValueInRange(IQ.adjustSelection(h,e.getSelection(),0,n)),_=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),b=e.getSelections().map((e,t)=>({selection:e,idx:t})).sort((e,t)=>mr.compareRangesUsingStarts(e.selection,t.selection));for(const{selection:v,idx:w}of b){let r=IQ.adjustSelection(h,v,i,0),C=IQ.adjustSelection(h,v,0,n);m!==h.getValueInRange(r)&&(r=v),f!==h.getValueInRange(C)&&(C=v);const y=v.setStartPosition(r.startLineNumber,r.startColumn).setEndPosition(C.endLineNumber,C.endColumn),S=(new hP).parse(t,!0,o),x=y.getStartPosition(),k=IQ.adjustWhitespace(h,x,s||w>0&&_!==h.getLineFirstNonWhitespaceColumn(v.positionLineNumber),S);S.resolveVariables(new bQ([g,new CQ(p,w,b.length,"spread"===e.getOption(88)),new vQ(h,v,w,a),new yQ(h,v,l),new SQ,new xQ(u),new kQ])),d[w]=VH.replace(y,S.toString()),d[w].identifier={major:w,minor:0},d[w]._isTracked=!0,c[w]=new NQ(e,S,k)}return{edits:d,snippets:c}}static createEditsAndSnippetsFromEdits(e,t,i,n,o,s,r){if(!e.hasModel()||0===t.length)return{edits:[],snippets:[]};const a=[],l=e.getModel(),d=new hP,c=new cP,h=new bQ([e.invokeWithinContext(e=>new wQ(e.get(zK),l)),new CQ(()=>o,0,e.getSelections().length,"spread"===e.getOption(88)),new vQ(l,e.getSelection(),0,s),new yQ(l,e.getSelection(),r),new SQ,new xQ(e.invokeWithinContext(e=>e.get(HA))),new kQ]);t=t.sort((e,t)=>mr.compareRangesUsingStarts(e.range,t.range));let u=0;for(let g=0;g<t.length;g++){const{range:e,template:i,keepWhitespace:o}=t[g];if(g>0){const i=t[g-1].range,n=mr.fromPositions(i.getEndPosition(),e.getStartPosition()),o=new nP(l.getValueInRange(n));c.appendChild(o),u+=o.value.length}const s=d.parseFragment(i,c);IQ.adjustWhitespace(l,e.getStartPosition(),void 0!==o?!o:n,c,new Set(s)),c.resolveVariables(h);const r=c.toString(),p=r.slice(u);u=r.length;const m=VH.replace(e,p);m.identifier={major:g,minor:0},m._isTracked=!0,a.push(m)}return d.ensureFinalTabstop(c,i,!0),{edits:a,snippets:[new NQ(e,c,"")]}}constructor(e,t,i=EQ,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){kle(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(e){if(!this._editor.hasModel())return;const{edits:t,snippets:i}="string"==typeof this._template?IQ.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):IQ.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=i,this._editor.executeEdits(e??Vy.snippet(),t,e=>{const t=e.filter(e=>!!e.identifier);for(let n=0;n<i.length;n++)i[n].initialize(t[n].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):t.map(e=>fr.fromPositions(e.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=EQ){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=IQ.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,e=>{const t=e.filter(e=>!!e.identifier);for(let o=0;o<n.length;o++)n[o].initialize(t[o].textChange);const i=n[0].isTrivialSnippet;if(!i){for(const e of this._snippets)e.merge(n);console.assert(0===n.length)}return this._snippets[0].hasPlaceholder&&!i?this._move(void 0):t.map(e=>fr.fromPositions(e.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const n=i.move(e);t.push(...n)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;const t=new Map;for(const i of this._snippets){const n=i.computePossibleSelections();if(0===t.size)for(const[i,o]of n){o.sort(mr.compareRangesUsingStarts);for(const n of e)if(o[0].containsRange(n)){t.set(i,[]);break}}if(0===t.size)return!1;t.forEach((e,t)=>{e.push(...n.get(t))})}e.sort(mr.compareRangesUsingStarts);for(const[i,n]of t)if(n.length===e.length){n.sort(mr.compareRangesUsingStarts);for(let o=0;o<n.length;o++)if(!n[o].containsRange(e[o])){t.delete(i);continue}}else t.delete(i);return t.size>0}},MQ=IQ=LQ([DQ(3,il)],MQ),RQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},OQ=function(e,t){return function(i,n){t(i,n,e)}},PQ={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0},TQ=class{static get(e){return e.getContribution(AQ.ID)}constructor(e,t,i,n,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._inSnippetObservable=Qce(this,!1),this._snippetListener=new De,this._modelVersionId=-1,this._inSnippet=AQ.InSnippetMode.bindTo(n),this._hasNextTabstop=AQ.HasNextTabstop.bindTo(n),this._hasPrevTabstop=AQ.HasPrevTabstop.bindTo(n)}dispose(){this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._session?.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,void 0===t?PQ:{...PQ,...t})}catch(Fae){this.cancel(),this._logService.error(Fae),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"<no_session>")}}_doInsert(e,t){if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&"string"!=typeof e&&this.cancel(),this._session?(ple("string"==typeof e),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new MQ(this._editor,e,t,this._languageConfigurationService),this._session.insert(t.reason)),t.undoStopAfter&&this._editor.getModel().pushStackElement(),this._session?.hasChoice){const e={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(e,t)=>{if(!this._session||e!==this._editor.getModel()||!to.equals(this._editor.getPosition(),t))return;const{activeChoice:i}=this._session;if(!i||0===i.choice.options.length)return;const n=e.getValueInRange(i.range),o=Boolean(i.choice.options.find(e=>e.value===n)),s=[];for(let r=0;r<i.choice.options.length;r++){const e=i.choice.options[r];s.push({kind:13,label:e.value,insertText:e.value,sortText:"a".repeat(r+1),range:i.range,filterText:o?`${n}_${e.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:Vae(1405,"Go to next placeholder...")}})}return{suggestions:s}}},t=this._editor.getModel();let i,n=!1;const o=()=>{i?.dispose(),n=!1},s=()=>{n||(i=this._languageFeaturesService.completionProvider.register({language:t.getLanguageId(),pattern:t.uri.fsPath,scheme:t.uri.scheme,exclusive:!0},e),this._snippetListener.add(i),n=!0)};this._choiceCompletions={provider:e,enable:s,disable:o}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(e=>e.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(this._session&&this._editor.hasModel()){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._inSnippetObservable.set(!0,void 0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){if(!this._session||!this._editor.hasModel())return void(this._currentChoice=void 0);const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions)return this._choiceCompletions?.disable(),void(this._currentChoice=void 0);this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{!function(e,t){e.getContribution("editor.contrib.suggestController")?.triggerSuggest((new Set).add(t),void 0,!0)}(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,this._session?.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){this._session?.prev(),this._updateState()}next(){this._session?.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}get isInSnippetObservable(){return this._inSnippetObservable}},AQ=TQ,TQ.ID="snippetController2",TQ.InSnippetMode=new Jo("inSnippetMode",!1,Vae(1402,"Whether the editor in current in snippet mode")),TQ.HasNextTabstop=new Jo("hasNextTabstop",!1,Vae(1403,"Whether there is a next tab stop when in snippet mode")),TQ.HasPrevTabstop=new Jo("hasPrevTabstop",!1,Vae(1404,"Whether there is a previous tab stop when in snippet mode")),FQ=TQ,Iue((FQ=AQ=RQ([OQ(1,Ks),OQ(2,Tx),OQ(3,es),OQ(4,il)],FQ)).ID,FQ,4),xue(new(WQ=sr.bindToContribution(FQ.get))({id:"jumpToNextSnippetPlaceholder",precondition:Po.and(FQ.InSnippetMode,FQ.HasNextTabstop),handler:e=>e.next(),kbOpts:{weight:130,kbExpr:jl.textInputFocus,primary:2}})),xue(new WQ({id:"jumpToPrevSnippetPlaceholder",precondition:Po.and(FQ.InSnippetMode,FQ.HasPrevTabstop),handler:e=>e.prev(),kbOpts:{weight:130,kbExpr:jl.textInputFocus,primary:1026}})),xue(new WQ({id:"leaveSnippet",precondition:FQ.InSnippetMode,handler:e=>e.cancel(!0),kbOpts:{weight:130,kbExpr:jl.textInputFocus,primary:9,secondary:[1033]}})),xue(new WQ({id:"acceptSnippet",precondition:FQ.InSnippetMode,handler:e=>e.finish()})),BQ=class extends tC{constructor(e){super(),this._textModel=e}getOffset(e){return this._textModel.getOffsetAt(e)}getPosition(e){return this._textModel.getPositionAt(e)}},VQ=[],HQ=class{constructor(e){this._contextKeyService=e}bind(e,t){return j_e(e,this._contextKeyService,t instanceof Function?t:e=>t.read(e))}},UQ=class{constructor(e,t,i,n=gSe){this.startValue=e,this.endValue=t,this.durationMs=i,this._interpolationFunction=n,this.startTimeMs=Date.now(),e===t&&(this.durationMs=0)}isFinished(){return Date.now()>=this.startTimeMs+this.durationMs}getValue(){const e=Date.now()-this.startTimeMs;return e>=this.durationMs?this.endValue:this._interpolationFunction(e,this.startValue,this.endValue-this.startValue,this.durationMs)}},KQ=class{constructor(e){this._value=Qce(this,e)}getValue(e){const t=this._value.read(e);return t.isFinished()||qQ.instance.invalidateOnNextAnimationFrame(e),t.getValue()}},(zQ=qQ=class{constructor(){this._counter=t_e(this),this._isScheduled=!1}invalidateOnNextAnimationFrame(e){this._counter.read(e),this._isScheduled||(this._isScheduled=!0,She().requestAnimationFrame(()=>{this._isScheduled=!1,this._update()}))}_update(){this._counter.trigger(void 0)}}).instance=new zQ,jQ=class{constructor(e,t){this.lineNumber=e,this.parts=t,nle(()=>ole(t,(e,t)=>e.column<=t.column))}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(0===this.parts.length)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return new lC([...this.parts.map(e=>new dC(mr.fromPositions(new to(1,e.column)),e.lines.map(e=>e.line).join("\n")))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>0===e.lines.length)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}},$Q=class{constructor(e,t,i,n=[]){this.column=e,this.text=t,this.preview=i,this._inlineDecorations=n,this.lines=qle(this.text).map((e,t)=>({line:e,lineDecorations:Rp.filter(this._inlineDecorations,t+1,1,e.length+1)}))}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t.line===e.lines[i].line&&Rp.equalsArr(t.lineDecorations,e.lines[i].lineDecorations))}},GQ=class{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=n,this.parts=[new $Q(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=qle(this.text)}renderForScreenReader(e){return this.newLines.join("\n")}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>0===e.lines.length)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}},ZQ=void 0,YQ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},QQ=function(e,t){return function(i,n){t(i,n,e)}},XQ=class{constructor(e,t){this._baseService=e,this._intercept=t}publicLog2(e,t){this._intercept(e,t),this._baseService.publicLog2(e,t)}},JQ=class extends XQ{constructor(e,t){super(e,(e,i)=>{let n=!0;i&&eX in i&&(n=Boolean(i[eX])),n&&t.getDataChannel("editTelemetry").sendData({eventName:e,data:i??{}})})}},JQ=YQ([QQ(0,fs),QQ(1,aQ)],JQ),eX=Symbol("shouldForwardToChannel"),tX=class{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}},iX=class{constructor(e,t){this.lineRangeMapping=e,this.changes=t}},nX=3,oX=class{computeDiff(e,t,i){const n=new dX(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),o=[];let s=null;for(const r of n.changes){let e,t;e=0===r.originalEndLineNumber?new Qw(r.originalStartLineNumber+1,r.originalStartLineNumber+1):new Qw(r.originalStartLineNumber,r.originalEndLineNumber+1),t=0===r.modifiedEndLineNumber?new Qw(r.modifiedStartLineNumber+1,r.modifiedStartLineNumber+1):new Qw(r.modifiedStartLineNumber,r.modifiedEndLineNumber+1);let i=new BE(e,t,r.charChanges?.map(e=>new VE(new mr(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),new mr(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn))));s&&(s.modified.endLineNumberExclusive!==i.modified.startLineNumber&&s.original.endLineNumberExclusive!==i.original.startLineNumber||(i=new BE(s.original.join(i.original),s.modified.join(i.modified),s.innerChanges&&i.innerChanges?s.innerChanges.concat(i.innerChanges):void 0),o.pop())),o.push(i),s=i}return nle(()=>ole(o,(e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive===t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)),new tX(o,[],n.quitEarly)}},sX=class{constructor(e){const t=[],i=[];for(let n=0,o=e.length;n<o;n++)t[n]=xSe(e[n],1),i[n]=kSe(e[n],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){const n=[],o=[],s=[];let r=0;for(let a=t;a<=i;a++){const t=this.lines[a],l=e?this._startColumns[a]:1,d=e?this._endColumns[a]:t.length+1;for(let e=l;e<d;e++)n[r]=t.charCodeAt(e-1),o[r]=a+1,s[r]=e,r++;!e&&a<i&&(n[r]=10,o[r]=a+1,s[r]=t.length+1,r++)}return new rX(n,o,s)}},rX=class{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}toString(){return"["+this._charCodes.map((e,t)=>(10===e?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return-1===e?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),10===this._charCodes[e]?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return-1===e?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),10===this._charCodes[e]?1:this._columns[e]+1)}},aX=class e{constructor(e,t,i,n,o,s,r,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=r,this.modifiedEndColumn=a}static createFromDiffChange(t,i,n){return new e(i.getStartLineNumber(t.originalStart),i.getStartColumn(t.originalStart),i.getEndLineNumber(t.originalStart+t.originalLength-1),i.getEndColumn(t.originalStart+t.originalLength-1),n.getStartLineNumber(t.modifiedStart),n.getStartColumn(t.modifiedStart),n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1),n.getEndColumn(t.modifiedStart+t.modifiedLength-1))}},lX=class e{constructor(e,t,i,n,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=o}static createFromDiffResult(t,i,n,o,s,r,a){let l,d,c,h,u;if(0===i.originalLength?(l=n.getStartLineNumber(i.originalStart)-1,d=0):(l=n.getStartLineNumber(i.originalStart),d=n.getEndLineNumber(i.originalStart+i.originalLength-1)),0===i.modifiedLength?(c=o.getStartLineNumber(i.modifiedStart)-1,h=0):(c=o.getStartLineNumber(i.modifiedStart),h=o.getEndLineNumber(i.modifiedStart+i.modifiedLength-1)),r&&i.originalLength>0&&i.originalLength<20&&i.modifiedLength>0&&i.modifiedLength<20&&s()){const e=n.createCharSequence(t,i.originalStart,i.originalStart+i.originalLength-1),r=o.createCharSequence(t,i.modifiedStart,i.modifiedStart+i.modifiedLength-1);if(e.getElements().length>0&&r.getElements().length>0){let t=SSe(e,r,s,!0).changes;a&&(t=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,o=e.length;n<o;n++){const o=e[n],s=o.originalStart-(i.originalStart+i.originalLength),r=o.modifiedStart-(i.modifiedStart+i.modifiedLength);Math.min(s,r)<nX?(i.originalLength=o.originalStart+o.originalLength-i.originalStart,i.modifiedLength=o.modifiedStart+o.modifiedLength-i.modifiedStart):(t.push(o),i=o)}return t}(t)),u=[];for(let i=0,n=t.length;i<n;i++)u.push(aX.createFromDiffChange(t[i],e,r))}}return new e(l,d,c,h,u)}},dX=class{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new sX(e),this.modified=new sX(t),this.continueLineDiff=LSe(i.maxComputationTime),this.continueCharDiff=LSe(0===i.maxComputationTime?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(1===this.original.lines.length&&0===this.original.lines[0].length)return 1===this.modified.lines.length&&0===this.modified.lines[0].length?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(1===this.modified.lines.length&&0===this.modified.lines[0].length)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};const e=SSe(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const e=[];for(let i=0,n=t.length;i<n;i++)e.push(lX.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[i],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:e}}const n=[];let o=0,s=0;for(let r=-1,a=t.length;r<a;r++){const e=r+1<a?t[r+1]:null,i=e?e.originalStart:this.originalLines.length,l=e?e.modifiedStart:this.modifiedLines.length;for(;o<i&&s<l;){const e=this.originalLines[o],t=this.modifiedLines[s];if(e!==t){{let i=xSe(e,1),r=xSe(t,1);for(;i>1&&r>1&&e.charCodeAt(i-2)===t.charCodeAt(r-2);)i--,r--;(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,s+1,1,r)}{let i=kSe(e,1),r=kSe(t,1);const a=e.length+1,l=t.length+1;for(;i<a&&r<l&&e.charCodeAt(i-1)===e.charCodeAt(r-1);)i++,r++;(i<a||r<l)&&this._pushTrimWhitespaceCharChange(n,o+1,i,a,s+1,r,l)}}o++,s++}e&&(n.push(lX.createFromDiffResult(this.shouldIgnoreTrimWhitespace,e,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=e.originalLength,s+=e.modifiedLength)}return{quitEarly:i,changes:n}}_pushTrimWhitespaceCharChange(e,t,i,n,o,s,r){if(this._mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r))return;let a;this.shouldComputeCharChanges&&(a=[new aX(t,i,t,n,o,s,o,r)]),e.push(new lX(t,t,o,o,a))}_mergeTrimWhitespaceCharChange(e,t,i,n,o,s,r){const a=e.length;if(0===a)return!1;const l=e[a-1];return 0!==l.originalEndLineNumber&&0!==l.modifiedEndLineNumber&&(l.originalEndLineNumber===t&&l.modifiedEndLineNumber===o?(this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new aX(t,i,t,n,o,s,o,r)),!0):l.originalEndLineNumber+1===t&&l.modifiedEndLineNumber+1===o&&(l.originalEndLineNumber=t,l.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new aX(t,i,t,n,o,s,o,r)),!0))}},cX=class{compute(e,t,i=VM.instance,n){if(0===e.length||0===t.length)return FM.trivial(e,t);const o=new zM(e.length,t.length),s=new zM(e.length,t.length),r=new zM(e.length,t.length);for(let g=0;g<e.length;g++)for(let a=0;a<t.length;a++){if(!i.isValid())return FM.trivialTimedOut(e,t);const l=0===g?0:o.get(g-1,a),d=0===a?0:o.get(g,a-1);let c;e.getElement(g)===t.getElement(a)?(c=0===g||0===a?0:o.get(g-1,a-1),g>0&&a>0&&3===s.get(g-1,a-1)&&(c+=r.get(g-1,a-1)),c+=n?n(g,a):1):c=-1;const h=Math.max(l,d,c);if(h===c){const e=g>0&&a>0?r.get(g-1,a-1):0;r.set(g,a,e+1),s.set(g,a,3)}else h===l?(r.set(g,a,0),s.set(g,a,1)):h===d&&(r.set(g,a,0),s.set(g,a,2));o.set(g,a,h)}const a=[];let l=e.length,d=t.length;function c(e,t){e+1===l&&t+1===d||a.push(new WM(new hl(e+1,l),new hl(t+1,d))),l=e,d=t}let h=e.length-1,u=t.length-1;for(;h>=0&&u>=0;)3===s.get(h,u)?(c(h,u),h--,u--):1===s.get(h,u)?h--:u--;return c(-1,-1),a.reverse(),new FM(a,!1)}},hX=class{compute(e,t,i=VM.instance){if(0===e.length||0===t.length)return FM.trivial(e,t);const n=e,o=t;function s(e,t){for(;e<n.length&&t<o.length&&n.getElement(e)===o.getElement(t);)e++,t++;return e}let r=0;const a=new gX;a.set(0,s(0,0));const l=new pX;l.set(0,0===a.get(0)?null:new uX(null,0,0,a.get(0)));let d=0;e:for(;;){if(r++,!i.isValid())return FM.trivialTimedOut(n,o);const e=-Math.min(r,o.length+r%2),t=Math.min(r,n.length+r%2);for(d=e;d<=t;d+=2){const i=d===t?-1:a.get(d+1),r=d===e?-1:a.get(d-1)+1,c=Math.min(Math.max(i,r),n.length),h=c-d;if(c>n.length||h>o.length)continue;const u=s(c,h);a.set(d,u);const g=c===i?l.get(d+1):l.get(d-1);if(l.set(d,u!==c?new uX(g,c,h,u-c):g),a.get(d)===n.length&&a.get(d)-d===o.length)break e}}let c=l.get(d);const h=[];let u=n.length,g=o.length;for(;;){const e=c?c.x+c.length:0,t=c?c.y+c.length:0;if(e===u&&t===g||h.push(new WM(new hl(e,u),new hl(t,g))),!c)break;u=c.x,g=c.y,c=c.prev}return h.reverse(),new FM(h,!1)}},uX=class{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}},gX=class{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if((e=-e-1)>=this.negativeArr.length){const e=this.negativeArr;this.negativeArr=new Int32Array(2*e.length),this.negativeArr.set(e)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const e=this.positiveArr;this.positiveArr=new Int32Array(2*e.length),this.positiveArr.set(e)}this.positiveArr[e]=t}}},pX=class{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}},mX=class{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let n=this.range.startLineNumber;n<=this.range.endLineNumber;n++){let t=e[n-1],o=0;n===this.range.startLineNumber&&this.range.startColumn>1&&(o=this.range.startColumn-1,t=t.substring(o)),this.lineStartOffsets.push(o);let s=0;if(!i){const e=t.trimStart();s=t.length-e.length,t=e.trimEnd()}this.trimmedWsLengthsByLineIdx.push(s);const r=n===this.range.endLineNumber?Math.min(this.range.endColumn-1-o-s,t.length):t.length;for(let e=0;e<r;e++)this.elements.push(t.charCodeAt(e));n<this.range.endLineNumber&&(this.elements.push("\n".charCodeAt(0)),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new hl(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(e=>String.fromCharCode(e)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=ESe(e>0?this.elements[e-1]:-1),i=ESe(e<this.elements.length?this.elements[e]:-1);if(7===t&&8===i)return 0;if(8===t)return 150;let n=0;return t!==i&&(n+=10,0===t&&1===i&&(n+=1)),n+=NSe(t),n+=NSe(i),n}translateOffset(e,t="right"){const i=jpe(this.firstElementOffsetByLineIdx,t=>t<=e),n=e-this.firstElementOffsetByLineIdx[i];return new to(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+n+(0===n&&"left"===t?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){const t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?mr.fromPositions(i,i):mr.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length)return;if(!DSe(this.elements[e]))return;let t=e;for(;t>0&&DSe(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&DSe(this.elements[i]);)i++;return new hl(t,i)}findSubWordContaining(e){if(e<0||e>=this.elements.length)return;if(!DSe(this.elements[e]))return;let t=e;for(;t>0&&DSe(this.elements[t-1])&&!ISe(this.elements[t]);)t--;let i=e;for(;i<this.elements.length&&DSe(this.elements[i])&&!ISe(this.elements[i]);)i++;return new hl(t,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,t){return this.elements[e]===this.elements[t]}extendToFullLines(e){return new hl(qpe(this.firstElementOffsetByLineIdx,t=>t<=e.start)??0,function(e,t){const i=$pe(e,t);return i===e.length?void 0:e[i]}(this.firstElementOffsetByLineIdx,t=>e.endExclusive<=t)??this.elements.length)}},fX={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10},_X=class{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){return 1e3-((0===e?0:FSe(this.lines[e-1]))+(e===this.lines.length?0:FSe(this.lines[e])))}getText(e){return this.lines.slice(e.start,e.endExclusive).join("\n")}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}},bX=class{constructor(){this.dynamicProgrammingDiffing=new cX,this.myersDiffingAlgorithm=new hX}computeDiff(e,t,i){if(e.length<=1&&Zde(e,t,(e,t)=>e===t))return new tX([],[],!1);if(1===e.length&&0===e[0].length||1===t.length&&0===t[0].length)return new tX([new BE(new Qw(1,e.length+1),new Qw(1,t.length+1),[new VE(new mr(1,1,e.length,e[e.length-1].length+1),new mr(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=0===i.maxComputationTimeMs?VM.instance:new HM(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,s=new Map;function r(e){let t=s.get(e);return void 0===t&&(t=s.size,s.set(e,t)),t}const a=e.map(e=>r(e.trim())),l=t.map(e=>r(e.trim())),d=new _X(a,e),c=new _X(l,t),h=(()=>d.length+c.length<1700?this.dynamicProgrammingDiffing.compute(d,c,n,(i,n)=>e[i]===t[n]?0===t[n].length?.1:1+Math.log(1+t[n].length):.99):this.myersDiffingAlgorithm.compute(d,c,n))();let u=h.diffs,g=h.hitTimeout;u=RSe(d,c,u),u=function(e,t,i){let n=i;if(0===n.length)return n;let o,s=0;do{o=!1;const r=[n[0]];for(let a=1;a<n.length;a++){const l=n[a],d=r[r.length-1];function c(t,i){const n=new hl(d.seq1Range.endExclusive,l.seq1Range.start);return e.getText(n).replace(/\s/g,"").length<=4&&(t.seq1Range.length+t.seq2Range.length>5||i.seq1Range.length+i.seq2Range.length>5)}c(d,l)?(o=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}n=r}while(s++<10&&o);return n}(d,0,u);const p=[],m=s=>{if(o)for(let r=0;r<s;r++){const s=f+r,a=_+r;if(e[s]!==t[a]){const r=this.refineDiff(e,t,new WM(new hl(s,s+1),new hl(a,a+1)),n,o,i);for(const e of r.mappings)p.push(e);r.hitTimeout&&(g=!0)}}};let f=0,_=0;for(const w of u){nle(()=>w.seq1Range.start-f===w.seq2Range.start-_),m(w.seq1Range.start-f),f=w.seq1Range.endExclusive,_=w.seq2Range.endExclusive;const s=this.refineDiff(e,t,w,n,o,i);s.hitTimeout&&(g=!0);for(const e of s.mappings)p.push(e)}m(e.length-f);const b=swe(p,new rC(e),new rC(t));let v=[];return i.computeMoves&&(v=this.computeMoves(b,e,t,a,l,n,o,i)),nle(()=>{function i(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;const i=t[e.lineNumber-1];return!(e.column<1||e.column>i.length+1)}function n(e,t){return!(e.startLineNumber<1||e.startLineNumber>t.length+1||e.endLineNumberExclusive<1||e.endLineNumberExclusive>t.length+1)}for(const o of b){if(!o.innerChanges)return!1;for(const n of o.innerChanges)if(!(i(n.modifiedRange.getStartPosition(),t)&&i(n.modifiedRange.getEndPosition(),t)&&i(n.originalRange.getStartPosition(),e)&&i(n.originalRange.getEndPosition(),e)))return!1;if(!n(o.modified,t)||!n(o.original,e))return!1}return!0}),new tX(b,v,g)}computeMoves(e,t,i,n,o,s,r,a){return MSe(e,t,i,n,o,s).map(e=>new iX(e,swe(this.refineDiff(t,i,new WM(e.original.toOffsetRange(),e.modified.toOffsetRange()),s,r,a).mappings,new rC(t),new rC(i),!0)))}refineDiff(e,t,i,n,o,s){const r=(a=i,new WE(new Qw(a.seq1Range.start+1,a.seq1Range.endExclusive+1),new Qw(a.seq2Range.start+1,a.seq2Range.endExclusive+1))).toRangeMapping2(e,t);var a;const l=new mX(e,r.originalRange,o),d=new mX(t,r.modifiedRange,o),c=l.length+d.length<500?this.dynamicProgrammingDiffing.compute(l,d,n):this.myersDiffingAlgorithm.compute(l,d,n);let h=c.diffs;return h=RSe(l,d,h),h=PSe(l,d,h,(e,t)=>e.findWordContaining(t)),s.extendToSubwords&&(h=PSe(l,d,h,(e,t)=>e.findSubWordContaining(t),!0)),h=function(e,t,i){const n=[];for(const o of i){const e=n[n.length-1];e&&(o.seq1Range.start-e.seq1Range.endExclusive<=2||o.seq2Range.start-e.seq2Range.endExclusive<=2)?n[n.length-1]=new WM(e.seq1Range.join(o.seq1Range),e.seq2Range.join(o.seq2Range)):n.push(o)}return n}(0,0,h),h=function(e,t,i){let n=i;if(0===n.length)return n;let o,s=0;do{o=!1;const a=[n[0]];for(let l=1;l<n.length;l++){const d=n[l],c=a[a.length-1];function h(i,n){const o=new hl(c.seq1Range.endExclusive,d.seq1Range.start);if(e.countLinesIn(o)>5||o.length>500)return!1;const s=e.getText(o).trim();if(s.length>20||s.split(/\r\n|\r|\n/).length>1)return!1;const r=e.countLinesIn(i.seq1Range),a=i.seq1Range.length,l=t.countLinesIn(i.seq2Range),h=i.seq2Range.length,u=e.countLinesIn(n.seq1Range),g=n.seq1Range.length,p=t.countLinesIn(n.seq2Range),m=n.seq2Range.length;function f(e){return Math.min(e,130)}return Math.pow(Math.pow(f(40*r+a),1.5)+Math.pow(f(40*l+h),1.5),1.5)+Math.pow(Math.pow(f(40*u+g),1.5)+Math.pow(f(40*p+m),1.5),1.5)>74184.96480721243}h(c,d)?(o=!0,a[a.length-1]=a[a.length-1].join(d)):a.push(d)}n=a}while(s++<10&&o);const r=[];return function(e,t){for(let i=0;i<e.length;i++)t(0===i?void 0:e[i-1],e[i],i+1===e.length?void 0:e[i+1])}(n,(t,i,n)=>{let o=i;function s(e){return e.length>0&&e.trim().length<=3&&i.seq1Range.length+i.seq2Range.length>100}const a=e.extendToFullLines(i.seq1Range),l=e.getText(new hl(a.start,i.seq1Range.start));s(l)&&(o=o.deltaStart(-l.length));const d=e.getText(new hl(i.seq1Range.endExclusive,a.endExclusive));s(d)&&(o=o.deltaEnd(d.length));const c=WM.fromOffsetPairs(t?t.getEndExclusives():BM.zero,n?n.getStarts():BM.max),h=o.intersect(c);r.length>0&&h.getStarts().equals(r[r.length-1].getEndExclusives())?r[r.length-1]=r[r.length-1].join(h):r.push(h)}),r}(l,d,h),{mappings:h.map(e=>new VE(l.translateRange(e.seq1Range),d.translateRange(e.seq2Range))),hitTimeout:c.hitTimeout}}},vX={getLegacy:()=>new oX,getDefault:()=>new bX},function(e){e.create=function(e,t){return e.isInlineEdit||e.uri?kX.create(e,t):xX.create(e,t)}}(wX||(wX={})),CX=class{constructor(e,t,i){this._data=e,this.identity=t,this.hint=i}get source(){return this._data.source}get isFromExplicitRequest(){return this._data.context.triggerKind===mb.Explicit}get forwardStable(){return this.source.inlineSuggestions.enableForwardStability??!1}get editRange(){return this.getSingleTextEdit().range}get targetRange(){return this.hint?.range&&!this.hint.jumpToEdit?this.hint?.range:this.editRange}get insertText(){return this.getSingleTextEdit().text}get semanticId(){return this.hash}get action(){return this._sourceInlineCompletion.gutterMenuLinkAction}get command(){return this._sourceInlineCompletion.command}get warning(){return this._sourceInlineCompletion.warning}get showInlineEditMenu(){return!!this._sourceInlineCompletion.showInlineEditMenu}get hash(){return JSON.stringify([this.getSingleTextEdit().text,this.getSingleTextEdit().range.getStartPosition().toString()])}get requestUuid(){return this._data.context.requestUuid}get partialAccepts(){return this._data.partialAccepts}get _sourceInlineCompletion(){return this._data.sourceInlineCompletion}addRef(){this.identity.addRef(),this.source.addRef()}removeRef(){this.identity.removeRef(),this.source.removeRef()}reportInlineEditShown(e,t,i){this._data.reportInlineEditShown(e,this.insertText,t,i)}reportPartialAccept(e,t,i){this._data.reportPartialAccept(e,t,i)}reportEndOfLife(e){this._data.reportEndOfLife(e)}setEndOfLifeReason(e){this._data.setEndOfLifeReason(e)}setIsPreceeded(e){this._data.setIsPreceeded(e.partialAccepts)}setNotShownReasonIfNotSet(e){this._data.setNotShownReason(e)}getSourceCompletion(){return this._sourceInlineCompletion}},(yX=class e{constructor(){this._onDispose=t_e(this),this._jumpedTo=Qce(this,!1),this._refCount=1,this.id="InlineCompletionIdentity"+e.idCounter++}get jumpedTo(){return this._jumpedTo}addRef(){this._refCount++}removeRef(){this._refCount--,0===this._refCount&&this._onDispose.trigger(void 0)}setJumpTo(e){this._jumpedTo.set(!0,e)}}).idCounter=0,SX=class e{static create(t){return new e(mr.lift(t.range),t.content,t.style,t.jumpToEdit)}constructor(e,t,i,n){this.range=e,this.content=t,this.style=i,this.jumpToEdit=n}withEdit(t,i){const n=xme([new hl(i.getOffset(this.range.getStartPosition()),i.getOffset(this.range.getEndPosition()))],t)[0];if(n)return new e(i.getRange(n),this.content,this.style,this.jumpToEdit)}},xX=class e extends CX{static create(t,i){const n=new yX,o=cSe(i),s=t.insertText.replace(/\r\n|\r|\n/g,i.getEOL()),r=function(e,t){const i=t.getEOL();return e.replaceRange.isEmpty&&e.newText.includes(i)&&(e=VSe(e,t)),e}(new Yw(o.getOffsetRange(t.range),s),i),a=r.removeCommonSuffixAndPrefix(i.getValue()),l=o.getTextReplacement(r),d=t.hint?SX.create(t.hint):void 0;return new e(r,a,l,l.range,t.snippetInfo,t.additionalTextEdits,t,n,d)}constructor(e,t,i,n,o,s,r,a,l){super(r,a,l),this._edit=e,this._trimmedEdit=t,this._textEdit=i,this._originalRange=n,this.snippetInfo=o,this.additionalTextEdits=s,this.isInlineEdit=!1}get hash(){return JSON.stringify(this._trimmedEdit.toJson())}getSingleTextEdit(){return this._textEdit}withIdentity(t){return new e(this._edit,this._trimmedEdit,this._textEdit,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,t,this.hint)}withEdit(t,i){const n=xme([this._edit.replaceRange],t);if(0===n.length)return;const o=new Yw(n[0],this._textEdit.text),s=cSe(i),r=s.getTextReplacement(o);let a=this.hint;return!a||(a=a.withEdit(t,s),a)?new e(o,o.removeCommonSuffixAndPrefix(i.getValue()),r,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,this.identity,a):void 0}canBeReused(e,t){const i=this._textEdit.range;return!!i&&i.containsPosition(t)&&this.isVisible(e,t)&&eC.ofRange(i).isGreaterThanOrEqualTo(eC.ofRange(this._originalRange))}isVisible(e,t){return WSe(this.getSingleTextEdit(),this._originalRange,e,t)}},kX=class e extends CX{static create(t,i){const n=BSe(i,t.range,t.insertText),o=new zR(i),s=lC.fromStringEdit(n,o),r=n.isEmpty()?new dC(new mr(1,1,1,1),""):s.toReplacement(o),a=new yX,l=n.replacements.map(e=>{const t=mr.fromPositions(i.getPositionAt(e.replaceRange.start),i.getPositionAt(e.replaceRange.endExclusive)),n=i.getValueInRange(t);return LX.create(e,n)}),d=t.hint?SX.create(t.hint):void 0;return new e(n,r,t.uri,t,a,l,d,!1,i.getVersionId())}constructor(e,t,i,n,o,s,r,a=!1,l){super(n,o,r),this._edit=e,this._textEdit=t,this.uri=i,this._edits=s,this._lastChangePartOfInlineEdit=a,this._inlineEditModelVersion=l,this.snippetInfo=void 0,this.additionalTextEdits=[],this.isInlineEdit=!0}get updatedEditModelVersion(){return this._inlineEditModelVersion}get updatedEdit(){return this._edit}getSingleTextEdit(){return this._textEdit}withIdentity(t){return new e(this._edit,this._textEdit,this.uri,this._data,t,this._edits,this.hint,this._lastChangePartOfInlineEdit,this._inlineEditModelVersion)}canBeReused(e,t){return this._lastChangePartOfInlineEdit&&this.updatedEditModelVersion===e.getVersionId()}withEdit(e,t){return this._applyTextModelChanges(e,this._edits,t)}_applyTextModelChanges(t,i,n){if((i=i.map(e=>e.applyTextModelChanges(t))).some(e=>void 0===e.edit))return;const o=n.getVersionId();let s=this._inlineEditModelVersion;const r=i.some(e=>e.lastChangeUpdatedEdit);if(r&&(s=o??-1),null===o||s+20<o)return;if(0===(i=i.filter(e=>!e.edit.isEmpty)).length)return;const a=new Zw(i.map(e=>e.edit)),l=cSe(n),d=l.getTextEdit(a).toReplacement(new zR(n));let c=this.hint;return!c||(c=c.withEdit(t,l),c)?new e(a,d,this.uri,this._data,this.identity,i,c,r,s):void 0}},LX=class e{static create(t,i){const n=sde(t.newText,i),o=rde(t.newText,i);return new e(t,t.newText.substring(n,t.newText.length-o),n,o)}get edit(){return this._edit}get lastChangeUpdatedEdit(){return this._lastChangeUpdatedEdit}constructor(e,t,i,n,o=!1){this._edit=e,this._trimmedNewText=t,this._prefixLength=i,this._suffixLength=n,this._lastChangeUpdatedEdit=o}applyTextModelChanges(e){const t=this._clone();return t._applyTextModelChanges(e),t}_clone(){return new e(this._edit,this._trimmedNewText,this._prefixLength,this._suffixLength,this._lastChangeUpdatedEdit)}_applyTextModelChanges(e){if(this._lastChangeUpdatedEdit=!1,!this._edit)throw new y("UpdatedInnerEdits: No edit to apply changes to");const t=this._applyChanges(this._edit,e);t?(this._edit=t.edit,this._lastChangeUpdatedEdit=t.editHasChanged):this._edit=void 0}_applyChanges(e,t){let i=e.replaceRange.start,n=e.replaceRange.endExclusive,o=e.newText,s=!1;const r=this._prefixLength>0||this._suffixLength>0;for(let a=t.replacements.length-1;a>=0;a--){const l=t.replacements[a],d=l.newText.length>0&&l.replaceRange.isEmpty;if(d&&!r&&l.replaceRange.start===i&&o.startsWith(l.newText))i+=l.newText.length,o=o.substring(l.newText.length),n=Math.max(i,n),s=!0;else if(d&&r&&l.replaceRange.start===i+this._prefixLength&&this._trimmedNewText.startsWith(l.newText))n+=l.newText.length,s=!0,this._prefixLength+=l.newText.length,this._trimmedNewText=this._trimmedNewText.substring(l.newText.length);else if(0===l.newText.length&&l.replaceRange.length>0&&l.replaceRange.start>=i+this._prefixLength&&l.replaceRange.endExclusive<=n-this._suffixLength)n-=l.replaceRange.length,s=!0;else if(l.equals(e))s=!0,i=l.replaceRange.endExclusive,o="";else if(!(l.replaceRange.start>n)){if(!(l.replaceRange.endExclusive<i))return;i+=l.newText.length-l.replaceRange.length,n+=l.newText.length-l.replaceRange.length}}return 0===this._trimmedNewText.length&&i+this._prefixLength===n-this._suffixLength?{edit:new Yw(new hl(i+this._prefixLength,i+this._prefixLength),""),editHasChanged:!0}:{edit:new Yw(new hl(i,n),o),editHasChanged:s}}},DX=class{constructor(e){this.lines=e,this.tokenization={getLineTokens:e=>this.lines[e-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}},IX=class e{constructor(){this._nodes=new Set,this._outgoingEdges=new Map}static from(t,i){const n=new e;for(const e of t)n._nodes.add(e);for(const e of t){const t=i(e);if(t.length>0){const i=new Set;for(const e of t)i.add(e);n._outgoingEdges.set(e,i)}}return n}removeCycles(){const e=[],t=new Set,i=new Set,n=[],o=s=>{t.add(s),i.add(s);const r=this._outgoingEdges.get(s);if(r)for(const a of r)t.has(a)?i.has(a)&&(e.push(a),n.push({from:s,to:a})):o(a);i.delete(s)};for(const s of this._nodes)t.has(s)||o(s);for(const{from:s,to:r}of n){const e=this._outgoingEdges.get(s);e&&e.delete(r)}return{foundCycles:e}}getOutgoing(e){const t=this._outgoingEdges.get(e);return t?Array.from(t):[]}},function(e){e.Jump="jump",e.Accept="accept",e.Inactive="inactive"}(NX||(NX={})),function(e){e.GhostText="ghostText",e.Custom="custom",e.SideBySide="sideBySide",e.Deletion="deletion",e.InsertionInline="insertionInline",e.InsertionMultiLine="insertionMultiLine",e.WordReplacements="wordReplacements",e.LineReplacement="lineReplacement",e.Collapsed="collapsed"}(EX||(EX={})),MX=class{constructor(e,t,i,n,o,s,r,a,l,d,c,h,u){this.range=e,this.insertText=t,this.snippetInfo=i,this.uri=n,this.hint=o,this.additionalTextEdits=s,this.sourceInlineCompletion=r,this.source=a,this.context=l,this.isInlineEdit=d,this._requestInfo=c,this._providerRequestInfo=h,this._correlationId=u,this._didShow=!1,this._timeUntilShown=void 0,this._showStartTime=void 0,this._shownDuration=0,this._showUncollapsedStartTime=void 0,this._showUncollapsedDuration=0,this._notShownReason=void 0,this._didReportEndOfLife=!1,this._lastSetEndOfLifeReason=void 0,this._isPreceeded=!1,this._partiallyAcceptedCount=0,this._partiallyAcceptedSinceOriginal={characters:0,ratio:0,count:0},this._viewData={editorType:c.editorType}}get showInlineEditMenu(){return this.sourceInlineCompletion.showInlineEditMenu??!1}get partialAccepts(){return this._partiallyAcceptedSinceOriginal}async reportInlineEditShown(e,t,i,n){if(this.updateShownDuration(i),this._didShow)return;this._didShow=!0,this._viewData.viewKind=i,this._viewData.renderData=n,this._timeUntilShown=Date.now()-this._requestInfo.startTime;const o=new Hy(n.lineCountModified,n.lineCountOriginal,n.characterCountModified,n.characterCountOriginal);this.source.provider.handleItemDidShow?.(this.source.inlineSuggestions,this.sourceInlineCompletion,t,o),this.sourceInlineCompletion.shownCommand&&await e.executeCommand(this.sourceInlineCompletion.shownCommand.id,...this.sourceInlineCompletion.shownCommand.arguments||[])}reportPartialAccept(e,t,i){this._partiallyAcceptedCount++,this._partiallyAcceptedSinceOriginal.characters+=i.characters,this._partiallyAcceptedSinceOriginal.ratio=Math.min(this._partiallyAcceptedSinceOriginal.ratio+(1-this._partiallyAcceptedSinceOriginal.ratio)*i.ratio,1),this._partiallyAcceptedSinceOriginal.count+=i.count,this.source.provider.handlePartialAccept?.(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}reportEndOfLife(e){if(!this._didReportEndOfLife&&(this._didReportEndOfLife=!0,this.reportInlineEditHidden(),e||(e=this._lastSetEndOfLifeReason??{kind:vb.Ignored,userTypingDisagreed:!1,supersededBy:void 0}),e.kind===vb.Rejected&&this.source.provider.handleRejection&&this.source.provider.handleRejection(this.source.inlineSuggestions,this.sourceInlineCompletion),this.source.provider.handleEndOfLifetime)){const t={requestUuid:this.context.requestUuid,correlationId:this._correlationId,selectedSuggestionInfo:!!this.context.selectedSuggestionInfo,partiallyAccepted:this._partiallyAcceptedCount,partiallyAcceptedCountSinceOriginal:this._partiallyAcceptedSinceOriginal.count,partiallyAcceptedRatioSinceOriginal:this._partiallyAcceptedSinceOriginal.ratio,partiallyAcceptedCharactersSinceOriginal:this._partiallyAcceptedSinceOriginal.characters,shown:this._didShow,shownDuration:this._shownDuration,shownDurationUncollapsed:this._showUncollapsedDuration,preceeded:this._isPreceeded,timeUntilShown:this._timeUntilShown,timeUntilProviderRequest:this._providerRequestInfo.startTime-this._requestInfo.startTime,timeUntilProviderResponse:this._providerRequestInfo.endTime-this._requestInfo.startTime,editorType:this._viewData.editorType,languageId:this._requestInfo.languageId,requestReason:this._requestInfo.reason,viewKind:this._viewData.viewKind,notShownReason:this._notShownReason,typingInterval:this._requestInfo.typingInterval,typingIntervalCharacterCount:this._requestInfo.typingIntervalCharacterCount,availableProviders:this._requestInfo.availableProviders.map(e=>e.toString()).join(","),...this._viewData.renderData};this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}}setIsPreceeded(e){this._isPreceeded=!0,0===this._partiallyAcceptedSinceOriginal.characters&&0===this._partiallyAcceptedSinceOriginal.ratio&&0===this._partiallyAcceptedSinceOriginal.count||console.warn("Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded."),this._partiallyAcceptedSinceOriginal=e}setNotShownReason(e){this._notShownReason??(this._notShownReason=e)}setEndOfLifeReason(e){this.reportInlineEditHidden(),this._lastSetEndOfLifeReason=e}updateShownDuration(e){const t=Date.now();this._showStartTime||(this._showStartTime=t);const i=e===EX.Collapsed;i||void 0!==this._showUncollapsedStartTime||(this._showUncollapsedStartTime=t),i&&void 0!==this._showUncollapsedStartTime&&(this._showUncollapsedDuration+=t-this._showUncollapsedStartTime)}reportInlineEditHidden(){if(void 0===this._showStartTime)return;const e=Date.now();this._shownDuration+=e-this._showStartTime,this._showStartTime=void 0,void 0!==this._showUncollapsedStartTime&&(this._showUncollapsedDuration+=e-this._showUncollapsedStartTime,this._showUncollapsedStartTime=void 0)}},function(e){e.TextEditor="textEditor",e.DiffEditor="diffEditor",e.Notebook="notebook"}(TX||(TX={})),RX=class{constructor(e,t,i){this.inlineSuggestions=e,this.inlineSuggestionsData=t,this.provider=i,this.refCount=0}addRef(){this.refCount++}removeRef(e={kind:"other"}){if(this.refCount--,0===this.refCount){for(const e of this.inlineSuggestionsData)e.reportEndOfLife();this.provider.disposeInlineCompletions(this.inlineSuggestions,e)}}},AX=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},PX=function(e,t){return function(i,n){t(i,n,e)}},OX=class extends Ie{constructor(e,t,i,n,o,s,r,a,l){super(),this._textModel=e,this._versionId=t,this._debounceValue=i,this._cursorPosition=n,this._languageConfigurationService=o,this._logService=s,this._configurationService=r,this._instantiationService=a,this._contextKeyService=l,this._updateOperation=this._register(new Ne),this._state=function(e,t){let i,n=!1;const o=new en(new Ki(e,void 0,t.update),(e,o)=>{n||(i=t.initial instanceof Function?t.initial():t.initial,n=!0);const s=t.update(e,i,o);return i=s,s},t.changeTracker,()=>{n&&(t.disposeFinal?.(i),n=!1)},t.equalityComparer??Ui,(e,t,s)=>{if(!n)throw new y("Can only set when there is a listener! This is to prevent leaks.");Vce(t,t=>{i=e,o.setValue(e,t,s)})},Hi.ofCaller());return o}(this,{initial:()=>({inlineCompletions:zX.createEmpty(),suggestWidgetInlineCompletions:zX.createEmpty()}),disposeFinal:e=>{e.inlineCompletions.dispose(),e.suggestWidgetInlineCompletions.dispose()},changeTracker:__e(()=>({versionId:this._versionId})),update:(e,t,i)=>{const n=Zw.compose(i.changes.map(e=>e.change?function(e){const t=e.map(e=>new Yw(hl.ofStartAndLength(e.rangeOffset,e.rangeLength),e.text));return t.reverse(),new Zw(t)}(e.change.changes):Zw.empty).filter(ule));if(n.isEmpty())return t;try{return{inlineCompletions:t.inlineCompletions.createStateWithAppliedEdit(n,this._textModel),suggestWidgetInlineCompletions:t.suggestWidgetInlineCompletions.createStateWithAppliedEdit(n,this._textModel)}}finally{t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()}}}),this.inlineCompletions=this._state.map(this,e=>e.inlineCompletions),this.suggestWidgetInlineCompletions=this._state.map(this,e=>e.suggestWidgetInlineCompletions),this._completionsEnabled=void 0,this.clearOperationOnTextModelChange=Dce(this,e=>{this._versionId.read(e),this._updateOperation.clear()}),this._loadingCount=Qce(this,0),this._loggingEnabled=q_e("editor.inlineSuggest.logFetch",!1,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._sendRequestData=q_e("editor.inlineSuggest.emptyResponseInformation",!0,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._structuredFetchLogger=this._register(this._instantiationService.createInstance(hQ.cast(),"editor.inlineSuggest.logFetch.commandId")),this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);const d=Aa.defaultChatAgent?.completionsEnablementSetting??void 0;d&&(this._updateCompletionsEnablement(d),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(d)&&this._updateCompletionsEnablement(d)}))),this._state.recomputeInitiallyAndOnChange(this._store)}_updateCompletionsEnablement(e){const t=this._configurationService.getValue(e);rle(t)?this._completionsEnabled=t:this._completionsEnabled=void 0}_log(e){this._loggingEnabled.get()&&this._logService.info(function(e){return e.sourceId+" @@ "+JSON.stringify({...e,modelUri:e.modelUri?.toString(),sourceId:void 0})}(e)),this._structuredFetchLogger.log(e)}fetch(e,t,i,n,o,s,r){const a=new BX(this._cursorPosition.get(),i,this._textModel.getVersionId(),new Set(e)),l=i.selectedSuggestionInfo?this.suggestWidgetInlineCompletions.get():this.inlineCompletions.get();if(this._updateOperation.value?.request.satisfies(a))return this._updateOperation.value.promise;if(l?.request?.satisfies(a))return Promise.resolve(!0);const d=!!this._updateOperation.value;this._updateOperation.clear();const c=new ot,h=(async()=>{const l=new De;this._loadingCount.set(this._loadingCount.get()+1,void 0);let h=!1;const u=()=>{h||(h=!0,this._loadingCount.set(this._loadingCount.get()-1,void 0))};l.add(new ft(()=>u(),1e4)).schedule();const g=new VX(i,r,e.filter(e=>e.providerId));try{const h=this._debounceValue.get(this._textModel),u=Zpe(e.map(e=>e.debounceDelayMs),(p=Oi,(e,t)=>void 0===e?void 0===t?Ri.neitherLessOrGreaterThan:Ri.lessThan:void 0===t?Ri.greaterThan:p(e,t)))??h;if((d||o&&i.triggerKind===mb.Automatic)&&await uSe(u,c.token),c.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==a.versionId)return g.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"),!1;const m=FX._requestId++;(this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get())&&this._log({sourceId:"InlineCompletions.fetch",kind:"start",requestId:m,modelUri:this._textModel.uri,modelVersion:this._textModel.getVersionId(),context:{triggerKind:i.triggerKind,suggestInfo:!!i.selectedSuggestionInfo||void 0},time:Date.now(),provider:t});const f=new Date,_=HSe(e,this._cursorPosition.get(),this._textModel,i,r,this._languageConfigurationService);zSe(c.token,()=>_.cancelAndDispose({kind:"tokenCancellation"}));let b=!1,v=!1;const w=[];for await(const e of _.lists)if(e){e.addRef(),l.add(Dle(()=>e.removeRef(0===e.inlineSuggestionsData.length?{kind:"empty"}:{kind:"notTaken"})));for(const t of e.inlineSuggestionsData){if(v=!0,!i.includeInlineEdits&&(t.isInlineEdit||t.showInlineEditMenu)){t.setNotShownReason("notInlineEditRequested");continue}if(!i.includeInlineCompletions&&!t.isInlineEdit&&!t.showInlineEditMenu){t.setNotShownReason("notInlineCompletionRequested");continue}const e=wX.create(t,this._textModel);w.push(e),e.isInlineEdit||e.showInlineEditMenu||i.triggerKind!==mb.Automatic||e.isVisible(this._textModel,this._cursorPosition.get())&&(b=!0)}if(b)break}if(_.cancelAndDispose({kind:"lostRace"}),this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get()){const e=_.didAllProvidersReturn;let t;(c.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==a.versionId)&&(t="canceled");const i=w.map(e=>({range:e.editRange.toString(),text:e.insertText,hint:e.hint,isInlineEdit:e.isInlineEdit,showInlineEditMenu:e.showInlineEditMenu,providerId:e.source.provider.providerId?.toString()}));this._log({sourceId:"InlineCompletions.fetch",kind:"end",requestId:m,durationMs:Date.now()-f.getTime(),error:t,result:i,time:Date.now(),didAllProvidersReturn:e})}if(g.setRequestUuid(_.contextWithUuid.requestUuid),v)g.setHasProducedSuggestion(),w.length>0&&c.token.isCancellationRequested&&w.forEach(e=>e.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders"));else if(c.token.isCancellationRequested)g.setNoSuggestionReasonIfNotSet("canceled:whileFetching");else{const e=this._contextKeyService.getContextKeyValue("completionsQuotaExceeded");g.setNoSuggestionReasonIfNotSet(e?"completionsQuotaExceeded":"noSuggestion")}const C=i.earliestShownDateTime-Date.now();if(C>0&&await uSe(C,c.token),c.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==a.versionId||s.get()){const e=c.token.isCancellationRequested?"canceled:afterMinShowDelay":this._store.isDisposed?"canceled:disposed":this._textModel.getVersionId()!==a.versionId?"canceled:documentChanged":s.get()?"canceled:userJumped":"unknown";return w.forEach(t=>t.setNotShownReasonIfNotSet(e)),!1}const y=new Date;this._debounceValue.update(this._textModel,y.getTime()-f.getTime());const S=this._cursorPosition.get();this._updateOperation.clear(),Wce(e=>{const t=this._state.get();i.selectedSuggestionInfo?this._state.set({inlineCompletions:zX.createEmpty(),suggestWidgetInlineCompletions:t.suggestWidgetInlineCompletions.createStateWithAppliedResults(w,a,this._textModel,S,n)},e):this._state.set({inlineCompletions:t.inlineCompletions.createStateWithAppliedResults(w,a,this._textModel,S,n),suggestWidgetInlineCompletions:zX.createEmpty()},e),t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()})}finally{l.dispose(),u(),this.sendInlineCompletionsRequestTelemetry(g)}var p;return!0})(),u=new HX(a,c,h);return this._updateOperation.value=u,h}clear(e){this._updateOperation.clear();const t=this._state.get();this._state.set({inlineCompletions:zX.createEmpty(),suggestWidgetInlineCompletions:zX.createEmpty()},e),t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()}seedInlineCompletionsWithSuggestWidget(){const e=this.inlineCompletions.get(),t=this.suggestWidgetInlineCompletions.get();t&&Wce(i=>{if(!e||(t.request?.versionId??-1)>(e.request?.versionId??-1)){e?.dispose();const n=this._state.get();this._state.set({inlineCompletions:t.clone(),suggestWidgetInlineCompletions:zX.createEmpty()},i),n.inlineCompletions.dispose(),n.suggestWidgetInlineCompletions.dispose()}this.clearSuggestWidgetInlineCompletions(i)})}sendInlineCompletionsRequestTelemetry(e){if(!this._sendRequestData.get()&&!this._contextKeyService.getContextKeyValue("isRunningUnificationExperiment"))return;if(void 0===e.requestUuid||e.hasProducedSuggestion)return;if(!function(e,t="*"){return void 0!==e&&(void 0!==e[t]?Boolean(e[t]):Boolean(e["*"]))}(this._completionsEnabled,this._textModel.getLanguageId()))return;if(!e.providers.some(e=>ySe(e.providerId?.extensionId)))return;const t={opportunityId:e.requestUuid,noSuggestionReason:e.noSuggestionReason??"unknown",extensionId:"vscode-core",extensionVersion:"0.0.0",groupId:"empty",shown:!1,editorType:e.requestInfo.editorType,requestReason:e.requestInfo.reason,typingInterval:e.requestInfo.typingInterval,typingIntervalCharacterCount:e.requestInfo.typingIntervalCharacterCount,languageId:e.requestInfo.languageId,selectedSuggestionInfo:!!e.context.selectedSuggestionInfo,availableProviders:e.providers.map(e=>e.providerId?.toString()).filter(ule).join(","),...(i=e.providers.some(e=>ySe(e.providerId?.extensionId)),{[eX]:i}),timeUntilProviderRequest:void 0,timeUntilProviderResponse:void 0,viewKind:void 0,preceeded:void 0,superseded:void 0,reason:void 0,correlationId:void 0,shownDuration:void 0,shownDurationUncollapsed:void 0,timeUntilShown:void 0,partiallyAccepted:void 0,partiallyAcceptedCountSinceOriginal:void 0,partiallyAcceptedRatioSinceOriginal:void 0,partiallyAcceptedCharactersSinceOriginal:void 0,cursorColumnDistance:void 0,cursorLineDistance:void 0,lineCountOriginal:void 0,lineCountModified:void 0,characterCountOriginal:void 0,characterCountModified:void 0,disjointReplacements:void 0,sameShapeReplacements:void 0,notShownReason:void 0};var i,n,o;n=this._instantiationService.createInstance(JQ),o=t,n.publicLog2("inlineCompletion.endOfLife",o)}clearSuggestWidgetInlineCompletions(e){this._updateOperation.value?.request.context.selectedSuggestionInfo&&this._updateOperation.clear()}cancelUpdate(){this._updateOperation.clear()}},FX=OX,OX._requestId=0,WX=OX,WX=FX=AX([PX(4,il),PX(5,Ks),PX(6,ka),PX(7,Jn),PX(8,es)],WX),BX=class{constructor(e,t,i,n){this.position=e,this.context=t,this.versionId=i,this.providers=n}satisfies(e){return this.position.equals(e.position)&&Cce(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(e,t)=>e.equals(t))&&(e.context.triggerKind===mb.Automatic||this.context.triggerKind===mb.Explicit)&&this.versionId===e.versionId&&(t=e.providers,i=this.providers,[...t].every(e=>i.has(e)));var t,i}},VX=class{constructor(e,t,i){this.context=e,this.requestInfo=t,this.providers=i,this.hasProducedSuggestion=!1}setRequestUuid(e){this.requestUuid=e}setNoSuggestionReasonIfNotSet(e){this.noSuggestionReason??(this.noSuggestionReason=e)}setHasProducedSuggestion(){this.hasProducedSuggestion=!0}},HX=class{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}},zX=class e extends Ie{static createEmpty(){return new e([],void 0)}constructor(e,t){for(const i of e)i.addRef();super(),this.inlineCompletions=e,this.request=t,this._register({dispose:()=>{for(const e of this.inlineCompletions)e.removeRef()}})}_findById(e){return this.inlineCompletions.find(t=>t.identity===e)}_findByHash(e){return this.inlineCompletions.find(t=>t.hash===e)}createStateWithAppliedEdit(t,i){return new e(this.inlineCompletions.map(e=>e.withEdit(t,i)).filter(ule),this.request)}createStateWithAppliedResults(t,i,n,o,s){let r;if(s){const e=this._findById(s);if(e&&e.canBeReused(n,i.position)){r=e;const i=t.find(t=>t.hash===e.hash);t=i?function(e,t){const i=t.indexOf(e);return i>-1?[e,...t.slice(0,i),...t.slice(i+1)]:t}(i,t):[e,...t]}}const a=r?!r.isInlineEdit:t.some(e=>!e.isInlineEdit&&e.isVisible(n,o));let l=[];for(const e of t){const t=this._findByHash(e.hash);let i;t&&t!==e?(i=e.withIdentity(t.identity),e.setIsPreceeded(t),t.setEndOfLifeReason({kind:vb.Ignored,userTypingDisagreed:!1,supersededBy:e.getSourceCompletion()})):i=e,a!==i.isInlineEdit&&l.push(i)}return l.sort(fce(e=>e.showInlineEditMenu,Ai)),l=function(e,t){const i=new Set;return e.filter(e=>{const n=t(e);return!i.has(n)&&(i.add(n),!0)})}(l,e=>e.semanticId),new e(l,i)}clone(){return new e(this.inlineCompletions,this.request)}},UX=class{constructor(e,t,i){this.edit=e,this.commands=t,this.inlineCompletion=i}equals(e){return this.edit.equals(e.edit)&&this.inlineCompletion===e.inlineCompletion}},KX=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},qX=function(e,t){return function(i,n){t(i,n,e)}},jX=eue("IInlineCompletionsService"),$X=new Jo("inlineCompletions.snoozed",!1,Vae(79,"Whether inline completions are currently snoozed")),GX=class extends Ie{get snoozeTimeLeft(){return void 0===this._snoozeTimeEnd?0:Math.max(0,this._snoozeTimeEnd-Date.now())}constructor(e,t){super(),this._contextKeyService=e,this._telemetryService=t,this._onDidChangeIsSnoozing=this._register(new je),this.onDidChangeIsSnoozing=this._onDidChangeIsSnoozing.event,this._snoozeTimeEnd=void 0,this._recentCompletionIds=[],this._timer=this._register(new pt);const i=$X.bindTo(this._contextKeyService);this._register(this.onDidChangeIsSnoozing(()=>i.set(this.isSnoozing())))}setSnoozeDuration(e){if(e<0)throw new y(`Invalid snooze duration: ${e}. Duration must be non-negative.`);if(0===e)return void this.cancelSnooze();const t=this.isSnoozing(),i=this.snoozeTimeLeft;this._snoozeTimeEnd=Date.now()+e,t||this._onDidChangeIsSnoozing.fire(!0),this._timer.cancelAndSet(()=>{if(this.isSnoozing())throw new y("Snooze timer did not fire as expected");this._onDidChangeIsSnoozing.fire(!1)},this.snoozeTimeLeft+1),this._reportSnooze(e-i,e)}isSnoozing(){return this.snoozeTimeLeft>0}cancelSnooze(){this.isSnoozing()&&(this._reportSnooze(-this.snoozeTimeLeft,0),this._snoozeTimeEnd=void 0,this._timer.cancel(),this._onDidChangeIsSnoozing.fire(!1))}reportNewCompletion(e){this._lastCompletionId=e,this._recentCompletionIds.unshift(e),this._recentCompletionIds.length>5&&this._recentCompletionIds.pop()}_reportSnooze(e,t){const i=Math.round(e/1e3),n=Math.round(t/1e3);this._telemetryService.publicLog2("inlineCompletions.snooze",{deltaSeconds:i,totalSeconds:n,lastCompletionId:this._lastCompletionId,recentCompletionIds:this._recentCompletionIds})}},GX=KX([qX(0,es),qX(1,fs)],GX),dge(jX,GX,1),ZX="inlineCompletions.lastSnoozeDuration",(YX=class e extends ms{constructor(){super({id:e.ID,title:zae(81,"Snooze Inline Suggestions"),precondition:Po.true(),f1:!0})}async run(e,...t){const i=e.get(tA),n=e.get(jX),o=e.get(eR);let s;t.length>0&&"number"==typeof t[0]&&(s=6e4*t[0]),s||(s=await this.getDurationFromUser(i,o)),s&&n.setSnoozeDuration(s)}async getDurationFromUser(e,t){const i=t.getNumber(ZX,0,3e5),n=[{label:"1 minute",id:"1",value:6e4},{label:"5 minutes",id:"5",value:3e5},{label:"10 minutes",id:"10",value:6e5},{label:"15 minutes",id:"15",value:9e5},{label:"30 minutes",id:"30",value:18e5},{label:"60 minutes",id:"60",value:36e5}],o=await e.pick(n,{placeHolder:Vae(80,"Select snooze duration for Inline Suggestions"),activeItem:n.find(e=>e.value===i)});if(o)return t.store(ZX,o.value,0,0),o.value}}).ID="editor.action.inlineSuggest.snooze",(QX=class e extends ms{constructor(){super({id:e.ID,title:zae(82,"Cancel Snooze Inline Suggestions"),precondition:$X,f1:!0})}async run(e){e.get(jX).cancelSnooze()}}).ID="editor.action.inlineSuggest.cancelSnooze",JX=class e extends Ie{getTypingInterval(){return(this._cacheInvalidated||null===this._cachedTypingIntervalResult)&&(this._cachedTypingIntervalResult=this._calculateTypingInterval(),this._cacheInvalidated=!1),this._cachedTypingIntervalResult}constructor(e){super(),this._textModel=e,this._typingSessions=[],this._currentSession=null,this._lastChangeTime=0,this._cachedTypingIntervalResult=null,this._cacheInvalidated=!0,this._register(this._textModel.onDidChangeContent(e=>this._updateTypingSpeed(e)))}_updateTypingSpeed(t){const i=Date.now();this._isUserTyping(t)?(this._currentSession&&i-this._lastChangeTime>e.MAX_SESSION_GAP_MS&&this._finalizeCurrentSession(),this._currentSession||(this._currentSession={startTime:i,endTime:i,characterCount:0}),this._currentSession.endTime=i,this._currentSession.characterCount+=this._getActualCharacterCount(t),this._lastChangeTime=i,this._cacheInvalidated=!0):this._finalizeCurrentSession()}_getActualCharacterCount(e){let t=0;for(const i of e.changes)t+=Math.max(i.text.length,i.rangeLength);return t}_isUserTyping(e){if(!e.detailedReasons||0===e.detailedReasons.length)return!1;for(const t of e.detailedReasons)if(this._isUserTypingReason(t))return!0;return!1}_isUserTypingReason(e){if(e.metadata.isUndoing||e.metadata.isRedoing)return!1;if("cursor"===e.metadata.source){const t=e.metadata.kind;return"type"===t||"compositionType"===t||"compositionEnd"===t}return!1}_finalizeCurrentSession(){this._currentSession&&(this._currentSession.endTime-this._currentSession.startTime>=e.MIN_SESSION_DURATION_MS&&this._currentSession.characterCount>0&&(this._typingSessions.push(this._currentSession),this._typingSessions.length>e.SESSION_HISTORY_LIMIT&&this._typingSessions.shift()),this._currentSession=null)}_calculateTypingInterval(){if(this._currentSession){const t={...this._currentSession};if(t.endTime-t.startTime>=e.MIN_SESSION_DURATION_MS&&t.characterCount>0){const e=[...this._typingSessions,t];return this._calculateSpeedFromSessions(e)}}return this._calculateSpeedFromSessions(this._typingSessions)}_calculateSpeedFromSessions(t){if(0===t.length)return{averageInterval:0,characterCount:0};const i=[...t].sort((e,t)=>t.endTime-e.endTime),n=Date.now()-e.TYPING_SPEED_WINDOW_MS,o=i.filter(e=>e.endTime>n),s=i.splice(o.length);let r=bce(o.map(e=>e.characterCount));for(let d=0;d<s.length&&r<e.MIN_CHARS_FOR_RELIABLE_SPEED;d++)o.push(s[d]),r+=s[d].characterCount;const a=bce(o.map(e=>e.endTime-e.startTime));if(0===a||r<=1)return{averageInterval:0,characterCount:r};const l=a/Math.max(1,r-1);return{averageInterval:Math.round(l),characterCount:r}}dispose(){this._finalizeCurrentSession(),super.dispose()}},(XX=JX).MAX_SESSION_GAP_MS=3e3,XX.MIN_SESSION_DURATION_MS=1e3,XX.SESSION_HISTORY_LIMIT=50,XX.TYPING_SPEED_WINDOW_MS=3e5,XX.MIN_CHARS_FOR_RELIABLE_SPEED=20,eJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},tJ=function(e,t){return function(i,n){t(i,n,e)}},iJ=class extends Ie{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,o,s,r,a,l,d,c,h,u,g){super(),this.textModel=e,this._selectedSuggestItem=t,this._textModelVersionId=i,this._positions=n,this._debounceValue=o,this._enabled=s,this._editor=r,this._instantiationService=a,this._commandService=l,this._languageConfigurationService=d,this._accessibilityService=c,this._languageFeaturesService=h,this._codeEditorService=u,this._inlineCompletionsService=g,this._isActive=Qce(this,!1),this._onlyRequestInlineEditsSignal=t_e(this),this._forceUpdateExplicitlySignal=t_e(this),this._noDelaySignal=t_e(this),this._fetchSpecificProviderSignal=t_e(this),this._selectedInlineCompletionId=Qce(this,void 0),this.primaryPosition=Dce(this,e=>this._positions.read(e)[0]??new to(1,1)),this.allPositions=Dce(this,e=>this._positions.read(e)),this._isAcceptingPartially=!1,this._appearedInsideViewport=Dce(this,e=>{const t=this.state.read(e);return!(!t||!t.inlineCompletion)&&function(e,t){const i=t.targetRange,n=e.getVisibleRanges();return!(n.length<1)&&new mr(n[0].startLineNumber,n[0].startColumn,n[n.length-1].endLineNumber,n[n.length-1].endColumn).containsRange(i)}(this._editor,t.inlineCompletion)}),this._onDidAccept=new je,this.onDidAccept=this._onDidAccept.event,this._lastShownInlineCompletionInfo=void 0,this._lastAcceptedInlineCompletionInfo=void 0,this._didUndoInlineEdits=Ece({owner:this,changeTracker:{createChangeSummary:()=>({didUndo:!1}),handleChange:(e,t)=>(t.didUndo=e.didChange(this._textModelVersionId)&&!!e.change?.isUndoing,!0)}},(e,t)=>{const i=this._textModelVersionId.read(e);return!!(null!==i&&this._lastAcceptedInlineCompletionInfo&&this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter===i-1&&this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit&&t.didUndo)&&(this._lastAcceptedInlineCompletionInfo=void 0,!0)}),this._preserveCurrentCompletionReasons=new Set([nJ.Redo,nJ.Undo,nJ.AcceptWord]),this.dontRefetchSignal=t_e(this),this._fetchInlineCompletionsPromise=Ece({owner:this,changeTracker:{createChangeSummary:()=>({dontRefetch:!1,preserveCurrentCompletion:!1,inlineCompletionTriggerKind:mb.Automatic,onlyRequestInlineEdits:!1,shouldDebounce:!0,provider:void 0,textChange:!1,changeReason:""}),handleChange:(e,t)=>{if(e.didChange(this._textModelVersionId)){this._preserveCurrentCompletionReasons.has(this._getReason(e.change))&&(t.preserveCurrentCompletion=!0);const i=e.change?.detailedReasons??[];t.changeReason=i.length>0?i[0].getType():"",t.textChange=!0}else e.didChange(this._forceUpdateExplicitlySignal)?(t.preserveCurrentCompletion=!0,t.inlineCompletionTriggerKind=mb.Explicit):e.didChange(this.dontRefetchSignal)?t.dontRefetch=!0:e.didChange(this._onlyRequestInlineEditsSignal)?t.onlyRequestInlineEdits=!0:e.didChange(this._fetchSpecificProviderSignal)&&(t.provider=e.change);return!0}}},(e,t)=>{if(this._source.clearOperationOnTextModelChange.read(e),this._noDelaySignal.read(e),this.dontRefetchSignal.read(e),this._onlyRequestInlineEditsSignal.read(e),this._forceUpdateExplicitlySignal.read(e),this._fetchSpecificProviderSignal.read(e),!(this._enabled.read(e)&&this._selectedSuggestItem.read(e)||this._isActive.read(e))||this._inlineCompletionsService.isSnoozing()&&t.inlineCompletionTriggerKind!==mb.Explicit)return void this._source.cancelUpdate();this._textModelVersionId.read(e);const i=this._source.suggestWidgetInlineCompletions.read(void 0);let n=this._selectedSuggestItem.read(e);if(this._shouldShowOnSuggestConflict.read(void 0)&&(n=void 0),i&&!n&&this._source.seedInlineCompletionsWithSuggestWidget(),t.dontRefetch)return Promise.resolve(!0);if(this._didUndoInlineEdits.read(e)&&t.inlineCompletionTriggerKind!==mb.Explicit)return void Wce(e=>{this._source.clear(e)});let o="";t.provider?o+="providerOnDidChange":t.inlineCompletionTriggerKind===mb.Explicit&&(o+="explicit"),t.changeReason&&(o+=o.length>0?`:${t.changeReason}`:t.changeReason);const s=this._typing.getTypingInterval(),r={editorType:this.editorType,startTime:Date.now(),languageId:this.textModel.getLanguageId(),reason:o,typingInterval:s.averageInterval,typingIntervalCharacterCount:s.characterCount,availableProviders:[]};let a={triggerKind:t.inlineCompletionTriggerKind,selectedSuggestionInfo:n?.toSelectedSuggestionInfo(),includeInlineCompletions:!t.onlyRequestInlineEdits,includeInlineEdits:this._inlineEditsEnabled.read(e),requestIssuedDateTime:r.startTime,earliestShownDateTime:r.startTime+(t.inlineCompletionTriggerKind===mb.Explicit||this.inAcceptFlow.read(void 0)?0:this._minShowDelay.read(void 0))};a.triggerKind===mb.Automatic&&t.textChange&&this.textModel.getAlternativeVersionId()===this._lastShownInlineCompletionInfo?.alternateTextModelVersionId&&(a={...a,includeInlineCompletions:!this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,includeInlineEdits:this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit});const l=this.selectedInlineCompletion.read(void 0)??this._inlineCompletionItems.read(void 0)?.inlineEdit,d=t.preserveCurrentCompletion||l?.forwardStable?l:void 0,c=this._jumpedToId.map(e=>!!e&&e===this._inlineCompletionItems.read(void 0)?.inlineEdit?.semanticId),h=t.provider?{providers:[t.provider],label:"single:"+t.provider.providerId?.toString()}:{providers:this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel),label:void 0},u=this.getAvailableProviders(h.providers);return r.availableProviders=u.map(e=>e.providerId).filter(ule),this._source.fetch(u,h.label,a,d?.identity,t.shouldDebounce,c,r)}),this._inlineCompletionItems=Nce({owner:this},e=>{const t=this._source.inlineCompletions.read(e);if(!t)return;const i=this.primaryPosition.read(e);let n;const o=[];for(const s of t.inlineCompletions)s.isInlineEdit?n=s:s.isVisible(this.textModel,i)&&o.push(s);return 0!==o.length&&(n=void 0),{inlineCompletions:o,inlineEdit:n}}),this._filteredInlineCompletionItems=Nce({owner:this,equalsFn:wce()},e=>this._inlineCompletionItems.read(e)?.inlineCompletions??[]),this.selectedInlineCompletionIndex=Dce(this,e=>{const t=this._selectedInlineCompletionId.read(e),i=this._filteredInlineCompletionItems.read(e),n=void 0===this._selectedInlineCompletionId?-1:i.findIndex(e=>e.semanticId===t);return-1===n?(this._selectedInlineCompletionId.set(void 0,void 0),0):n}),this.selectedInlineCompletion=Dce(this,e=>this._filteredInlineCompletionItems.read(e)[this.selectedInlineCompletionIndex.read(e)]),this.activeCommands=Nce({owner:this,equalsFn:wce()},e=>this.selectedInlineCompletion.read(e)?.source.inlineSuggestions.commands??[]),this.inlineCompletionsCount=Dce(this,e=>this.lastTriggerKind.read(e)===mb.Explicit?this._filteredInlineCompletionItems.read(e).length:void 0),this._hasVisiblePeekWidgets=Dce(this,e=>this._editorObs.openedPeekWidgets.read(e)>0),this._shouldShowOnSuggestConflict=Dce(this,e=>{const t=this._showOnSuggestConflict.read(e);if("never"!==t&&this.selectedInlineCompletion.read(e)){const i=this._selectedSuggestItem.read(e);return!!i&&("whenSuggestListIsIncomplete"!==t||i.listIncomplete)}return!1}),this.state=Nce({owner:this,equalsFn:(e,t)=>e&&t?"ghostText"===e.kind&&"ghostText"===t.kind?mSe(e.ghostTexts,t.ghostTexts)&&e.inlineCompletion===t.inlineCompletion&&e.suggestItem===t.suggestItem:"inlineEdit"===e.kind&&"inlineEdit"===t.kind&&e.inlineEdit.equals(t.inlineEdit):e===t},e=>{const t=this.textModel;if(this._suppressInSnippetMode.read(e)&&this._isInSnippetMode.read(e))return;const i=this._inlineCompletionItems.read(e),n=i?.inlineEdit;if(n){if(this._hasVisiblePeekWidgets.read(e))return;let o=n.getSingleTextEdit();o=_Se(o,t);const s=this.primaryPosition.map(e=>Qw.fromRangeInclusive(n.targetRange).addMargin(1,1).contains(e.lineNumber)),r=n.source.inlineSuggestions.commands,a=new UX(o,r??[],n),l=n.updatedEdit;return{kind:"inlineEdit",inlineEdit:a,inlineCompletion:n,edits:l?lC.fromStringEdit(l,new zR(this.textModel)).replacements:[o],cursorAtInlineEdit:s,nextEditUri:"vscode.open"!==i.inlineEdit?.command?.id&&"_workbench.open"!==i.inlineEdit?.command?.id||!i.inlineEdit?.command.arguments?.length?void 0:_i.from(i.inlineEdit?.command.arguments[0])}}const o=this._selectedSuggestItem.read(e);if(!this._shouldShowOnSuggestConflict.read(e)&&o){const i=_Se(o.getSingleTextEdit(),t),n=this._computeAugmentation(i,e);if(!this._suggestPreviewEnabled.read(e)&&!n)return;const s=n?.edit??i,r=n?n.edit.text.length-i.text.length:0,a=this._suggestPreviewMode.read(e),l=this._positions.read(e),d=[s,...qSe(this.textModel,l,s)].map((e,i)=>({edit:e,ghostText:e?vSe(e,t,a,l[i],r):void 0})).filter(({edit:e,ghostText:t})=>void 0!==e&&void 0!==t),c=d.map(({edit:e})=>e),h=d.map(({ghostText:e})=>e);return{kind:"ghostText",edits:c,primaryGhostText:h[0]??new jQ(s.range.endLineNumber,[]),ghostTexts:h,inlineCompletion:n?.completion,suggestItem:o}}{if(!this._isActive.read(e))return;const i=this.selectedInlineCompletion.read(e);if(!i)return;const n=i.getSingleTextEdit(),o=this._inlineSuggestMode.read(e),s=this._positions.read(e),r=[n,...qSe(this.textModel,s,n)].map((e,i)=>({edit:e,ghostText:e?vSe(e,t,o,s[i],0):void 0})).filter(({edit:e,ghostText:t})=>void 0!==e&&void 0!==t),a=r.map(({edit:e})=>e),l=r.map(({ghostText:e})=>e);if(!l[0])return;return{kind:"ghostText",edits:a,primaryGhostText:l[0],ghostTexts:l,inlineCompletion:i,suggestItem:void 0}}}),this.inlineCompletionState=Dce(this,e=>{const t=this.state.read(e);if(t&&"ghostText"===t.kind&&!this._editorObs.inComposition.read(e))return t}),this.inlineEditState=Dce(this,e=>{const t=this.state.read(e);if(t&&"inlineEdit"===t.kind)return t}),this.inlineEditAvailable=Dce(this,e=>!!this.inlineEditState.read(e)),this.warning=Dce(this,e=>this.inlineCompletionState.read(e)?.inlineCompletion?.warning),this.ghostTexts=Nce({owner:this,equalsFn:mSe},e=>{const t=this.inlineCompletionState.read(e);if(t)return t.ghostTexts}),this.primaryGhostText=Nce({owner:this,equalsFn:fSe},e=>{const t=this.inlineCompletionState.read(e);if(t)return t?.primaryGhostText}),this.showCollapsed=Dce(this,e=>{const t=this.state.read(e);if(!t||"inlineEdit"!==t.kind)return!1;if(t.inlineCompletion.hint)return!1;const i=t.inlineCompletion.updatedEditModelVersion===this._textModelVersionId.read(e);return(this._inlineEditsShowCollapsedEnabled.read(e)||!i)&&this._jumpedToId.read(e)!==t.inlineCompletion.semanticId&&!this._inAcceptFlow.read(e)}),this._tabShouldIndent=Dce(this,e=>!this._inAcceptFlow.read(e)&&this._editorObs.selections.read(e)?.some(e=>e.isEmpty()?0===this.textModel.getLineLength(e.startLineNumber):function(e){return e.startLineNumber!==e.endLineNumber}(e)||e.containsRange(function(e,t){const i=e.getLineIndentColumn(t),n=e.getLineLastNonWhitespaceColumn(t);return new mr(t,i,t,Math.max(n,i))}(this.textModel,e.startLineNumber)))),this.tabShouldJumpToInlineEdit=Dce(this,e=>{if(this._tabShouldIndent.read(e))return!1;const t=this.inlineEditState.read(e);return!(!t||!this.showCollapsed.read(e)&&(this._inAcceptFlow.read(e)&&this._appearedInsideViewport.read(e)&&!t.inlineCompletion.hint?.jumpToEdit||t.cursorAtInlineEdit.read(e)))}),this.tabShouldAcceptInlineEdit=Dce(this,e=>{const t=this.inlineEditState.read(e);return!!t&&!this.showCollapsed.read(e)&&!this._tabShouldIndent.read(e)&&(!(!this._inAcceptFlow.read(e)||!this._appearedInsideViewport.read(e)||t.inlineCompletion.hint?.jumpToEdit)||t.inlineCompletion.targetRange.startLineNumber===this._editorObs.cursorLineNumber.read(e)||this._jumpedToId.read(e)===t.inlineCompletion.semanticId||t.cursorAtInlineEdit.read(e))}),this._jumpedToId=Qce(this,void 0),this._inAcceptFlow=Qce(this,!1),this.inAcceptFlow=this._inAcceptFlow,this._source=this._register(this._instantiationService.createInstance(WX,this.textModel,this._textModelVersionId,this._debounceValue,this.primaryPosition)),this.lastTriggerKind=this._source.inlineCompletions.map(this,e=>e?.request?.context.triggerKind),this._editorObs=bwe(this._editor);const p=this._editorObs.getOption(134);this._suggestPreviewEnabled=p.map(e=>e.preview),this._suggestPreviewMode=p.map(e=>e.previewMode);const m=this._editorObs.getOption(71);this._inlineSuggestMode=m.map(e=>e.mode),this._suppressedInlineCompletionGroupIds=m.map(e=>new Set(e.experimental.suppressInlineSuggestions.split(","))),this._inlineEditsEnabled=m.map(e=>!!e.edits.enabled),this._inlineEditsShowCollapsedEnabled=m.map(e=>e.edits.showCollapsed),this._triggerCommandOnProviderChange=m.map(e=>e.triggerCommandOnProviderChange),this._minShowDelay=m.map(e=>e.minShowDelay),this._showOnSuggestConflict=m.map(e=>e.experimental.showOnSuggestConflict),this._suppressInSnippetMode=m.map(e=>e.suppressInSnippetMode),this._isInSnippetMode=FQ.get(this._editor)?.isInSnippetObservable??z_e(!1),this._typing=this._register(new JX(this.textModel)),this._register(this._inlineCompletionsService.onDidChangeIsSnoozing(e=>{e&&this.stop()}));{const e="vscode-notebook-cell"===this.textModel.uri.scheme,[t]=this._codeEditorService.listDiffEditors().filter(e=>e.getOriginalEditor().getId()===this._editor.getId()||e.getModifiedEditor().getId()===this._editor.getId());this.isInDiffEditor=!!t,this.editorType=e?TX.Notebook:this.isInDiffEditor?TX.DiffEditor:TX.TextEditor}this._register(Kce(this.state,e=>{e&&e.inlineCompletion&&this._inlineCompletionsService.reportNewCompletion(e.inlineCompletion.requestUuid)})),this._register(Kce(this._fetchInlineCompletionsPromise)),this._register(Rce(e=>{this._editorObs.versionId.read(e),this._inAcceptFlow.set(!1,void 0)})),this._register(Rce(e=>{this.state.map((e,t)=>!e||"inlineEdit"===e.kind&&!e.cursorAtInlineEdit.read(t)).read(e)&&this._jumpedToId.set(void 0,void 0)}));const f=this.inlineEditState.map(e=>e?.inlineCompletion.semanticId);this._register(Rce(e=>{f.read(e)&&(this._editor.pushUndoStop(),this._lastShownInlineCompletionInfo={alternateTextModelVersionId:this.textModel.getAlternativeVersionId(),inlineCompletion:this.state.get().inlineCompletion})})),jce(this,Hce(this._languageFeaturesService.inlineCompletionsProvider.onDidChange,()=>this._languageFeaturesService.inlineCompletionsProvider.all(e)),(e,t)=>{e.onDidChangeInlineCompletions&&t.add(e.onDidChangeInlineCompletions(()=>{if(!this._enabled.get())return;if((this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor())!==this._editor)return;if(this._triggerCommandOnProviderChange.get())return void this.trigger(void 0,{onlyFetchInlineEdits:!0});const t=this.state.get();t&&(t.inlineCompletion||t.edits)&&t.inlineCompletion?.source.provider!==e||Wce(t=>{this._fetchSpecificProviderSignal.trigger(t,e),this.trigger(t)})}))}).recomputeInitiallyAndOnChange(this._store),this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store)}getIndentationInfo(e){let t=!1,i=!0;const n=this?.primaryGhostText.read(e);if(this?._selectedSuggestItem&&n&&n.parts.length>0){const{column:e,lines:o}=n.parts[0],s=o[0].line;if(e<=this.textModel.getLineIndentColumn(n.lineNumber)){let e=jle(s);-1===e&&(e=s.length-1),t=e>0;const n=this.textModel.getOptions().tabSize;i=br.visibleColumnFromColumn(s,e+1,n)<n}}return{startsWithIndentation:t,startsWithIndentationLessThanTabSize:i}}_getReason(e){return e?.isUndoing?nJ.Undo:e?.isRedoing?nJ.Redo:this.isAcceptingPartially?nJ.AcceptWord:nJ.Other}getAvailableProviders(e){const t=this._suppressedInlineCompletionGroupIds.get(),i=e.filter(e=>!(e.groupId&&t.has(e.groupId))),n=new Set;for(const s of i)s.excludesGroupIds?.forEach(e=>n.add(e));const o=[];for(const s of i)s.groupId&&n.has(s.groupId)||o.push(s);return o}async trigger(e,t={}){Vce(e,e=>{t.onlyFetchInlineEdits&&this._onlyRequestInlineEditsSignal.trigger(e),t.noDelay&&this._noDelaySignal.trigger(e),this._isActive.set(!0,e),t.explicit&&(this._inAcceptFlow.set(!0,e),this._forceUpdateExplicitlySignal.trigger(e)),t.provider&&this._fetchSpecificProviderSignal.trigger(e,t.provider)}),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e,t=!1){return this.trigger(e,{onlyFetchInlineEdits:t,explicit:!0})}stop(e="automatic",t){Vce(t,t=>{if("explicitCancel"===e){const e=this.state.get()?.inlineCompletion;e&&e.reportEndOfLife({kind:vb.Rejected})}this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentation(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t);return function(e,t){for(const i of e){const e=t(i);if(void 0!==e)return e}}(n?n.inlineCompletions.filter(e=>!e.isInlineEdit):[this.selectedInlineCompletion.read(t)].filter(ule),t=>{let n=t.getSingleTextEdit();return n=_Se(n,i,mr.fromPositions(n.range.getStartPosition(),e.range.getEndPosition())),bSe(n,e)?{completion:t,edit:n}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}_getMetadata(e,t,i=void 0){return i?Vy.inlineCompletionPartialAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t,type:i}):Vy.inlineCompletionAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t})}async accept(e=this._editor){if(e.getModel()!==this.textModel)throw new y;let t,i=!1;const n=this.state.get();if("ghostText"===n?.kind){if(!n||n.primaryGhostText.isEmpty()||!n.inlineCompletion)return;t=n.inlineCompletion}else{if("inlineEdit"!==n?.kind)return;t=n.inlineCompletion,i=!!n.nextEditUri}t.addRef();try{if(e.pushUndoStop(),i);else if(t.snippetInfo){const i=dC.delete(t.editRange),n=t.additionalTextEdits.map(e=>new dC(mr.lift(e.range),e.text??"")),o=lC.fromParallelReplacementsUnsorted([i,...n]);e.edit(o,this._getMetadata(t,this.textModel.getLanguageId())),e.setPosition(t.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),FQ.get(e)?.insert(t.snippetInfo.snippet,{undoStopBefore:!1})}else{const i=n.edits;let o=i;"ghostText"===n.kind&&(o=function(e,t){const i=cSe(t),n=t.getValue();return e.map(e=>i.getStringReplacement(e)).map(e=>e.removeCommonSuffixPrefix(n)).map(e=>i.getTextReplacement(e))}(i,this.textModel));const s=hSe(o).map(e=>fr.fromPositions(e)),r=t.additionalTextEdits.map(e=>new dC(mr.lift(e.range),e.text??"")),a=lC.fromParallelReplacementsUnsorted([...i,...r]);if(e.edit(a,this._getMetadata(t,this.textModel.getLanguageId())),void 0===t.hint&&e.setSelections("inlineEdit"===n.kind?s.slice(-1):s,"inlineCompletionAccept"),"inlineEdit"===n.kind&&!this._accessibilityService.isMotionReduced()){const t=a.getNewRanges(),i=this._store.add(new oJ(e,t,()=>{this._store.delete(i)}))}}this._onDidAccept.fire(),this.stop(),t.command&&await this._commandService.executeCommand(t.command.id,...t.command.arguments||[]).then(void 0,Gae),t.reportEndOfLife({kind:vb.Accepted})}finally{t.removeRef(),this._inAcceptFlow.set(!0,void 0),this._lastAcceptedInlineCompletionInfo={textModelVersionIdAfter:this.textModel.getVersionId(),inlineCompletion:t}}}async acceptNextWord(){await this._acceptNext(this._editor,"word",(e,t)=>{const i=this.textModel.getLanguageIdAtPosition(e.lineNumber,e.column),n=this._languageConfigurationService.getLanguageConfiguration(i),o=new RegExp(n.wordDefinition.source,n.wordDefinition.flags.replace("g","")),s=t.match(o);let r=0;r=s&&void 0!==s.index?0===s.index?s[0].length:s.index:t.length;const a=/\s+/g.exec(t);return a&&void 0!==a.index&&a.index+a[0].length<r&&(r=a.index+a[0].length),r},0)}async acceptNextLine(){await this._acceptNext(this._editor,"line",(e,t)=>{const i=t.match(/\n/);return i&&void 0!==i.index?i.index+1:t.length},1)}async _acceptNext(e,t,i,n){if(e.getModel()!==this.textModel)throw new y;const o=this.inlineCompletionState.get();if(!o||o.primaryGhostText.isEmpty()||!o.inlineCompletion)return;const s=o.primaryGhostText,r=o.inlineCompletion;if(r.snippetInfo)return void(await this.accept(e));const a=s.parts[0],l=new to(s.lineNumber,a.column),d=a.text,c=i(l,d);if(c===d.length&&1===s.parts.length)return void this.accept(e);const h=d.substring(0,c),u=this._positions.get(),g=u[0];r.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const i=mr.fromPositions(g,l),n=new dC(i,e.getModel().getValueInRange(i)+h),o=[n,...qSe(this.textModel,u,n)].filter(ule),s=hSe(o).map(e=>fr.fromPositions(e));e.edit(lC.fromParallelReplacementsUnsorted(o),this._getMetadata(r,t)),e.setSelections(s,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}const i=mr.fromPositions(r.editRange.getStartPosition(),eC.ofText(h).addToPosition(l)),o=e.getModel().getValueInRange(i,1).length;r.reportPartialAccept(o,{kind:n,acceptedLength:o},{characters:c,ratio:c/d.length,count:1})}finally{r.removeRef()}}handleSuggestAccepted(e){const t=_Se(e.getSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const n=this.textModel.getValueInRange(i.completion.editRange,1).length+t.text.length;i.completion.reportPartialAccept(t.text.length,{kind:2,acceptedLength:n},{characters:t.text.length,count:1,ratio:1})}extractReproSample(){return{documentValue:this.textModel.getValue(),inlineCompletion:this.state.get()?.inlineCompletion?.getSourceCompletion()}}jump(){const e=this.inlineEditState.get();e&&Wce(t=>{this._jumpedToId.set(e.inlineCompletion.semanticId,t),this.dontRefetchSignal.trigger(t);const i=e.inlineCompletion.targetRange,n=i.getStartPosition();if(this._editor.setPosition(n,"inlineCompletions.jump"),!i.isSingleLine()||!e.inlineCompletion.hint&&e.inlineCompletion.insertText.includes("\n")){const e=new mr(i.startLineNumber-1,1,i.endLineNumber+1,1);this._editor.revealRange(e,1)}else this._editor.revealPosition(n);e.inlineCompletion.identity.setJumpTo(t),this._editor.focus()})}async handleInlineSuggestionShown(e,t,i){await e.reportInlineEditShown(this._commandService,t,i)}},iJ=eJ([tJ(7,Jn),tJ(8,fo),tJ(9,il),tJ(10,Fc),tJ(11,Tx),tJ(12,eo),tJ(13,jX)],iJ),function(e){e[e.Undo=0]="Undo",e[e.Redo=1]="Redo",e[e.AcceptWord=2]="AcceptWord",e[e.Other=3]="Other"}(nJ||(nJ={})),oJ=class extends Ie{constructor(e,t,i){super(),i&&this._register({dispose:()=>i()}),this._register(bwe(e).setDecorations(z_e(t.map(e=>({range:e,options:{description:"animation",className:"edits-fadeout-decoration",zIndex:1}})))));const n=new UQ(1,0,1e3,pSe),o=new KQ(n);this._register(Rce(t=>{const i=o.getValue(t);e.getContainerDomNode().style.setProperty("--animation-opacity",i.toString()),n.isFinished()&&this.dispose()}))}},rJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},aJ=function(e,t){return function(i,n){t(i,n,e)}},dJ=class{constructor(e){this.name=e}select(e,t,i){if(0===i.length)return 0;const n=i[0].score[0];for(let o=0;o<i.length;o++){const{score:e,completion:t}=i[o];if(e[0]!==n)break;if(t.preselect)return o}return 0}},cJ=class extends dJ{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}},hJ=class extends dJ{constructor(){super("recentlyUsed"),this._cache=new Ls(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(0===i.length)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const o=i[0].score[0];let s=-1,r=-1,a=-1;for(let l=0;l<i.length&&i[l].score[0]===o;l++){const t=`${e.getLanguageId()}/${i[l].textLabel}`,n=this._cache.peek(t);if(n&&n.touch>a&&n.type===i[l].completion.kind&&n.insertText===i[l].completion.insertText&&(a=n.touch,r=l),i[l].completion.preselect&&-1===s)return l}return-1!==r?r:-1!==s?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();for(const[t,i]of e)i.touch=0,i.type="number"==typeof i.type?i.type:pb.fromString(i.type),this._cache.set(t,i);this._seq=this._cache.size}},uJ=class extends dJ{constructor(){super("recentlyUsedByPrefix"),this._trie=VA.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${n}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const o=`${e.getLanguageId()}/${n}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let r=0;r<i.length;r++){const{kind:e,insertText:t}=i[r].completion;if(e===s.type&&t===s.insertText)return r}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((e,t)=>-(e[1].touch-t[1].touch)).forEach((e,t)=>e[1].touch=t),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type="number"==typeof i.type?i.type:pb.fromString(i.type),this._trie.set(t,i)}}},sJ=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new De,this._persistSoon=new ft(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(e=>{e.reason===tR.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(this._strategy?.name!==i){this._saveState(),this._strategy=new(lJ._strategyCtors.get(i)||cJ);try{const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=this._storageService.get(`${lJ._storagePrefix}/${i}`,e);t&&this._strategy.fromJSON(JSON.parse(t))}catch(Fae){}}return this._strategy}_saveState(){if(this._strategy){const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=JSON.stringify(this._strategy);this._storageService.store(`${lJ._storagePrefix}/${this._strategy.name}`,t,e,1)}}},lJ=sJ,sJ._strategyCtors=new Map([["recentlyUsedByPrefix",uJ],["recentlyUsed",hJ],["first",cJ]]),sJ._storagePrefix="suggest/memories",gJ=sJ,gJ=lJ=rJ([aJ(0,eR),aJ(1,ka)],gJ),dge(pJ=eue("ISuggestMemories"),gJ,1),fJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_J=function(e,t){return function(i,n){t(i,n,e)}},mJ=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=bJ.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(e=>e.hasChanged(139)&&this._update()),this._update()}dispose(){this._configListener.dispose(),this._selectionListener?.dispose(),this._ckAtEnd.reset()}_update(){const e="on"===this._editor.getOption(139);if(this._enabled!==e)if(this._enabled=e,this._enabled){const e=()=>{if(!this._editor.hasModel())return void this._ckAtEnd.set(!1);const e=this._editor.getModel(),t=this._editor.getSelection(),i=e.getWordAtPosition(t.getStartPosition());i?this._ckAtEnd.set(i.endColumn===t.getStartPosition().column&&t.getStartPosition().lineNumber===t.getEndPosition().lineNumber):this._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(e),e()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},bJ=mJ,mJ.AtEnd=new Jo("atEndOfWord",!1,{type:"boolean",description:Vae(1494,"A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled")}),vJ=mJ,vJ=bJ=fJ([_J(1,es)],vJ),CJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},yJ=function(e,t){return function(i,n){t(i,n,e)}},wJ=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=SJ.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){this._ckOtherSuggestions.reset(),this._listener?.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){0!==e.items.length&&SJ._moveIndex(!0,e,t)!==t?(this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)):this.reset()}static _moveIndex(e,t,i){let n=i;for(let o=t.items.length;o>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,n!==i)&&t.items[n].completion.additionalTextEdits;o--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=SJ._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},SJ=wJ,wJ.OtherSuggestions=new Jo("hasOtherSuggestions",!1),xJ=wJ,xJ=SJ=CJ([yJ(1,es)],xJ),kJ=class{constructor(e,t,i,n){this._disposables=new De,this._disposables.add(i.onDidSuggest(e=>{0===e.completionModel.items.length&&this.reset()})),this._disposables.add(i.onDidCancel(e=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&0!==i.state){const t=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&n(this._active.item)}}))}_onItem(e){if(!e||!sce(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new Ur;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}},DJ=class e{async provideSelectionRanges(t,i){const n=[];for(const o of i){const i=[];n.push(i);const s=new Map;await new Promise(i=>e._bracketsRightYield(i,0,t,o,s)),await new Promise(n=>e._bracketsLeftYield(n,0,t,o,s,i))}return n}static _bracketsRightYield(t,i,n,o,s){const r=new Map,a=Date.now();for(;;){if(i>=e._maxRounds){t();break}if(!o){t();break}const l=n.bracketPairs.findNextBracket(o);if(!l){t();break}if(Date.now()-a>e._maxDuration){setTimeout(()=>e._bracketsRightYield(t,i+1,n,o,s));break}if(l.bracketInfo.isOpeningBracket){const e=l.bracketInfo.bracketText,t=r.has(e)?r.get(e):0;r.set(e,t+1)}else{const e=l.bracketInfo.getOpeningBrackets()[0].bracketText;let t=r.has(e)?r.get(e):0;if(t-=1,r.set(e,Math.max(0,t)),t<0){let t=s.get(e);t||(t=new Ae,s.set(e,t)),t.push(l.range)}}o=l.range.getEndPosition()}}static _bracketsLeftYield(t,i,n,o,s,r){const a=new Map,l=Date.now();for(;;){if(i>=e._maxRounds&&0===s.size){t();break}if(!o){t();break}const d=n.bracketPairs.findPrevBracket(o);if(!d){t();break}if(Date.now()-l>e._maxDuration){setTimeout(()=>e._bracketsLeftYield(t,i+1,n,o,s,r));break}if(d.bracketInfo.isOpeningBracket){const t=d.bracketInfo.bracketText;let i=a.has(t)?a.get(t):0;if(i-=1,a.set(t,Math.max(0,i)),i<0){const i=s.get(t);if(i){const o=i.shift();0===i.size&&s.delete(t);const a=mr.fromPositions(d.range.getEndPosition(),o.getStartPosition()),l=mr.fromPositions(d.range.getStartPosition(),o.getEndPosition());r.push({range:a}),r.push({range:l}),e._addBracketLeading(n,l,r)}}}else{const e=d.bracketInfo.getOpeningBrackets()[0].bracketText,t=a.has(e)?a.get(e):0;a.set(e,t+1)}o=d.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(n);0!==o&&o!==t.startColumn&&(i.push({range:mr.fromPositions(new to(n,o),t.getEndPosition())}),i.push({range:mr.fromPositions(new to(n,1),t.getEndPosition())}));const s=n-1;if(s>0){const n=e.getLineFirstNonWhitespaceColumn(s);n===t.startColumn&&n!==e.getLineLastNonWhitespaceColumn(s)&&(i.push({range:mr.fromPositions(new to(s,n),t.getEndPosition())}),i.push({range:mr.fromPositions(new to(s,1),t.getEndPosition())}))}}},(LJ=DJ)._maxDuration=30,LJ._maxRounds=2,NJ=class e{static async create(t,i){if(!i.getOption(134).localityBonus)return e.None;if(!i.hasModel())return e.None;const n=i.getModel(),o=i.getPosition();if(!t.canComputeWordRanges(n.uri))return e.None;const[s]=await(new DJ).provideSelectionRanges(n,[o]);if(0===s.length)return e.None;const r=await t.computeWordRanges(n.uri,s[0].range);if(!r)return e.None;const a=n.getWordUntilPosition(o);return delete r[a.word],new class extends e{distance(e,t){if(!o.equals(i.getPosition()))return 0;if(17===t.kind)return 2<<20;const n=r["string"==typeof t.label?t.label:t.label.label];if(oce(n))return 2<<20;const a=Yde(n,mr.fromPositions(e),mr.compareRangesUsingStarts),l=a>=0?n[a]:n[Math.max(0,~a-1)];let d=s.length;for(const i of s){if(!mr.containsRange(i.range,l))break;d-=1}return d}}}},(IJ=NJ).None=new class extends IJ{distance(){return 0}},EJ=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}},MJ=class e{constructor(t,i,n,o,s,r,a=aD.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=e._compareCompletionItems,this._items=t,this._column=i,this._wordDistance=o,this._options=s,this._refilterKind=1,this._lineContext=n,this._fuzzyScoreOptions=a,"top"===r?this._snippetCompareFn=e._compareCompletionItemsSnippetsUp:"bottom"===r&&(this._snippetCompareFn=e._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){this._lineContext.leadingLineContent===e.leadingLineContent&&this._lineContext.characterCountDelta===e.characterCountDelta||(this._refilterKind=this._lineContext.characterCountDelta<e.characterCountDelta&&this._filteredItems?2:1,this._lineContext=e)}get items(){return this._ensureCachedState(),this._filteredItems}getItemsByProvider(){return this._ensureCachedState(),this._itemsByProvider}getIncompleteProvider(){this._ensureCachedState();const e=new Set;for(const[t,i]of this.getItemsByProvider())i.length>0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){0!==this._refilterKind&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",o="";const s=1===this._refilterKind?this._items:this._filteredItems,r=[],a=!this._options.filterGraceful||s.length>2e3?Tbe:Obe;for(let l=0;l<s.length;l++){const d=s[l];if(d.isInvalid)continue;const c=this._itemsByProvider.get(d.provider);c?c.push(d):this._itemsByProvider.set(d.provider,[d]);const h=d.position.column-d.editStart.column,u=h+i-(d.position.column-this._column);if(n.length!==u&&(n=0===u?"":t.slice(-u),o=n.toLowerCase()),d.word=n,0===u)d.score=rD.Default;else{let e=0;for(;e<h;){const t=n.charCodeAt(e);if(32!==t&&9!==t)break;e+=1}if(e>=u)d.score=rD.Default;else if("string"==typeof d.completion.filterText){const t=a(n,o,e,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!t)continue;0===Qle(d.completion.filterText,d.textLabel)?d.score=t:(d.score=kbe(n,o,e,d.textLabel,d.labelLow,0),d.score[0]=t[0])}else{const t=a(n,o,e,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!t)continue;d.score=t}}d.idx=l,d.distance=this._wordDistance.distance(d.position,d.completion),r.push(d),e.push(d.textLabel.length)}this._filteredItems=r.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?Xde(e.length-.85,e,(e,t)=>e-t):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]<t.score[0]?1:e.distance<t.distance?-1:e.distance>t.distance?1:e.idx<t.idx?-1:e.idx>t.idx?1:0}static _compareCompletionItemsSnippetsDown(t,i){if(t.completion.kind!==i.completion.kind){if(28===t.completion.kind)return 1;if(28===i.completion.kind)return-1}return e._compareCompletionItems(t,i)}static _compareCompletionItemsSnippetsUp(t,i){if(t.completion.kind!==i.completion.kind){if(28===t.completion.kind)return-1;if(28===i.completion.kind)return 1}return e._compareCompletionItems(t,i)}},TJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},RJ=function(e,t){return function(i,n){t(i,n,e)}},AJ=class{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const n=t.getWordAtPosition(i);return!(!n||n.endColumn!==i.column&&n.startColumn+1!==i.column||!isNaN(Number(n.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}},PJ=OJ=class{constructor(e,t,i,n,o,s,r,a,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=o,this._contextKeyService=s,this._configurationService=r,this._languageFeaturesService=a,this._envService=l,this._toDispose=new De,this._triggerCharacterListener=new De,this._triggerQuickSuggest=new pt,this._triggerState=void 0,this._completionDisposables=new De,this._onDidCancel=new je,this._onDidTrigger=new je,this._onDidSuggest=new je,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._currentSelection=this._editor.getSelection()||new fr(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(e=>{d||this._onCursorChange(e)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{d||void 0===this._triggerState||this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){kle(this._triggerCharacterListener),kle([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(104)||!this._editor.hasModel()||!this._editor.getOption(137))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const t of i.triggerCharacters||[]){let n=e.get(t);n||(n=new Set,e.set(t,n)),n.add(i)}const t=t=>{if(!function(e,t){if(!Boolean(t.getContextKeyValue("inlineSuggestionVisible")))return!0;const i=t.getContextKeyValue(bY.suppressSuggestions.key);return void 0!==i?!i:!e.getOption(71).suppressSuggestions}(this._editor,this._contextKeyService,this._configurationService))return;if(AJ.shouldAutoTrigger(this._editor))return;if(!t){const e=this._editor.getPosition();t=this._editor.getModel().getLineContent(e.lineNumber).substr(0,e.column-1)}let i="";lde(t.charCodeAt(t.length-1))?ade(t.charCodeAt(t.length-2))&&(i=t.substr(t.length-2)):i=t.charAt(t.length-1);const n=e.get(i);if(n){const e=new Map;if(this._completionModel)for(const[t,i]of this._completionModel.getItemsByProvider())n.has(t)||e.set(t,i);this.trigger({auto:!0,triggerKind:1,triggerCharacter:i,retrigger:Boolean(this._completionModel),clipboardText:this._completionModel?.clipboardText,completionOptions:{providerFilter:n,providerItemsToReuse:e}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){void 0!==this._triggerState&&(this._triggerQuickSuggest.cancel(),this._requestToken?.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){void 0!==this._triggerState&&(this._editor.hasModel()&&this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.trigger({auto:this._triggerState.auto,retrigger:!0}):this.cancel())}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||0!==e.reason&&3!==e.reason||"keyboard"!==e.source&&"deleteLeft"!==e.source?this.cancel():void 0===this._triggerState&&0===e.reason?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():void 0!==this._triggerState&&3===e.reason&&this._refilterCompletionItems()}_onCompositionEnd(){void 0===this._triggerState?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){fY.isAllOff(this._editor.getOption(102))||this._editor.getOption(134).snippetsPreventQuickSuggestions&&FQ.get(this._editor)?.isInSnippet()||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(void 0!==this._triggerState)return;if(!AJ.shouldAutoTrigger(this._editor))return;if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(102);if(!fY.isAllOff(i)){if(!fY.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),o=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("on"!==fY.valueFor(i,o))return}(function(e,t){if(!Boolean(t.getContextKeyValue(bY.inlineSuggestionVisible.key)))return!0;const i=t.getContextKeyValue(bY.suppressSuggestions.key);return void 0!==i?!i:!e.getOption(71).suppressSuggestions})(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}},this._editor.getOption(103)))}_refilterCompletionItems(){ple(this._editor.hasModel()),ple(void 0!==this._triggerState);const e=new AJ(this._editor.getModel(),this._editor.getPosition(),{...this._triggerState,refilter:!0});this._onNewContext(e)}trigger(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new AJ(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let n={triggerKind:e.triggerKind??0};e.triggerCharacter&&(n={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new ot;let o=1;switch(this._editor.getOption(128)){case"top":o=0;break;case"bottom":o=2}const{itemKind:s,showDeprecated:r}=OJ.createSuggestFilter(this._editor),a=new gY(o,e.completionOptions?.kindFilter??s,e.completionOptions?.providerFilter,e.completionOptions?.providerItemsToReuse,r),l=NJ.create(this._editorWorkerService,this._editor),d=iSe(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),a,n,this._requestToken.token);Promise.all([d,l]).then(async([t,i])=>{if(this._requestToken?.dispose(),!this._editor.hasModel())return void t.disposable.dispose();let n=e?.clipboardText;if(!n&&t.needsClipboard&&(n=await this._clipboardService.readText()),void 0===this._triggerState)return void t.disposable.dispose();const o=new AJ(this._editor.getModel(),this._editor.getPosition(),e),s={...aD.default,firstMatchCanBeWeak:!this._editor.getOption(134).matchOnWordStartOnly};if(this._completionModel=new MJ(t.items,this._context.column,{leadingLineContent:o.leadingLineContent,characterCountDelta:o.column-this._context.column},i,this._editor.getOption(134),this._editor.getOption(128),s,n),this._completionDisposables.add(t.disposable),this._onNewContext(o),this._reportDurationsTelemetry(t.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const e of t.items)e.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${e.provider._debugDisplayName}`,e.completion)}).catch($ae)}_reportDurationsTelemetry(e){Math.random()>1e-4||setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;"none"===e.getOption(128)&&t.add(28);const i=e.getOption(134);return i.showMethods||t.add(0),i.showFunctions||t.add(1),i.showConstructors||t.add(2),i.showFields||t.add(3),i.showVariables||t.add(4),i.showClasses||t.add(5),i.showStructs||t.add(6),i.showInterfaces||t.add(7),i.showModules||t.add(8),i.showProperties||t.add(9),i.showEvents||t.add(10),i.showOperators||t.add(11),i.showUnits||t.add(12),i.showValues||t.add(13),i.showConstants||t.add(14),i.showEnums||t.add(15),i.showEnumMembers||t.add(16),i.showKeywords||t.add(17),i.showWords||t.add(18),i.showColors||t.add(19),i.showFiles||t.add(20),i.showReferences||t.add(21),i.showColors||t.add(22),i.showFolders||t.add(23),i.showTypeParameters||t.add(24),i.showSnippets||t.add(28),i.showUsers||t.add(25),i.showIssues||t.add(26),{itemKind:t,showDeprecated:i.showDeprecated}}_onNewContext(e){if(this._context)if(e.lineNumber===this._context.lineNumber)if($le(e.leadingLineContent)===$le(this._context.leadingLineContent)){if(e.column<this._context.column)e.leadingWord.word?this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0}):this.cancel();else if(this._completionModel)if(0!==e.leadingWord.word.length&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){if(AJ.shouldAutoTrigger(this._editor)&&this._context){const e=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:e}})}}else if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&0!==e.leadingWord.word.length){const e=new Map,t=new Set;for(const[i,n]of this._completionModel.getItemsByProvider())n.length>0&&n[0].container.incomplete?t.add(i):e.set(i,n);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:t,providerItemsToReuse:e}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){const n=AJ.shouldAutoTrigger(this._editor);if(!this._context)return void this.cancel();if(n&&this._context.leadingWord.endColumn<e.leadingWord.startColumn)return void this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0});if(this._context.triggerOptions.auto)return void this.cancel();if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}else this.cancel();else this.cancel()}},PJ=OJ=TJ([RJ(1,DM),RJ(2,nT),RJ(3,fs),RJ(4,Ks),RJ(5,es),RJ(6,ka),RJ(7,Tx),RJ(8,fW)],PJ),FJ=class e{constructor(t,i){this._disposables=new De,this._lastOvertyped=[],this._locked=!1,this._disposables.add(t.onWillType(()=>{if(this._locked||!t.hasModel())return;const i=t.getSelections(),n=i.length;let o=!1;for(let e=0;e<n;e++)if(!i[e].isEmpty()){o=!0;break}if(!o)return void(0!==this._lastOvertyped.length&&(this._lastOvertyped.length=0));this._lastOvertyped=[];const s=t.getModel();for(let t=0;t<n;t++){const n=i[t];if(s.getValueLengthInRange(n)>e._maxSelectionLength)return;this._lastOvertyped[t]={value:s.getValueInRange(n),multiline:n.startLineNumber!==n.endLineNumber}}})),this._disposables.add(i.onDidTrigger(e=>{this._locked=!0})),this._disposables.add(i.onDidCancel(e=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}},FJ._maxSelectionLength=51200,WJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},BJ=function(e,t){return function(i,n){t(i,n,e)}},VJ=class{constructor(e,t,i,n,o){this._menuId=t,this._menuService=n,this._contextKeyService=o,this._menuDisposables=new De,this.element=Mhe(e,Ahe(".suggest-status-bar"));const s=e=>e instanceof ps?i.createInstance(bR,e,{useComma:!1}):void 0;this._leftActions=new NE(this.element,{actionViewItemProvider:s}),this._rightActions=new NE(this.element,{actionViewItemProvider:s}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const t=[],i=[];for(const[n,o]of e.getActions())"left"===n?t.push(...o):i.push(...o);this._leftActions.clear(),this._leftActions.push(t),this._rightActions.clear(),this._rightActions.push(i)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}},VJ=WJ([BJ(2,Jn),BJ(3,cs),BJ(4,es)],VJ),HJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},zJ=function(e,t){return function(i,n){t(i,n,e)}},UJ=class{constructor(e,t,i){this._editor=e,this._themeService=t,this._markdownRendererService=i,this._onDidClose=new je,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new je,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new De,this._renderDisposeable=new De,this._size=new Tn(330,0),this.domNode=Ahe(".suggest-details"),this.domNode.classList.add("no-docs"),this._body=Ahe(".body"),this._scrollbar=new Tm(this._body,{alwaysConsumeMouseWheel:!0}),Mhe(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Mhe(this._body,Ahe(".header")),this._close=Mhe(this._header,Ahe("span"+mo.asCSSSelector(go.close))),this._close.title=Vae(1490,"Close"),this._close.role="button",this._close.tabIndex=-1,this._type=Mhe(this._header,Ahe("p.type")),this._docs=Mhe(this._body,Ahe("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(59)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(59),i=t.getMassagedFontFamily(),n=e.get(135)||t.fontSize,o=e.get(136)||t.lineHeight,s=t.fontWeight,r=`${n}px`,a=`${o}px`;this.domNode.style.fontSize=r,this.domNode.style.lineHeight=""+o/n,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=a,this._close.style.width=a}getLayoutInfo(){const e=this._editor.getOption(136)||this._editor.getOption(59).lineHeight,t=Npe(this._themeService.getColorTheme().type)?2:1;return{lineHeight:e,borderWidth:t,borderHeight:2*t,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=Vae(1491,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,2*this.getLayoutInfo().lineHeight),this._onDidChangeContents.fire(this)}renderItem(e,t){this._renderDisposeable.clear();let{detail:i,documentation:n}=e.completion;if(t){let t="";t+=`score: ${e.score[0]}\n`,t+=`prefix: ${e.word??"(no prefix)"}\n`,t+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}\n`,t+=`distance: ${e.distance} (localityBonus-setting)\n`,t+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}\n`,t+=`commit_chars: ${e.completion.commitCharacters?.join("")}\n`,n=(new pD).appendCodeblock("empty",t),i=`Provider: ${e.provider._debugDisplayName}`}if(t||jSe(e)){if(this.domNode.classList.remove("no-docs","no-type"),i){const e=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=e,this._type.title=e,Phe(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gim.test(e))}else Jce(this._type),this._type.title="",Fhe(this._type),this.domNode.classList.add("no-type");if(Jce(this._docs),"string"==typeof n)this._docs.classList.remove("markdown-docs"),this._docs.textContent=n;else if(n){this._docs.classList.add("markdown-docs"),Jce(this._docs);const e=this._markdownRendererService.render(n,{context:this._editor,asyncRenderCallback:()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}});this._docs.appendChild(e.element),this._renderDisposeable.add(e)}this.domNode.classList.toggle("detail-and-doc",!!i&&!!n),this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=e=>{e.preventDefault(),e.stopPropagation()},this._close.onclick=e=>{e.preventDefault(),e.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}else this.clearContents()}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new Tn(e,t);Tn.equals(i,this._size)||(this._size=i,function(e,t,i){"number"==typeof t&&(e.style.width=`${t}px`),"number"==typeof i&&(e.style.height=`${i}px`)}(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}focus(){this.domNode.focus()}},UJ=HJ([zJ(1,Sf),zJ(2,LA)],UJ),KJ=class{constructor(e,t){let i,n;this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new De,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new fB,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let o=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(e=>{if(i&&n){this.widget.layout(e.dimension.width,e.dimension.height);let t=!1;e.west&&(s=n.width-e.dimension.width,t=!0),e.north&&(o=n.height-e.dimension.height,t=!0),t&&this._applyTopLeft({top:i.top+o,left:i.left+s})}e.done&&(i=void 0,n=void 0,o=0,s=0,this._userSize=e.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){this._anchorBox=e.getBoundingClientRect(),this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const n=rhe(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),s=new Tn(220,2*o.lineHeight),r=e.top,a=function(){const i=n.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),a=-o.borderWidth+e.left+e.width,l=new Tn(i,n.height-e.top-o.borderHeight-o.verticalPadding),d=l.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:r,left:a,fit:i-t.width,maxSizeTop:l,maxSizeBottom:d,minSize:s.with(Math.min(i,s.width))}}(),l=[a,function(){const i=e.left-o.borderWidth-o.horizontalPadding,a=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),l=new Tn(i,n.height-e.top-o.borderHeight-o.verticalPadding),d=l.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:r,left:a,fit:i-t.width,maxSizeTop:l,maxSizeBottom:d,minSize:s.with(Math.min(i,s.width))}}(),function(){const i=e.left,r=-o.borderWidth+e.top+e.height,a=new Tn(e.width-o.borderHeight,n.height-e.top-e.height-o.verticalPadding);return{top:r,left:i,fit:a.height-t.height,maxSizeBottom:a,maxSizeTop:a,minSize:s.with(a.width)}}()],d=l.find(e=>e.fit>=0)??l.sort((e,t)=>t.fit-e.fit)[0],c=e.top+e.height-o.borderHeight;let h,u=t.height;const g=Math.max(d.maxSizeTop.height,d.maxSizeBottom.height);let p;u>g&&(u=g),i?u<=d.maxSizeTop.height?(h=!0,p=d.maxSizeTop):(h=!1,p=d.maxSizeBottom):u<=d.maxSizeBottom.height?(h=!1,p=d.maxSizeBottom):(h=!0,p=d.maxSizeTop);let{top:m,left:f}=d;!h&&u>e.height&&(m=c-u);const _=this._editor.getDomNode();if(_){const e=_.getBoundingClientRect();m-=e.top,f-=e.left}this._applyTopLeft({left:f,top:m}),this._resizable.enableSashes(!h,d===a,h,d!==a),this._resizable.minSize=d.minSize,this._resizable.maxSize=p,this._resizable.layout(u,Math.min(p.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}},qJ=eue("fileService"),function(e){e[e.FILE=0]="FILE",e[e.FOLDER=1]="FOLDER",e[e.ROOT_FOLDER=2]="ROOT_FOLDER"}(jJ||(jJ={})),$J=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/,ZJ=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},YJ=function(e,t){return function(i,n){t(i,n,e)}},QJ=rwe("suggest-more-info",go.chevronRight,Vae(1492,"Icon for more information in the suggest widget.")),XJ=new(GJ=class e{extract(t,i){if(t.textLabel.match(e._regexStrict))return i[0]=t.textLabel,!0;if(t.completion.detail&&t.completion.detail.match(e._regexStrict))return i[0]=t.completion.detail,!0;if(t.completion.documentation){const n="string"==typeof t.completion.documentation?t.completion.documentation:t.completion.documentation.value,o=e._regexRelaxed.exec(n);if(o&&(0===o.index||o.index+o[0].length===n.length))return i[0]=o[0],!0}return!1}},GJ._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,GJ._regexStrict=new RegExp(`^${GJ._regexRelaxed.source}$`,"i"),GJ),JJ=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new je,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new De,i=e;i.classList.add("show-file-icons");const n=Mhe(e,Ahe(".icon")),o=Mhe(n,Ahe("span.colorspan")),s=Mhe(Mhe(e,Ahe(".contents")),Ahe(".main")),r=Mhe(s,Ahe(".icon-label.codicon")),a=Mhe(s,Ahe("span.left")),l=Mhe(s,Ahe("span.right")),d=new BK(a,{supportHighlights:!0,supportIcons:!0});t.add(d);const c=Mhe(a,Ahe("span.signature-label")),h=Mhe(a,Ahe("span.qualifier-label")),u=Mhe(l,Ahe("span.details-label")),g=Mhe(l,Ahe("span.readMore"+mo.asCSSSelector(QJ)));return g.title=Vae(1493,"Read More"),{root:i,left:a,right:l,icon:n,colorspan:o,iconLabel:d,iconContainer:r,parametersLabel:c,qualifierLabel:h,detailsLabel:u,readMore:g,disposables:t,configureFont:()=>{const e=this._editor.getOptions(),t=e.get(59),o=t.getMassagedFontFamily(),r=t.fontFeatureSettings,a=t.fontVariationSettings,l=e.get(135)||t.fontSize,d=e.get(136)||t.lineHeight,c=t.fontWeight,h=`${l}px`,u=`${d}px`,p=`${t.letterSpacing}px`;i.style.fontSize=h,i.style.fontWeight=c,i.style.letterSpacing=p,s.style.fontFamily=o,s.style.fontFeatureSettings=r,s.style.fontVariationSettings=a,s.style.lineHeight=u,n.style.height=u,n.style.width=u,g.style.height=u,g.style.width=u}}}renderElement(e,t,i){i.configureFont();const{completion:n}=e;i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:Lbe(e.score)},s=[];if(19===n.kind&&XJ.extract(e,s))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=s[0];else if(20===n.kind&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const t=$Se(this._modelService,this._languageService,_i.from({scheme:"fake",path:e.textLabel}),jJ.FILE),s=$Se(this._modelService,this._languageService,_i.from({scheme:"fake",path:n.detail}),jJ.FILE);o.extraClasses=t.length>s.length?t:s}else 23===n.kind&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[$Se(this._modelService,this._languageService,_i.from({scheme:"fake",path:e.textLabel}),jJ.FOLDER),$Se(this._modelService,this._languageService,_i.from({scheme:"fake",path:n.detail}),jJ.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...mo.asClassNameArray(pb.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),"string"==typeof n.label?(i.parametersLabel.textContent="",i.detailsLabel.textContent=ZSe(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=ZSe(n.label.detail||""),i.detailsLabel.textContent=ZSe(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(134).showInlineDetails?Phe(i.detailsLabel):Fhe(i.detailsLabel),jSe(e)?(i.right.classList.add("can-expand-details"),Phe(i.readMore),i.readMore.onmousedown=e=>{e.stopPropagation(),e.preventDefault()},i.readMore.onclick=e=>{e.stopPropagation(),e.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Fhe(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}},JJ=ZJ([YJ(1,io),YJ(2,La),YJ(3,Sf)],JJ),t1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},i1=function(e,t){return function(i,n){t(i,n,e)}},mpe("editorSuggestWidget.background",yh,Vae(1473,"Background color of the suggest widget.")),mpe("editorSuggestWidget.border",xh,Vae(1474,"Border color of the suggest widget.")),o1=mpe("editorSuggestWidget.foreground",Ch,Vae(1475,"Foreground color of the suggest widget.")),mpe("editorSuggestWidget.selectedForeground",dp,Vae(1476,"Foreground color of the selected entry in the suggest widget.")),mpe("editorSuggestWidget.selectedIconForeground",cp,Vae(1477,"Icon foreground color of the selected entry in the suggest widget.")),s1=mpe("editorSuggestWidget.selectedBackground",hp,Vae(1478,"Background color of the selected entry in the suggest widget.")),mpe("editorSuggestWidget.highlightForeground",Bg,Vae(1479,"Color of the match highlights in the suggest widget.")),mpe("editorSuggestWidget.focusHighlightForeground",Vg,Vae(1480,"Color of the match highlights in the suggest widget when an item is focused.")),mpe("editorSuggestWidgetStatus.foreground",bpe(o1,.5),Vae(1481,"Foreground color of the suggest widget status.")),r1=class{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof YH}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(Tn.is(t))return Tn.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}},e1=class{constructor(e,t,i,n,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Ne,this._pendingShowDetails=new Ne,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new pt,this._disposables=new De,this._onDidSelect=new Ze,this._onDidFocus=new Ze,this._onDidHide=new je,this._onDidShow=new je,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new je,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new fB,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new l1(this,e),this._persistedSize=new r1(t,e);class s{constructor(e,t,i=!1,n=!1){this.persistedSize=e,this.currentSize=t,this.persistHeight=i,this.persistWidth=n}}let r;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),r=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(e=>{if(this._resize(e.dimension.width,e.dimension.height),r&&(r.persistHeight=r.persistHeight||!!e.north||!!e.south,r.persistWidth=r.persistWidth||!!e.east||!!e.west),e.done){if(r){const{itemHeight:e,defaultSize:t}=this.getLayoutInfo(),i=Math.round(e/2);let{width:n,height:o}=this.element.size;(!r.persistHeight||Math.abs(r.currentSize.height-o)<=i)&&(o=r.persistedSize?.height??t.height),(!r.persistWidth||Math.abs(r.currentSize.width-n)<=i)&&(n=r.persistedSize?.width??t.width),this._persistedSize.store(new Tn(n,o))}this._contentWidget.unlockPreference(),r=void 0}})),this._messageElement=Mhe(this.element.domNode,Ahe(".message")),this._listElement=Mhe(this.element.domNode,Ahe(".tree"));const a=this._disposables.add(o.createInstance(UJ,this.editor));a.onDidClose(()=>this.toggleDetails(),this,this._disposables),this._details=new KJ(a,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(134).showIcons);l();const d=o.createInstance(JJ,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new bE("SuggestWidget",this._listElement,{getHeight:e=>this.getLayoutInfo().itemHeight,getTemplateId:e=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>P?"listitem":"option",getWidgetAriaLabel:()=>Vae(1484,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:e=>{let t=e.textLabel;const i=pb.toLabel(e.completion.kind);if("string"!=typeof e.completion.label){const{detail:n,description:o}=e.completion.label;n&&o?t=Vae(1485,"{0} {1}, {2}, {3}",t,n,o,i):n?t=Vae(1486,"{0} {1}, {2}",t,n,i):o&&(t=Vae(1487,"{0}, {1}, {2}",t,o,i))}else t=Vae(1488,"{0}, {1}",t,i);if(!e.isResolved||!this._isDetailsVisible())return t;const{documentation:n,detail:o}=e.completion;return Vae(1489,"{0}, docs: {1}",t,Fle("{0}{1}",o||"",n?"string"==typeof n?n:n.value:""))}}}),this._list.style(ywe({listInactiveFocusBackground:s1,listInactiveFocusOutline:hh})),this._status=o.createInstance(VJ,this.element.domNode,hY);const c=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(134).showStatusBar);c(),this._disposables.add(this._list.onMouseDown(e=>this._onListMouseDownOrTap(e))),this._disposables.add(this._list.onTap(e=>this._onListMouseDownOrTap(e))),this._disposables.add(this._list.onDidChangeSelection(e=>this._onListSelection(e))),this._disposables.add(this._list.onDidChangeFocus(e=>this._onListFocus(e))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(e=>{e.hasChanged(134)&&(c(),l()),this._completionModel&&(e.hasChanged(59)||e.hasChanged(135)||e.hasChanged(136))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=cY.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=cY.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=cY.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=cY.HasFocusedSuggestion.bindTo(i),this._disposables.add(xn(this._details.widget.domNode,"keydown",e=>{this._onDetailsKeydown.fire(e)})),this._disposables.add(this.editor.onMouseDown(e=>this._onEditorMouseDown(e)))}dispose(){this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),this._loadingTimeout?.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){0!==this._state&&this._contentWidget.layout()}_onListMouseDownOrTap(e){void 0!==e.element&&void 0!==e.index&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onListFocus(e){if(this._ignoreFocusEvents)return;if(5===this._state&&this._setState(3),!e.elements.length)return this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),void this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&(this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=Ele(async e=>{const i=Rle(()=>{this._isDetailsVisible()&&this._showDetails(!0,!1)},250),n=e.onCancellationRequested(()=>i.dispose());try{return await t.resolve(e)}finally{i.dispose(),n.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this._showDetails(!1,!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:this._list.getElementID(i)}))}).catch($ae)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",4===e),this.element.domNode.classList.remove("message"),e){case 0:Fhe(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=n1.LOADING_MESSAGE,Fhe(this._listElement,this._status.element),Phe(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Xhe(n1.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=n1.NO_SUGGESTIONS_MESSAGE,Fhe(this._listElement,this._status.element),Phe(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Xhe(n1.NO_SUGGESTIONS_MESSAGE);break;case 3:case 4:Fhe(this._messageElement),Phe(this._listElement,this._status.element),this._show();break;case 5:Fhe(this._messageElement),Phe(this._listElement,this._status.element),this._details.show(),this._show(),this._details.widget.focus()}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){0===this._state&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=Rle(()=>this._setState(1),t)))}showSuggestions(e,t,i,n,o){if(this._contentWidget.setPosition(this.editor.getPosition()),this._loadingTimeout?.dispose(),this._currentSuggestionDetails?.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&2!==this._state&&0!==this._state)return void this._setState(4);const s=this._completionModel.items.length,r=0===s;if(this._ctxSuggestWidgetMultipleSuggestions.set(s>1),r)return this._setState(n?0:2),void(this._completionModel=void 0);this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0,0===t?0:.33*this.getLayoutInfo().itemHeight),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=Dn(pn(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(0!==this._state&&2!==this._state&&1!==this._state&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){5===this._state?(this._list.setFocus(this._list.getFocus()),this._setState(3)):3===this._state&&(this._setState(5),this._isDetailsVisible()?this._details.widget.focus():this.toggleDetails(!0))}toggleDetails(e=!1){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):!jSe(this._list.getFocusedElements()[0])&&!this._explainMode||3!==this._state&&5!==this._state&&4!==this._state||(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this._showDetails(!1,e))}_showDetails(e,t){this._pendingShowDetails.value=Dn(pn(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show();let i=!1;e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details"),t&&(this._details.widget.focus(),i=!0)),i||this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this._showDetails(!1,!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){this._pendingLayout.clear(),this._pendingShowDetails.clear(),this._loadingTimeout?.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(4.3*this.getLayoutInfo().itemHeight);e&&e.height<t&&this._persistedSize.store(e.with(void 0,t))}isFrozen(){return 4===this._state}_afterRender(e){null!==e?2!==this._state&&1!==this._state&&(this._isDetailsVisible()&&!this._details.widget.isEmpty&&this._details.show(),this._positionDetails()):this._isDetailsVisible()&&this._details.hide()}_layout(e){if(!this.editor.hasModel())return;if(!this.editor.getDomNode())return;const t=rhe(this.element.domNode.ownerDocument.body),i=this.getLayoutInfo();e||(e=i.defaultSize);let n=e.height,o=e.width;if(this._status.element.style.height=`${i.itemHeight}px`,2===this._state||1===this._state)n=i.itemHeight+i.borderHeight,o=i.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new Tn(o,n),this._contentWidget.setPreference(2);else{const s=t.width-i.borderHeight-2*i.horizontalPadding;o>s&&(o=s);const r=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:o,a=i.statusBarHeight+this._list.contentHeight+i.borderHeight,l=i.itemHeight+i.statusBarHeight,d=lhe(this.editor.getDomNode()),c=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),h=d.top+c.top+c.height,u=Math.min(t.height-h-i.verticalPadding,a),g=d.top+c.top-i.verticalPadding,p=Math.min(g,a);let m=Math.min(Math.max(p,u)+i.borderHeight,a);n===this._cappedHeight?.capped&&(n=this._cappedHeight.wanted),n<l&&(n=l),n>m&&(n=m),n>u&&p>u||this._forceRenderingAbove&&g>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),m=p):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),m=u),this.element.preferredSize=new Tn(r,i.defaultSize.height),this.element.maxSize=new Tn(s,m),this.element.minSize=new Tn(220,l),this._cappedHeight=n===a?{wanted:this._cappedHeight?.wanted??e.height,capped:n}:void 0}this._resize(o,n)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=t-o+"px",this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,2===this._contentWidget.getPosition()?.preference[0])}getLayoutInfo(){const e=this.editor.getOption(59),t=Vve(this.editor.getOption(136)||e.lineHeight,8,1e3),i=this.editor.getOption(134).showStatusBar&&2!==this._state&&1!==this._state?t:0,n=this._details.widget.getLayoutInfo().borderWidth;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:2*n,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Tn(430,i+12*t)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},n1=e1,e1.LOADING_MESSAGE=Vae(1482,"Loading..."),e1.NO_SUGGESTIONS_MESSAGE=Vae(1483,"No suggestions."),a1=e1,a1=n1=t1([i1(1,eR),i1(2,es),i1(3,Sf),i1(4,Jn)],a1),l1=class{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return!this._hidden&&this._position&&this._preference?{position:this._position,preference:[this._preference]}:null}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new Tn(t+2*i+n,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}},c1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},h1=function(e,t){return function(i,n){t(i,n,e)}},g1=class{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=Lx.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const i=e.getOffsetAt(t),n=e.getPositionAt(i+1);e.changeDecorations(e=>{this._marker&&e.removeDecoration(this._marker),this._marker=e.addDecoration(mr.fromPositions(t,n),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}return this._model.getLineMaxColumn(e.lineNumber)-e.column}},d1=class{static get(e){return e.getContribution(u1.ID)}get onWillInsertSuggestItem(){return this._onWillInsertSuggestItem.event}constructor(e,t,i,n,o,s,r){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=o,this._logService=s,this._telemetryService=r,this._lineSuffix=new Ne,this._toDispose=new De,this._selectors=new m1(e=>e.priority),this._onWillInsertSuggestItem=new je,this._wantsForceRenderingAbove=!1,this.editor=e,this.model=o.createInstance(PJ,this.editor),this._selectors.register({priority:0,select:(e,t,i)=>this._memoryService.select(e,t,i)});const a=cY.InsertMode.bindTo(n);a.set(e.getOption(134).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>a.set(e.getOption(134).insertMode))),this.widget=this._toDispose.add(new Ln(pn(e.getDomNode()),()=>{const e=this._instantiationService.createInstance(a1,this.editor);this._toDispose.add(e),this._toDispose.add(e.onDidSelect(e=>this._insertSuggestion(e,0),this));const t=new kJ(this.editor,e,this.model,e=>this._insertSuggestion(e,2));this._toDispose.add(t);const i=cY.MakesTextEdit.bindTo(this._contextKeyService),n=cY.HasInsertAndReplaceRange.bindTo(this._contextKeyService),o=cY.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Dle(()=>{i.reset(),n.reset(),o.reset()})),this._toDispose.add(e.onDidFocus(({item:e})=>{const t=this.editor.getPosition(),s=e.editStart.column,r=t.column;let a=!0;"smart"!==this.editor.getOption(1)||2!==this.model.state||e.completion.additionalTextEdits||4&e.completion.insertTextRules||r-s!==e.completion.insertText.length||(a=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:s,endLineNumber:t.lineNumber,endColumn:r})!==e.completion.insertText),i.set(a),n.set(!to.equals(e.editInsertEnd,e.editReplaceEnd)),o.set(Boolean(e.provider.resolveCompletionItem)||Boolean(e.completion.documentation)||e.completion.detail!==e.completion.label)})),this._toDispose.add(e.onDetailsKeyDown(e=>{e.toKeyCodeChord().equals(new pe(!0,!1,!1,!1,33))||F&&e.toKeyCodeChord().equals(new pe(!1,!1,!1,!0,33))?e.stopPropagation():e.toKeyCodeChord().isModifierKey()||this.editor.focus()})),this._wantsForceRenderingAbove&&e.forceRenderingAbove(),e})),this._overtypingCapturer=this._toDispose.add(new Ln(pn(e.getDomNode()),()=>this._toDispose.add(new FJ(this.editor,this.model)))),this._alternatives=this._toDispose.add(new Ln(pn(e.getDomNode()),()=>this._toDispose.add(new xJ(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(vJ,e)),this._toDispose.add(this.model.onDidTrigger(e=>{this.widget.value.showTriggered(e.auto,e.shy?250:50),this._lineSuffix.value=new g1(this.editor.getModel(),e.position)})),this._toDispose.add(this.model.onDidSuggest(e=>{if(e.triggerOptions.shy)return;let t=-1;for(const n of this._selectors.itemsOrderedByPriorityDesc)if(t=n.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items),-1!==t)break;if(-1===t&&(t=0),0===this.model.state)return;let i=!1;if(e.triggerOptions.auto){const t=this.editor.getOption(134);"never"===t.selectionMode||"always"===t.selectionMode?i="never"===t.selectionMode:"whenTriggerCharacter"===t.selectionMode?i=1!==e.triggerOptions.triggerKind:"whenQuickSuggestion"===t.selectionMode&&(i=1===e.triggerOptions.triggerKind&&!e.triggerOptions.refilter)}this.widget.value.showSuggestions(e.completionModel,t,e.isFrozen,e.triggerOptions.auto,i)})),this._toDispose.add(this.model.onDidCancel(e=>{e.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const l=cY.AcceptSuggestionsOnEnter.bindTo(n),d=()=>{const e=this.editor.getOption(1);l.set("on"===e||"smart"===e)};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item)return this._alternatives.value.reset(),this.model.cancel(),void this.model.clear();if(!this.editor.hasModel())return;const i=FQ.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),o=n.getAlternativeVersionId(),{item:s}=e,r=[],a=new ot;1&t||this.editor.pushUndoStop();const l=this.getOverwriteInfo(s,Boolean(8&t));this._memoryService.memorize(n,this.editor.getPosition(),s);const d=s.isResolved;let c=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const e=PL.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(e=>{let t=mr.lift(e.range);if(t.startLineNumber===s.position.lineNumber&&t.startColumn>s.position.column){const e=this.editor.getPosition().column-s.position.column,i=e,n=mr.spansMultipleLines(t)?0:e;t=new mr(t.startLineNumber,t.startColumn+i,t.endLineNumber,t.endColumn+n)}return VH.replaceMove(t,e.text)})),e.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const e=new Fe;let i;const o=n.onDidChangeContent(e=>{if(e.isFlush)return a.cancel(),void o.dispose();for(const t of e.changes){const e=mr.getEndPosition(t.range);i&&!to.isBefore(e,i)||(i=e)}}),l=t;t|=2;let d=!1;const c=this.editor.onWillType(()=>{c.dispose(),d=!0,2&l||this.editor.pushUndoStop()});r.push(s.resolve(a.token).then(()=>{if(!s.completion.additionalTextEdits||a.token.isCancellationRequested)return;if(i&&s.completion.additionalTextEdits.some(e=>to.isBefore(i,mr.getStartPosition(e.range))))return!1;d&&this.editor.pushUndoStop();const e=PL.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(e=>VH.replaceMove(mr.lift(e.range),e.text))),e.restoreRelativeVerticalPositionOfCursor(this.editor),!d&&2&l||this.editor.pushUndoStop(),!0}).then(t=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",e.elapsed(),t),h=!0===t?1:!1===t?0:-2}).finally(()=>{o.dispose(),c.dispose()}))}let{insertText:u}=s.completion;if(4&s.completion.insertTextRules||(u=hP.escape(u)),this.model.cancel(),i.insert(u,{overwriteBefore:l.overwriteBefore,overwriteAfter:l.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&s.completion.insertTextRules),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value,reason:Vy.suggest({providerId:bb.fromExtensionId(s.extensionId?.value)})}),2&t||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===f1.id)this.model.trigger({auto:!0,retrigger:!0});else{const e=new Fe;r.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(e=>{s.completion.extensionId?Gae(e):$ae(e)}).finally(()=>{c=e.elapsed()}))}4&t&&this._alternatives.value.set(e,e=>{for(a.cancel();n.canUndo();){o!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(e,3|(8&t?8:0));break}}),this._alertCompletionItem(s),Promise.all(r).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,n,d,c,h,e.index,e.model.items),this.model.clear(),a.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,n,o,s,r){if(Math.random()>1e-4)return;const a=new Map;for(let c=0;c<Math.min(30,r.length);c++){const e=r[c].textLabel;a.has(e)?a.get(e).push(c):a.set(e,[c])}const l=a.get(e.textLabel),d=l&&l.length>1?l[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:e.extensionId?.value??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:Ude(Os(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:As(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:o,index:s,firstIndex:d})}getOverwriteInfo(e,t){ple(this.editor.hasModel());let i="replace"===this.editor.getOption(134).insertMode;t&&(i=!i);const n=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column;return{overwriteBefore:n+(this.editor.getPosition().column-e.position.column),overwriteAfter:o+(this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0)}}_alertCompletionItem(e){sce(e.completion.additionalTextEdits)&&Qhe(Vae(1463,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length))}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},n=e=>{if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;const t=this.editor.getPosition(),i=e.editStart.column,n=t.column;return n-i!==e.completion.insertText.length||this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:i,endLineNumber:t.lineNumber,endColumn:n})!==e.completion.insertText};Be.once(this.model.onDidTrigger)(e=>{const t=[];Be.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{kle(t),i()},void 0,t),this.model.onDidSuggest(({completionModel:e})=>{if(kle(t),0===e.items.length)return void i();const o=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.items),s=e.items[o];n(s)?(this.editor.pushUndoStop(),this._insertSuggestion({index:o,item:s,model:e},7)):i()},void 0,t)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),this._insertSuggestion(i,n)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.isInitialized?this.widget.value.forceRenderingAbove():this._wantsForceRenderingAbove=!0}stopForceRenderingAbove(){this.widget.isInitialized?this.widget.value.stopForceRenderingAbove():this._wantsForceRenderingAbove=!1}registerSelector(e){return this._selectors.register(e)}},u1=d1,d1.ID="editor.contrib.suggestController",p1=d1,p1=u1=c1([h1(1,pJ),h1(2,fo),h1(3,es),h1(4,Jn),h1(5,Ks),h1(6,fs)],p1),m1=class{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(-1!==this._items.indexOf(e))throw new Error("Value is already registered");return this._items.push(e),this._items.sort((e,t)=>this.prioritySelector(t)-this.prioritySelector(e)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}},f1=class e extends rr{constructor(){super({id:e.id,label:zae(1471,"Trigger Suggest"),precondition:Po.and(jl.writable,jl.hasCompletionItemProvider,cY.Visible.toNegated()),kbOpts:{kbExpr:jl.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=p1.get(t);if(!n)return;let o;i&&"object"==typeof i&&!0===i.auto&&(o=!0),n.triggerSuggest(void 0,o,void 0)}},f1.id="editor.action.triggerSuggest",Iue(p1.ID,p1,2),kue(f1),_1=190,xue(new(b1=sr.bindToContribution(p1.get))({id:"acceptSelectedSuggestion",precondition:Po.and(cY.Visible,cY.HasFocusedSuggestion),handler(e){e.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Po.and(cY.Visible,jl.textInputFocus),weight:_1},{primary:3,kbExpr:Po.and(cY.Visible,jl.textInputFocus,cY.AcceptSuggestionsOnEnter,cY.MakesTextEdit),weight:_1}],menuOpts:[{menuId:hY,title:Vae(1464,"Insert"),group:"left",order:1,when:cY.HasInsertAndReplaceRange.toNegated()},{menuId:hY,title:Vae(1465,"Insert"),group:"left",order:1,when:Po.and(cY.HasInsertAndReplaceRange,cY.InsertMode.isEqualTo("insert"))},{menuId:hY,title:Vae(1466,"Replace"),group:"left",order:1,when:Po.and(cY.HasInsertAndReplaceRange,cY.InsertMode.isEqualTo("replace"))}]})),xue(new b1({id:"acceptAlternativeSelectedSuggestion",precondition:Po.and(cY.Visible,jl.textInputFocus,cY.HasFocusedSuggestion),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:hY,group:"left",order:2,when:Po.and(cY.HasInsertAndReplaceRange,cY.InsertMode.isEqualTo("insert")),title:Vae(1467,"Replace")},{menuId:hY,group:"left",order:2,when:Po.and(cY.HasInsertAndReplaceRange,cY.InsertMode.isEqualTo("replace")),title:Vae(1468,"Insert")}]})),_o.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),xue(new b1({id:"hideSuggestWidget",precondition:cY.Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:9,secondary:[1033]}})),xue(new b1({id:"selectNextSuggestion",precondition:Po.and(cY.Visible,Po.or(cY.MultipleSuggestions,cY.HasFocusedSuggestion.negate())),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),xue(new b1({id:"selectNextPageSuggestion",precondition:Po.and(cY.Visible,Po.or(cY.MultipleSuggestions,cY.HasFocusedSuggestion.negate())),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:12,secondary:[2060]}})),xue(new b1({id:"selectLastSuggestion",precondition:Po.and(cY.Visible,Po.or(cY.MultipleSuggestions,cY.HasFocusedSuggestion.negate())),handler:e=>e.selectLastSuggestion()})),xue(new b1({id:"selectPrevSuggestion",precondition:Po.and(cY.Visible,Po.or(cY.MultipleSuggestions,cY.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),xue(new b1({id:"selectPrevPageSuggestion",precondition:Po.and(cY.Visible,Po.or(cY.MultipleSuggestions,cY.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:11,secondary:[2059]}})),xue(new b1({id:"selectFirstSuggestion",precondition:Po.and(cY.Visible,Po.or(cY.MultipleSuggestions,cY.HasFocusedSuggestion.negate())),handler:e=>e.selectFirstSuggestion()})),xue(new b1({id:"focusSuggestion",precondition:Po.and(cY.Visible,cY.HasFocusedSuggestion.negate()),handler:e=>e.focusSuggestion(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}})),xue(new b1({id:"focusAndAcceptSuggestion",precondition:Po.and(cY.Visible,cY.HasFocusedSuggestion.negate()),handler:e=>{e.focusSuggestion(),e.acceptSelectedSuggestion(!0,!1)}})),xue(new b1({id:"toggleSuggestionDetails",precondition:Po.and(cY.Visible,cY.HasFocusedSuggestion),handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:hY,group:"right",order:1,when:Po.and(cY.DetailsVisible,cY.CanResolve),title:Vae(1469,"Show Less")},{menuId:hY,group:"right",order:1,when:Po.and(cY.DetailsVisible.toNegated(),cY.CanResolve),title:Vae(1470,"Show More")}]})),xue(new b1({id:"toggleExplainMode",precondition:cY.Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2138}})),xue(new b1({id:"toggleSuggestionFocus",precondition:cY.Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:2570,mac:{primary:778}}})),xue(new b1({id:"insertBestCompletion",precondition:Po.and(jl.textInputFocus,Po.equals("config.editor.tabCompletion","on"),vJ.AtEnd,cY.Visible.toNegated(),xJ.OtherSuggestions.toNegated(),FQ.InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(rle(t)?{fallback:"tab",...t}:{fallback:"tab"})},kbOpts:{weight:_1,primary:2}})),xue(new b1({id:"insertNextSuggestion",precondition:Po.and(jl.textInputFocus,Po.equals("config.editor.tabCompletion","on"),xJ.OtherSuggestions,cY.Visible.toNegated(),FQ.InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:2}})),xue(new b1({id:"insertPrevSuggestion",precondition:Po.and(jl.textInputFocus,Po.equals("config.editor.tabCompletion","on"),xJ.OtherSuggestions,cY.Visible.toNegated(),FQ.InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:_1,kbExpr:jl.textInputFocus,primary:1026}})),kue(class extends rr{constructor(){super({id:"editor.action.resetSuggestSize",label:zae(1472,"Reset Suggest Widget Size"),precondition:void 0})}run(e,t){p1.get(t)?.resetWidgetSize()}}),v1=class extends Ie{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new je),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(e=>{e.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(e=>{e.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const n=p1.get(this.editor);if(n){this._register(n.registerSelector({priority:100,select:(e,t,i)=>{const o=this.editor.getModel();if(!o)return-1;const s=this.suggestControllerPreselector(),r=s?_Se(s,o):void 0;if(!r)return-1;const a=to.lift(t),l=Gpe(i.map((e,t)=>{const i=_Se(w1.fromSuggestion(n,o,a,e,this.isShiftKeyPressed).getSingleTextEdit(),o);return{index:t,valid:bSe(r,i),prefixLength:i.text.length,suggestItem:e}}).filter(e=>e&&e.valid&&e.prefixLength>0),fce(e=>e.prefixLength,Oi));return l?l.index:-1}}));let e=!1;const t=()=>{e||(e=!0,this._register(n.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(n.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(n.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(Be.once(n.model.onDidTrigger)(e=>{t()})),this._register(n.onWillInsertSuggestItem(e=>{const t=this.editor.getPosition(),i=this.editor.getModel();if(!t||!i)return;const o=w1.fromSuggestion(n,i,t,e.item,this.isShiftKeyPressed);this.onWillAccept(o)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();var i,n;this._isActive===e&&((i=this._currentSuggestItemInfo)===(n=t)||i&&n&&i.equals(n))||(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=p1.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();return t&&i&&n?w1.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed):void 0}stopForceRenderingAbove(){p1.get(this.editor)?.stopForceRenderingAbove()}forceRenderingAbove(){p1.get(this.editor)?.forceRenderingAbove()}},w1=class e{static fromSuggestion(t,i,n,o,s){let{insertText:r}=o.completion,a=!1;if(4&o.completion.insertTextRules){const e=(new hP).parse(r);e.children.length<100&&MQ.adjustWhitespace(i,n,!0,e),r=e.toString(),a=!0}const l=t.getOverwriteInfo(o,s);return new e(mr.fromPositions(n.delta(0,-l.overwriteBefore),n.delta(0,Math.max(l.overwriteAfter,0))),r,o.completion.kind,a,o.container.incomplete??!1)}constructor(e,t,i,n,o){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=n,this.listIncomplete=o}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new fb(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}getSingleTextEdit(){return new dC(this.range,this.insertText)}},C1=class extends Ie{constructor(e,t,i){super(),this._editorObs=e,this._handleSuggestAccepted=t,this._suggestControllerPreselector=i,this._suggestWidgetAdaptor=this._register(new v1(this._editorObs.editor,()=>(this._editorObs.forceUpdate(),this._suggestControllerPreselector()),e=>this._editorObs.forceUpdate(t=>{this._handleSuggestAccepted(e)}))),this.selectedItem=Hce(this,e=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(t=>e(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem)}stopForceRenderingAbove(){this._suggestWidgetAdaptor.stopForceRenderingAbove()}forceRenderingAbove(){this._suggestWidgetAdaptor.forceRenderingAbove()}},y1=class{constructor(e,t){this.lineNumber=e,this.columnRange=t}},S1=class{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new y(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new mr(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}toZeroBasedOffsetRange(){return new hl(this.startColumn-1,this.endColumnExclusive-1)}},x1=class e{static fromLineTokens(t){const i=[];for(let e=0;e<t.getCount();e++)i.push(new k1(t.getTokenText(e),t.getMetadata(e)));return e.create(i)}static create(t){return new e(t)}constructor(e){this._tokenInfo=e}toLineTokens(e){return gl.createFromTextAndMetadata(this.map((e,t)=>({text:t.text,metadata:t.metadata})),e)}map(e){const t=[];let i=0;for(const n of this._tokenInfo){const o=new hl(i,i+n.text.length);t.push(e(o,n)),i+=n.text.length}return t}slice(t){const i=[];let n=0;for(const e of this._tokenInfo){const o=n,s=o+e.text.length;if(s>t.start){if(o>=t.endExclusive)break;const n=Math.max(0,t.start-o),r=Math.max(0,s-t.endExclusive);i.push(new k1(e.text.slice(n,e.text.length-r),e.metadata))}n+=e.text.length}return e.create(i)}append(t){const i=this._tokenInfo.concat(t._tokenInfo);return e.create(i)}},k1=class{constructor(e,t){this.text=e,this.metadata=t}},D1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},I1=function(e,t){return function(i,n){t(i,n,e)}},N1="ghost-text",L1=class extends Ie{constructor(e,t,i,n,o,s){super(),this._editor=e,this._model=t,this._options=i,this._shouldKeepCursorStable=n,this._isClickable=o,this._languageService=s,this._isDisposed=Qce(this,!1),this._editorObs=bwe(this._editor),this._warningState=Dce(e=>{const t=this._model.ghostText.read(e);if(!t)return;const i=this._model.warning.read(e);return i?{lineNumber:t.lineNumber,position:new to(t.lineNumber,t.parts[0].column),icon:i.icon}:void 0}),this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this._useSyntaxHighlighting=this._options.map(e=>e.syntaxHighlightingEnabled),this._extraClassNames=Dce(this,e=>{const t=[...this._options.read(e).extraClasses??[]];return this._useSyntaxHighlighting.read(e)&&t.push("syntax-highlighted"),this._warningState.read(e)&&t.push("warning"),t.map(e=>` ${e}`).join("")}),this.uiState=Dce(this,e=>{if(this._isDisposed.read(e))return;const t=this._editorObs.model.read(e);if(t!==this._model.targetTextModel.read(e))return;const i=this._model.ghostText.read(e);if(!i)return;const n=i instanceof GQ?i.columnRange:void 0,o=this._useSyntaxHighlighting.read(e),{inlineTexts:s,additionalLines:r,hiddenRange:a,additionalLinesOriginalSuffix:l}=function(e,t,i){const n=[],o=[];function s(e,t){if(o.length>0){const i=o[o.length-1];t&&i.decorations.push(new Rp(i.content.length+1,i.content.length+1+e[0].line.length,t,0)),i.content+=e[0].line,e=e.slice(1)}for(const i of e)o.push({content:i.line,decorations:t?[new Rp(1,i.line.length+1,t,0),...i.lineDecorations]:[...i.lineDecorations]})}const r=t.getLineContent(e.lineNumber);let a,l,d=0;for(const c of e.parts){let e=c.lines;void 0===a?(n.push({column:c.column,text:e[0].line,preview:c.preview,lineDecorations:e[0].lineDecorations}),e=e.slice(1)):s([{line:r.substring(d,c.column-1),lineDecorations:[]}],void 0),e.length>0&&(s(e,i),void 0===a&&c.column<=r.length&&(a=c.column)),d=c.column-1}return void 0!==a&&(l=new y1(e.lineNumber,new S1(d+1,r.length+1))),{inlineTexts:n,additionalLines:o,hiddenRange:void 0!==a?new S1(a,r.length+1):void 0,additionalLinesOriginalSuffix:l}}(i,t,N1+this._extraClassNames.read(e)),d=t.getLineContent(i.lineNumber),c=new Zw(s.map(e=>Yw.insert(e.column-1,e.text))),h=o?t.tokenization.tokenizeLinesAt(i.lineNumber,[c.apply(d),...r.map(e=>e.content)]):void 0,u=c.getNewRanges(),g=s.map((e,t)=>({...e,tokens:h?.[0]?.getTokensInRange(u[t])})),p=r.map((e,i)=>{let n=h?.[i+1]??gl.createEmpty(e.content,this._languageService.languageIdCodec);if(i===r.length-1&&l){const e=x1.fromLineTokens(t.tokenization.getLineTokens(l.lineNumber)).slice(l.columnRange.toZeroBasedOffsetRange());n=x1.fromLineTokens(n).append(e).toLineTokens(n.languageIdCodec)}return{content:n,decorations:e.decorations}}),m=this._editor.getSelection()?.getStartPosition().column,f=g.filter(e=>""!==e.text),_=0!==f.length,b={cursorColumnDistance:(_?f[0].column:1)-m,cursorLineDistance:_?0:r.findIndex(e=>""!==e.content)+1,lineCountOriginal:_?1:0,lineCountModified:r.length+(_?1:0),characterCountOriginal:0,characterCountModified:bce(f.map(e=>e.text.length))+bce(p.map(e=>e.content.getTextLength())),disjointReplacements:f.length+(r.length>0?1:0),sameShapeReplacements:f.length>1&&0===p.length?f.every(e=>e.text===f[0].text):void 0};return this._model.handleInlineCompletionShown.read(e)?.(b),{replacedRange:n,inlineTexts:g,additionalLines:p,hiddenRange:a,lineNumber:i.lineNumber,additionalReservedLineCount:this._model.minReservedLineCount.read(e),targetTextModel:t,syntaxHighlightingEnabled:o}}),this.decorations=Dce(this,e=>{const t=this.uiState.read(e);if(!t)return[];const i=[],n=this._extraClassNames.read(e);t.replacedRange&&i.push({range:t.replacedRange.toRange(t.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace"+n,description:"GhostTextReplacement"}}),t.hiddenRange&&i.push({range:t.hiddenRange.toRange(t.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const o of t.inlineTexts)i.push({range:mr.fromPositions(new to(t.lineNumber,o.column)),options:{description:"ghost-text-decoration",after:{content:o.text,tokens:o.tokens,inlineClassName:(o.preview?"ghost-text-decoration-preview":"ghost-text-decoration")+(this._isClickable?" clickable":"")+n+o.lineDecorations.map(e=>" "+e.className).join(" "),cursorStops:Xr.Left,attachedData:new M1(this)},showIfCollapsed:!0}});return i}),this._additionalLinesWidget=this._register(new T1(this._editor,Dce(e=>{const t=this.uiState.read(e);return t?{lineNumber:t.lineNumber,additionalLines:t.additionalLines,minReservedLineCount:t.additionalReservedLineCount,targetTextModel:t.targetTextModel}:void 0}),this._shouldKeepCursorStable,this._isClickable)),this._isInlineTextHovered=this._editorObs.isTargetHovered(e=>6===e.target.type&&e.target.detail.injectedText?.options.attachedData instanceof M1&&e.target.detail.injectedText.options.attachedData.owner===this,this._store),this.isHovered=Dce(this,e=>!this._isDisposed.read(e)&&(this._isInlineTextHovered.read(e)||this._additionalLinesWidget.isHovered.read(e))),this.height=Dce(this,e=>this._editorObs.getOption(75).read(e)+(this._additionalLinesWidget.viewZoneHeight.read(e)??0)),this._register(Dle(()=>{this._isDisposed.set(!0,void 0)})),this._register(this._editorObs.setDecorations(this.decorations)),this._isClickable&&(this._register(this._additionalLinesWidget.onDidClick(e=>this._onDidClick.fire(e))),this._register(this._editor.onMouseUp(e=>{if(6!==e.target.type)return;const t=e.target.detail.injectedText?.options.attachedData;t instanceof M1&&t.owner===this&&this._onDidClick.fire(e.event)}))),this._register(Pce((e,t)=>{}))}static getWarningWidgetContext(e){const t=e.ghostTextViewWarningWidgetData;return t||(e.parentElement?this.getWarningWidgetContext(e.parentElement):void 0)}ownsViewZone(e){return this._additionalLinesWidget.viewZoneId===e}},L1.hot=K_e(L1),E1=L1,E1=D1([I1(5,La)],E1),M1=class{constructor(e){this.owner=e}},T1=class extends Ie{get viewZoneId(){return this._viewZoneInfo?.viewZoneId}get viewZoneHeight(){return this._viewZoneHeight}constructor(e,t,i,n){super(),this._editor=e,this._lines=t,this._shouldKeepCursorStable=i,this._isClickable=n,this._viewZoneHeight=Qce("viewZoneHeight",void 0),this.editorOptionsChanged=cwe("editorOptionChanged",Be.filter(this._editor.onDidChangeConfiguration,e=>e.hasChanged(40)||e.hasChanged(133)||e.hasChanged(113)||e.hasChanged(108)||e.hasChanged(60)||e.hasChanged(59)||e.hasChanged(75))),this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this._viewZoneListener=this._register(new Ne),this.isHovered=bwe(this._editor).isTargetHovered(e=>YSe(e.target.element),this._store),this.hasBeenAccepted=!1,this._editor instanceof pL&&this._shouldKeepCursorStable&&this._register(this._editor.onBeforeExecuteEdit(e=>this.hasBeenAccepted="inlineSuggestion.accept"===e.source)),this._register(Rce(e=>{const t=this._lines.read(e);this.editorOptionsChanged.read(e),t?(this.hasBeenAccepted=!1,this.updateLines(t.lineNumber,t.additionalLines,t.minReservedLineCount)):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this._viewZoneListener.clear(),this._editor.changeViewZones(e=>{this.removeActiveViewZone(e)})}updateLines(e,t,i){const n=this._editor.getModel();if(!n)return;const{tabSize:o}=n.getOptions();this._editor.changeViewZones(n=>{const s=new De;this.removeActiveViewZone(n);const r=Math.max(t.length,i);if(r>0){const i=document.createElement("div");!function(e,t,i,n,o){const s=n.get(40),r=n.get(133),a=n.get(108),l=n.get(60),d=n.get(59),c=n.get(75);let h="suggest-preview-text";o&&(h+=" clickable");const u=new _a(1e4);u.appendString(`<div class="${h}">`);for(let p=0,m=i.length;p<m;p++){const e=i[p],n=e.content;u.appendString('<div class="view-line'),u.appendString('" style="top:'),u.appendString(String(p*c)),u.appendString('px;width:1000000px;">');const o=n.getLineContent(),h=pde(o),g=gde(o);kpe(new Wp(d.isMonospace&&!s,d.canUseHalfwidthRightwardsArrow,o,!1,h,g,0,n,e.decorations,t,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,"none",a,l!==zd.OFF,null,null,0),u),u.appendString("</div>")}u.appendString("</div>"),Wge(e,d);const g=u.build();e.innerHTML=R1?R1.createHTML(g):g}(i,o,t,this._editor.getOptions(),this._isClickable),this._isClickable&&(s.add(ehe(i,"mousedown",e=>{e.preventDefault()})),s.add(ehe(i,"click",e=>{YSe(e.target)&&this._onDidClick.fire(new Se(pn(e),e))}))),this.addViewZone(n,e,r,i)}this._viewZoneListener.value=s})}addViewZone(e,t,i,n){const o=e.addZone({afterLineNumber:t,heightInLines:i,domNode:n,afterColumnAffinity:1,onComputedHeight:e=>{this._viewZoneHeight.set(e,void 0)}});this.keepCursorStable(t,i),this._viewZoneInfo={viewZoneId:o,heightInLines:i,lineNumber:t}}removeActiveViewZone(e){this._viewZoneInfo&&(e.removeZone(this._viewZoneInfo.viewZoneId),this.hasBeenAccepted||this.keepCursorStable(this._viewZoneInfo.lineNumber,-this._viewZoneInfo.heightInLines),this._viewZoneInfo=void 0,this._viewZoneHeight.set(void 0,void 0))}keepCursorStable(e,t){if(!this._shouldKeepCursorStable)return;const i=this._editor.getSelection()?.getStartPosition()?.lineNumber;void 0!==i&&e<i&&this._editor.setScrollTop(this._editor.getScrollTop()+t*this._editor.getOption(75))}},R1=Bpe("editorGhostText",{createHTML:e=>e}),(O1=A1=class{constructor(e){this.replacements=e,tle(ole(e,(e,t)=>e.lineRange.endLineNumberExclusive<=t.lineRange.startLineNumber))}toString(){return this.replacements.map(e=>e.toString()).join(",")}getNewLineRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(Qw.ofLength(i.lineRange.startLineNumber+t,i.newLines.length)),t+=i.newLines.length-i.lineRange.length;return e}}).empty=new O1([]),P1=class e{static fromSingleTextEdit(t,i){const n=qle(t.text);let o=t.range.startLineNumber;const s=i.getValueOfRange(mr.fromPositions(new to(t.range.startLineNumber,1),t.range.getStartPosition()));n[0]=s+n[0];let r=t.range.endLineNumber+1;const a=i.getTransformer().getLineLength(t.range.endLineNumber)+1,l=i.getValueOfRange(mr.fromPositions(t.range.getEndPosition(),new to(t.range.endLineNumber,a)));n[n.length-1]=n[n.length-1]+l;const d=t.range.startColumn===i.getTransformer().getLineLength(t.range.startLineNumber)+1,c=1===t.range.endColumn;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o<r&&c&&n[n.length-1].length===l.length&&(r--,n.pop()),new e(new Qw(o,r),n)}constructor(e,t){this.lineRange=e,this.newLines=t}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}toLineEdit(){return new A1([this])}},F1=class{get lineEdit(){return 0===this.edit.replacements.length?new P1(new Qw(1,1),[]):P1.fromSingleTextEdit(this.edit.toReplacement(this.originalText),this.originalText)}get originalLineRange(){return this.lineEdit.lineRange}get modifiedLineRange(){return this.lineEdit.toLineEdit().getNewLineRanges()[0]}get displayRange(){return this.originalText.lineRange.intersect(this.originalLineRange.join(Qw.ofLength(this.originalLineRange.startLineNumber,this.lineEdit.newLines.length)))}constructor(e,t,i,n,o,s){this.originalText=e,this.edit=t,this.cursorPosition=i,this.multiCursorPositions=n,this.commands=o,this.inlineCompletion=s}},W1=class{constructor(e,t,i){this._model=e,this.inlineEdit=t,this.tabAction=i,this.action=this.inlineEdit.inlineCompletion.action,this.displayName=this.inlineEdit.inlineCompletion.source.provider.displayName??Vae(1219,"Inline Edit"),this.extensionCommands=this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands??[],this.isInDiffEditor=this._model.isInDiffEditor,this.displayLocation=this.inlineEdit.inlineCompletion.hint,this.showCollapsed=this._model.showCollapsed}accept(){this._model.accept()}jump(){this._model.jump()}handleInlineEditShown(e,t){this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion,e,t)}},B1=class{constructor(e){this._model=e,this.onDidAccept=this._model.onDidAccept,this.inAcceptFlow=this._model.inAcceptFlow}},V1=class{constructor(e,t,i,n){this.lineRange=i;const o=bwe(e),s=Dce(this,e=>o.isFocused.read(e)&&n.showInlineEditMenu?NX.Accept:NX.Inactive);this.model=new W1(t,new F1(new aC(""),new lC([n.getSingleTextEdit()]),t.primaryPosition.get(),t.allPositions.get(),n.source.inlineSuggestions.commands??[],n),s)}},H1=class e{static fromPoints(t,i){return new e(t.x,t.y,i.x,i.y)}static fromPointSize(t,i){return new e(t.x,t.y,t.x+i.x,t.y+i.y)}static fromLeftTopRightBottom(t,i,n,o){return new e(t,i,n,o)}static fromLeftTopWidthHeight(t,i,n,o){return new e(t,i,t+n,i+o)}static fromRanges(t,i){return new e(t.start,i.start,t.endExclusive,i.endExclusive)}static hull(t){let i=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(const e of t)i=Math.min(i,e.left),n=Math.min(n,e.top),o=Math.max(o,e.right),s=Math.max(s,e.bottom);return new e(i,n,o,s)}get width(){return this.right-this.left}get height(){return this.bottom-this.top}constructor(e,t,i,n){if(this.left=e,this.top=t,this.right=i,this.bottom=n,e>i)throw new y("Invalid arguments: Horizontally offset by "+(e-i));if(t>n)throw new y("Invalid arguments: Vertically offset by "+(t-n))}withMargin(t,i,n,o){let s,r,a,l;return void 0===i&&void 0===n&&void 0===o?s=r=a=l=t:void 0===n&&void 0===o?(s=r=i,a=l=t):(s=o,r=i,a=t,l=n),new e(this.left-s,this.top-a,this.right+r,this.bottom+l)}intersectVertical(t){const i=Math.max(this.top,t.start),n=Math.min(this.bottom,t.endExclusive);return new e(this.left,i,this.right,Math.max(i,n))}intersectHorizontal(t){const i=Math.max(this.left,t.start),n=Math.min(this.right,t.endExclusive);return new e(i,this.top,Math.max(i,n),this.bottom)}toString(){return`Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`}intersect(t){const i=Math.max(this.left,t.left),n=Math.min(this.right,t.right),o=Math.max(this.top,t.top),s=Math.min(this.bottom,t.bottom);if(!(i>n||o>s))return new e(i,o,n,s)}containsRect(e){return this.left<=e.left&&this.top<=e.top&&this.right>=e.right&&this.bottom>=e.bottom}containsPoint(e){return this.left<=e.x&&this.top<=e.y&&this.right>=e.x&&this.bottom>=e.y}moveToBeContainedIn(t){const i=this.width,n=this.height;let o=this.left,s=this.top;return o<t.left?o=t.left:o+i>t.right&&(o=t.right-i),s<t.top?s=t.top:s+n>t.bottom&&(s=t.bottom-n),new e(o,s,o+i,s+n)}withWidth(t){return new e(this.left,this.top,this.left+t,this.bottom)}withHeight(t){return new e(this.left,this.top,this.right,this.top+t)}withTop(t){return new e(this.left,t,this.right,this.bottom)}withLeft(t){return new e(t,this.top,this.right,this.bottom)}translateX(t){return new e(this.left+t,this.top,this.right+t,this.bottom)}translateY(t){return new e(this.left,this.top+t,this.right,this.bottom+t)}getLeftBottom(){return new gT(this.left,this.bottom)}getRightBottom(){return new gT(this.right,this.bottom)}getRightTop(){return new gT(this.right,this.top)}toStyles(){return{position:"absolute",left:`${this.left}px`,top:`${this.top}px`,width:`${this.width}px`,height:`${this.height}px`}}},z1=class e{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Zde(this.startLineNumbers,e.startLineNumbers)&&Zde(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new e([],[],0)}},U1=Bpe("stickyScrollViewLayer",{createHTML:e=>e}),K1="data-sticky-line-index",q1="data-sticky-is-line",j1="data-sticky-is-folding-icon",$1=class extends Ie{get height(){return this._height}constructor(e){super(),this._foldingIconStore=this._register(new De),this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._height=-1,this._onDidChangeStickyScrollHeight=this._register(new je),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._editor=e,this._lineHeight=e.getOption(75),this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof YH),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable),this._setHeight(0);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(131).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(131)&&t(),e.hasChanged(75)&&(this._lineHeight=this._editor.getOption(75))})),this._register(this._editor.onDidScrollChange(e=>{e.scrollLeftChanged&&t(),e.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),t(),this._register(this._editor.onDidLayoutChange(e=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){const n=!this._state&&!e,o=this._state&&this._state.equals(e);if(void 0===i&&(n||o))return;const s=this._findRenderingData(e),r=this._lineNumbers;this._lineNumbers=s.lineNumbers,this._lastLineRelativePosition=s.lastLineRelativePosition;const a=this._findIndexToRebuildFrom(r,this._lineNumbers,i);this._renderRootNode(this._lineNumbers,this._lastLineRelativePosition,t,a),this._state=e}_findRenderingData(e){if(!e)return{lineNumbers:[],lastLineRelativePosition:0};const t=[...e.startLineNumbers];null!==e.showEndForLine&&(t[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]);let i=0;for(let n=0;n<t.length;n++)i+=this._editor.getLineHeightForPosition(new to(t[n],1));return 0===i?{lineNumbers:[],lastLineRelativePosition:0}:{lineNumbers:t,lastLineRelativePosition:e.lastLineRelativePosition}}_findIndexToRebuildFrom(e,t,i){if(0===t.length)return 0;if(void 0!==i)return i;const n=t.findIndex(t=>!e.includes(t));return-1===n?0:n}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",this._editor.getScrollWidth()-e.verticalScrollbarWidth+"px"),this._rootDomNode.style.width=e.width-e.verticalScrollbarWidth+"px"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(!!e||i.isCollapsed)}}async _renderRootNode(e,t,i,n){const o=this._editor._getViewModel();if(!o)return void this._clearWidget();if(0===e.length)return void this._clearWidget();const s=[],r=e[e.length-1];let a=0;for(let d=0;d<this._renderedStickyLines.length;d++)if(d<n){const e=this._renderedStickyLines[d];s.push(this._updatePosition(e,a,e.lineNumber===r)),a+=e.height}else{const e=this._renderedStickyLines[d];e.lineNumberDomNode.remove(),e.lineDomNode.remove()}const l=this._editor.getLayoutInfo();for(let d=n;d<e.length;d++){const t=this._renderChildNode(o,d,e[d],a,r===e[d],i,l);a+=t.height,this._linesDomNode.appendChild(t.lineDomNode),this._lineNumbersDomNode.appendChild(t.lineNumberDomNode),s.push(t)}i&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin)),this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(e=>e.scrollWidth))+l.verticalScrollbarWidth,this._renderedStickyLines=s,this._setHeight(a+t),this._editor.layoutOverlayWidget(this)}_clearWidget(){for(let e=0;e<this._renderedStickyLines.length;e++){const t=this._renderedStickyLines[e];t.lineNumberDomNode.remove(),t.lineDomNode.remove()}this._setHeight(0)}_setHeight(e){this._height!==e&&(this._height=e,0===this._height?this._rootDomNode.style.display="none":(this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${this._height}px`,this._linesDomNodeScrollable.style.height=`${this._height}px`,this._rootDomNode.style.height=`${this._height}px`),this._onDidChangeStickyScrollHeight.fire({height:this._height}))}_setFoldingHoverListeners(){"mouseover"===this._editor.getOption(126)&&(this._foldingIconStore.clear(),this._foldingIconStore.add(ehe(this._lineNumbersDomNode,On.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ehe(this._lineNumbersDomNode,On.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n,o,s,r){const a=e.coordinatesConverter.convertModelPositionToViewPosition(new to(i,1)).lineNumber,l=e.getViewLineRenderingData(a),d=this._editor.getOption(76),c=this._editor.getOption(117).verticalScrollbarSize;let h;try{h=Rp.filter(l.inlineDecorations,a,l.minColumn,l.maxColumn)}catch(x){h=[]}const u=this._editor.getLineHeightForPosition(new to(i,1)),g=e.getTextDirection(i),p=new Wp(!0,!0,l.content,l.continuesWithWrappedLine,l.isBasicASCII,l.containsRTL,0,l.tokens,h,l.tabSize,l.startVisibleColumn,1,1,1,500,"none",!0,!0,null,g,c),m=new _a(2e3),f=kpe(p,m);let _;_=U1?U1.createHTML(m.build()):m.build();const b=document.createElement("span");b.setAttribute(K1,String(t)),b.setAttribute(q1,""),b.setAttribute("role","listitem"),b.tabIndex=0,b.className="sticky-line-content",b.classList.add(`stickyLine${i}`),b.style.lineHeight=`${u}px`,b.innerHTML=_;const v=document.createElement("span");v.setAttribute(K1,String(t)),v.setAttribute("data-sticky-is-line-number",""),v.className="sticky-line-number",v.style.lineHeight=`${u}px`;const w=r.contentLeft;v.style.width=`${w}px`;const C=document.createElement("span");1===d.renderType||3===d.renderType&&i%10==0?C.innerText=i.toString():2===d.renderType&&(C.innerText=Math.abs(i-this._editor.getPosition().lineNumber).toString()),C.className="sticky-line-number-inner",C.style.width=`${r.lineNumbersWidth}px`,C.style.paddingLeft=`${r.lineNumbersLeft}px`,v.appendChild(C);const y=this._renderFoldingIconForLine(s,i);y&&(v.appendChild(y.domNode),y.domNode.style.left=`${r.lineNumbersWidth+r.lineNumbersLeft}px`,y.domNode.style.lineHeight=`${u}px`),this._editor.applyFontInfo(b),this._editor.applyFontInfo(v),v.style.lineHeight=`${u}px`,b.style.lineHeight=`${u}px`,v.style.height=`${u}px`,b.style.height=`${u}px`;const S=new G1(t,i,b,v,y,f.characterMapping,b.scrollWidth,u);return this._updatePosition(S,n,o)}_updatePosition(e,t,i){const n=e.lineDomNode,o=e.lineNumberDomNode;if(i){const i="0";n.style.zIndex=i,o.style.zIndex=i;const s=`${t+this._lastLineRelativePosition+(e.foldingIcon?.isCollapsed?1:0)}px`;n.style.top=s,o.style.top=s}else{const e="1";n.style.zIndex=e,o.style.zIndex=e,n.style.top=`${t}px`,o.style.top=`${t}px`}return e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(126);if(!e||"never"===i)return;const n=e.regions,o=n.findRange(t),s=n.getStartLineNumber(o);if(t!==s)return;const r=n.isCollapsed(o),a=new Z1(r,s,n.getEndLineNumber(o),this._lineHeight);return a.setVisible(!!this._isOnGlyphMargin||r||"always"===i),a.domNode.setAttribute(j1,""),a}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=Rpe(t.characterMapping,e,0);return new to(t.lineNumber,i)}getLineNumberFromChildDomNode(e){return this._getRenderedStickyLineFromChildDomNode(e)?.lineNumber??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return null===t||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,K1);return t?parseInt(t,10):null}isInStickyLine(e){return void 0!==this._getAttributeValue(e,q1)}isInFoldingIconDomNode(e){return void 0!==this._getAttributeValue(e,j1)}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(null!==i)return i;e=e.parentElement}}},G1=class{constructor(e,t,i,n,o,s,r,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=o,this.characterMapping=s,this.scrollWidth=r,this.height=a}},Z1=class{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width="26px",this.domNode.style.height=`${n}px`,this.domNode.style.lineHeight=`${n}px`,this.domNode.className=mo.asClassName(e?HG:VG)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}},Y1=class{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}},Q1=class{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}},X1=class{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}},J1=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},e0=function(e,t){return function(i,n){t(i,n,e)}},function(e){e.OUTLINE_MODEL="outlineModel",e.FOLDING_PROVIDER_MODEL="foldingProviderModel",e.INDENTATION_MODEL="indentationModel"}(t0||(t0={})),function(e){e[e.VALID=0]="VALID",e[e.INVALID=1]="INVALID",e[e.CANCELED=2]="CANCELED"}(i0||(i0={})),n0=class extends Ie{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new ht(300)),this._updateOperation=this._register(new De),this._editor.getOption(131).defaultModel){case t0.OUTLINE_MODEL:this._modelProviders.push(new s0(this._editor,n));case t0.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new l0(this._editor,t,n));case t0.INDENTATION_MODEL:this._modelProviders.push(new a0(this._editor,i))}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const o=await i;if(this._modelPromise!==n)return null;switch(o){case i0.CANCELED:return this._updateOperation.clear(),null;case i0.VALID:return t.stickyModel}}return null}).catch(e=>($ae(e),null))}},n0=J1([e0(2,Jn),e0(3,Tx)],n0),o0=class extends Ie{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,i0.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Ele(e=>this.createModelFromProvider(e));return{statusPromise:t.then(t=>this.isModelValid(t)?e.isCancellationRequested?i0.CANCELED:(this._stickyModel=this.createStickyModel(e,t),i0.VALID):this._invalid()).then(void 0,e=>($ae(e),i0.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}},s0=class extends o0{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return jZ.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,this._stickyModel?.outlineProviderId),o=this._editor.getModel();return new X1(o.uri,o.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(ke.first(e.children.values())instanceof qZ){const n=ke.find(e.children.values(),e=>e.id===t);if(n)i=n.children;else{let n,o="",s=-1;for(const[t,i]of e.children.entries()){const e=this._findSumOfRangesOfGroup(i);e>s&&(n=i,s=e,o=i.id)}t=o,i=n.children}}else i=e.children;const n=[],o=Array.from(i.values()).sort((e,t)=>{const i=new Y1(e.symbol.range.startLineNumber,e.symbol.range.endLineNumber),n=new Y1(t.symbol.range.startLineNumber,t.symbol.range.endLineNumber);return this._comparator(i,n)});for(const s of o)n.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new Q1(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const n of e.children.values())if(n.symbol.selectionRange.startLineNumber!==n.symbol.range.endLineNumber)if(n.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(n,n.symbol.selectionRange.startLineNumber));else for(const e of n.children.values())i.push(this._stickyModelFromOutlineElement(e,n.symbol.selectionRange.startLineNumber));return i.sort((e,t)=>this._comparator(e.range,t.range)),new Q1(new Y1(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber),i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof KZ?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}},s0=J1([e0(1,Tx)],s0),r0=class extends o0{constructor(e){super(e),this._foldingLimitReporter=this._register(new oZ(e))}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new X1(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return null!==e}_fromFoldingRegions(e){const t=e.length,i=[],n=new Q1(void 0,[],void 0);for(let o=0;o<t;o++){const t=e.getParentIndex(o);let s;s=-1!==t?i[t]:n;const r=new Q1(new Y1(e.getStartLineNumber(o),e.getEndLineNumber(o)+1),[],s);s.children.push(r),i.push(r)}return n}},a0=class extends r0{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new AG(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}},a0=J1([e0(1,il)],a0),l0=class extends r0{constructor(e,t,i){super(e),this._languageFeaturesService=i,this.provider=this._register(new Ne),this._register(this._languageFeaturesService.foldingRangeProvider.onDidChange(()=>{this._updateProvider(e,t)})),this._updateProvider(e,t)}_updateProvider(e,t){const i=nZ.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());0!==i.length&&(this.provider.value=new ZG(e.getModel(),i,t,this._foldingLimitReporter,void 0))}isProviderValid(){return void 0!==this.provider}async createModelFromProvider(e){return this.provider.value?.compute(e)??null}},l0=J1([e0(2,Tx)],l0),d0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},c0=function(e,t){return function(i,n){t(i,n,e)}},h0=class{constructor(e,t,i,n){this.startLineNumber=e,this.endLineNumber=t,this.top=i,this.height=n}},u0=class extends Ie{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new je),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new De),this._updateSoon=this._register(new ft(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(131)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(131).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Dle(()=>{this._stickyModelProvider?.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){return this._model?.version}updateStickyModelProvider(){this._stickyModelProvider?.dispose(),this._stickyModelProvider=null,this._editor.hasModel()&&(this._stickyModelProvider=new n0(this._editor,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){this._cts?.dispose(!0),this._cts=new ot,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization())return void(this._model=null);const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}getCandidateStickyLinesIntersecting(e){if(!this._model?.element)return[];const t=[];return this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,0,-1),this.filterHiddenRanges(t)}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,o,s){const r=this._editor.getModel();if(!r)return;if(0===t.children.length)return;let a=s;const l=[];for(let h=0;h<t.children.length;h++){const e=t.children[h];e.range&&l.push(e.range.startLineNumber)}const d=this.updateIndex(Yde(l,e.startLineNumber,(e,t)=>e-t)),c=this.updateIndex(Yde(l,e.endLineNumber,(e,t)=>e-t));for(let h=d;h<=c;h++){const s=t.children[h];if(!s||!s.range)continue;const{startLineNumber:l,endLineNumber:d}=s.range;if(d>l+1&&e.startLineNumber<=d+1&&l-1<=e.endLineNumber&&l!==a&&r.isValidRange(new mr(l,1,d,1))){a=l;const t=this._editor.getLineHeightForPosition(new to(l,1));i.push(new h0(l,d-1,o,t)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,s,i,n+1,o+t,l)}}}filterHiddenRanges(e){const t=this._editor._getViewModel()?.getHiddenAreas();return t?e.filter(e=>!t.some(t=>e.startLineNumber>=t.startLineNumber&&e.endLineNumber<=t.endLineNumber+1)):e}updateIndex(e){return-1===e?0:e<0?-e-2:e}},u0=d0([c0(1,Tx),c0(2,il)],u0),p0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},m0=function(e,t){return function(i,n){t(i,n,e)}},g0=class extends Ie{constructor(e,t,i,n,o,s,r){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=r,this._sessionStore=new De,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._mouseTarget=null,this._onDidChangeStickyScrollHeight=this._register(new je),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._stickyScrollWidget=new $1(this._editor),this._stickyLineCandidateProvider=new u0(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=z1.Empty;const a=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeLineHeight(e=>{e.changes.forEach(e=>{const t=e.lineNumber;this._widgetState.startLineNumbers.includes(t)&&this._renderStickyScroll(t)})})),this._register(this._editor.onDidChangeFont(e=>{e.changes.forEach(e=>{const t=e.lineNumber;this._widgetState.startLineNumbers.includes(t)&&this._renderStickyScroll(t)})})),this._register(this._editor.onDidChangeConfiguration(e=>{this._readConfigurationChange(e)})),this._register(ehe(a,On.CONTEXT_MENU,async e=>{this._onContextMenu(pn(a),e)})),this._stickyScrollFocusedContextKey=jl.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=jl.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(Ehe(a));this._register(l.onDidBlur(e=>{!1===this._positionRevealed&&0===a.clientHeight?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(l.onDidFocus(e=>{this.focus()})),this._registerMouseListeners(),this._register(ehe(a,On.MOUSE_DOWN,e=>{this._onMouseDown=!0})),this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight(e=>{this._onDidChangeStickyScrollHeight.fire(e)})),this._onDidResize(),this._readConfiguration()}get stickyScrollWidgetHeight(){return this._stickyScrollWidget.height}static get(e){return e.getContribution(f0.ID)}_disposeFocusStickyScrollStore(){this._stickyScrollFocusedContextKey.set(!1),this._focusDisposableStore?.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}isFocused(){return this._focused}focus(){if(this._onMouseDown)return this._onMouseDown=!1,void this._editor.focus();!0!==this._stickyScrollFocusedContextKey.get()&&(this._focused=!0,this._focusDisposableStore=new De,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(mr.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new De),t=this._register(new KH(this._editor,{extractLineNumberFromMouseEvent:e=>{const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);return t?t.lineNumber:0}})),i=e=>{if(!this._editor.hasModel())return null;if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return null;const t=e.target.element;if(!t||t.innerText!==t.innerHTML)return null;const i=this._stickyScrollWidget.getEditorPositionFromNode(t);return i?{range:new mr(i.lineNumber,i.column,i.lineNumber,i.column+t.innerText.length),textElement:t}:null},n=this._stickyScrollWidget.getDomNode();this._register(xn(n,On.CLICK,e=>{if(e.ctrlKey||e.altKey||e.metaKey)return;if(!e.leftButton)return;if(e.shiftKey){const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(e.target);if(null===t)return;const i=new to(this._endLineNumbers[t],1);return void this._revealLineInCenterIfOutsideViewport(i)}if(this._stickyScrollWidget.isInFoldingIconDomNode(e.target)){const t=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);return void this._toggleFoldingRegionForLine(t)}if(!this._stickyScrollWidget.isInStickyLine(e.target))return;let t=this._stickyScrollWidget.getEditorPositionFromNode(e.target);if(!t){const i=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);if(null===i)return;t=new to(i,1)}this._revealPosition(t)})),this._register(ehe(r,On.MOUSE_MOVE,e=>{this._mouseTarget=e.target,this._onMouseMoveOrKeyDown(e)})),this._register(ehe(r,On.KEY_DOWN,e=>{this._onMouseMoveOrKeyDown(e)})),this._register(ehe(r,On.KEY_UP,()=>{void 0!==this._showEndForLine&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([t,n])=>{const o=i(t);if(!o||!t.hasTriggerModifier||!this._editor.hasModel())return void e.clear();const{range:s,textElement:r}=o;if(s.equalsRange(this._stickyRangeProjectedOnEditor)){if("underline"===r.style.textDecoration)return}else this._stickyRangeProjectedOnEditor=s,e.clear();const a=new ot;let l;e.add(Dle(()=>a.dispose(!0))),Lye(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new to(s.startLineNumber,s.startColumn+1),!1,a.token).then(t=>{if(!a.token.isCancellationRequested)if(0!==t.length){this._candidateDefinitionsLength=t.length;const i=r;l!==i?(e.clear(),l=i,l.style.textDecoration="underline",e.add(Dle(()=>{l.style.textDecoration="none"}))):l||(l=i,l.style.textDecoration="underline",e.add(Dle(()=>{l.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async e=>{if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return;const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);t&&this._editor.hasModel()&&this._stickyRangeProjectedOnEditor&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:t.lineNumber,column:1})),this._instaService.invokeFunction(Rye,e,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))}))}_onContextMenu(e,t){const i=new Se(e,t);this._contextMenuService.showContextMenu({menuId:ds.StickyScrollContext,getAnchor:()=>i})}_onMouseMoveOrKeyDown(e){if(!e.shiftKey)return;if(!this._mouseTarget||!xhe(this._mouseTarget))return;const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);null!==t&&this._showEndForLine!==t&&(this._showEndForLine=t,this._renderStickyScroll())}_toggleFoldingRegionForLine(e){if(!this._foldingModel||null===e)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t?.foldingIcon;if(!i)return;Vye(this._foldingModel,1,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(75)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(131);if(!1===e.enabled)return this._editor.removeOverlayWidget(this._stickyScrollWidget),this._resetState(),this._sessionStore.clear(),void(this._enabled=!1);e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(e=>{e.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(e=>this._onTokensChange(e))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0),2===this._editor.getOption(76).renderType&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(131)||e.hasChanged(81)||e.hasChanged(75)||e.hasChanged(126)||e.hasChanged(76))&&this._readConfiguration(),(e.hasChanged(76)||e.hasChanged(52)||e.hasChanged(126))&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const t of e.ranges)if(i>=t.fromLineNumber&&i<=t.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const e=this._editor.getLayoutInfo().height/this._editor.getOption(75);this._maxStickyLines=Math.round(.25*e),this._renderStickyScroll(0)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization())return void this._resetState();const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(void 0===n||n===t.getVersionId())if(this._focused)if(-1===this._focusedStickyElementIndex)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,-1!==this._focusedStickyElementIndex&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const e=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),0===this._stickyScrollWidget.lineNumberCount?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(e)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}else await this._updateState(i)}_updateAndGetMinRebuildFromLine(e){if(void 0!==e){const t=void 0!==this._minRebuildFromLine?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){this._minRebuildFromLine=void 0,this._foldingModel=await(nZ.get(this._editor)?.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=z1.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=Math.min(this._maxStickyLines,this._editor.getOption(131).maxLineCount),t=this._editor.getScrollTop();let i=0;const n=[],o=[],s=this._editor.getVisibleRanges();if(0!==s.length){const r=new Y1(s[0].startLineNumber,s[s.length-1].endLineNumber),a=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(r);for(const s of a){const r=s.startLineNumber,a=s.endLineNumber,l=s.top,d=l+s.height,c=this._editor.getTopForLineNumber(r)-t,h=this._editor.getBottomForLineNumber(a)-t;if(l>c&&l<=h&&(n.push(r),o.push(a+1),d>h&&(i=h-d)),n.length===e)break}}return this._endLineNumbers=o,new z1(n,o,i,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},f0=g0,g0.ID="store.contrib.stickyScrollController",_0=g0,_0=f0=p0([m0(1,sT),m0(2,Tx),m0(3,Jn),m0(4,il),m0(5,vW),m0(6,es)],_0),b0=mpe("inlineEdit.originalBackground",bpe(iu,.2),Vae(1220,"Background color for the original text in inline edits."),!0),v0=mpe("inlineEdit.modifiedBackground",bpe(tu,.3),Vae(1221,"Background color for the modified text in inline edits."),!0),mpe("inlineEdit.originalChangedLineBackground",bpe(iu,.8),Vae(1222,"Background color for the changed lines in the original text of inline edits."),!0),w0=mpe("inlineEdit.originalChangedTextBackground",bpe(iu,.8),Vae(1223,"Overlay color for the changed text in the original text of inline edits."),!0),C0=mpe("inlineEdit.modifiedChangedLineBackground",{light:bpe(nu,.7),dark:bpe(nu,.7),hcDark:nu,hcLight:nu},Vae(1224,"Background color for the changed lines in the modified text of inline edits."),!0),y0=mpe("inlineEdit.modifiedChangedTextBackground",bpe(tu,.7),Vae(1225,"Overlay color for the changed text in the modified text of inline edits."),!0),S0=mpe("inlineEdit.gutterIndicator.primaryForeground",Ju,Vae(1226,"Foreground color for the primary inline edit gutter indicator.")),x0=mpe("inlineEdit.gutterIndicator.primaryBorder",tg,Vae(1227,"Border color for the primary inline edit gutter indicator.")),k0=mpe("inlineEdit.gutterIndicator.primaryBackground",{light:bpe(x0,.5),dark:bpe(x0,.4),hcDark:bpe(x0,.4),hcLight:bpe(x0,.5)},Vae(1228,"Background color for the primary inline edit gutter indicator.")),L0=mpe("inlineEdit.gutterIndicator.secondaryForeground",og,Vae(1229,"Foreground color for the secondary inline edit gutter indicator.")),D0=mpe("inlineEdit.gutterIndicator.secondaryBorder",sg,Vae(1230,"Border color for the secondary inline edit gutter indicator.")),I0=mpe("inlineEdit.gutterIndicator.secondaryBackground",D0,Vae(1231,"Background color for the secondary inline edit gutter indicator.")),N0=mpe("inlineEdit.gutterIndicator.successfulForeground",Ju,Vae(1232,"Foreground color for the successful inline edit gutter indicator.")),E0=mpe("inlineEdit.gutterIndicator.successfulBorder",tg,Vae(1233,"Border color for the successful inline edit gutter indicator.")),M0=mpe("inlineEdit.gutterIndicator.successfulBackground",E0,Vae(1234,"Background color for the successful inline edit gutter indicator.")),T0=mpe("inlineEdit.gutterIndicator.background",{hcDark:bpe("tab.inactiveBackground",.5),hcLight:bpe("tab.inactiveBackground",.5),dark:bpe("tab.inactiveBackground",.5),light:"#5f5f5f18"},Vae(1235,"Background color for the inline edit gutter indicator.")),R0=mpe("inlineEdit.originalBorder",{light:iu,dark:iu,hcDark:iu,hcLight:iu},Vae(1236,"Border color for the original text in inline edits.")),O0=mpe("inlineEdit.modifiedBorder",{light:fpe(tu,.6),dark:tu,hcDark:tu,hcLight:tu},Vae(1237,"Border color for the modified text in inline edits.")),A0=mpe("inlineEdit.tabWillAcceptModifiedBorder",{light:fpe(O0,0),dark:fpe(O0,0),hcDark:fpe(O0,0),hcLight:fpe(O0,0)},Vae(1238,"Modified border color for the inline edits widget when tab will accept it.")),P0=mpe("inlineEdit.tabWillAcceptOriginalBorder",{light:fpe(R0,0),dark:fpe(R0,0),hcDark:fpe(R0,0),hcLight:fpe(R0,0)},Vae(1239,"Original border color for the inline edits widget over the original text when tab will accept it.")),F0=class{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}build(){return this._data}},W0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},B0=function(e,t){return function(i,n){t(i,n,e)}},V0=class{constructor(e,t,i,n,o,s){this._model=e,this._close=t,this._editorObs=i,this._contextKeyService=n,this._keybindingService=o,this._commandService=s,this._inlineEditsShowCollapsed=this._editorObs.getOption(71).map(e=>e.edits.showCollapsed)}toDisposableLiveElement(){return this._createHoverContent().toDisposableLiveElement()}_createHoverContent(){const e=Qce("active",void 0),t=t=>({title:t.title,icon:t.icon,keybinding:"string"==typeof t.commandId?this._getKeybinding(t.commandArgs?void 0:t.commandId):Dce(this,e=>"string"==typeof t.commandId?void 0:this._getKeybinding(t.commandArgs?void 0:t.commandId.read(e)).read(e)),isActive:e.map(e=>e===t.id),onHoverChange:i=>e.set(i?t.id:void 0,void 0),onAction:()=>(this._close(!0),this._commandService.executeCommand("string"==typeof t.commandId?t.commandId:t.commandId.get(),...t.commandArgs??[]))}),i=function(e){return zn.div({class:"header",style:{color:gpe(ah),fontSize:"13px",fontWeight:"600",padding:"0 4px",lineHeight:28}},[e])}(this._model.displayName),n=dxe(t({id:"gotoAndAccept",title:`${Vae(1212,"Go To")} / ${Vae(1213,"Accept")}`,icon:go.check,commandId:QW})),o=dxe(t({id:"reject",title:Vae(1214,"Reject"),icon:go.close,commandId:eB})),s=this._model.extensionCommands.map((e,i)=>dxe(t({id:e.command.id+"_"+i,title:e.command.title,icon:e.icon??go.symbolEvent,commandId:e.command.id,commandArgs:e.command.arguments}))),r=this._inlineEditsShowCollapsed.map(e=>dxe(t(e?{id:"showExpanded",title:Vae(1215,"Show Expanded"),icon:go.expandAll,commandId:tB}:{id:"showCollapsed",title:Vae(1216,"Show Collapsed"),icon:go.collapseAll,commandId:tB}))),a=dxe(t({id:"snooze",title:Vae(1217,"Snooze"),icon:go.bellSlash,commandId:"editor.action.inlineSuggest.snooze"})),l=dxe(t({id:"settings",title:Vae(1218,"Settings"),icon:go.gear,commandId:"workbench.action.openSettings",commandArgs:["@tag:nextEditSuggestions"]})),d=this._model.action?[this._model.action]:[],c=d.length>0?function(e,t){return Dce({name:"inlineEdits.actionBar"},i=>zn.div({class:["action-widget-action-bar"],style:{padding:"3px 24px"}},[zn.div({ref:n=>{i.store.add(new NE(n,t)).push(e,{icon:!1,label:!0})}})]))}(d.map(e=>({id:e.id,label:e.title+"...",enabled:!0,run:()=>this._commandService.executeCommand(e.id,...e.arguments??[]),class:void 0,tooltip:e.tooltip??e.title})),{hoverDelegate:HR}):void 0;return h=[i,n,o,r,s.length?cxe():void 0,a,l,...s,c?cxe():void 0,c],zn.div({class:"content",style:{margin:4,minWidth:180}},h);var h}_getKeybinding(e){return e?Hce(this._contextKeyService.onDidChangeContext,()=>this._keybindingService.lookupKeybinding(e)):z_e(void 0)}},V0=W0([B0(3,es),B0(4,xw),B0(5,fo)],V0),H0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},z0=function(e,t){return function(i,n){t(i,n,e)}},U0=class extends Ie{get model(){const e=this._model.get();if(!e)throw new y("Inline Edit Model not available");return e}constructor(e,t,i,n,o,s,r,a,l,d){super(),this._editorObs=e,this._originalRange=t,this._verticalOffset=i,this._model=n,this._isHoveringOverInlineEdit=o,this._focusIsInMenu=s,this._hoverService=r,this._instantiationService=a,this._accessibilityService=l,this._tabAction=Dce(this,e=>{const t=this._model.read(e);return t?t.tabAction.read(e):NX.Inactive}),this._hoverVisible=Qce(this,!1),this.isHoverVisible=this._hoverVisible,this._isHoveredOverIcon=Qce(this,!1),this._isHoveredOverIconDebounced=Uce(this._isHoveredOverIcon,100),this.isHoveredOverIcon=this._isHoveredOverIconDebounced,this._isHoveredOverInlineEditDebounced=Uce(this._isHoveringOverInlineEdit,100),this._gutterIndicatorStyles=this._tabAction.map(this,(e,t)=>{switch(e){case NX.Inactive:return{background:JSe(I0,d).read(t).toString(),foreground:JSe(L0,d).read(t).toString(),border:JSe(D0,d).read(t).toString()};case NX.Jump:return{background:JSe(k0,d).read(t).toString(),foreground:JSe(S0,d).read(t).toString(),border:JSe(x0,d).read(t).toString()};case NX.Accept:return{background:JSe(M0,d).read(t).toString(),foreground:JSe(N0,d).read(t).toString(),border:JSe(E0,d).read(t).toString()};default:ele()}}),this._originalRangeObs=axe(this._originalRange),this._state=Dce(this,e=>{const t=this._originalRangeObs.read(e);if(t)return{range:t,lineOffsetRange:this._editorObs.observeLineOffsetRange(t,e.store)}}),this._stickyScrollController=_0.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?Hce(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):z_e(0),this._lineNumberToRender=Dce(this,e=>{if(0!==this._verticalOffset.read(e))return"";const t=this._originalRange.read(e)?.startLineNumber,i=this._editorObs.getOption(76).read(e);if(void 0===t||0===i.renderType)return"";if(3===i.renderType){const i=this._editorObs.cursorPosition.read(e);return t%10==0||i&&i.lineNumber===t?t.toString():""}if(2===i.renderType){const i=this._editorObs.cursorPosition.read(e);if(!i)return"";const n=Math.abs(t-i.lineNumber);return 0===n?t.toString():n.toString()}return 4===i.renderType?i.renderFn?i.renderFn(t):"":t.toString()}),this._availableWidthForIcon=Dce(this,e=>{const t=this._editorObs.editor.getModel(),i=this._editorObs.editor,n=this._editorObs.layoutInfo.read(e),o=n.decorationsLeft+n.decorationsWidth-n.glyphMarginLeft;if(!t||o<=0)return()=>0;if(0===n.lineNumbersLeft)return()=>o;const s=this._editorObs.getOption(76).read(e);if(2===s.renderType||0===s.renderType)return()=>o;const r=i.getOption(59).typicalHalfwidthCharacterWidth,a=n.lineNumbersLeft+n.lineNumbersWidth,l=(t.getLineCount()+1).toString().length,d=[];for(let c=1;c<=l;c++){const e=10**(c-1),t=i.getTopForLineNumber(e),s=c*r,l=Math.min(o,Math.max(0,a-s-n.glyphMarginLeft));d.push({firstLineNumberWithDigitCount:e,topOfLineNumber:t,usableWidthLeftOfLineNumber:l})}return e=>{for(let t=d.length-1;t>=0;t--)if(e>=d[t].topOfLineNumber)return d[t].usableWidthLeftOfLineNumber;throw new y("Could not find avilable width for icon")}}),this._layout=Dce(this,e=>{const t=this._state.read(e);if(!t)return;const i=this._editorObs.layoutInfo.read(e),n=this._editorObs.observeLineHeightForLine(t.range.map(e=>e.startLineNumber)).read(e),o=i.decorationsLeft+i.decorationsWidth-i.glyphMarginLeft-4,s=i.height-4,r=H1.fromLeftTopWidthHeight(2,2,o,s),a=r.withTop(this._stickyScrollHeight.read(e)),l=r.withTop(a.top+2),d=t.lineOffsetRange.read(e),c=H1.fromRanges(hl.fromTo(l.left,l.right),d),h=n,u=this._verticalOffset.read(e),g=c.withHeight(h).translateY(u),p=a.containsRect(g),m=this._tabAction.map(e=>e===NX.Accept?go.keyboardTab:go.arrowRight),f=Dce(this,e=>this._isHoveredOverIconDebounced.read(e)||this._isHoveredOverInlineEditDebounced.read(e)?go.check:this._tabAction.read(e)===NX.Accept?go.keyboardTab:(this._editorObs.cursorLineNumber.read(e)??0)<=t.range.read(e).startLineNumber?go.keyboardTabAbove:go.keyboardTabBelow),_=e=>{const t=this._availableWidthForIcon.read(void 0)(e.bottom+this._editorObs.editor.getScrollTop())-2;return Math.max(Math.min(t,22),16)};if(p){const e=g;let t;t=0===i.lineNumbersWidth?Math.min(Math.max(i.lineNumbersLeft-r.left,0),e.width-22):Math.max(i.lineNumbersLeft+i.lineNumbersWidth-r.left,0);const n=e.withWidth(t),o=Math.max(Math.min(i.decorationsWidth,22),16);return{gutterEditArea:c,icon:f,iconDirection:"right",iconRect:e.withWidth(o).translateX(t),pillRect:e,lineNumberRect:n}}const b=r.intersect(c);if(b&&b.height>=h){const e=g.moveToBeContainedIn(l).moveToBeContainedIn(b),t=e.withWidth(_(e));return{gutterEditArea:c,icon:f,iconDirection:"right",iconRect:t,pillRect:t}}const v=g.moveToBeContainedIn(r),w=v.withWidth(_(v)),C=w;return{gutterEditArea:c,icon:m,iconDirection:w.top<g.top?"top":"bottom",iconRect:C,pillRect:w}}),this._iconRef=zn.ref(),this.isVisible=this._layout.map(e=>!!e),this._indicator=zn.div({class:"inline-edits-view-gutter-indicator",onclick:()=>{const e=this._layout.get()?.icon.get()===go.check;this._editorObs.editor.focus(),e?this.model.accept():this.model.jump()},tabIndex:0,style:{position:"absolute",overflow:"visible"}},axe(this._layout).map(e=>e?[zn.div({style:{position:"absolute",background:gpe(T0),borderRadius:"4px",...lxe(t=>e.read(t).gutterEditArea)}}),zn.div({class:"icon",ref:this._iconRef,onmouseenter:()=>{this._showHover()},style:{cursor:"pointer",zIndex:"20",position:"absolute",backgroundColor:this._gutterIndicatorStyles.map(e=>e.background),"--vscodeIconForeground":this._gutterIndicatorStyles.map(e=>e.foreground),border:this._gutterIndicatorStyles.map(e=>`1px solid ${e.border}`),boxSizing:"border-box",borderRadius:"4px",display:"flex",justifyContent:"flex-end",transition:"background-color 0.2s ease-in-out, width 0.2s ease-in-out",...lxe(t=>e.read(t).pillRect)}},[zn.div({className:"line-number",style:{lineHeight:e.map(e=>e.lineNumberRect?e.lineNumberRect.height:0),display:e.map(e=>e.lineNumberRect?"flex":"none"),alignItems:"center",justifyContent:"flex-end",width:e.map(e=>e.lineNumberRect?e.lineNumberRect.width:0),height:"100%",color:this._gutterIndicatorStyles.map(e=>e.foreground)}},this._lineNumberToRender),zn.div({style:{rotate:e.map(e=>`${function(e){switch(e){case"top":return 90;case"bottom":return-90;case"right":return 0}}(e.iconDirection)}deg`),transition:"rotate 0.2s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",marginRight:e.map(e=>e.pillRect.width-e.iconRect.width-(e.lineNumberRect?.width??0)),width:e.map(e=>e.iconRect.width)}},[e.map((e,t)=>pve(e.icon.read(t)))])])]:[])).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._indicator.element,position:z_e(null),allowEditorOverflow:!1,minContentWidthInPx:z_e(0)})),this._register(this._editorObs.editor.onMouseMove(e=>{if(void 0===this._state.get())return;const t=this._iconRef.element.getBoundingClientRect(),i=H1.fromLeftTopWidthHeight(t.left,t.top,t.width,t.height),n=new gT(e.event.posx,e.event.posy);this._isHoveredOverIcon.set(i.containsPoint(n),void 0)})),this._register(this._editorObs.editor.onDidScrollChange(()=>{this._isHoveredOverIcon.set(!1,void 0)})),this._register(ume(this._isHoveredOverInlineEditDebounced,e=>{e&&this.triggerAnimation()})),this._register(Rce(e=>{this._indicator.readEffect(e),this._indicator.element&&this._editorObs.editor.applyFontInfo(this._indicator.element)}))}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{outline:`2px solid ${this._gutterIndicatorStyles.map(e=>e.border).get()}`,outlineOffset:"-1px",offset:0},{outline:"2px solid transparent",outlineOffset:"10px",offset:1}],{duration:500}).finished}_showHover(){if(this._hoverVisible.get())return;const e=new De,t=e.add(this._instantiationService.createInstance(V0,this.model,e=>{e&&this._editorObs.editor.focus(),n?.dispose()},this._editorObs).toDisposableLiveElement()),i=e.add(Ehe(t.element));e.add(i.onDidBlur(()=>this._focusIsInMenu.set(!1,void 0))),e.add(i.onDidFocus(()=>this._focusIsInMenu.set(!0,void 0))),e.add(Dle(()=>this._focusIsInMenu.set(!1,void 0)));const n=this._hoverService.showInstantHover({target:this._iconRef.element,content:t.element});n?(this._hoverVisible.set(!0,void 0),e.add(this._editorObs.editor.onDidScrollChange(()=>n.dispose())),e.add(n.onDispose(()=>{this._hoverVisible.set(!1,void 0),e.dispose()}))):e.dispose()}},U0=H0([z0(6,BR),z0(7,Jn),z0(8,Fc),z0(9,Sf)],U0),K0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},q0=function(e,t){return function(i,n){t(i,n,e)}},function(e){e.FirstTime="firstTime",e.SecondTime="secondTime",e.Active="active"}(j0||(j0={})),$0=class extends Ie{constructor(e,t,i,n,o,s){super(),this._host=e,this._model=t,this._indicator=i,this._collapsedView=n,this._storageService=o,this._configurationService=s,this._disposables=this._register(new Ne),this._setupDone=Qce({name:"setupDone"},!1),this._activeCompletionId=Dce(e=>{const t=this._model.read(e);if(!t)return;if(!this._setupDone.read(e))return;const i=this._indicator.read(e);return i&&i.isVisible.read(e)?t.inlineEdit.inlineCompletion.identity.id:void 0}),this._register(this._initializeDebugSetting()),this._disposables.value=this.setupNewUserExperience(),this._setupDone.set(!0,void 0)}setupNewUserExperience(){if(this.getNewUserType()===j0.Active)return;const e=new De;let t=!1,i=!1,n=0,o=0;var s,r;return e.add((s=this._activeCompletionId,r=async(e,s,r,a)=>{if(void 0===e)return;let l=this.getNewUserType();switch(l){case j0.FirstTime:(n++>=5||t)&&(l=j0.SecondTime,this.setNewUserType(l));break;case j0.SecondTime:o++>=3&&i&&(l=j0.Active,this.setNewUserType(l))}switch(l){case j0.FirstTime:for(let e=0;e<3&&!a.isCancellationRequested;e++)await(this._indicator.get()?.triggerAnimation()),await Tle(500);break;case j0.SecondTime:this._indicator.get()?.triggerAnimation()}},gme(s,(e,t,i,n)=>{r(e,t,i,Ile(n))}))),e.add(Rce(e=>{this._collapsedView.isVisible.read(e)&&this.getNewUserType()!==j0.Active&&this._collapsedView.triggerAnimation()})),e.add(Pce((e,i)=>{const n=this._indicator.read(e);n&&i.add(ume(n.isHoveredOverIcon,async e=>{e&&(t=!0)}))})),e.add(Pce((e,t)=>{const n=this._host.read(e);n&&t.add(n.onDidAccept(()=>{i=!0}))})),e}getNewUserType(){return this._storageService.get("inlineEditsGutterIndicatorUserKind",-1,j0.FirstTime)}setNewUserType(e){switch(e){case j0.FirstTime:throw new y("UserKind should not be set to first time");case j0.SecondTime:break;case j0.Active:this._disposables.clear()}this._storageService.store("inlineEditsGutterIndicatorUserKind",e,-1,0)}_initializeDebugSetting(){const e="editor.inlineSuggest.edits.resetNewUserExperience";return this._configurationService.getValue(e)&&this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._configurationService.onDidChangeConfiguration(t=>{t.affectsConfiguration(e)&&this._configurationService.getValue(e)&&(this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._disposables.value=this.setupNewUserExperience())})}},$0=K0([q0(4,eR),q0(5,ka)],$0),G0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Z0=function(e,t){return function(i,n){t(i,n,e)}},Y0=class extends Ie{constructor(e,t,i){super(),this._editor=e,this._edit=t,this._accessibilityService=i,this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this._iconRef=zn.ref(),this.isHovered=z_e(!1),this._editorObs=bwe(this._editor);const n=this._edit.map(e=>e?.edit.replacements[0]??null).map(e=>e?_Se(e,this._editor.getModel()).range.getStartPosition():null),o=this._editorObs.observePosition(n,this._store),s=Dce(e=>{const t=o.read(e);if(!t)return null;const i=this._editorObs.layoutInfoContentLeft.read(e),n=this._editorObs.scrollLeft.read(e);return new gT(i+t.x-n,t.y)}),r=zn.div({class:"inline-edits-collapsed-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[[this.getCollapsedIndicator(s)]]).keepUpdated(this._store).element;this._register(this._editorObs.createOverlayWidget({domNode:r,position:z_e(null),allowEditorOverflow:!1,minContentWidthInPx:z_e(0)})),this.isVisible=this._edit.map((e,t)=>!!e&&null!==s.read(t))}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{offset:0,transform:"translateY(-3px)"},{offset:.2,transform:"translateY(1px)"},{offset:.36,transform:"translateY(-1px)"},{offset:.52,transform:"translateY(1px)"},{offset:.68,transform:"translateY(-1px)"},{offset:.84,transform:"translateY(1px)"},{offset:1,transform:"translateY(0px)"}],{duration:2e3}).finished}getCollapsedIndicator(e){const t=this._editorObs.layoutInfoContentLeft,i=e.map((e,i)=>e?e.deltaX(-t.read(i)):null),n=this.createIconPath(i);return zn.svg({class:"collapsedView",ref:this._iconRef,style:{position:"absolute",...lxe(e=>oxe(this._editorObs).read(e)),overflow:"hidden",pointerEvents:"none"}},[zn.svgElem("path",{class:"collapsedViewPath",d:n,fill:gpe(x0)})])}createIconPath(e){return e.map(e=>{if(!e)return(new F0).build();const t=e.deltaX(-3).deltaY(-1),i=t.deltaX(6),n=t.deltaY(1),o=i.deltaY(1),s=n.deltaX(3).deltaY(3);return(new F0).moveTo(t).lineTo(i).lineTo(o).lineTo(s).lineTo(n).lineTo(t).build()})}},Y0=G0([Z0(2,Fc)],Y0),Q0=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},X0=function(e,t){return function(i,n){t(i,n,e)}},J0=class extends Ie{constructor(e,t,i,n,o){super(),this._editor=e,this._languageService=o,this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this._isHovered=Qce(this,!1),this.isHovered=this._isHovered,this._viewRef=zn.ref(),this._editorObs=bwe(this._editor);const s=i.map((e,t)=>{let i;switch(e){case NX.Inactive:i=I0;break;case NX.Jump:i=k0;break;case NX.Accept:i=M0}return{border:JSe(i,n).read(t).toString(),background:gpe(wh)}}),r=t.map(e=>e?this.getState(e):void 0),a=r.map(e=>e?this.getRendering(e,s):void 0);this.minEditorScrollHeight=Dce(this,e=>{const t=r.read(e);return t?t.rect.read(e).bottom+this._editor.getScrollTop():0});const l=zn.div({class:"inline-edits-custom-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[a]).keepUpdated(this._store);this._register(this._editorObs.createOverlayWidget({domNode:l.element,position:z_e(null),allowEditorOverflow:!1,minContentWidthInPx:qce(this,(e,t)=>{const i=r.read(e);if(!i)return t??0;const n=i.rect.map(e=>e.right).read(e)+this._editorObs.layoutInfoVerticalScrollbarWidth.read(e)+4-this._editorObs.layoutInfoContentLeft.read(e);return Math.max(t??0,n)}).recomputeInitiallyAndOnChange(this._store)})),this._register(Rce(e=>{a.read(e)?this._isHovered.set(l.isHovered.read(e),void 0):this._isHovered.set(!1,void 0)}))}fitsInsideViewport(e,t,i){const n=this._editorObs.layoutInfoWidth.read(i),o=this._editorObs.layoutInfoContentLeft.read(i),s=this._editor.getLayoutInfo().verticalScrollbarWidth,r=0!==this._editorObs.layoutInfoMinimap.read(i).minimapLeft?this._editorObs.layoutInfoMinimap.read(i).minimapWidth:0;return txe(this._editorObs,e,void 0)+nxe(t,this._editor,this._editor.getModel())+18<n-o-s-r}getState(e){const t=Dce(this,t=>{const i=e.range.startLineNumber,n=e.range.endLineNumber,o=e.range.startColumn,s=e.range.endColumn,r=this._editor.getModel()?.getLineCount()??0;return{lineWidth:txe(this._editorObs,new Qw(i,i+1),t),lineWidthBelow:i+1<=r?txe(this._editorObs,new Qw(i+1,i+2),t):void 0,lineWidthAbove:i-1>=1?txe(this._editorObs,new Qw(i-1,i),t):void 0,startContentLeftOffset:this._editor.getOffsetForColumn(i,o),endContentLeftOffset:this._editor.getOffsetForColumn(n,s)}}),i=e.range.startLineNumber,n=e.range.endLineNumber,o=this.fitsInsideViewport(new Qw(i,n+1),e.content,void 0);return{rect:Dce(this,s=>{const r=this._editorObs.getOption(59).read(s).typicalHalfwidthCharacterWidth,{lineWidth:a,lineWidthBelow:l,lineWidthAbove:d,startContentLeftOffset:c,endContentLeftOffset:h}=t.read(s),u=this._editorObs.layoutInfoContentLeft.read(s),g=this._editorObs.observeLineHeightForLine(i).recomputeInitiallyAndOnChange(s.store).read(s),p=this._editorObs.scrollTop.read(s),m=this._editorObs.scrollLeft.read(s);let f,_,b;f=i===n&&h+5*r>=a&&o?"end":void 0!==l&&l+14-4-4<c?"below":void 0!==d&&d+14-4-4<c?"above":"end";let v=0,w=0;switch(f){case"end":_=this._editorObs.editor.getTopForLineNumber(i),b=a,v=18;break;case"below":_=this._editorObs.editor.getTopForLineNumber(i+1),b=c,v=8,w=2;break;case"above":_=this._editorObs.editor.getTopForLineNumber(i-1),b=c,v=8,w=2}return H1.fromLeftTopWidthHeight(u+b-m,_-p,r*e.content.length,g).withMargin(0,4).translateX(v).translateY(w)}),label:e.content,kind:e.style}}getRendering(e,t){const i=document.createElement("div"),n=this._editor.getModel().tokenization.tokenizeLinesAt(1,[e.label])?.[0];let o;o=n&&e.kind===_b.Code?ml.fromLineTokens(n).toLineTokens(e.label,this._languageService.languageIdCodec):gl.createEmpty(e.label,this._languageService.languageIdCodec);const s=uwe(new JM([o]),eT.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),[],i,!0);i.style.width=`${s.minWidthInPx}px`;const r=e.rect.map(e=>e.withMargin(0,4));return zn.div({class:"collapsedView",ref:this._viewRef,style:{position:"absolute",...lxe(e=>r.read(e)),overflow:"hidden",boxSizing:"border-box",cursor:"pointer",border:t.map(e=>`1px solid ${e.border}`),borderRadius:"4px",backgroundColor:t.map(e=>e.background),display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap"},onmousedown:e=>{e.preventDefault()},onclick:e=>{this._onDidClick.fire(new Se(pn(e),e))}},[i])}},J0=Q0([X0(3,Sf),X0(4,La)],J0),e2=class extends Ie{constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._uiState=i,this._tabAction=n,this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this._display=Dce(this,e=>this._uiState.read(e)?"block":"none"),this._editorMaxContentWidthInRange=Dce(this,e=>{const t=this._originalDisplayRange.read(e);return t?(this._editorObs.versionId.read(e),qce(this,(e,i)=>{const n=txe(this._editorObs,t,e);return Math.max(n,i??0)})):z_e(0)}).map((e,t)=>e.read(t)),this._maxPrefixTrim=Dce(this,e=>{const t=this._uiState.read(e);return t?ixe(t.deletions,t.originalRange,[],this._editor):{prefixTrim:0,prefixLeftOffset:0}}),this._editorLayoutInfo=Dce(this,e=>{const t=this._edit.read(e);if(!t)return null;if(!this._uiState.read(e))return null;const i=this._editorObs.layoutInfo.read(e),n=this._editorObs.scrollLeft.read(e),o=this._editorObs.getOption(59).map(e=>e.typicalHalfwidthCharacterWidth).read(e),s=i.contentLeft+Math.max(this._editorMaxContentWidthInRange.read(e),o)-n,r=t.originalLineRange,a=this._originalVerticalStartPosition.read(e)??this._editor.getTopForLineNumber(r.startLineNumber)-this._editorObs.scrollTop.read(e),l=this._originalVerticalEndPosition.read(e)??this._editor.getTopForLineNumber(r.endLineNumberExclusive)-this._editorObs.scrollTop.read(e),d=i.contentLeft+this._maxPrefixTrim.read(e).prefixLeftOffset-n;return s<=d?null:{codeRect:H1.fromLeftTopRightBottom(d,a,s,l).withMargin(0,0),contentLeft:i.contentLeft}}).recomputeInitiallyAndOnChange(this._store),this._originalOverlay=zn.div({style:{pointerEvents:"none"}},Dce(this,e=>{const t=axe(this._editorLayoutInfo).read(e);if(!t)return;const i=t.map(e=>H1.fromLeftTopRightBottom(e.contentLeft-4-1,e.codeRect.top,e.contentLeft,e.codeRect.bottom)),n=Dce(this,e=>{const n=t.read(e).codeRect,o=i.read(e);return n.intersectHorizontal(new hl(o.left,Number.MAX_SAFE_INTEGER))}),o=this._uiState.map(e=>e?.inDiffEditor?3:1).read(e),s=n.map(e=>e.withMargin(o,o));return[zn.div({class:"originalSeparatorDeletion",style:{...s.read(e).toStyles(),borderRadius:"4px",border:`${1+o}px solid ${gpe(wh)}`,boxSizing:"border-box"}}),zn.div({class:"originalOverlayDeletion",style:{...n.read(e).toStyles(),borderRadius:"4px",border:XSe(this._tabAction).map(e=>`1px solid ${gpe(e)}`),boxSizing:"border-box",backgroundColor:gpe(b0)}}),zn.div({class:"originalOverlayHiderDeletion",style:{...i.read(e).toStyles(),backgroundColor:gpe(wh)}})]})).keepUpdated(this._store),this._nonOverflowView=zn.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._originalOverlay]]).keepUpdated(this._store),this.isHovered=z_e(!1),this._editorObs=bwe(this._editor);const o=Dce(this,e=>{const t=this._edit.read(e);return t?new to(t.originalLineRange.startLineNumber,1):null}),s=Dce(this,e=>{const t=this._edit.read(e);return t?new to(t.originalLineRange.endLineNumberExclusive,1):null});this._originalDisplayRange=this._uiState.map(e=>e?.originalRange),this._originalVerticalStartPosition=this._editorObs.observePosition(o,this._store).map(e=>e?.y),this._originalVerticalEndPosition=this._editorObs.observePosition(s,this._store).map(e=>e?.y),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:z_e(null),allowEditorOverflow:!1,minContentWidthInPx:Dce(this,e=>{const t=this._editorLayoutInfo.read(e);return null===t?0:t.codeRect.width})}))}},t2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},i2=function(e,t){return function(i,n){t(i,n,e)}},n2=class extends Ie{constructor(e,t,i,n,o){super(),this._editor=e,this._input=t,this._tabAction=i,this._languageService=o,this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this._state=Dce(this,e=>{const t=this._input.read(e);if(!t)return;const i=this._editor.getModel(),n=i.getEOL();if(1===t.startColumn&&t.lineNumber>1&&0!==i.getLineLength(t.lineNumber)&&t.text.endsWith(n)&&!t.text.startsWith(n)){const e=i.getLineLength(t.lineNumber-1)+1;return{lineNumber:t.lineNumber-1,column:e,text:n+t.text.slice(0,-n.length)}}return{lineNumber:t.lineNumber,column:t.startColumn,text:t.text}}),this._trimVertically=Dce(this,e=>{const t=this._state.read(e),i=t?.text;if(!i||""===i.trim())return{topOffset:0,bottomOffset:0,linesTop:0,linesBottom:0};const n=this._editor.getLineHeightForPosition(new to(t.lineNumber,1)),o=this._editor.getModel().getEOL();let s=0,r=0,a=0;for(;a<i.length&&i.startsWith(o,a);a+=o.length)s+=1;for(let l=i.length;l>a&&i.endsWith(o,l);l-=o.length)r+=1;return{topOffset:s*n,bottomOffset:r*n,linesTop:s,linesBottom:r}}),this._maxPrefixTrim=Dce(this,e=>{const t=this._state.read(e);if(!t)return{prefixLeftOffset:0,prefixTrim:0};const i=this._editor.getModel(),n=i.getEOL(),o=this._trimVertically.read(e),s=t.text.split(n),r=s.slice(o.linesTop,s.length-o.linesBottom);return 0===o.linesTop&&(r[0]=i.getLineContent(t.lineNumber)+r[0]),ixe([],new Qw(t.lineNumber,t.lineNumber+(o.linesTop>0?0:1)),r,this._editor)}),this._ghostText=Dce(e=>{const t=this._state.read(e),i=this._maxPrefixTrim.read(e);if(!t)return;const n=this._editor.getModel().getEOL(),o=t.text.split(n).map((e,t)=>new Wk(new mr(t+1,0===t?1:i.prefixTrim+1,t+1,e.length+1),"modified-background",0));return new jQ(t.lineNumber,[new $Q(t.column,t.text,!1,o)])}),this._display=Dce(this,e=>this._state.read(e)?"block":"none"),this._editorMaxContentWidthInRange=Dce(this,e=>{const t=this._state.read(e);if(!t)return 0;this._editorObs.versionId.read(e);const i=this._editor.getModel(),n=i.getEOL(),o=t.text.startsWith(n)?"":i.getValueInRange(new mr(t.lineNumber,1,t.lineNumber,t.column)),s=i.getValueInRange(new mr(t.lineNumber,t.column,t.lineNumber,i.getLineLength(t.lineNumber)+1)),r=(o+t.text+s).split(n),a=eT.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),l=r.map(e=>{const n=i.tokenization.tokenizeLinesAt(t.lineNumber,[e])?.[0];let o;return o=n?ml.fromLineTokens(n).toLineTokens(e,this._languageService.languageIdCodec):gl.createEmpty(e,this._languageService.languageIdCodec),uwe(new JM([o]),a,[],Ahe("div"),!0).minWidthInPx});return Math.max(...l)}),this.startLineOffset=this._trimVertically.map(e=>e.topOffset),this.originalLines=this._state.map(e=>e?new Qw(e.lineNumber,Math.min(e.lineNumber+2,this._editor.getModel().getLineCount()+1)):void 0),this._overlayLayout=Dce(this,e=>{this._ghostText.read(e);const t=this._state.read(e);if(!t)return null;this._editorObs.observePosition(Qce(this,new to(t.lineNumber,t.column)),e.store).read(e);const i=this._editorObs.layoutInfo.read(e),n=this._editorObs.scrollLeft.read(e),o=this._editorObs.layoutInfoVerticalScrollbarWidth.read(e),s=i.contentLeft+this._editorMaxContentWidthInRange.read(e)-n,r=this._maxPrefixTrim.read(e).prefixLeftOffset??0,a=i.contentLeft+r-n;if(s<=a)return null;const{topOffset:l,bottomOffset:d}=this._trimVertically.read(e),c=this._editorObs.scrollTop.read(e),h=this._ghostTextView.height.read(e)-l-d,u=this._editor.getTopForLineNumber(t.lineNumber)-c+l,g=new H1(a,u,s,u+h);return{overlay:g,startsAtContentLeft:0===r,contentLeft:i.contentLeft,minContentWidthRequired:r+g.width+o}}).recomputeInitiallyAndOnChange(this._store),this._modifiedOverlay=zn.div({style:{pointerEvents:"none"}},Dce(this,e=>{const t=axe(this._overlayLayout).read(e);if(!t)return;const i=t.map(e=>H1.fromLeftTopRightBottom(e.contentLeft-4-1,e.overlay.top,e.contentLeft,e.overlay.bottom)).read(e),n=this._input.map(e=>e?.inDiffEditor?3:1).read(e),o=t.map(e=>e.overlay.withMargin(0,1,0,e.startsAtContentLeft?0:1).intersectHorizontal(new hl(i.left,Number.MAX_SAFE_INTEGER))),s=o.map(e=>e.withMargin(n,n));return[zn.div({class:"originalUnderlayInsertion",style:{...s.read(e).toStyles(),borderRadius:4,border:`${1+n}px solid ${gpe(wh)}`,boxSizing:"border-box"}}),zn.div({class:"originalOverlayInsertion",style:{...o.read(e).toStyles(),borderRadius:4,border:QSe(this._tabAction).map(e=>`1px solid ${gpe(e)}`),boxSizing:"border-box",backgroundColor:gpe(v0)}}),zn.div({class:"originalOverlayHiderInsertion",style:{...i.toStyles(),backgroundColor:gpe(wh)}})]})).keepUpdated(this._store),this._view=zn.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._modifiedOverlay]]).keepUpdated(this._store),this._editorObs=bwe(this._editor),this._ghostTextView=this._register(n.createInstance(E1,this._editor,{ghostText:this._ghostText,minReservedLineCount:z_e(0),targetTextModel:this._editorObs.model.map(e=>e??void 0),warning:z_e(void 0),handleInlineCompletionShown:z_e(()=>{})},Qce(this,{syntaxHighlightingEnabled:!0,extraClasses:["inline-edit"]}),!0,!0)),this.isHovered=this._ghostTextView.isHovered,this._register(this._ghostTextView.onDidClick(e=>{this._onDidClick.fire(e)})),this._register(this._editorObs.createOverlayWidget({domNode:this._view.element,position:z_e(null),allowEditorOverflow:!1,minContentWidthInPx:Dce(this,e=>{const t=this._overlayLayout.read(e);return null===t?0:t.minContentWidthRequired})}))}},n2=t2([i2(3,Jn),i2(4,La)],n2),o2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},s2=function(e,t){return function(i,n){t(i,n,e)}},r2=class extends Ie{constructor(e,t,i,n,o,s){super(),this._editor=e,this._edit=t,this._isInDiffEditor=i,this._tabAction=n,this._languageService=o,this._themeService=s,this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this._maxPrefixTrim=this._edit.map((e,t)=>e?ixe(e.replacements.flatMap(e=>[e.originalRange,e.modifiedRange]),e.originalRange,e.modifiedLines,this._editor.editor,t):void 0),this._modifiedLineElements=Dce(this,e=>{const t=[];let i=0;const n=this._maxPrefixTrim.read(e),o=this._edit.read(e);if(!o||!n)return;const s=n.prefixTrim,r=function(e){const t=[];for(;e.length;){let i=e.shift();i.startLineNumber!==i.endLineNumber&&(e.push(new mr(i.startLineNumber+1,1,i.endLineNumber,i.endColumn)),i=new mr(i.startLineNumber,i.startColumn,i.startLineNumber,Number.MAX_SAFE_INTEGER)),t.push(i)}return t}(o.replacements.map(e=>e.modifiedRange)).map(e=>new mr(e.startLineNumber,e.startColumn-s,e.endLineNumber,e.endColumn-s)),a=this._editor.model.get(),l=o.modifiedRange.startLineNumber;for(let d=0;d<o.modifiedRange.length;d++){const n=document.createElement("div"),c=l+d,h=o.modifiedLines[d].slice(s),u=a.tokenization.tokenizeLinesAt(c,[h])?.[0];let g;g=u?ml.fromLineTokens(u).toLineTokens(h,this._languageService.languageIdCodec):gl.createEmpty(h,this._languageService.languageIdCodec);const p=[];for(const e of r.filter(e=>e.startLineNumber===c)){const t=Math.min(e.endColumn,h.length+1);p.push(new Wk(new mr(1,e.startColumn,1,t),"inlineCompletions-modified-bubble",0))}const m=uwe(new JM([g]),eT.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),p,n,!0);this._editor.getOption(59).read(e),i=Math.max(i,m.minWidthInPx),t.push(n)}return{lines:t,requiredWidth:i}}),this._layout=Dce(this,e=>{const t=this._modifiedLineElements.read(e),i=this._maxPrefixTrim.read(e),n=this._edit.read(e);if(!t||!i||!n)return;const{prefixLeftOffset:o}=i,{requiredWidth:s}=t,r=this._editor.observeLineHeightsForLineRange(n.originalRange).read(e),a=(()=>{const e=r.slice(0,n.modifiedRange.length);for(;e.length<n.modifiedRange.length;)e.push(r[r.length-1]);return e})(),l=this._editor.layoutInfoContentLeft.read(e),d=this._editor.layoutInfoVerticalScrollbarWidth.read(e),c=this._editor.scrollLeft.read(e),h=this._editor.scrollTop.read(e),u=l-c,g=this._editor.editor.getModel(),p=n.originalRange.mapToLineArray(e=>this._editor.editor.getOffsetForColumn(e,g.getLineMaxColumn(e))-o),m=Math.max(...p,s),f=n.originalRange.startLineNumber,_=n.originalRange.endLineNumberExclusive-1,b=this._editor.editor.getTopForLineNumber(f)-h,v=this._editor.editor.getBottomForLineNumber(_)-h,w=H1.fromLeftTopWidthHeight(u+o,b,m,v-b),C=H1.fromLeftTopWidthHeight(w.left,w.bottom,w.width,a.reduce((e,t)=>e+t,0)),y=H1.hull([w,C]),S=y.intersectVertical(new hl(w.bottom,Number.MAX_SAFE_INTEGER));return{originalLinesOverlay:w,modifiedLinesOverlay:C,background:y,lowerBackground:S,lowerText:new H1(S.left,S.top,S.right,S.bottom),modifiedLineHeights:a,minContentWidthRequired:o+m+d}}),this._viewZoneInfo=Dce(e=>{if(!this._editor.getOption(71).map(e=>"always"===e.edits.allowCodeShifting).read(e))return;const t=this._layout.read(e),i=this._edit.read(e);return t&&i?{height:t.lowerBackground.height,lineNumber:i.originalRange.endLineNumberExclusive}:void 0}),this.minEditorScrollHeight=Dce(this,e=>{const t=axe(this._layout).read(e);return t&&void 0===this._viewZoneInfo.read(e)?t.read(e).lowerText.bottom+this._editor.editor.getScrollTop():0}),this._div=zn.div({class:"line-replacement"},[Dce(this,e=>{const t=axe(this._layout).read(e),i=this._modifiedLineElements.read(e);if(!t||!i)return[];const n=t.read(e),o=this._editor.layoutInfoContentLeft.read(e),s=this._isInDiffEditor.read(e)?3:1;i.lines.forEach((e,t)=>{e.style.width=`${n.lowerText.width}px`,e.style.height=`${n.modifiedLineHeights[t]}px`,e.style.position="relative"});const r=QSe(this._tabAction).read(e),a=XSe(this._tabAction).read(e);return[zn.div({style:{position:"absolute",...lxe(e=>oxe(this._editor).read(e)),overflow:"hidden",pointerEvents:"none"}},[zn.div({class:"borderAroundLineReplacement",style:{position:"absolute",...lxe(e=>t.read(e).background.translateX(-o).withMargin(s)),borderRadius:"4px",border:`${s+1}px solid ${gpe(wh)}`,boxSizing:"border-box",pointerEvents:"none"}}),zn.div({class:"originalOverlayLineReplacement",style:{position:"absolute",...lxe(e=>t.read(e).background.translateX(-o)),borderRadius:"4px",border:JSe(a,this._themeService).map(e=>`1px solid ${e.toString()}`),pointerEvents:"none",boxSizing:"border-box",background:gpe(b0)}}),zn.div({class:"modifiedOverlayLineReplacement",style:{position:"absolute",...lxe(e=>t.read(e).lowerBackground.translateX(-o)),borderRadius:"0 0 4px 4px",background:gpe(wh),boxShadow:`${gpe(mh)} 0 6px 6px -6px`,border:`1px solid ${gpe(r)}`,boxSizing:"border-box",overflow:"hidden",cursor:"pointer",pointerEvents:"auto"},onmousedown:e=>{e.preventDefault()},onclick:e=>this._onDidClick.fire(new Se(pn(e),e))},[zn.div({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:gpe(C0)}})]),zn.div({class:"modifiedLinesLineReplacement",style:{position:"absolute",boxSizing:"border-box",...lxe(e=>t.read(e).lowerText.translateX(-o)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",whiteSpace:"nowrap",borderRadius:"0 0 4px 4px",overflow:"hidden"}},[...i.lines])])]})]).keepUpdated(this._store),this.isHovered=this._editor.isTargetHovered(e=>this._isMouseOverWidget(e),this._store),this._previousViewZoneInfo=void 0,this._register(Dle(()=>this._editor.editor.changeViewZones(e=>this.removePreviousViewZone(e)))),this._register(function(e,t){let i;return Oce({debugReferenceFn:t},n=>{const o=e.read(n),s=i;i=o,t({lastValue:s,newValue:o})})}(this._viewZoneInfo,({lastValue:e,newValue:t})=>{e===t||e?.height===t?.height&&e?.lineNumber===t?.lineNumber||this._editor.editor.changeViewZones(e=>{this.removePreviousViewZone(e),t&&this.addViewZone(t,e)})})),this._register(this._editor.createOverlayWidget({domNode:this._div.element,minContentWidthInPx:Dce(this,e=>this._layout.read(e)?.minContentWidthRequired??0),position:z_e({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}_isMouseOverWidget(e){const t=this._layout.get();return!!(t&&e.event instanceof fp)&&t.lowerBackground.containsPoint(new gT(e.event.relativePos.x,e.event.relativePos.y))}removePreviousViewZone(e){if(!this._previousViewZoneInfo)return;e.removeZone(this._previousViewZoneInfo.id);const t=this._editor.cursorLineNumber.get();null!==t&&t>=this._previousViewZoneInfo.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()-this._previousViewZoneInfo.height),this._previousViewZoneInfo=void 0}addViewZone(e,t){const i=t.addZone({afterLineNumber:e.lineNumber-1,heightInPx:e.height,domNode:Ahe("div")});this._previousViewZoneInfo={height:e.height,lineNumber:e.lineNumber,id:i};const n=this._editor.cursorLineNumber.get();null!==n&&n>=e.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()+e.height)}},r2=o2([s2(4,La),s2(5,Sf)],r2),a2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},l2=function(e,t){return function(i,n){t(i,n,e)}},d2=class extends Ie{static fitsInsideViewport(e,t,i,n){const o=bwe(e),s=o.layoutInfoWidth.read(n),r=o.layoutInfoContentLeft.read(n),a=e.getLayoutInfo().verticalScrollbarWidth,l=0!==o.layoutInfoMinimap.read(n).minimapLeft?o.layoutInfoMinimap.read(n).minimapWidth:0;return txe(o,i.displayRange,void 0)+i.lineEdit.newLines.reduce((i,n)=>Math.max(i,nxe(n,e,t)),0)+20+14<s-r-a-l}constructor(e,t,i,n,o,s,r){super(),this._editor=e,this._edit=t,this._previewTextModel=i,this._uiState=n,this._tabAction=o,this._instantiationService=s,this._themeService=r,this._editorObs=bwe(this._editor),this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this._display=Dce(this,e=>this._uiState.read(e)?"block":"none"),this.previewRef=zn.ref();const a=this._uiState.map(e=>e?.isInDiffEditor?3:1);this._editorContainer=zn.div({class:["editorContainer"],style:{position:"absolute",overflow:"hidden",cursor:"pointer"},onmousedown:e=>{e.preventDefault()},onclick:e=>{this._onDidClick.fire(new Se(pn(e),e))}},[zn.div({class:"preview",style:{pointerEvents:"none"},ref:this.previewRef})]).keepUpdated(this._store),this.isHovered=this._editorContainer.didMouseMoveDuringHover,this.previewEditor=this._register(this._instantiationService.createInstance(YH,this.previewRef.element,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},rulers:[],padding:{top:0,bottom:0},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,revealHorizontalRightPadding:0,bracketPairColorization:{enabled:!0,independentColorPoolPerBracketType:!1},scrollBeyondLastLine:!1,scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off"},{contextKeyValues:{[bY.inInlineEditsPreviewEditor.key]:!0},contributions:[]},this._editor)),this._previewEditorObs=bwe(this.previewEditor),this._activeViewZones=[],this._updatePreviewEditor=Dce(this,e=>{this._editorContainer.readEffect(e),this._previewEditorObs.model.read(e),this._display.read(e),this._nonOverflowView&&(this._nonOverflowView.element.style.display=this._display.read(e));const t=this._uiState.read(e),i=this._edit.read(e);if(!t||!i)return;const n=i.originalLineRange,o=[];n.startLineNumber>1&&o.push(new mr(1,1,n.startLineNumber-1,1)),n.startLineNumber+t.newTextLineCount<this._previewTextModel.getLineCount()+1&&o.push(new mr(n.startLineNumber+t.newTextLineCount,1,this._previewTextModel.getLineCount()+1,1)),this.previewEditor.setHiddenAreas(o,void 0,!0);const s=[...this._activeViewZones];this._activeViewZones=[];const r=n.endLineNumberExclusive-n.startLineNumber-t.newTextLineCount;this.previewEditor.changeViewZones(e=>{s.forEach(t=>e.removeZone(t)),r>0&&this._activeViewZones.push(e.addZone({afterLineNumber:n.startLineNumber+t.newTextLineCount-1,heightInLines:r,showInHiddenAreas:!0,domNode:Ahe("div.diagonal-fill.inline-edits-view-zone")}))})}),this._previewEditorWidth=Dce(this,e=>{const t=this._edit.read(e);return t?(this._updatePreviewEditor.read(e),txe(this._previewEditorObs,t.modifiedLineRange,e)):0}),this._cursorPosIfTouchesEdit=Dce(this,e=>{const t=this._editorObs.cursorPosition.read(e),i=this._edit.read(e);if(i&&t)return i.modifiedLineRange.contains(t.lineNumber)?t:void 0}),this._originalStartPosition=Dce(this,e=>{const t=this._edit.read(e);return t?new to(t.originalLineRange.startLineNumber,1):null}),this._originalEndPosition=Dce(this,e=>{const t=this._edit.read(e);return t?new to(t.originalLineRange.endLineNumberExclusive,1):null}),this._originalVerticalStartPosition=this._editorObs.observePosition(this._originalStartPosition,this._store).map(e=>e?.y),this._originalVerticalEndPosition=this._editorObs.observePosition(this._originalEndPosition,this._store).map(e=>e?.y),this._originalDisplayRange=this._edit.map(e=>e?.displayRange),this._editorMaxContentWidthInRange=Dce(this,e=>{const t=this._originalDisplayRange.read(e);return t?(this._editorObs.versionId.read(e),qce(this,(e,i)=>{const n=txe(this._editorObs,t,e);return Math.max(n,i??0)})):z_e(0)}).map((e,t)=>e.read(t)),this._previewEditorLayoutInfo=Dce(this,e=>{const t=this._edit.read(e);if(!t)return null;if(!this._uiState.read(e))return null;const i=t.originalLineRange,n=this._editorObs.scrollLeft.read(e),o=this._editorMaxContentWidthInRange.read(e),s=this._editorObs.layoutInfo.read(e),r=this._previewEditorWidth.read(e),a=s.contentWidth-s.verticalScrollbarWidth,l=this._editor.getContainerDomNode().getBoundingClientRect(),d=s.contentLeft+s.contentWidth+l.left,c=pn(this._editor.getContainerDomNode()).innerWidth-d,h=pn(this._editor.getContainerDomNode()).innerWidth-l.right,u=Math.min(.3*s.contentWidth,r,100),g=0+c,p=this._cursorPosIfTouchesEdit.read(e),m=Math.max(a+n-0-Math.max(0,u-g),Math.min(p?function(e,t,i){return e.layoutInfo.read(i),e.value.read(i),e.model.read(i)?(e.scrollTop.read(i),e.editor.getOffsetForColumn(t.lineNumber,t.column)):0}(this._editorObs,p,e)+50:0,a+n)),f=Math.min(o+20,m),_=o+20+r+70,b=m-f;let v,w;f>n?(v=0,w=s.contentLeft+f-n):(v=n-f,w=s.contentLeft);const C=this._originalVerticalStartPosition.read(e)??this._editor.getTopForLineNumber(i.startLineNumber)-this._editorObs.scrollTop.read(e),y=this._originalVerticalEndPosition.read(e)??this._editor.getBottomForLineNumber(i.endLineNumberExclusive-1)-this._editorObs.scrollTop.read(e),S=s.contentLeft-n;let x=H1.fromLeftTopRightBottom(S,C,w,y);const k=0===x.height;k||(x=x.withMargin(0,0));const L=this._previewEditorObs.observeLineHeightsForLineRange(t.modifiedLineRange).read(e).reduce((e,t)=>e+t,0),D=y-C,I=Math.max(D,L),N=0===b,E=Math.min(r+12,h+s.width-s.contentLeft-0);let M=H1.fromLeftTopWidthHeight(x.right+0,C,E,I);return M=k?M.withMargin(0,0).translateY(0):M.withMargin(0,0).translateX(1),{codeRect:x,editRect:M,codeScrollLeft:n,contentLeft:s.contentLeft,isInsertion:k,maxContentWidth:_,shouldShowShadow:N,desiredPreviewEditorScrollLeft:v,previewEditorWidth:E}}),this._stickyScrollController=_0.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?Hce(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):z_e(0),this._shouldOverflow=Dce(this,e=>!1),this._originalBackgroundColor=Hce(this,this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme().getColor(b0)??eh.transparent),this._backgroundSvg=zn.svg({transform:"translate(-0.5 -0.5)",style:{overflow:"visible",pointerEvents:"none",position:"absolute"}},[zn.svgElem("path",{class:"rightOfModifiedBackgroundCoverUp",d:Dce(this,e=>{const t=this._previewEditorLayoutInfo.read(e);if(t&&!this._originalBackgroundColor.read(e).isTransparent())return(new F0).moveTo(t.codeRect.getRightTop()).lineTo(t.codeRect.getRightTop().deltaX(1e3)).lineTo(t.codeRect.getRightBottom().deltaX(1e3)).lineTo(t.codeRect.getRightBottom()).build()}),style:{fill:ppe(wh,"transparent")}})]).keepUpdated(this._store),this._originalOverlay=zn.div({style:{pointerEvents:"none",display:this._previewEditorLayoutInfo.map(e=>e?.isInsertion?"none":"block")}},Dce(this,e=>{const t=axe(this._previewEditorLayoutInfo).read(e);if(!t)return;const i=a.read(e),n=XSe(this._tabAction).map(e=>`1px solid ${gpe(e)}`),o=`${1+i}px solid ${gpe(wh)}`,s=0!==t.read(e).codeScrollLeft,r=t.map(e=>e.codeRect.bottom<e.editRect.bottom),l=t.map(e=>H1.fromLeftTopRightBottom(e.contentLeft-4-1,e.codeRect.top,e.contentLeft,e.codeRect.bottom+10)).read(e),d=new hl(l.left,Number.MAX_SAFE_INTEGER),c=t.map(e=>e.codeRect.intersectHorizontal(d)),h=c.map(e=>e.withMargin(i,0,i,i).intersectHorizontal(d)),u=c.map(e=>H1.fromLeftTopWidthHeight(e.right-10+1,e.bottom-1,10,10).intersectHorizontal(d));return[zn.div({class:"originalSeparatorSideBySide",style:{...h.read(e).toStyles(),boxSizing:"border-box",borderRadius:"4px 0 0 4px",borderTop:o,borderBottom:o,borderLeft:s?"none":o}}),zn.div({class:"originalOverlaySideBySide",style:{...c.read(e).toStyles(),boxSizing:"border-box",borderRadius:"4px 0 0 4px",borderTop:n,borderBottom:n,borderLeft:s?"none":n,backgroundColor:gpe(b0)}}),zn.div({class:"originalCornerCutoutSideBySide",style:{pointerEvents:"none",display:r.map(e=>e?"block":"none"),...u.read(e).toStyles()}},[zn.div({class:"originalCornerCutoutBackground",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",backgroundColor:JSe(b0,this._themeService).map(e=>e.toString())}}),zn.div({class:"originalCornerCutoutBorder",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box",borderTop:n,borderRight:n,borderRadius:"0 100% 0 0",backgroundColor:gpe(wh)}})]),zn.div({class:"originalOverlaySideBySideHider",style:{...l.toStyles(),backgroundColor:gpe(wh)}})]})).keepUpdated(this._store),this._modifiedOverlay=zn.div({style:{pointerEvents:"none"}},Dce(this,e=>{const t=axe(this._previewEditorLayoutInfo).read(e);if(!t)return;const i=t.map(e=>e.codeRect.bottom<e.editRect.bottom),n=a.read(e),o=i.map(e=>`0 4px 4px ${e?4:0}px`),s=JSe(QSe(this._tabAction),this._themeService).map(e=>`1px solid ${e.toString()}`),r=`${1+n}px solid ${gpe(wh)}`,l=t.map(e=>e.editRect.withMargin(0,1)),d=l.map(e=>e.withMargin(n,n,n,0)),c=Dce(this,e=>{const i=l.read(e),n=t.read(e);return!n.isInsertion||n.contentLeft>=i.left?H1.fromLeftTopWidthHeight(i.left,i.top,0,0):new H1(n.contentLeft,i.top,i.left,i.top+2)});return[zn.div({class:"modifiedInsertionSideBySide",style:{...c.read(e).toStyles(),backgroundColor:QSe(this._tabAction).map(e=>gpe(e))}}),zn.div({class:"modifiedSeparatorSideBySide",style:{...d.read(e).toStyles(),borderRadius:o,borderTop:r,borderBottom:r,borderRight:r,boxSizing:"border-box"}}),zn.div({class:"modifiedOverlaySideBySide",style:{...l.read(e).toStyles(),borderRadius:o,border:s,boxSizing:"border-box",backgroundColor:gpe(v0)}})]})).keepUpdated(this._store),this._nonOverflowView=zn.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[this._backgroundSvg,Dce(this,e=>this._shouldOverflow.read(e)?[]:[this._editorContainer,this._originalOverlay,this._modifiedOverlay])]).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:z_e(null),allowEditorOverflow:!1,minContentWidthInPx:Dce(this,e=>{const t=this._previewEditorLayoutInfo.read(e)?.maxContentWidth;return void 0===t?0:t})})),this.previewEditor.setModel(this._previewTextModel),this._register(Rce(e=>{const t=this._previewEditorLayoutInfo.read(e);if(!t)return;const i=t.editRect.withMargin(-0,-0);this.previewEditor.layout({height:i.height,width:t.previewEditorWidth+15}),this._editorContainer.element.style.top=`${i.top}px`,this._editorContainer.element.style.left=`${i.left}px`,this._editorContainer.element.style.width=`${t.previewEditorWidth+0}px`})),this._register(Rce(e=>{const t=this._previewEditorLayoutInfo.read(e);t&&this._previewEditorObs.editor.setScrollLeft(t.desiredPreviewEditorScrollLeft)})),this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store)}},d2=a2([l2(5,Jn),l2(6,Sf)],d2),h2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},u2=function(e,t){return function(i,n){t(i,n,e)}},c2=class extends Ie{constructor(e,t,i,n){super(),this._editor=e,this._edit=t,this._tabAction=i,this._languageService=n,this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this._start=this._editor.observePosition(z_e(this._edit.range.getStartPosition()),this._store),this._end=this._editor.observePosition(z_e(this._edit.range.getEndPosition()),this._store),this._line=document.createElement("div"),this._hoverableElement=Qce(this,null),this.isHovered=this._hoverableElement.map((e,t)=>e?.didMouseMoveDuringHover.read(t)??!1),this._renderTextEffect=Dce(this,e=>{const t=this._editor.model.get(),i=t.getLineContent(this._edit.range.startLineNumber),n=Yw.replace(new hl(this._edit.range.startColumn-1,this._edit.range.endColumn-1),this._edit.text),o=n.replace(i),s=t.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber,[o])?.[0];let r;r=s?ml.fromLineTokens(s).slice(n.getRangeAfterReplace()).toLineTokens(this._edit.text,this._languageService.languageIdCodec):gl.createEmpty(this._edit.text,this._languageService.languageIdCodec);const a=uwe(new JM([r]),eT.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),[],this._line,!0);this._line.style.width=`${a.minWidthInPx}px`});const o=this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());this._layout=Dce(this,e=>{this._renderTextEffect.read(e);const t=this._start.read(e),i=this._end.read(e);if(!t||!i||t.x>i.x||t.y>i.y)return;const n=o.read(e),s=this._editor.scrollLeft.read(e),r=this._editor.getOption(59).read(e).typicalHalfwidthCharacterWidth,a=new gT(3*r,4),l=H1.fromPoints(t,i).withHeight(n).translateX(-s),d=H1.fromPointSize(l.getLeftBottom().add(a),new gT(this._edit.text.length*r,l.height));return{originalLine:l,modifiedLine:d,lowerBackground:d.withLeft(l.left),lineHeight:n}}),this.minEditorScrollHeight=Dce(this,e=>{const t=axe(this._layout).read(e);return t?t.read(e).modifiedLine.bottom+1+this._editor.editor.getScrollTop():0}),this._root=zn.div({class:"word-replacement"},[Dce(this,e=>{const t=axe(this._layout).read(e);if(!t)return[];const i=XSe(this._tabAction).map(e=>gpe(e)).read(e),n=QSe(this._tabAction).map(e=>gpe(e)).read(e);return[zn.div({style:{position:"absolute",...lxe(e=>oxe(this._editor).read(e)),overflow:"hidden",pointerEvents:"none"}},[zn.div({style:{position:"absolute",...lxe(e=>t.read(e).lowerBackground.withMargin(1,2,1,0)),background:gpe(wh),cursor:"pointer",pointerEvents:"auto"},onmousedown:e=>{e.preventDefault()},onmouseup:e=>this._onDidClick.fire(new Se(pn(e),e)),obsRef:e=>{this._hoverableElement.set(e,void 0)}}),zn.div({style:{position:"absolute",...lxe(e=>t.read(e).modifiedLine.withMargin(1,2)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",boxSizing:"border-box",borderRadius:"4px",border:`1px solid ${n}`,background:gpe(y0),display:"flex",justifyContent:"center",alignItems:"center",outline:`2px solid ${gpe(wh)}`}},[this._line]),zn.div({style:{position:"absolute",...lxe(e=>t.read(e).originalLine.withMargin(1)),boxSizing:"border-box",borderRadius:"4px",border:`1px solid ${i}`,background:gpe(w0),pointerEvents:"none"}},[]),zn.svg({width:11,height:14,viewBox:"0 0 11 14",fill:"none",style:{position:"absolute",left:t.map(e=>e.modifiedLine.left-16),top:t.map(e=>e.modifiedLine.top+Math.round((e.lineHeight-14-5)/2))}},[zn.svgElem("path",{d:"M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5",stroke:gpe(Kh)}),zn.svgElem("path",{d:"M6 7.5L9.99999 10.49998L6 13.5",stroke:gpe(Kh)})])])]})]).keepUpdated(this._store),this._register(this._editor.createOverlayWidget({domNode:this._root.element,minContentWidthInPx:z_e(0),position:z_e({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}},c2.MAX_LENGTH=100,g2=c2,g2=h2([u2(3,La)],g2),p2=class extends Ie{constructor(e,t,i){super(),this._originalEditor=e,this._state=t,this._modifiedTextModel=i,this._onDidClick=this._register(new je),this.onDidClick=this._onDidClick.event,this.isHovered=bwe(this._originalEditor).isTargetHovered(e=>6===e.target.type&&e.target.detail.injectedText?.options.attachedData instanceof m2&&e.target.detail.injectedText.options.attachedData.owner===this,this._store),this._tokenizationFinished=Hce(this._modifiedTextModel.onDidChangeTokens,()=>f2++),this._decorations=Dce(this,e=>{const t=this._state.read(e);if(!t)return;const i=t.modifiedText,n="insertionInline"===t.mode,o=1===t.diff.length&&1===t.diff[0].innerChanges?.length,s=[],r=[],a=Lx.register({className:"inlineCompletions-line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),l=Lx.register({className:"inlineCompletions-line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),d=Lx.register({className:"inlineCompletions-char-delete",description:"char-delete",isWholeLine:!1,zIndex:1}),c=Lx.register({className:"inlineCompletions-char-insert",description:"char-insert",isWholeLine:!0}),h=Lx.register({className:"inlineCompletions-char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),u=Lx.register({className:"inlineCompletions-char-insert diff-range-empty",description:"char-insert diff-range-empty"}),g=Lx.register({className:"inlineCompletions-original-lines",description:"inlineCompletions-original-lines",isWholeLine:!1,shouldFillLineOnLineBreak:!0}),p="sideBySide"!==t.mode&&"deletion"!==t.mode&&"insertionInline"!==t.mode&&"lineReplacement"!==t.mode,m="lineReplacement"===t.mode;for(const f of t.diff)if(p&&(f.original.isEmpty||s.push({range:f.original.toInclusiveRange(),options:l}),f.modified.isEmpty||r.push({range:f.modified.toInclusiveRange(),options:a})),f.modified.isEmpty||f.original.isEmpty)f.original.isEmpty||s.push({range:f.original.toInclusiveRange(),options:d}),f.modified.isEmpty||r.push({range:f.modified.toInclusiveRange(),options:c});else{const a=n&&hxe(f);for(const n of f.innerChanges||[]){if(f.original.contains(n.originalRange.startLineNumber)&&(!m||!n.originalRange.isEmpty())){const e=this._originalEditor.getModel()?.getValueInRange(n.originalRange,1);s.push({range:n.originalRange,options:{description:"char-delete",shouldFillLineOnLineBreak:!1,className:sxe("inlineCompletions-char-delete",n.originalRange.isSingleLine()&&"insertionInline"===t.mode&&"single-line-inline",n.originalRange.isEmpty()&&"empty",(n.originalRange.isEmpty()&&o||"deletion"===t.mode&&"\n"===e)&&!a&&"diff-range-empty"),inlineClassName:a?sxe("strike-through","inlineCompletions"):null,zIndex:1}})}if(f.modified.contains(n.modifiedRange.startLineNumber)&&r.push({range:n.modifiedRange,options:n.modifiedRange.isEmpty()&&!a&&o?u:h}),a){const o=i.getValueOfRange(n.modifiedRange),r=o.length>3?[{text:o.slice(0,1),extraClasses:["start"],offsetRange:new hl(n.modifiedRange.startColumn-1,n.modifiedRange.startColumn)},{text:o.slice(1,-1),extraClasses:[],offsetRange:new hl(n.modifiedRange.startColumn,n.modifiedRange.endColumn-2)},{text:o.slice(-1),extraClasses:["end"],offsetRange:new hl(n.modifiedRange.endColumn-2,n.modifiedRange.endColumn-1)}]:[{text:o,extraClasses:["start","end"],offsetRange:new hl(n.modifiedRange.startColumn-1,n.modifiedRange.endColumn)}];this._tokenizationFinished.read(e);const a=this._modifiedTextModel.tokenization.getLineTokens(n.modifiedRange.startLineNumber);for(const{text:e,extraClasses:i,offsetRange:l}of r)s.push({range:mr.fromPositions(n.originalRange.getEndPosition()),options:{description:"inserted-text",before:{tokens:a.getTokensInRange(l),content:e,inlineClassName:sxe("inlineCompletions-char-insert",n.modifiedRange.isSingleLine()&&"insertionInline"===t.mode&&"single-line-inline",...i),cursorStops:Xr.None,attachedData:new m2(this)},zIndex:2,showIfCollapsed:!0}})}}}if(t.isInDiffEditor)for(const f of t.diff)f.original.isEmpty||s.push({range:f.original.toExclusiveRange(),options:g});return{originalDecorations:s,modifiedDecorations:r}}),this._register(bwe(this._originalEditor).setDecorations(this._decorations.map(e=>e?.originalDecorations??[])));const n=this._state.map(e=>e?.modifiedCodeEditor);this._register(Pce((e,t)=>{const i=n.read(e);i&&t.add(bwe(i).setDecorations(this._decorations.map(e=>e?.modifiedDecorations??[])))})),this._register(this._originalEditor.onMouseUp(e=>{if(6!==e.target.type)return;const t=e.target.detail.injectedText?.options.attachedData;t instanceof m2&&t.owner===this&&this._onDidClick.fire(e.event)}))}},m2=class{constructor(e){this.owner=e}},f2=0,_2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},b2=function(e,t){return function(i,n){t(i,n,e)}},v2=class extends Ie{constructor(e,t,i,n,o,s){super(),this._editor=e,this._host=t,this._model=i,this._ghostTextIndicator=n,this._focusIsInMenu=o,this._instantiationService=s,this._editorObs=bwe(this._editor),this._tabAction=Dce(e=>this._model.read(e)?.tabAction.read(e)??NX.Inactive),this._constructorDone=Qce(this,!1),this._uiState=Dce(this,e=>{const t=this._model.read(e);if(!t||!this._constructorDone.read(e))return;const i=t.inlineEdit;let n=VE.fromEdit(i.edit),o=i.edit.apply(i.originalText),s=swe(n,i.originalText,new aC(o)),r=this.determineRenderState(t,e,s,new aC(o));if(r){if(r.kind===EX.SideBySide){const e=rxe(o,i.modifiedLineRange,a.getOptions().tabSize);o=e.applyToString(o),n=function(e,t){const i=[];for(const n of e){const e=t.mapRange(n.modifiedRange);i.push(new VE(n.originalRange,e))}return i}(n,e),s=swe(n,i.originalText,new aC(o))}return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()),this._previewTextModel.getValue()!==o&&this._previewTextModel.setValue(o),t.showCollapsed.read(e)&&!this._indicator.read(e)?.isHoverVisible.read(e)&&(r={kind:EX.Collapsed,viewData:r.viewData}),t.handleInlineEditShown(r.kind,r.viewData),{state:r,diff:s,edit:i,newText:o,newTextLineCount:i.modifiedLineRange.length,isInDiffEditor:t.isInDiffEditor}}$ae(new Error(`unable to determine view: tried to render ${this._previousView?.view}`))}),this._previewTextModel=this._register(this._instantiationService.createInstance(vx,"",this._editor.getModel().getLanguageId(),{...vx.DEFAULT_CREATION_OPTIONS,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},null)),this._indicatorCyclicDependencyCircuitBreaker=Qce(this,!1),this._indicator=Dce(this,e=>{if(!this._indicatorCyclicDependencyCircuitBreaker.read(e))return;const t=Nce({owner:this,equalsFn:Cce((e,t)=>e.equals(t))},e=>{const t=this._ghostTextIndicator.read(e);if(t)return t.lineRange;const i=this._uiState.read(e);if(i){if("custom"===i.state?.kind){const e=i.state.displayLocation?.range;if(!e)throw new y("custom view should have a range");return new Qw(e.startLineNumber,e.endLineNumber)}return"insertionMultiLine"===i.state?.kind?this._insertion.originalLines.read(e):i.edit.displayRange}}),i=Dce(this,e=>{const t=this._model.read(e);if(t)return t;const i=this._ghostTextIndicator.read(e);return i?i.model:t});return e.store.add(this._instantiationService.createInstance(U0,this._editorObs,t,this._gutterIndicatorOffset,i,this._inlineEditsIsHovered,this._focusIsInMenu))}),this._inlineEditsIsHovered=Dce(this,e=>this._sideBySide.isHovered.read(e)||this._wordReplacementViews.read(e).some(t=>t.isHovered.read(e))||this._deletion.isHovered.read(e)||this._inlineDiffView.isHovered.read(e)||this._lineReplacementView.isHovered.read(e)||this._insertion.isHovered.read(e)||this._customView.isHovered.read(e)),this._gutterIndicatorOffset=Dce(this,e=>{if("insertionMultiLine"===this._uiState.read(e)?.state?.kind)return this._insertion.startLineOffset.read(e);const t=this._ghostTextIndicator.read(e);return t?function(e,t){const i=e.model.inlineEdit.edit.replacements;if(1!==i.length)return 0;const n=t.getModel();if(!n)return 0;const o=n.getEOL(),s=i[0];if(s.range.isEmpty()&&s.text.startsWith(o)){const e=t.getLineHeightForPosition(s.range.getStartPosition());return function(e,t){if(!t.length)return 0;let i=0,n=0;for(;e.startsWith(t,n);)i++,n+=t.length;return i}(s.text,o)*e}return 0}(t,this._editor):0}),this._sideBySide=this._register(this._instantiationService.createInstance(d2,this._editor,this._model.map(e=>e?.inlineEdit),this._previewTextModel,this._uiState.map(e=>e&&e.state?.kind===EX.SideBySide?{newTextLineCount:e.newTextLineCount,isInDiffEditor:e.isInDiffEditor}:void 0),this._tabAction)),this._deletion=this._register(this._instantiationService.createInstance(e2,this._editor,this._model.map(e=>e?.inlineEdit),this._uiState.map(e=>e&&e.state?.kind===EX.Deletion?{originalRange:e.state.originalRange,deletions:e.state.deletions,inDiffEditor:e.isInDiffEditor}:void 0),this._tabAction)),this._insertion=this._register(this._instantiationService.createInstance(n2,this._editor,this._uiState.map(e=>e&&e.state?.kind===EX.InsertionMultiLine?{lineNumber:e.state.lineNumber,startColumn:e.state.column,text:e.state.text,inDiffEditor:e.isInDiffEditor}:void 0),this._tabAction)),this._inlineDiffViewState=Dce(this,e=>{const t=this._uiState.read(e);if(t&&t.state&&"wordReplacements"!==t.state.kind&&"insertionMultiLine"!==t.state.kind&&"collapsed"!==t.state.kind&&"custom"!==t.state.kind)return{modifiedText:new aC(t.newText),diff:t.diff,mode:t.state.kind,modifiedCodeEditor:this._sideBySide.previewEditor,isInDiffEditor:t.isInDiffEditor}}),this._inlineCollapsedView=this._register(this._instantiationService.createInstance(Y0,this._editor,this._model.map((e,t)=>"collapsed"===this._uiState.read(t)?.state?.kind?e?.inlineEdit:void 0))),this._customView=this._register(this._instantiationService.createInstance(J0,this._editor,this._model.map((e,t)=>"custom"===this._uiState.read(t)?.state?.kind?e?.displayLocation:void 0),this._tabAction)),this._inlineDiffView=this._register(new p2(this._editor,this._inlineDiffViewState,this._previewTextModel)),this._wordReplacementViews=jce(this,this._uiState.map(e=>"wordReplacements"===e?.state?.kind?e.state.replacements:[]),(e,t)=>t.add(this._instantiationService.createInstance(g2,this._editorObs,e,this._tabAction))),this._lineReplacementView=this._register(this._instantiationService.createInstance(r2,this._editorObs,this._uiState.map(e=>e?.state?.kind===EX.LineReplacement?{originalRange:e.state.originalRange,modifiedRange:e.state.modifiedRange,modifiedLines:e.state.modifiedLines,replacements:e.state.replacements}:void 0),this._uiState.map(e=>e?.isInDiffEditor??!1),this._tabAction)),this._useCodeShifting=this._editorObs.getOption(71).map(e=>e.edits.allowCodeShifting),this._renderSideBySide=this._editorObs.getOption(71).map(e=>e.edits.renderSideBySide),this._register(Pce((e,t)=>{const i=this._model.read(e);i&&t.add(Be.any(this._sideBySide.onDidClick,this._deletion.onDidClick,this._lineReplacementView.onDidClick,this._insertion.onDidClick,...this._wordReplacementViews.read(e).map(e=>e.onDidClick),this._inlineDiffView.onDidClick,this._customView.onDidClick)(e=>{this._viewHasBeenShownLongerThan(350)&&(e.preventDefault(),i.accept())}))})),this._indicator.recomputeInitiallyAndOnChange(this._store),this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store),this._indicatorCyclicDependencyCircuitBreaker.set(!0,void 0),this._register(this._instantiationService.createInstance($0,this._host,this._model,this._indicator,this._inlineCollapsedView));const r=Dce(this,e=>Math.max(...this._wordReplacementViews.read(e).map(t=>t.minEditorScrollHeight.read(e)),this._lineReplacementView.minEditorScrollHeight.read(e),this._customView.minEditorScrollHeight.read(e))).recomputeInitiallyAndOnChange(this._store),a=this._editor.getModel();let l;this._register(Rce(e=>{const t=r.read(e);this._editor.changeViewZones(e=>{const i=t-this._editor.getScrollHeight()+1;0!==i&&l&&(e.removeZone(l),l=void 0),i<=0||(l=e.addZone({afterLineNumber:a.getLineCount(),heightInPx:i,domNode:Ahe("div.minScrollHeightViewZone")}))})})),this._constructorDone.set(!0,void 0)}getCacheId(e){return e.inlineEdit.inlineCompletion.identity.id}determineView(e,t,i,n){const o=e.inlineEdit,s=this._previousView?.id===this.getCacheId(e)&&!e.displayLocation?.jumpToEdit,r=this._previousView?.editorWidth!==this._editorObs.layoutInfoWidth.read(t)&&(this._previousView?.view===EX.SideBySide||this._previousView?.view===EX.LineReplacement);if(s&&!r)return this._previousView.view;if(e.inlineEdit.inlineCompletion instanceof kX&&e.inlineEdit.inlineCompletion.uri)return EX.Custom;if(e.displayLocation&&!e.inlineEdit.inlineCompletion.identity.jumpedTo.read(t))return EX.Custom;const a=o.originalLineRange.length,l=o.modifiedLineRange.length,d=i.flatMap(e=>e.innerChanges??[]),c=1===d.length;if(!e.isInDiffEditor){if(c&&"never"!==this._useCodeShifting.read(t)&&uxe(i))return gxe(i,o.cursorPosition)?EX.InsertionInline:EX.LineReplacement;if(mxe(d,o,n))return EX.Deletion;if(pxe(i)&&"always"===this._useCodeShifting.read(t))return EX.InsertionMultiLine;if(d.every(e=>eC.ofRange(e.originalRange).columnCount<g2.MAX_LENGTH&&eC.ofRange(e.modifiedRange).columnCount<g2.MAX_LENGTH)&&c&&1===a&&1===l){const t=d.map(e=>n.getValueOfRange(e.modifiedRange)),i=d.map(t=>e.inlineEdit.originalText.getValueOfRange(t.originalRange));if(!(t.some(e=>e.includes("\t"))||i.some(e=>e.includes("\t"))||d.some(e=>e.originalRange.isEmpty())&&fxe(d.map(e=>new dC(e.originalRange,"")),o.originalText).some(e=>e.range.isEmpty()&&eC.ofRange(e.range).columnCount<g2.MAX_LENGTH)))return EX.WordReplacements}}if(a>0&&l>0)return(1!==a||1!==l||e.isInDiffEditor)&&"never"!==this._renderSideBySide.read(t)&&d2.fitsInsideViewport(this._editor,this._previewTextModel,o,t)?EX.SideBySide:EX.LineReplacement;if(e.isInDiffEditor){if(mxe(d,o,n))return EX.Deletion;if(pxe(i)&&"always"===this._useCodeShifting.read(t))return EX.InsertionMultiLine}return EX.SideBySide}determineRenderState(e,t,i,n){const o=e.inlineEdit;let s=this.determineView(e,t,i,n);if(this._willRenderAboveCursor(t,o,s))switch(s){case EX.LineReplacement:case EX.WordReplacements:s=EX.SideBySide}this._previousView={id:this.getCacheId(e),view:s,editorWidth:this._editor.getLayoutInfo().width,timestamp:Date.now()};const r=i.flatMap(e=>e.innerChanges??[]),a=this._editor.getModel(),l=r.map(e=>({originalRange:e.originalRange,modifiedRange:e.modifiedRange,original:a.getValueInRange(e.originalRange),modified:n.getValueOfRange(e.modifiedRange)})),d=o.cursorPosition,c=0!==l.length&&l[0].modified.startsWith(a.getEOL()),h={cursorColumnDistance:0===o.edit.replacements.length?0:o.edit.replacements[0].range.getStartPosition().column-d.column,cursorLineDistance:o.lineEdit.lineRange.startLineNumber-d.lineNumber+(c&&o.lineEdit.lineRange.startLineNumber>=d.lineNumber?1:0),lineCountOriginal:o.lineEdit.lineRange.length,lineCountModified:o.lineEdit.newLines.length,characterCountOriginal:l.reduce((e,t)=>e+t.original.length,0),characterCountModified:l.reduce((e,t)=>e+t.modified.length,0),disjointReplacements:l.length,sameShapeReplacements:l.every(e=>e.original===l[0].original&&e.modified===l[0].modified)};switch(s){case EX.InsertionInline:return{kind:EX.InsertionInline,viewData:h};case EX.SideBySide:return{kind:EX.SideBySide,viewData:h};case EX.Collapsed:return{kind:EX.Collapsed,viewData:h};case EX.Custom:return{kind:EX.Custom,displayLocation:e.displayLocation,viewData:h}}if(s===EX.Deletion)return{kind:EX.Deletion,originalRange:o.originalLineRange,deletions:r.map(e=>e.originalRange),viewData:h};if(s===EX.InsertionMultiLine){const e=r[0];return{kind:EX.InsertionMultiLine,lineNumber:e.originalRange.startLineNumber,column:e.originalRange.startColumn,text:n.getValueOfRange(e.modifiedRange),viewData:h}}const u=l.map(e=>new dC(e.originalRange,e.modified));if(0!==u.length){if(s===EX.WordReplacements){let e=function(e,t){return _xe(e,t,e=>/^[a-zA-Z]$/.test(e))}(u,o.originalText);return e.some(e=>e.range.isEmpty())&&(e=fxe(u,o.originalText)),{kind:EX.WordReplacements,replacements:e,viewData:h}}return s===EX.LineReplacement?{kind:EX.LineReplacement,originalRange:o.originalLineRange,modifiedRange:o.modifiedLineRange,modifiedLines:o.modifiedLineRange.mapToLineArray(e=>n.getLineAt(e)),replacements:r.map(e=>({originalRange:e.originalRange,modifiedRange:e.modifiedRange})),viewData:h}:void 0}}_willRenderAboveCursor(e,t,i){if("always"===this._useCodeShifting.read(e))return!1;for(const n of t.multiCursorPositions){if(i===EX.WordReplacements&&n.lineNumber===t.originalLineRange.startLineNumber+1)return!0;if(i===EX.LineReplacement&&n.lineNumber>=t.originalLineRange.endLineNumberExclusive&&n.lineNumber<t.modifiedLineRange.endLineNumberExclusive+t.modifiedLineRange.length)return!0}return!1}_viewHasBeenShownLongerThan(e){const t=this._previousView?.timestamp;if(!t)throw new y("viewHasBeenShownLongThan called before a view has been shown");return Date.now()-t>=e}},v2=_2([b2(5,Jn)],v2),C2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},y2=function(e,t){return function(i,n){t(i,n,e)}},w2=class extends Ie{constructor(e,t,i,n,o){super(),this._editor=e,this._edit=t,this._model=i,this._focusIsInMenu=n,this._inlineEdit=Dce(this,e=>{const t=this._model.read(e);if(!t)return;const i=this._edit.read(e);if(!i)return;const n=this._editor.getModel();if(!n)return;const o=t.inlineEditState.read(void 0)?.inlineCompletion.updatedEdit;if(!o)return;const s=new lC(o.replacements.map(e=>new dC(mr.fromPositions(n.getPositionAt(e.replaceRange.start),n.getPositionAt(e.replaceRange.endExclusive)),e.newText)));return new F1(new zR(n),s,t.primaryPosition.read(void 0),t.allPositions.read(void 0),i.commands,i.inlineCompletion)}),this._inlineEditModel=Dce(this,e=>{const t=this._model.read(e);if(!t)return;const i=this._inlineEdit.read(e);return i?new W1(t,i,Dce(this,e=>{if(this._editorObs.isFocused.read(e)){if(t.tabShouldJumpToInlineEdit.read(e))return NX.Jump;if(t.tabShouldAcceptInlineEdit.read(e))return NX.Accept}return NX.Inactive})):void 0}),this._inlineEditHost=Dce(this,e=>{const t=this._model.read(e);if(t)return new B1(t)}),this._ghostTextIndicator=Dce(this,e=>{const t=this._model.read(e);if(!t)return;const i=t.inlineCompletionState.read(e);if(!i)return;const n=i.inlineCompletion;if(!n)return;if(!n.showInlineEditMenu)return;const o=Qw.ofLength(i.primaryGhostText.lineNumber,1);return new V1(this._editor,t,o,n)}),this._editorObs=bwe(this._editor),this._register(o.createInstance(v2,this._editor,this._inlineEditHost,this._inlineEditModel,this._ghostTextIndicator,this._focusIsInMenu))}},w2.hot=K_e(w2),S2=w2,S2=C2([y2(4,Jn)],S2),x2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},k2=function(e,t){return function(i,n){t(i,n,e)}},L2=class extends Ie{constructor(e,t,i,n){super(),this._editor=e,this._model=t,this._focusIsInMenu=i,this._instantiationService=n,this._ghostTexts=Dce(this,e=>this._model.read(e)?.ghostTexts.read(e)??[]),this._stablizedGhostTexts=function(e,t){const i=Qce("result",[]),n=[];return t.add(Rce(t=>{const o=e.read(t);Wce(e=>{if(o.length!==n.length){n.length=o.length;for(let e=0;e<n.length;e++)n[e]||(n[e]=Qce("item",o[e]));i.set([...n],e)}n.forEach((t,i)=>t.set(o[i],e))})})),i}(this._ghostTexts,this._store),this._editorObs=bwe(this._editor),this._ghostTextWidgets=jce(this,this._stablizedGhostTexts,(e,t)=>Mce(t=>this._instantiationService.createInstance(E1.hot.read(t),this._editor,{ghostText:e,warning:this._model.map((e,t)=>{const i=e?.warning?.read(t);return i?{icon:i.icon}:void 0}),minReservedLineCount:z_e(0),targetTextModel:this._model.map(e=>e?.textModel),handleInlineCompletionShown:this._model.map((e,t)=>{const i=e?.inlineCompletionState.read(t)?.inlineCompletion;return i?t=>e.handleInlineSuggestionShown(i,EX.GhostText,t):()=>{}})},this._editorObs.getOption(71).map(e=>({syntaxHighlightingEnabled:e.syntaxHighlightingEnabled})),!1,!1)).recomputeInitiallyAndOnChange(t)).recomputeInitiallyAndOnChange(this._store),this._inlineEdit=Dce(this,e=>this._model.read(e)?.inlineEditState.read(e)?.inlineEdit),this._everHadInlineEdit=qce(this,(e,t)=>t||!!this._inlineEdit.read(e)||!!this._model.read(e)?.inlineCompletionState.read(e)?.inlineCompletion?.showInlineEditMenu),this._inlineEditWidget=Mce(e=>{if(this._everHadInlineEdit.read(e))return this._instantiationService.createInstance(S2.hot.read(e),this._editor,this._inlineEdit,this._model,this._focusIsInMenu)}).recomputeInitiallyAndOnChange(this._store),this._fontFamily=this._editorObs.getOption(71).map(e=>e.fontFamily),this._register(cpe(Dce(e=>`\n.monaco-editor .ghost-text-decoration,\n.monaco-editor .ghost-text-decoration-preview,\n.monaco-editor .ghost-text {\n\tfont-family: ${this._fontFamily.read(e)};\n}`))),this._register(new rB(this._editor,this._model,this._instantiationService))}shouldShowHoverAtViewZone(e){return this._ghostTextWidgets.get()[0]?.get().ownsViewZone(e)??!1}},L2=x2([k2(3,Jn)],L2),I2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},N2=function(e,t){return function(i,n){t(i,n,e)}},D2=class extends Ie{static getInFocusedEditorOrParent(e){const t=KCe(e);return t?E2.get(t):null}static get(e){return(t=e.getContribution(E2.ID))instanceof XZ?t._instance:t;var t}constructor(e,t,i,n,o,s,r,a,l,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=n,this._commandService=o,this._debounceService=s,this._languageFeaturesService=r,this._accessibilitySignalService=a,this._keybindingService=l,this._accessibilityService=d,this._editorObs=bwe(this.editor),this._positions=Dce(this,e=>this._editorObs.selections.read(e)?.map(e=>e.getEndPosition())??[new to(1,1)]),this._suggestWidgetAdapter=this._register(new C1(this._editorObs,e=>this.model.get()?.handleSuggestAccepted(e),()=>this.model.get()?.selectedInlineCompletion.get()?.getSingleTextEdit())),this._enabledInConfig=Hce(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).enabled),this._isScreenReaderEnabled=Hce(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Hce(this,this._contextKeyService.onDidChangeContext,()=>!0===this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")),this._enabled=Dce(this,e=>this._enabledInConfig.read(e)&&(!this._isScreenReaderEnabled.read(e)||!this._editorDictationInProgress.read(e))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._focusIsInMenu=Qce(this,!1),this._focusIsInEditorOrMenu=Dce(this,e=>{const t=this._editorObs.isFocused.read(e),i=this._focusIsInMenu.read(e);return t||i}),this._cursorIsInIndentation=Dce(this,e=>{const t=this._editorObs.cursorPosition.read(e);if(null===t)return!1;const i=this._editorObs.model.read(e);if(!i)return!1;this._editorObs.versionId.read(e);const n=i.getLineIndentColumn(t.lineNumber);return t.column<=n}),this.model=Mce(this,e=>{if(this._editorObs.isReadonly.read(e))return;const t=this._editorObs.model.read(e);return t?this._instantiationService.createInstance(iJ,t,this._suggestWidgetAdapter.selectedItem,this._editorObs.versionId,this._positions,this._debounceValue,this._enabled,this.editor):void 0}).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=t_e(this),this._hideInlineEditOnSelectionChange=this._editorObs.getOption(71).map(e=>!0),this._view=this._register(this._instantiationService.createInstance(L2,this.editor,this.model,this._focusIsInMenu)),E2._instances.add(this),this._register(Dle(()=>E2._instances.delete(this))),this._register(Rce(e=>{const t=this.model.read(e);if(!t)return;const i=t.state.read(e);if(!i)return;if(!this._focusIsInEditorOrMenu.read(void 0))return;const n="inlineEdit"===i.kind?i.nextEditUri:void 0;for(const o of E2._instances)o!==this&&(n&&Ts(n,o.editor.getModel()?.uri)?o.model.read(void 0)?.trigger():o.reject())})),this._register(Rce(e=>{const t=this.model.read(e),i=this.editor.getModel()?.uri;t&&i&&e.store.add(t.onDidAccept(()=>{for(const e of E2._instances){if(e===this)continue;const t=e.model.read(void 0)?.state.read(void 0);"inlineEdit"===t?.kind&&Ts(t.nextEditUri,i)&&e.model.read(void 0)?.stop("automatic")}}))})),this._register(ume(this._editorObs.onDidType,(e,t)=>{this._enabled.get()&&this.model.get()?.trigger()})),this._register(ume(this._editorObs.onDidPaste,(e,t)=>{this._enabled.get()&&this.model.get()?.trigger()}));const c=new Set([ed.Tab.id,ed.DeleteLeft.id,ed.DeleteRight.id,QW,"acceptSelectedSuggestion",jY.ID,qY.ID,iV.NextMatchFindAction,...er.getRegisteredCommands()]);this._register(this._commandService.onDidExecuteCommand(t=>{if(c.has(t.commandId)&&e.hasTextFocus()&&this._enabled.get()){let e=!1;"editor.action.inlineSuggest.commit"===t.commandId&&(e=!0),this._editorObs.forceUpdate(t=>{this.model.get()?.trigger(t,{noDelay:e})})}})),this._register(ume(this._editorObs.selections,(e,t,i)=>{if(i.some(e=>3===e.reason||"api"===e.source)){if(!this._hideInlineEditOnSelectionChange.get()&&"inlineEdit"===this.model.get()?.state.get()?.kind)return;const e=this.model.get();if(!e)return;"ghostText"===e.state.get()?.kind&&this.model.get()?.stop()}})),this._register(Rce(t=>{const i=this._focusIsInEditorOrMenu.read(t),n=this.model.read(void 0);if(i){const e=n?.state.read(void 0);return void(e&&"inlineEdit"===e.kind&&e.nextEditUri||Wce(e=>{for(const t of E2._instances)t!==this&&t.model.read(void 0)?.stop("automatic",e)}))}this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(71).keepOnBlur||dB.dropDownVisible||n&&(n.state.read(void 0)?.inlineCompletion?.isFromExplicitRequest&&n.inlineEditAvailable.read(void 0)||Wce(e=>{n.stop("automatic",e)}))})),this._register(Rce(e=>{const t=this.model.read(e)?.inlineCompletionState.read(e);t?.suggestItem?t.primaryGhostText.lineCount>=2&&this._suggestWidgetAdapter.forceRenderingAbove():this._suggestWidgetAdapter.stopForceRenderingAbove()})),this._register(Dle(()=>{this._suggestWidgetAdapter.stopForceRenderingAbove()}));const h=qce(this,(e,t)=>{const i=this.model.read(e)?.state.read(e);return this._suggestWidgetAdapter.selectedItem.get()?t:i?.inlineCompletion?.semanticId});this._register(gme(Dce(e=>(this._playAccessibilitySignal.read(e),h.read(e),{})),async(e,t,i,n)=>{let o=this.model.get(),s=o?.state.get();if(!s||!o)return;if(await Tle(50,Ile(n)),await dwe(this._suggestWidgetAdapter.selectedItem,hle,()=>!1,Ile(n)),o=this.model.get(),s=o?.state.get(),!s||!o)return;const r="ghostText"===s.kind?o.textModel.getLineContent(s.primaryGhostText.lineNumber):"";this._accessibilitySignalService.playSignal("ghostText"===s.kind?TL.inlineSuggestion:TL.nextEditSuggestion),this.editor.getOption(12)&&("ghostText"===s.kind?this._provideScreenReaderUpdate(s.primaryGhostText.renderForScreenReader(r)):this._provideScreenReaderUpdate(""))})),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")});const u=new HQ(this._contextKeyService);this._register(u.bind(bY.cursorInIndentation,this._cursorIsInIndentation)),this._register(u.bind(bY.hasSelection,e=>!this._editorObs.cursorSelection.read(e)?.isEmpty())),this._register(u.bind(bY.cursorAtInlineEdit,this.model.map((e,t)=>e?.inlineEditState?.read(t)?.cursorAtInlineEdit.read(t)))),this._register(u.bind(bY.tabShouldAcceptInlineEdit,this.model.map((e,t)=>!!e?.tabShouldAcceptInlineEdit.read(t)))),this._register(u.bind(bY.tabShouldJumpToInlineEdit,this.model.map((e,t)=>!!e?.tabShouldJumpToInlineEdit.read(t)))),this._register(u.bind(bY.inlineEditVisible,e=>void 0!==this.model.read(e)?.inlineEditState.read(e))),this._register(u.bind(bY.inlineSuggestionHasIndentation,e=>this.model.read(e)?.getIndentationInfo(e)?.startsWithIndentation)),this._register(u.bind(bY.inlineSuggestionHasIndentationLessThanTabSize,e=>this.model.read(e)?.getIndentationInfo(e)?.startsWithIndentationLessThanTabSize)),this._register(u.bind(bY.suppressSuggestions,e=>{const t=this.model.read(e)?.inlineCompletionState.read(e);return t?.primaryGhostText&&t?.inlineCompletion?t.inlineCompletion.source.inlineSuggestions.suppressSuggestions:void 0})),this._register(u.bind(bY.inlineSuggestionVisible,e=>{const t=this.model.read(e)?.inlineCompletionState.read(e);return!!t?.inlineCompletion&&void 0!==t?.primaryGhostText&&!t?.primaryGhostText.isEmpty()}));const g=Dce(this,e=>{const t=this.model.read(e)?.inlineCompletionState.read(e)?.primaryGhostText;if(t&&!t.isEmpty())return new to(t.lineNumber,t.parts[0].column)});this._register(u.bind(bY.cursorBeforeGhostText,e=>{const t=g.read(e);if(!t)return!1;const i=this._editorObs.cursorPosition.read(e);return!!i&&t.equals(i)})),this._register(this._instantiationService.createInstance(pQ,this.editor))}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(169)&&(n=Vae(1204,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Qhe(n?e+", "+n:e)}shouldShowHoverAt(e){const t=this.model.get()?.primaryGhostText.get();return!!t&&t.parts.some(i=>e.containsPosition(new to(t.lineNumber,i.column)))}shouldShowHoverAtViewZone(e){return this._view.shouldShowHoverAtViewZone(e)}reject(){Wce(e=>{const t=this.model.get();if(t&&(t.stop("explicitCancel",e),this._focusIsInEditorOrMenu.get()))for(const i of E2._instances)i!==this&&i.model.get()?.stop("automatic",e)})}jump(){const e=this.model.get();e&&e.jump()}},E2=D2,D2._instances=new Set,D2.hot=K_e(D2),D2.ID="editor.contrib.inlineCompletionsController",M2=D2,M2=E2=I2([N2(1,Jn),N2(2,es),N2(3,ka),N2(4,fo),N2(5,vW),N2(6,Tx),N2(7,NL),N2(8,xw),N2(9,Fc)],M2),T2=class e extends rr{constructor(){super({id:e.ID,label:zae(1183,"Show Next Inline Suggestion"),precondition:Po.and(jl.writable,bY.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){M2.get(t)?.model.get()?.next()}},T2.ID=JW,R2=class e extends rr{constructor(){super({id:e.ID,label:zae(1184,"Show Previous Inline Suggestion"),precondition:Po.and(jl.writable,bY.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){M2.get(t)?.model.get()?.previous()}},R2.ID=XW,O2=function(...e){return new aY(e)}((pa={showNoResultNotification:tSe(eSe()),providerId:tSe((ma="vscode://schemas/inlineCompletionProviderIdArgs",fa=iY,new lY(ma,fa))),explicit:tSe(eSe())},new rY(pa)),new oY),A2=class extends rr{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:zae(1185,"Trigger Inline Suggestion"),precondition:jl.writable,metadata:{description:Vae(1172,"Triggers an inline suggestion in the editor."),args:[{name:"args",description:Vae(1173,"Options for triggering inline suggestions."),isOptional:!0,schema:O2.getJSONSchema()}]}})}async run(e,t,i){const n=e.get(Xv),o=e.get(Tx),s=M2.get(t),r=O2.validateOrThrow(i),a=r?.providerId?o.inlineCompletionsProvider.all(t.getModel()).find(e=>function(e){const t=[];return e.providerId&&(t.push(e.providerId.toStringWithoutVersion()),t.push(e.providerId.extensionId+":*")),t}(e).some(e=>e===r.providerId)):void 0;await async function(e,t){const i=new on(e,t);try{await e(i)}finally{i.finish()}}(async e=>{await(s?.model.get()?.trigger(e,{provider:a,explicit:r?.explicit??!0})),s?.playAccessibilitySignal(e)}),r?.showNoResultNotification&&(s?.model.get()?.state.get()||n.notify({severity:Qv.Info,message:Vae(1174,"No inline suggestion is available.")}))}},P2=class extends rr{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:zae(1186,"Accept Next Word Of Inline Suggestion"),precondition:Po.and(jl.writable,bY.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:Po.and(jl.writable,bY.inlineSuggestionVisible,bY.cursorBeforeGhostText,Wc.negate())},menuOpts:[{menuId:ds.InlineSuggestionToolbar,title:Vae(1175,"Accept Word"),group:"primary",order:2}]})}async run(e,t){await(M2.get(t)?.model.get()?.acceptNextWord())}},F2=class extends rr{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:zae(1187,"Accept Next Line Of Inline Suggestion"),precondition:Po.and(jl.writable,bY.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:ds.InlineSuggestionToolbar,title:Vae(1176,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){await(M2.get(t)?.model.get()?.acceptNextLine())}},W2=class extends rr{constructor(){super({id:QW,label:zae(1188,"Accept Inline Suggestion"),precondition:Po.or(bY.inlineSuggestionVisible,bY.inlineEditVisible),menuOpts:[{menuId:ds.InlineSuggestionToolbar,title:Vae(1177,"Accept"),group:"primary",order:2},{menuId:ds.InlineEditsActions,title:Vae(1178,"Accept"),group:"primary",order:2}],kbOpts:[{primary:2,weight:200,kbExpr:Po.or(Po.and(bY.inlineSuggestionVisible,jl.tabMovesFocus.toNegated(),cY.Visible.toNegated(),jl.hoverFocused.toNegated(),bY.hasSelection.toNegated(),bY.inlineSuggestionHasIndentationLessThanTabSize),Po.and(bY.inlineEditVisible,jl.tabMovesFocus.toNegated(),cY.Visible.toNegated(),jl.hoverFocused.toNegated(),bY.tabShouldAcceptInlineEdit))}]})}async run(e,t){const i=M2.getInFocusedEditorOrParent(e);i&&(i.model.get()?.accept(i.editor),i.editor.focus())}},ns.registerKeybindingRule({id:QW,weight:202,primary:2,when:Po.and(bY.inInlineEditsPreviewEditor)}),B2=class extends rr{constructor(){super({id:"editor.action.inlineSuggest.jump",label:zae(1189,"Jump to next inline edit"),precondition:bY.inlineEditVisible,menuOpts:[{menuId:ds.InlineEditsActions,title:Vae(1179,"Jump"),group:"primary",order:1,when:bY.cursorAtInlineEdit.toNegated()}],kbOpts:{primary:2,weight:201,kbExpr:Po.and(bY.inlineEditVisible,jl.tabMovesFocus.toNegated(),cY.Visible.toNegated(),jl.hoverFocused.toNegated(),bY.tabShouldJumpToInlineEdit)}})}async run(e,t){const i=M2.get(t);i&&i.jump()}},(V2=class e extends rr{constructor(){super({id:e.ID,label:zae(1190,"Hide Inline Suggestion"),precondition:Po.or(bY.inlineSuggestionVisible,bY.inlineEditVisible),kbOpts:{weight:190,primary:9},menuOpts:[{menuId:ds.InlineEditsActions,title:Vae(1180,"Reject"),group:"primary",order:3}]})}async run(e,t){const i=M2.getInFocusedEditorOrParent(e);Wce(e=>{i?.model.get()?.stop("explicitCancel",e)}),i?.editor.focus()}}).ID=eB,(H2=class e extends rr{constructor(){super({id:e.ID,label:zae(1191,"Toggle Inline Suggestions Show Collapsed"),precondition:Po.true()})}async run(e,t){const i=e.get(ka),n=i.getValue("editor.inlineSuggest.edits.showCollapsed");i.updateValue("editor.inlineSuggest.edits.showCollapsed",!n)}}).ID=tB,ns.registerKeybindingRule({id:V2.ID,weight:-1,primary:9,secondary:[1033],when:Po.and(bY.inInlineEditsPreviewEditor)}),(z2=class e extends ms{constructor(){super({id:e.ID,title:Vae(1181,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:ds.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Po.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e){const t=e.get(ka),i="always"===t.getValue("editor.inlineSuggest.showToolbar")?"onHover":"always";t.updateValue("editor.inlineSuggest.showToolbar",i)}}).ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar",U2=class extends rr{constructor(){super({id:"editor.action.inlineSuggest.dev.extractRepro",label:Vae(1182,"Developer: Extract Inline Suggest State"),alias:"Developer: Inline Suggest Extract Repro",precondition:Po.or(bY.inlineEditVisible,bY.inlineSuggestionVisible)})}async run(e,t){const i=e.get(nT),n=M2.get(t)?.model.get();if(!n)return;const o=n.extractReproSample(),s=qle(JSON.stringify({inlineCompletion:o.inlineCompletion},null,4)).map(e=>"// "+e).join("\n"),r=`${o.documentValue}\n\n// <json>\n${s}\n// </json>\n`;return await i.writeText(r),{reproCase:r}}},K2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},q2=function(e,t){return function(i,n){t(i,n,e)}},j2=class{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}},$2=class{constructor(e,t,i,n,o){this._editor=e,this.accessibilityService=t,this._instantiationService=i,this._telemetryService=n,this._markdownRendererService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=M2.get(this._editor);if(!t)return null;const i=e.target;if(8===i.type){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new EW(1e3,this,mr.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}if(7===i.type&&t.shouldShowHoverAt(i.range))return new EW(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(6===i.type&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range))return new EW(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(9===i.type&&i.element){const n=E1.getWarningWidgetContext(i.element);if(n&&t.shouldShowHoverAt(n.range))return new EW(1e3,this,n.range,e.event.posx,e.event.posy,!1)}return null}computeSync(e,t){if("onHover"!==this._editor.getOption(71).showToolbar)return[];const i=M2.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new j2(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new De,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(12)&&i.add(this.renderScreenReaderText(e,n));const o=n.controller.model.get(),s=document.createElement("div");return e.fragment.appendChild(s),i.add(Pce((t,i)=>{const n=i.add(this._instantiationService.createInstance(dB.hot.read(t),this._editor,!1,z_e(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands,o.warning,()=>{e.onContentsChanged()}));s.replaceChildren(n.getDomNode())})),o.triggerExplicitly(),new MW([{hoverPart:n,hoverElement:s,dispose(){i.dispose()}}])}getAccessibleContent(e){return Vae(1205,"There are inline completions here")}renderScreenReaderText(e,t){const i=new De,n=Ahe,o=n("div.hover-row.markdown-hover"),s=Mhe(o,n("div.hover-contents",{"aria-live":"assertive"})),r=t=>{const n=Vae(1206,"Suggestion:"),o=i.add(this._markdownRendererService.render((new pD).appendText(n).appendCodeblock("text",t),{context:this._editor,asyncRenderCallback:()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}}));s.replaceChildren(o.element)};return i.add(Rce(e=>{const i=t.controller.model.read(e)?.primaryGhostText.read(e);if(i){const e=this._editor.getModel().getLineContent(i.lineNumber);r(i.renderForScreenReader(e))}else Rhe(s)})),e.fragment.appendChild(o),i}},$2=K2([q2(1,Fc),q2(2,Jn),q2(3,fs),q2(4,LA)],$2),G2=class{},Iue(M2.ID,M2.hot.get(),3),kue(A2),kue(T2),kue(R2),kue(P2),kue(F2),kue(W2),kue(H2),kue(V2),kue(B2),mue(z2),kue(U2),mue(YX),mue(QX),TW.register($2),ZZ.register(new G2),Y2=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Q2=function(e,t){return function(i,n){t(i,n,e)}},Z2=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new De,this.toUnhookForKeyboard=new De,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new KH(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([e,t])=>{this.startFindDefinitionFromMouse(e,t??void 0)})),this.toUnhook.add(o.onExecute(e=>{this.isEnabled(e)&&this.gotoDefinition(e.target.position,e.hasSideBySideModifier).catch(e=>{$ae(e)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(X2.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(9===e.target.type&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordAtPosition=null,void this.removeLinkDecorations();const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){this.toUnhookForKeyboard.clear();const t=e?this.editor.getModel()?.getWordAtPosition(e):null;if(!t)return this.currentWordAtPosition=null,void this.removeLinkDecorations();if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new mA(this.editor,15);let n;this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Ele(t=>this.findDefinition(e,t));try{n=await this.previousPromise}catch(s){return void $ae(s)}if(!n||!n.length||!i.validate(this.editor))return void this.removeLinkDecorations();const o=n[0].originSelectionRange?mr.lift(n[0].originSelectionRange):new mr(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(!(n.length>1)){const e=n[0];if(!e.uri)return;return this.textModelResolverService.createModelReference(e.uri).then(t=>{if(!t.object||!t.object.textEditorModel)return void t.dispose();const{object:{textEditorModel:i}}=t,{startLineNumber:n}=e.range;if(n<1||n>i.getLineCount())return void t.dispose();const s=this.getPreviewValue(i,n,e),r=this.languageService.guessLanguageIdByFilepathOrFirstLine(i.uri);this.addDecoration(o,s?(new pD).appendCodeblock(r||"",s):void 0),t.dispose()})}{let e=o;for(const{originSelectionRange:t}of n)t&&(e=mr.plusRange(e,t));this.addDecoration(e,(new pD).appendText(Vae(1077,"Click to show {0} definitions.",n.length)))}}getPreviewValue(e,t,i){let n=i.range;return n.endLineNumber-n.startLineNumber>=X2.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t)),n=e.validateRange(n),this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);for(let o=t+1;o<i.endLineNumber;o++){const t=e.getLineFirstNonWhitespaceColumn(o);n=Math.min(n,t)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${n-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),n=Math.min(e.getLineCount(),t+X2.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<n&&i!==e.getLineFirstNonWhitespaceColumn(o);o++);return new mr(t,1,o+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&6===e.target.type&&!(e.target.detail.injectedText?.options instanceof kx)&&(e.hasTriggerModifier||!!t&&t.keyCodeIsTriggerKey)&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?Lye(this.languageFeaturesService.definitionProvider,i,e,!1,t):Promise.resolve(null)}async gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(e=>new Tq({openToSide:t,openInPeek:!t&&this.editor.getOption(101)&&!this.isInPeekEditor(e),muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e))}isInPeekEditor(e){const t=e.get(es);return az.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},X2=Z2,Z2.ID="editor.contrib.gotodefinitionatposition",Z2.MAX_SOURCE_PREVIEW_LINES=8,J2=Z2,Iue((J2=X2=Y2([Q2(1,no),Q2(2,La),Q2(3,Tx)],J2)).ID,J2,2),kue(class extends rr{constructor(){super({id:"editor.action.debugEditorGpuRenderer",label:zae(1101,"Developer: Debug Editor GPU Renderer"),precondition:Po.true()})}async run(e,t){const i=e.get(Jn),n=await e.get(tA).pick([{label:Vae(1098,"Log Texture Atlas Stats"),id:"logTextureAtlasStats"},{label:Vae(1099,"Save Texture Atlas"),id:"saveTextureAtlas"},{label:Vae(1100,"Draw Glyph"),id:"drawGlyph"}],{canPickMany:!1});if(n)switch(n.id){case"logTextureAtlasStats":i.invokeFunction(e=>{const t=e.get(Ks),i=hw.atlas;if(!hw.atlas)return void t.error("No texture atlas found");const n=i.getStats();t.info(["Texture atlas stats",...n].join("\n\n"))});break;case"saveTextureAtlas":i.invokeFunction(async e=>{const t=e.get(HA),i=e.get(qJ),n=t.getWorkspace().folders;if(n.length>0){const e=hw.atlas,t=[];for(const[o,s]of e.pages.entries())t.push(i.writeFile(_i.joinPath(n[0].uri,`textureAtlasPage${o}_actual.png`),Ni.wrap(new Uint8Array(await(await s.source.convertToBlob()).arrayBuffer()))),i.writeFile(_i.joinPath(n[0].uri,`textureAtlasPage${o}_usage.png`),Ni.wrap(new Uint8Array(await(await s.getUsagePreview()).arrayBuffer()))));await Promise.all(t)}});break;case"drawGlyph":i.invokeFunction(async e=>{const t=e.get(ka),i=e.get(qJ),n=e.get(tA),o=e.get(HA).getWorkspace().folders;if(0===o.length)return;const s=hw.atlas,r=t.getValue("editor.fontFamily"),a=t.getValue("editor.fontSize"),l=new Ev(a,r,She().devicePixelRatio,hw.decorationStyleCache);let d=await n.input({prompt:"Enter a character to draw (prefix with 0x for code point))"});if(!d)return;const c=d.match(/0x(?<codePoint>[0-9a-f]+)/i)?.groups?.codePoint;void 0!==c&&(d=String.fromCodePoint(parseInt(c,16)));const h=s.getGlyph(l,d,0,0,0);if(!h)return;const u=s.pages[h.pageIndex].source.getContext("2d")?.getImageData(h.x,h.y,h.w,h.h);if(!u)return;const g=new OffscreenCanvas(u.width,u.height);lme(g.getContext("2d")).putImageData(u,0,0);const p=await g.convertToBlob({type:"image/png"}),m=_i.joinPath(o[0].uri,`glyph_${d}_0_${a}px_${r.replaceAll(/[,\\\/\.'\s]/g,"_")}.png`);await i.writeFile(m,Ni.wrap(new Uint8Array(await p.arrayBuffer())))})}}}),function(e){e.NoAutoFocus="noAutoFocus",e.FocusIfVisible="focusIfVisible",e.AutoFocusImmediately="autoFocusImmediately"}(e4||(e4={})),t4=class extends rr{constructor(){super({id:"editor.action.showHover",label:zae(1107,"Show or Focus Hover"),metadata:{description:zae(1108,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[e4.NoAutoFocus,e4.FocusIfVisible,e4.AutoFocusImmediately],enumDescriptions:[Vae(1104,"The hover will not automatically take focus."),Vae(1105,"The hover will take focus only if it is already visible."),Vae(1106,"The hover will automatically take focus when it appears.")],default:e4.FocusIfVisible}}}}]},precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:vle(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=t$.get(t);if(!n)return;const o=i?.focus;let s=e4.FocusIfVisible;Object.values(e4).includes(o)?s=o:"boolean"==typeof o&&o&&(s=e4.AutoFocusImmediately);const r=e=>{const i=t.getPosition(),o=new mr(i.lineNumber,i.column,i.lineNumber,i.column);n.showContentHover(o,1,2,e)},a=2===t.getOption(2);n.isHoverVisible?s!==e4.NoAutoFocus?n.focus():r(a):r(a||s===e4.AutoFocusImmediately)}},i4=class extends rr{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:zae(1109,"Show Definition Preview Hover"),precondition:void 0,metadata:{description:zae(1110,"Show the definition preview hover in the editor.")}})}run(e,t){const i=t$.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const o=new mr(n.lineNumber,n.column,n.lineNumber,n.column),s=J2.get(t);s&&s.startFindDefinitionFromCursor(n).then(()=>{i.showContentHover(o,1,2,!0)})}},n4=class extends rr{constructor(){super({id:"editor.action.hideHover",label:zae(1111,"Hide Hover"),alias:"Hide Content Hover",precondition:void 0})}run(e,t){t$.get(t)?.hideContentHover()}},o4=class extends rr{constructor(){super({id:"editor.action.scrollUpHover",label:zae(1112,"Scroll Up Hover"),precondition:jl.hoverFocused,kbOpts:{kbExpr:jl.hoverFocused,primary:16,weight:100},metadata:{description:zae(1113,"Scroll up the editor hover.")}})}run(e,t){const i=t$.get(t);i&&i.scrollUp()}},s4=class extends rr{constructor(){super({id:"editor.action.scrollDownHover",label:zae(1114,"Scroll Down Hover"),precondition:jl.hoverFocused,kbOpts:{kbExpr:jl.hoverFocused,primary:18,weight:100},metadata:{description:zae(1115,"Scroll down the editor hover.")}})}run(e,t){const i=t$.get(t);i&&i.scrollDown()}},r4=class extends rr{constructor(){super({id:"editor.action.scrollLeftHover",label:zae(1116,"Scroll Left Hover"),precondition:jl.hoverFocused,kbOpts:{kbExpr:jl.hoverFocused,primary:15,weight:100},metadata:{description:zae(1117,"Scroll left the editor hover.")}})}run(e,t){const i=t$.get(t);i&&i.scrollLeft()}},a4=class extends rr{constructor(){super({id:"editor.action.scrollRightHover",label:zae(1118,"Scroll Right Hover"),precondition:jl.hoverFocused,kbOpts:{kbExpr:jl.hoverFocused,primary:17,weight:100},metadata:{description:zae(1119,"Scroll right the editor hover.")}})}run(e,t){const i=t$.get(t);i&&i.scrollRight()}},l4=class extends rr{constructor(){super({id:"editor.action.pageUpHover",label:zae(1120,"Page Up Hover"),precondition:jl.hoverFocused,kbOpts:{kbExpr:jl.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:zae(1121,"Page up the editor hover.")}})}run(e,t){const i=t$.get(t);i&&i.pageUp()}},d4=class extends rr{constructor(){super({id:"editor.action.pageDownHover",label:zae(1122,"Page Down Hover"),precondition:jl.hoverFocused,kbOpts:{kbExpr:jl.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:zae(1123,"Page down the editor hover.")}})}run(e,t){const i=t$.get(t);i&&i.pageDown()}},c4=class extends rr{constructor(){super({id:"editor.action.goToTopHover",label:zae(1124,"Go To Top Hover"),precondition:jl.hoverFocused,kbOpts:{kbExpr:jl.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:zae(1125,"Go to the top of the editor hover.")}})}run(e,t){const i=t$.get(t);i&&i.goToTop()}},h4=class extends rr{constructor(){super({id:"editor.action.goToBottomHover",label:zae(1126,"Go To Bottom Hover"),precondition:jl.hoverFocused,kbOpts:{kbExpr:jl.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:zae(1127,"Go to the bottom of the editor hover.")}})}run(e,t){const i=t$.get(t);i&&i.goToBottom()}},u4=class extends rr{constructor(){super({id:$W,label:GW,alias:"Increase Hover Verbosity Level",precondition:jl.hoverVisible})}run(e,t,i){const n=t$.get(t);if(!n)return;const o=void 0!==i?.index?i.index:n.focusedHoverPartIndex();n.updateHoverVerbosityLevel(gb.Increase,o,i?.focus)}},g4=class extends rr{constructor(){super({id:ZW,label:YW,alias:"Decrease Hover Verbosity Level",precondition:jl.hoverVisible})}run(e,t,i){const n=t$.get(t);if(!n)return;const o=void 0!==i?.index?i.index:n.focusedHoverPartIndex();t$.get(t)?.updateHoverVerbosityLevel(gb.Decrease,o,i?.focus)}},p4=class{constructor(e){this._editor=e}computeSync(e){const t=e=>({value:e}),i=this._editor.getLineDecorations(e.lineNumber),n=[],o="lineNo"===e.laneOrLine;if(!i)return n;for(const s of i){const i=s.options.glyphMargin?.position??Yr.Center;if(!o&&i!==e.laneOrLine)continue;const r=o?s.options.lineNumberHoverMessage:s.options.glyphMarginHoverMessage;r&&!Vbe(r)&&n.push(...gce(r).map(t))}return n}},f4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_4=function(e,t){return function(i,n){t(i,n,e)}},v4=Ahe,m4=class extends Ie{constructor(e,t){super(),this._markdownRendererService=t,this.allowEditorOverflow=!0,this._renderDisposeables=this._register(new De),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new vB(!0)),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._hoverOperation=this._register(new pB(this._editor,new p4(this._editor))),this._register(this._hoverOperation.onResult(e=>this._withResult(e))),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(59)&&this._updateFont()})),this._register(xn(this._hover.containerDomNode,"mouseleave",e=>{this._onMouseLeave(e)})),this._editor.addOverlayWidget(this)}dispose(){this._hoverComputerOptions=void 0,this._editor.removeOverlayWidget(this),super.dispose()}getId(){return b4.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(e=>this._editor.applyFontInfo(e))}_onModelDecorationsChanged(){this._isVisible&&this._hoverComputerOptions&&(this._hoverOperation.cancel(),this._hoverOperation.start(0,this._hoverComputerOptions))}showsOrWillShow(e){const t=e.target;return 2===t.type&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):3===t.type&&(this._startShowingAt(t.position.lineNumber,"lineNo"),!0)}_startShowingAt(e,t){this._hoverComputerOptions&&this._hoverComputerOptions.lineNumber===e&&this._hoverComputerOptions.laneOrLine===t||(this._hoverOperation.cancel(),this.hide(),this._hoverComputerOptions={lineNumber:e,laneOrLine:t},this._hoverOperation.start(0,this._hoverComputerOptions))}hide(){this._hoverComputerOptions=void 0,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e.value,this._messages.length>0?this._renderMessages(e.options.lineNumber,e.options.laneOrLine,this._messages):this.hide()}_renderMessages(e,t,i){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const o of i){const e=v4("div.hover-row.markdown-hover"),t=Mhe(e,v4("div.hover-contents")),i=this._renderDisposeables.add(this._markdownRendererService.render(o.value,{context:this._editor}));t.appendChild(i.element),n.appendChild(e)}this._updateContents(n),this._showAt(e,t)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e,t){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const i=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),s=this._editor.getOption(75),r=this._hover.containerDomNode.clientHeight,a=n-o-(r-s)/2,l=i.glyphMarginLeft+i.glyphMarginWidth+("lineNo"===t?i.lineNumbersWidth:0),d=i.height-r,c=Math.max(0,Math.min(Math.round(a),d));if(this._editor.getOption(51)){const e=this._editor.getDomNode();if(e){const t=lhe(e);this._hover.containerDomNode.style.position="fixed",this._hover.containerDomNode.style.left=`${t.left+l}px`,this._hover.containerDomNode.style.top=`${t.top+c}px`}}else this._hover.containerDomNode.style.position="absolute",this._hover.containerDomNode.style.left=`${l}px`,this._hover.containerDomNode.style.top=`${c}px`;this._hover.containerDomNode.style.zIndex="11"}_onMouseLeave(e){const t=this._editor.getDomNode();t&&vCe(t,e.x,e.y)||this.hide()}},b4=m4,m4.ID="editor.contrib.modesGlyphHoverWidget",w4=m4,w4=b4=f4([_4(1,LA)],w4),y4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},S4=function(e,t){return function(i,n){t(i,n,e)}},(C4=class extends Ie{constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new De,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new ft(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(e=>this._onEditorMouseDown(e))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(e=>this._onEditorMouseMove(e))),this._listenersStore.add(this._editor.onKeyDown(e=>this._onKeyDown(e)))):(this._listenersStore.add(this._editor.onMouseMove(e=>this._onEditorMouseMove(e))),this._listenersStore.add(this._editor.onKeyDown(e=>this._onKeyDown(e)))),this._listenersStore.add(this._editor.onMouseLeave(e=>this._onEditorMouseLeave(e))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this.hideGlyphHover()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(e=>this._onEditorScrollChanged(e)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideGlyphHover()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,this._isMouseOnGlyphHoverWidget(e)||this.hideGlyphHover()}_isMouseOnGlyphHoverWidget(e){const t=this._glyphWidget?.getDomNode();return!!t&&vCe(t,e.event.posx,e.event.posy)}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnGlyphHoverWidget(e)||this.hideGlyphHover())}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnGlyphHoverWidget(e);return t&&i}_onEditorMouseMove(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)?this._reactToEditorMouseMoveRunner.cancel():this._reactToEditorMouseMove(e))}_reactToEditorMouseMove(e){e&&(this._tryShowHoverWidget(e)||this.hideGlyphHover())}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&5!==e.keyCode&&6!==e.keyCode&&57!==e.keyCode&&4!==e.keyCode&&this.hideGlyphHover()}hideGlyphHover(){this._glyphWidget?.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(w4,this._editor)),this._glyphWidget}dispose(){super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),this._glyphWidget?.dispose()}}).ID="editor.contrib.marginHover",x4=C4,x4=y4([S4(1,Jn)],x4),k4=class{},L4=class{},D4=class{},Iue(t$.ID,t$,2),Iue(x4.ID,x4,2),kue(t4),kue(i4),kue(n4),kue(o4),kue(s4),kue(r4),kue(a4),kue(l4),kue(d4),kue(c4),kue(h4),kue(u4),kue(g4),TW.register(_H),TW.register(Bj),Upe((e,t)=>{const i=e.getColor(qh);i&&(t.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${i.transparent(.5)}; }`))}),ZZ.register(new k4),ZZ.register(new L4),ZZ.register(new D4),N4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},E4=function(e,t){return function(i,n){t(i,n,e)}},M4=class e extends rr{constructor(){super({id:e.ID,label:zae(1148,"Convert Indentation to Spaces"),precondition:jl.writable,metadata:{description:zae(1149,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new z4(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}},M4.ID="editor.action.indentationToSpaces",T4=class e extends rr{constructor(){super({id:e.ID,label:zae(1150,"Convert Indentation to Tabs"),precondition:jl.writable,metadata:{description:zae(1151,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),o=t.getSelection();if(!o)return;const s=new U4(o,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}},T4.ID="editor.action.indentationToTabs",R4=class extends rr{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(tA),n=e.get(io),o=t.getModel();if(!o)return;const s=n.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),r=o.getOptions(),a=[1,2,3,4,5,6,7,8].map(e=>({id:e.toString(),label:e.toString(),description:e===s.tabSize&&e===r.tabSize?Vae(1144,"Configured Tab Size"):e===s.tabSize?Vae(1145,"Default Tab Size"):e===r.tabSize?Vae(1146,"Current Tab Size"):void 0})),l=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(a,{placeHolder:Vae(1147,"Select Tab Size for Current File"),activeItem:a[l]}).then(e=>{if(e&&o&&!o.isDisposed()){const t=parseInt(e.label,10);this.displaySizeOnly?o.updateOptions({tabSize:t}):o.updateOptions({tabSize:t,indentSize:t,insertSpaces:this.insertSpaces})}})},50)}},(O4=class e extends R4{constructor(){super(!1,!1,{id:e.ID,label:zae(1152,"Indent Using Tabs"),precondition:void 0,metadata:{description:zae(1153,"Use indentation with tabs.")}})}}).ID="editor.action.indentUsingTabs",(A4=class e extends R4{constructor(){super(!0,!1,{id:e.ID,label:zae(1154,"Indent Using Spaces"),precondition:void 0,metadata:{description:zae(1155,"Use indentation with spaces.")}})}}).ID="editor.action.indentUsingSpaces",(P4=class e extends R4{constructor(){super(!0,!0,{id:e.ID,label:zae(1156,"Change Tab Display Size"),precondition:void 0,metadata:{description:zae(1157,"Change the space size equivalent of the tab.")}})}}).ID="editor.action.changeTabDisplaySize",F4=class e extends rr{constructor(){super({id:e.ID,label:zae(1158,"Detect Indentation from Content"),precondition:void 0,metadata:{description:zae(1159,"Detect the indentation from content.")}})}run(e,t){const i=e.get(io),n=t.getModel();if(!n)return;const o=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(o.insertSpaces,o.tabSize)}},F4.ID="editor.action.detectIndentation",W4=class extends rr{constructor(){super({id:"editor.action.reindentlines",label:zae(1160,"Reindent Lines"),precondition:jl.writable,metadata:{description:zae(1161,"Reindent the lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(il),n=t.getModel();if(!n)return;const o=bxe(n,i,1,n.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}},B4=class extends rr{constructor(){super({id:"editor.action.reindentselectedlines",label:zae(1162,"Reindent Selected Lines"),precondition:jl.writable,metadata:{description:zae(1163,"Reindent the selected lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(il),n=t.getModel();if(!n)return;const o=t.getSelections();if(null===o)return;const s=[];for(const r of o){let e=r.startLineNumber,t=r.endLineNumber;if(e!==t&&1===r.endColumn&&t--,1===e){if(e===t)continue}else e--;const o=bxe(n,i,e,t);s.push(...o)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}},V4=class{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&"string"==typeof i.text&&this._edits.push(i)}getEditOperations(e,t){for(const n of this._edits)t.addEditOperation(mr.lift(n.range),n.text);let i=!1;Array.isArray(this._edits)&&1===this._edits.length&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}},I4=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new De,this.callOnModel=new De,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!this.editor.getOption(17)||this.editor.getOption(16)<4||this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(null===t||t.length>1)return;const i=this.editor.getModel();if(!i)return;if(this.rangeContainsOnlyWhitespaceCharacters(i,e))return;if(!this.editor.getOption(18)&&function(e,t){const i=t=>2===function(e,t){const i=t.lineNumber;if(!e.tokenization.isCheapToTokenize(i))return;e.tokenization.forceTokenization(i);const n=e.tokenization.getLineTokens(i),o=n.findTokenIndexAtOffset(t.column-1);return n.getStandardTokenType(o)}(e,t);return i(t.getStartPosition())||i(t.getEndPosition())}(i,e))return;if(!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const n=this.editor.getOption(16),{tabSize:o,indentSize:s,insertSpaces:r}=i.getOptions(),a=[],l={shiftIndent:e=>kl.shiftIndent(e,e.length+1,o,s,r),unshiftIndent:e=>kl.unshiftIndent(e,e.length+1,o,s,r)};let d=e.startLineNumber,c=i.getLineContent(d);if(!/\S/.test(c.substring(0,e.startColumn-1))){const e=yge(n,i,i.getLanguageId(),d,l,this._languageConfigurationService);if(null!==e){const t=$le(c),n=rSe(e,o);if(n!==rSe(t,o)){const e=aSe(n,o,r);a.push({range:new mr(d,1,d,t.length+1),text:e}),c=e+c.substring(t.length)}else{const e=Sge(i,d,this._languageConfigurationService);if(0===e||8===e)return}}}const h=d;for(;d<e.endLineNumber&&!/\S/.test(i.getLineContent(d+1));)d++;if(d!==e.endLineNumber){const t=yge(n,{tokenization:{getLineTokens:e=>i.tokenization.getLineTokens(e),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(e,t)=>i.getLanguageIdAtPosition(e,t)},getLineContent:e=>e===h?c:i.getLineContent(e)},i.getLanguageId(),d+1,l,this._languageConfigurationService);if(null!==t){const n=rSe(t,o),s=rSe($le(i.getLineContent(d+1)),o);if(n!==s){const t=n-s;for(let n=d+1;n<=e.endLineNumber;n++){const e=$le(i.getLineContent(n)),s=aSe(rSe(e,o)+t,o,r);s!==e&&a.push({range:new mr(n,1,n,e.length+1),text:s})}}}}if(a.length>0){this.editor.pushUndoStop();const e=new V4(a,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",e),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=e=>0===e.trim().length;let n=!0;if(t.startLineNumber===t.endLineNumber)n=i(e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1));else for(let o=t.startLineNumber;o<=t.endLineNumber;o++){const s=e.getLineContent(o);if(n=o===t.startLineNumber?i(s.substring(t.startColumn-1)):o===t.endLineNumber?i(s.substring(0,t.endColumn-1)):0===e.getLineFirstNonWhitespaceColumn(o),!n)break}return n}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},I4.ID="editor.contrib.autoIndentOnPaste",H4=I4,H4=N4([E4(1,il)],H4),z4=class{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),wxe(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}},U4=class{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),wxe(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}},Iue(H4.ID,H4,2),kue(M4),kue(T4),kue(O4),kue(A4),kue(P4),kue(F4),kue(W4),kue(B4),Iue($q.ID,$q,1),TW.register(Qq),K4=class{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new fr(i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn),i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn)):new fr(i.endLineNumber,i.endColumn-this._text.length,i.endLineNumber,i.endColumn)}},j4=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},$4=function(e,t){return function(i,n){t(i,n,e)}},q4=class{static get(e){return e.getContribution(G4.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){this.currentRequest?.cancel();const i=this.editor.getSelection(),n=this.editor.getModel();if(!n||!i)return;let o=i;if(o.startLineNumber!==o.endLineNumber)return;const s=new mA(this.editor,5),r=n.uri;return this.editorWorkerService.canNavigateValueSet(r)?(this.currentRequest=Ele(e=>this.editorWorkerService.navigateValueSet(r,o,t)),this.currentRequest.then(t=>{if(!t||!t.range||!t.value)return;if(!s.validate(this.editor))return;const i=mr.lift(t.range);let n=t.range;const r=t.value.length-(o.endColumn-o.startColumn);n={startLineNumber:n.startLineNumber,startColumn:n.startColumn,endLineNumber:n.endLineNumber,endColumn:n.startColumn+t.value.length},r>1&&(o=new fr(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+r-1));const a=new K4(i,o,t.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,a),this.editor.pushUndoStop(),this.decorations.set([{range:n,options:G4.DECORATION}]),this.decorationRemover?.cancel(),this.decorationRemover=Tle(350),this.decorationRemover.then(()=>this.decorations.clear()).catch($ae)}).catch($ae)):Promise.resolve(void 0)}},G4=q4,q4.ID="editor.contrib.inPlaceReplaceController",q4.DECORATION=Lx.register({description:"in-place-replace",className:"valueSetReplacement"}),Z4=q4,Z4=G4=j4([$4(1,DM)],Z4),Y4=class extends rr{constructor(){super({id:"editor.action.inPlaceReplace.up",label:zae(1240,"Replace with Previous Value"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=Z4.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}},Q4=class extends rr{constructor(){super({id:"editor.action.inPlaceReplace.down",label:zae(1241,"Replace with Next Value"),precondition:jl.writable,kbOpts:{kbExpr:jl.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=Z4.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}},Iue(Z4.ID,Z4,4),kue(Y4),kue(Q4),X4=class{constructor(e){this._selection=e,this._selectionId=null}getEditOperations(e,t){const i=function(e){const t=e.getLineCount(),i=-1===Gle(e.getLineContent(t));if(t&&!i)return VH.insert(new to(t,e.getLineMaxColumn(t)),e.getEOL())}(e);i&&t.addEditOperation(i.range,i.text),this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}},J4=class e extends rr{constructor(){super({id:e.ID,label:zae(1242,"Insert Final New Line"),precondition:jl.writable})}run(e,t,i){const n=t.getSelection();if(null===n)return;const o=new X4(n);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop()}},J4.ID="editor.action.insertFinalNewLine",kue(J4),e5=class extends rr{constructor(){super({id:"expandLineSelection",label:zae(1243,"Expand Line Selection"),precondition:void 0,kbOpts:{weight:0,kbExpr:jl.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const n=t._getViewModel();n.model.pushStackElement(),n.setCursorStates(i.source,3,oa.expandLineSelection(n,n.getCursorStates())),n.revealAllCursors(i.source,!0)}},kue(e5),i5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},n5=function(e,t){return function(i,n){t(i,n,e)}},s5=new Jo("LinkedEditingInputVisible",!1),t5=class extends Ie{static get(e){return e.getContribution(o5.ID)}constructor(e,t,i,n,o){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new De),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=s5.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new De),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(e=>{(e.hasChanged(78)||e.hasChanged(106))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=null!==t&&(this._editor.getOption(78)||this._editor.getOption(106))&&this._providers.has(t);if(i===this._enabled&&!e)return;if(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||null===t)return;this._localToDispose.add(Be.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const n=new ht(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=n.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},s=new ht(0),r=e=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(e))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(e=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const t=this._currentDecorations.getRange(0);if(t&&e.changes.every(e=>t.intersectRanges(e.range)))return void r(this._syncRangesToken)}o()})),this._localToDispose.add({dispose:()=>{n.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||0===this._currentDecorations.length)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const n=t.getValueInRange(i);if(this._currentWordPattern){const e=n.match(this._currentWordPattern);if((e?e[0].length:0)!==n.length)return this.clearRanges()}const o=[];for(let s=1,r=this._currentDecorations.length;s<r;s++){const e=this._currentDecorations.getRange(s);if(e)if(e.startLineNumber!==e.endLineNumber)o.push({range:e,text:n});else{let i=t.getValueInRange(e),s=n,r=e.startColumn,a=e.endColumn;const l=sde(i,s);r+=l,i=i.substr(l),s=s.substr(l);const d=rde(i,s);a-=d,i=i.substr(0,i.length-d),s=s.substr(0,s.length-d),r===a&&0===s.length||o.push({range:new mr(e.startLineNumber,r,e.endLineNumber,a),text:s})}}if(0!==o.length)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const e=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(e)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations.clear(),this._currentRequestCts&&(this._currentRequestCts.cancel(),this._currentRequestCts=null,this._currentRequestPosition=null)}async updateRanges(e=!1){if(!this._editor.hasModel())return void this.clearRanges();const t=this._editor.getPosition();if(!this._enabled&&!e||this._editor.getSelections().length>1)return void this.clearRanges();const i=this._editor.getModel(),n=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===n){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const e=this._currentDecorations.getRange(0);if(e&&e.containsPosition(t))return}}this._currentRequestPosition?.equals(t)||this._currentDecorations.getRange(0)?.containsPosition(t)||this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const o=this._currentRequestCts=new ot;try{const e=new Fe(!1),s=await Cxe(this._providers,i,t,o.token);if(this._debounceInformation.update(i,e.elapsed()),o!==this._currentRequestCts)return;if(this._currentRequestCts=null,n!==i.getVersionId())return;let r=[];s?.ranges&&(r=s.ranges),this._currentWordPattern=s?.wordPattern||this._languageWordPattern;let a=!1;for(let i=0,n=r.length;i<n;i++)if(mr.containsPosition(r[i],t)){if(a=!0,0!==i){const e=r[i];r.splice(i,1),r.unshift(e)}break}if(!a)return void this.clearRanges();const l=r.map(e=>({range:e,options:o5.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(l),this._syncRangesToken++}catch(s){Yae(s)||$ae(s),this._currentRequestCts!==o&&this._currentRequestCts||this.clearRanges()}}},o5=t5,t5.ID="editor.contrib.linkedEditing",t5.DECORATION=Lx.register({description:"linked-editing",stickiness:0,className:"linked-editing-decoration"}),r5=t5,r5=o5=i5([n5(1,es),n5(2,Tx),n5(3,il),n5(4,vW)],r5),a5=class extends rr{constructor(){super({id:"editor.action.linkedEditing",label:zae(1276,"Start Linked Editing"),precondition:Po.and(jl.writable,jl.hasRenameProvider),kbOpts:{kbExpr:jl.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(eo),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return _i.isUri(n)&&to.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(e=>{e&&(e.setPosition(o),e.invokeWithinContext(t=>(this.reportTelemetry(t,e),this.run(t,e))))},$ae):super.runCommand(e,t)}run(e,t){const i=r5.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}},xue(new(sr.bindToContribution(r5.get))({id:"cancelLinkedEditingInput",precondition:s5,handler:e=>e.clearRanges(),kbOpts:{kbExpr:jl.editorTextFocus,weight:199,primary:9,secondary:[1033]}})),mpe("editor.linkedEditingBackground",{dark:eh.fromHex("#f00").transparent(.3),light:eh.fromHex("#f00").transparent(.3),hcDark:eh.fromHex("#f00").transparent(.3),hcLight:eh.white},Vae(1275,"Background color when the editor auto renames on type.")),Sue("_executeLinkedEditingProvider",(e,t,i)=>{const{linkedEditingRangeProvider:n}=e.get(Tx);return Cxe(n,t,i,it.None)}),Iue(r5.ID,r5,1),kue(a5),d5=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:"function"==typeof this._provider.resolveLink?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}},c5=class e{constructor(t){this._disposables=new De;let i=[];for(const[n,o]of t){const t=n.links.map(e=>new d5(e,o));i=e._union(i,t),xle(n)&&(this._disposables??(this._disposables=new De),this._disposables.add(n))}this.links=i}dispose(){this._disposables?.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,o,s,r;for(n=0,s=0,o=e.length,r=t.length;n<o&&s<r;){const o=e[n],r=t[s];mr.areIntersectingOrTouching(o.range,r.range)?n++:mr.compareRangesUsingStarts(o.range,r.range)<0?(i.push(o),n++):(i.push(r),s++)}for(;n<o;n++)i.push(e[n]);for(;s<r;s++)i.push(t[s]);return i}},(l5=c5).Empty=new l5([]),_o.registerCommand("_executeLinkProvider",async(e,...t)=>{let[i,n]=t;ple(i instanceof _i),"number"!=typeof n&&(n=0);const{linkProvider:o}=e.get(Tx),s=e.get(io).getModel(i);if(!s)return[];const r=await yxe(o,s,it.None);if(!r)return[];for(let l=0;l<Math.min(n,r.links.length);l++)await r.links[l].resolve(it.None);const a=r.links.slice(0);return r.dispose(),a}),u5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},g5=function(e,t){return function(i,n){t(i,n,e)}},h5=class extends Ie{static get(e){return e.getContribution(p5.ID)}constructor(e,t,i,n,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=n,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new ft(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new KH(e));this._register(s.onMouseMoveOrRelevantKeyDown(([e,t])=>{this._onEditorMouseMove(e,t)})),this._register(s.onExecute(e=>{this.onEditorMouseUp(e)})),this._register(s.onCancel(e=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(e=>{e.hasChanged(79)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(e=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(e=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(e=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(e=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(79))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Ele(t=>yxe(this.providers,e,t));try{const t=new Fe(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){$ae(t)}finally{this.computePromise=null}}}updateDecorations(e){const t="altKey"===this.editor.getOption(86),i=[],n=Object.keys(this.currentOccurrences);for(const s of n){const e=this.currentOccurrences[s];i.push(e.decorationId)}const o=[];if(e)for(const s of e)o.push(_5.decoration(s,t));this.editor.changeDecorations(t=>{const n=t.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let i=0,o=n.length;i<o;i++){const t=new _5(e[i],n[i]);this.currentOccurrences[t.decorationId]=t}})}_onEditorMouseMove(e,t){const i="altKey"===this.editor.getOption(86);if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const t=this.getLinkOccurrence(e.target.position);t&&this.editor.changeDecorations(e=>{t.activate(e,i),this.activeLinkDecorationId=t.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e="altKey"===this.editor.getOption(86);if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:n}=e;n.resolve(it.None).then(e=>{if("string"==typeof e&&this.editor.hasModel()){const t=this.editor.getModel().uri;if(t.scheme===yi.file&&e.startsWith(`${yi.file}:`)){const i=_i.parse(e);if(i.scheme===yi.file){const n=Cue(i);let o=null;n.startsWith("/./")||n.startsWith("\\.\\")?o=`.${n.substr(1)}`:(n.startsWith("//./")||n.startsWith("\\\\.\\"))&&(o=`.${n.substr(2)}`),o&&(e=Fs(t,o))}}}return this.openerService.open(e,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},e=>{const t=e instanceof Error?e.message:e;"invalid"===t?this.notificationService.warn(Vae(1277,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):"missing"===t?this.notificationService.warn(Vae(1278,"Failed to open this link because its target is missing.")):$ae(e)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const e=this.currentOccurrences[i.id];if(e)return e}return null}isEnabled(e,t){return Boolean(6===e.target.type&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey||e.isMiddleClick&&"openLink"===e.mouseMiddleClickAction))}stop(){this.computeLinks.cancel(),this.activeLinksList&&(this.activeLinksList?.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},p5=h5,h5.ID="editor.linkDetector",m5=h5,m5=p5=u5([g5(1,SA),g5(2,Xv),g5(3,Tx),g5(4,vW)],m5),f5={general:Lx.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Lx.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})},_5=class e{static decoration(t,i){return{range:t.range,options:e._getOptions(t,i,!1)}}static _getOptions(e,t,i){const n={...i?f5.active:f5.general};return n.hoverMessage=function(e,t){const i=e.url&&/^command:/i.test(e.url.toString()),n=e.tooltip?e.tooltip:i?Vae(1279,"Execute command"):Vae(1280,"Follow link"),o=t?F?Vae(1281,"cmd + click"):Vae(1282,"ctrl + click"):F?Vae(1283,"option + click"):Vae(1284,"alt + click");if(e.url){let t="";if(/^command:/i.test(e.url.toString())){const i=e.url.toString().match(/^command:([^?#]+)/);i&&(t=Vae(1285,"Execute command {0}",i[1]))}return new pD("",!0).appendLink(e.url.toString(!0).replace(/ /g,"%20"),n,t).appendMarkdown(` (${o})`)}return(new pD).appendText(`${n} (${o})`)}(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(t,i){t.changeDecorationOptions(this.decorationId,e._getOptions(this.link,i,!0))}deactivate(t,i){t.changeDecorationOptions(this.decorationId,e._getOptions(this.link,i,!1))}},b5=class extends rr{constructor(){super({id:"editor.action.openLink",label:zae(1286,"Open Link"),precondition:void 0})}run(e,t){const i=m5.get(t);if(!i)return;if(!t.hasModel())return;const n=t.getSelections();for(const o of n){const e=i.getLinkOccurrence(o.getEndPosition());e&&i.openLinkOccurrence(e,!1)}}},Iue(m5.ID,m5,1),kue(b5),(v5=class extends Ie{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(e=>{const t=this._editor.getOption(133);t>=0&&6===e.target.type&&e.target.position.column>=t&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}).ID="editor.contrib.longLinesHelper",Iue(v5.ID,v5,2),w5=class extends Ie{constructor(e){super(),this._editor=e;const t=bwe(this._editor),i=t.getOption(171);this._register(Rce(e=>{if(!i.read(e))return;const n=t.domNode.read(e);if(!n)return;const o=e.store.add(Xce("scrollingSession",void 0));e.store.add(this._editor.onMouseDown(e=>{if(o.read(void 0))return void o.set(void 0,void 0);if(!e.event.middleButton)return;e.event.stopPropagation(),e.event.preventDefault();const t=new De,i=new gT(e.event.posx,e.event.posy),s=function(e,t,i){const n=Qce("pos",t);return i.add(ehe(e,"mousemove",e=>{n.set(new gT(e.pageX,e.pageY),void 0)})),n}(pn(n),i,t).map(e=>e.subtract(i).withThreshold(5)),r=n.getBoundingClientRect(),a=new gT(i.x-r.left,i.y-r.top);o.set({mouseDeltaAfterThreshold:s,initialMousePosInEditor:a,didScroll:!1,dispose:()=>t.dispose()},void 0),t.add(this._editor.onMouseUp(e=>{const t=o.read(void 0);t&&t.didScroll&&o.set(void 0,void 0)})),t.add(this._editor.onKeyDown(e=>{o.set(void 0,void 0)}))})),e.store.add(Rce(e=>{const t=o.read(e);if(!t)return;let i=Date.now();e.store.add(Rce(e=>{qQ.instance.invalidateOnNextAnimationFrame(e);const n=Date.now(),o=n-i;i=n;const s=o/32,r=t.mouseDeltaAfterThreshold.read(void 0).scale(s),a=new gT(this._editor.getScrollLeft(),this._editor.getScrollTop());var l;this._editor.setScrollPosition({scrollLeft:(l=a.add(r)).x,scrollTop:l.y}),r.isZero()||(t.didScroll=!0)}));const s=Dce(e=>{const i=t.mouseDeltaAfterThreshold.read(e);let n="";return n+=i.y<0?"n":i.y>0?"s":"",n+=i.x<0?"w":i.x>0?"e":"",n});e.store.add(Rce(e=>{n.setAttribute("data-scroll-direction",s.read(e))}))}));const s=e.store.add(zn.div({class:["scroll-editor-on-middle-click-dot",o.map(e=>e?"":"hidden")],style:{left:o.map(e=>e?e.initialMousePosInEditor.x:0),top:o.map(e=>e?e.initialMousePosInEditor.y:0)}}).toDisposableLiveElement());e.store.add(Xve(n,s.element)),e.store.add(Rce(e=>{const t=o.read(e);n.classList.toggle("scroll-editor-on-middle-click-editor",!!t)}))}))}},Iue(w5.ID="editor.contrib.middleScroll",w5,2),C5=mpe("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},Vae(1563,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},Vae(1564,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0),mpe("editor.wordHighlightTextBackground",C5,Vae(1565,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),y5=mpe("editor.wordHighlightBorder",{light:null,dark:null,hcDark:hh,hcLight:hh},Vae(1566,"Border color of a symbol during read-access, like reading a variable.")),mpe("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:hh,hcLight:hh},Vae(1567,"Border color of a symbol during write-access, like writing to a variable.")),mpe("editor.wordHighlightTextBorder",y5,Vae(1568,"Border color of a textual occurrence for a symbol.")),S5=mpe("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",Vae(1569,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),x5=mpe("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",Vae(1570,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),k5=mpe("editorOverviewRuler.wordHighlightTextForeground",Cu,Vae(1571,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),L5=Lx.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:Hpe(x5),position:Zr.Center},minimap:{color:Hpe(Lu),position:1}}),D5=Lx.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:Hpe(k5),position:Zr.Center},minimap:{color:Hpe(Lu),position:1}}),I5=Lx.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:Hpe(Cu),position:Zr.Center},minimap:{color:Hpe(Lu),position:1}}),N5=Lx.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),E5=Lx.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:Hpe(S5),position:Zr.Center},minimap:{color:Hpe(Lu),position:1}}),Upe((e,t)=>{const i=e.getColor(Fh);i&&t.addRule(`.monaco-editor .selectionHighlight { background-color: ${i.transparent(.5)}; }`)}),T5=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},R5=function(e,t){return function(i,n){t(i,n,e)}},A5=class extends rr{constructor(){super({id:"editor.action.insertCursorAbove",label:zae(1298,"Add Cursor Above"),precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"3_multi",title:Vae(1290,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&!1===i.logicalLine&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,oa.addCursorUp(o,s,n)),o.revealTopMostCursor(i.source),kxe(s,o.getCursorStates())}},P5=class extends rr{constructor(){super({id:"editor.action.insertCursorBelow",label:zae(1299,"Add Cursor Below"),precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"3_multi",title:Vae(1291,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let n=!0;i&&!1===i.logicalLine&&(n=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,oa.addCursorDown(o,s,n)),o.revealBottomMostCursor(i.source),kxe(s,o.getCursorStates())}},F5=class extends rr{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:zae(1300,"Add Cursors to Line Ends"),precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"3_multi",title:Vae(1292,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let n=e.startLineNumber;n<e.endLineNumber;n++){const e=t.getLineMaxColumn(n);i.push(new fr(n,e,n,e))}e.endColumn>1&&i.push(new fr(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),r=[];n.forEach(e=>this.getCursorsForSelection(e,i,r)),r.length>0&&t.setSelections(r),kxe(s,o.getCursorStates())}},W5=class extends rr{constructor(){super({id:"editor.action.addCursorsToBottom",label:zae(1301,"Add Cursors to Bottom"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=t.getModel().getLineCount(),o=[];for(let a=i[0].startLineNumber;a<=n;a++)o.push(new fr(a,i[0].startColumn,a,i[0].endColumn));const s=t._getViewModel(),r=s.getCursorStates();o.length>0&&t.setSelections(o),kxe(r,s.getCursorStates())}},B5=class extends rr{constructor(){super({id:"editor.action.addCursorsToTop",label:zae(1302,"Add Cursors to Top"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),n=[];for(let r=i[0].startLineNumber;r>=1;r--)n.push(new fr(r,i[0].startColumn,r,i[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();n.length>0&&t.setSelections(n),kxe(s,o.getCursorStates())}},V5=class{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}},H5=class e{static create(t,i){if(!t.hasModel())return null;const n=i.getState();if(!t.hasTextFocus()&&n.isRevealed&&n.searchString.length>0)return new e(t,i,!1,n.searchString,n.wholeWord,n.matchCase,null);let o,s,r=!1;const a=t.getSelections();1===a.length&&a[0].isEmpty()?(r=!0,o=!0,s=!0):(o=n.wholeWord,s=n.matchCase);const l=t.getSelection();let d,c=null;if(l.isEmpty()){const e=t.getConfiguredWordAtPosition(l.getStartPosition());if(!e)return null;d=e.word,c=new fr(l.startLineNumber,e.startColumn,l.startLineNumber,e.endColumn)}else d=t.getModel().getValueInRange(l).replace(/\r\n/g,"\n");return new e(t,i,r,d,o,s,c)}constructor(e,t,i,n,o,s,r){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=o,this.matchCase=s,this.currentMatch=r}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();return e?new V5(this._editor.getSelections().concat(e),e,0):null}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new V5(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new fr(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();return e?new V5(this._editor.getSelections().concat(e),e,0):null}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new V5(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new fr(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}},z5=class e extends Ie{static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._sessionDispose=this._register(new De),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=H5.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(e=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(e=>{(e.matchCase||e.wholeWord)&&this._endSession()}))}}_endSession(){this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController&&this._session.findController.getState().change({wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0},!1),this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new fr(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const i=e.getState().matchCase;if(!Lxe(this._editor.getModel(),t,i)){const e=this._editor.getModel(),i=[];for(let n=0,o=t.length;n<o;n++)i[n]=this._expandEmptyToWord(e,t[n]);return void this._editor.setSelections(i)}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null;const i=e.getState();if(i.isRevealed&&i.searchString.length>0&&i.isRegex){const e=this._editor.getModel();t=i.searchScope?e.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824):e.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const e=this._editor.getSelection();for(let i=0,n=t.length;i<n;i++){const n=t[i];if(n.range.intersectRanges(e)){t[i]=t[0],t[0]=n;break}}this._setSelections(t.map(e=>new fr(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)))}}},z5.ID="editor.contrib.multiCursorController",U5=class extends rr{run(e,t){const i=z5.get(t);if(!i)return;const n=t._getViewModel();if(n){const o=n.getCursorStates(),s=_G.get(t);if(s)this._run(i,s);else{const n=e.get(Jn).createInstance(_G,t);this._run(i,n),n.dispose()}kxe(o,n.getCursorStates())}}},K5=class extends U5{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:zae(1303,"Add Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:2082,weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"3_multi",title:Vae(1293,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}},q5=class extends U5{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:zae(1304,"Add Selection to Previous Find Match"),precondition:void 0,menuOpts:{menuId:ds.MenubarSelectionMenu,group:"3_multi",title:Vae(1294,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}},j5=class extends U5{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:zae(1305,"Move Last Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:vle(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}},$5=class extends U5{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:zae(1306,"Move Last Selection to Previous Find Match"),precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}},G5=class extends U5{constructor(){super({id:"editor.action.selectHighlights",label:zae(1307,"Select All Occurrences of Find Match"),precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:3114,weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"3_multi",title:Vae(1295,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}},Z5=class extends U5{constructor(){super({id:"editor.action.changeAll",label:zae(1308,"Change All Occurrences"),precondition:Po.and(jl.writable,jl.editorTextFocus),kbOpts:{kbExpr:jl.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}},Y5=class{constructor(e,t,i,n,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return null===this._cachedFindMatches&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(mr.compareRangesUsingStarts)),this._cachedFindMatches}},M5=class extends Ie{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new ft(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(t=>{this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123)})),this._register(e.onDidChangeCursorSelection(e=>{this._isEnabled&&(e.selection.isEmpty()?3===e.reason?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(e=>{this._setState(null)})),this._register(e.onDidChangeModelContent(e=>{this._isEnabled&&this.updateSoon.schedule()}));const i=_G.get(e);i&&this._register(i.getState().onFindReplaceStateChange(e=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(O5._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(e,t,i,n,o){if(!t)return null;if(!o.hasModel())return null;if(!i){const e=o.getSelection();if(e.startLineNumber!==e.endLineNumber)return null}const s=z5.get(o);if(!s)return null;const r=_G.get(o);if(!r)return null;let a=s.getSession(r);if(!a){const e=o.getSelections();if(e.length>1){const t=r.getState().matchCase;if(!Lxe(o.getModel(),e,t))return null}a=H5.create(o,r)}if(!a)return null;if(a.currentMatch)return null;if(/^[ \t]+$/.test(a.searchText))return null;if(n>0&&a.searchText.length>n)return null;const l=r.getState(),d=l.matchCase;if(l.isRevealed){let e=l.searchString;d||(e=e.toLowerCase());let t=a.searchText;if(d||(t=t.toLowerCase()),e===t&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new Y5(o.getModel(),a.searchText,a.matchCase,a.wholeWord?o.getOption(148):null,e)}_setState(e){if(this.state=e,!this.state)return void this._decorations.clear();if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),n=this.editor.getSelections();n.sort(mr.compareRangesUsingStarts);const o=[];for(let l=0,d=0,c=i.length,h=n.length;l<c;){const e=i[l];if(d>=h)o.push(e),l++;else{const t=mr.compareRangesUsingStarts(e,n[d]);t<0?(!n[d].isEmpty()&&mr.areIntersecting(e,n[d])||o.push(e),l++):(t>0||l++,d++)}}const s="off"!==this.editor.getOption(90),r=this._languageFeaturesService.documentHighlightProvider.has(t)&&s,a=o.map(e=>({range:e,options:xxe(r)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}},O5=M5,M5.ID="editor.contrib.selectionHighlighter",Q5=M5,Q5=O5=T5([R5(1,Tx)],Q5),X5=class extends rr{constructor(){super({id:"editor.action.focusNextCursor",label:zae(1309,"Focus Next Cursor"),metadata:{description:Vae(1296,"Focuses the next cursor"),args:[]},precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const o=Array.from(n.getCursorStates()),s=o.shift();s&&(o.push(s),n.setCursorStates(i.source,3,o),n.revealPrimaryCursor(i.source,!0),kxe(o,n.getCursorStates()))}},J5=class extends rr{constructor(){super({id:"editor.action.focusPreviousCursor",label:zae(1310,"Focus Previous Cursor"),metadata:{description:Vae(1297,"Focuses the previous cursor"),args:[]},precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const o=Array.from(n.getCursorStates()),s=o.pop();s&&(o.unshift(s),n.setCursorStates(i.source,3,o),n.revealPrimaryCursor(i.source,!0),kxe(o,n.getCursorStates()))}},Iue(z5.ID,z5,4),Iue(Q5.ID,Q5,1),kue(A5),kue(P5),kue(F5),kue(K5),kue(q5),kue(j5),kue($5),kue(G5),kue(Z5),kue(W5),kue(B5),kue(X5),kue(J5),e3={Visible:new Jo("parameterHintsVisible",!1),MultipleSignatures:new Jo("parameterHintsMultipleSignatures",!1)},_o.registerCommand("_executeSignatureHelpProvider",async(e,...t)=>{const[i,n,o]=t;ple(_i.isUri(i)),ple(to.isIPosition(n)),ple("string"==typeof o||!o);const s=e.get(Tx),r=await e.get(no).createModelReference(i);try{const e=await Ixe(s.signatureHelpProvider,r.object.textEditorModel,to.lift(n),{triggerKind:Cb.Invoke,isRetrigger:!1,triggerCharacter:o},it.None);if(!e)return;return setTimeout(()=>e.dispose(),0),e.value}finally{r.dispose()}}),function(e){e.Default={type:0},e.Pending=class{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}},e.Active=class{constructor(e){this.hints=e,this.type=1}}}(t3||(t3={})),i3=class e extends Ie{constructor(t,i,n=e.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new je),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=t3.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Ne),this.triggerChars=new Ur,this.retriggerChars=new Ur,this.triggerId=0,this.editor=t,this.providers=i,this.throttledDelayer=new ht(n),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(e=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(e=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(e=>this.onCursorChange(e))),this._register(this.editor.onDidChangeModelContent(e=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(e=>this.onDidType(e))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){2===this._state.type&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=t3.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch($ae)}next(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(98).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?0:t+1):this.cancel()}previous(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=0===t,n=this.editor.getOption(98).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?e-1:t-1):this.cancel()}updateActiveSignature(e){1===this.state.type&&(this.state=new t3.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=1===this.state.type||2===this.state.type,i=this.getLastActiveHints();if(this.cancel(!0),0===this._pendingTriggers.length)return!1;const n=this._pendingTriggers.reduce(Nxe);this._pendingTriggers=[];const o={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),r=this.editor.getPosition();this.state=new t3.Pending(Ele(e=>Ixe(this.providers,s,r,o,e)),i);try{const t=await this.state.request;return e!==this.triggerId?(t?.dispose(),!1):t&&t.value.signatures&&0!==t.value.signatures.length?(this.state=new t3.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(t?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1)}catch(a){return e===this.triggerId&&(this.state=t3.Default),$ae(a),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return 1===this.state.type||2===this.state.type||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const e of t.signatureHelpTriggerCharacters||[])if(e.length){const t=e.charCodeAt(0);this.triggerChars.add(t),this.retriggerChars.add(t)}for(const e of t.signatureHelpRetriggerCharacters||[])e.length&&this.retriggerChars.add(e.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:Cb.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){"mouse"===e.source?this.cancel():this.isTriggered&&this.trigger({triggerKind:Cb.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Cb.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}},i3.DEFAULT_DELAY=120,o3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},s3=function(e,t){return function(i,n){t(i,n,e)}},a3=Ahe,l3=rwe("parameter-hints-next",go.chevronDown,Vae(1312,"Icon for show next parameter hint.")),d3=rwe("parameter-hints-previous",go.chevronUp,Vae(1313,"Icon for show previous parameter hint.")),n3=class extends Ie{constructor(e,t,i,n){super(),this.editor=e,this.model=t,this.markdownRendererService=n,this.renderDisposeables=this._register(new De),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.keyVisible=e3.Visible.bindTo(i),this.keyMultipleSignatures=e3.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=a3(".editor-widget.parameter-hints-widget"),t=Mhe(e,a3(".phwrapper"));t.tabIndex=-1;const i=Mhe(t,a3(".controls")),n=Mhe(i,a3(".button"+mo.asCSSSelector(d3))),o=Mhe(i,a3(".overloads")),s=Mhe(i,a3(".button"+mo.asCSSSelector(l3)));this._register(ehe(n,"click",e=>{An.stop(e),this.previous()})),this._register(ehe(s,"click",e=>{An.stop(e),this.next()}));const r=a3(".body"),a=new Tm(r,{alwaysConsumeMouseWheel:!0});this._register(a),t.appendChild(a.getDomNode());const l=Mhe(r,a3(".signature")),d=Mhe(r,a3(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:o,docs:d,scrollbar:a},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(e=>{this.visible&&this.editor.layoutContentWidget(this)}));const c=()=>{if(!this.domNodes)return;const e=this.editor.getOption(59),t=this.domNodes.element;t.style.fontSize=`${e.fontSize}px`,t.style.lineHeight=""+e.lineHeight/e.fontSize,t.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",e.fontFamily),t.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",vd.fontFamily)};c(),this._register(Be.chain(this.editor.onDidChangeConfiguration.bind(this.editor),e=>e.filter(e=>e.hasChanged(59)))(c)),this._register(this.editor.onDidLayoutChange(e=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes?.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const n=Mhe(this.domNodes.signature,a3(".code")),o=i.parameters.length>0,s=i.activeParameter??e.activeParameter;o?this.renderParameters(n,i,s):Mhe(n,a3("span")).textContent=i.label;const r=i.parameters[s];if(r?.documentation){const e=a3("span.documentation");if("string"==typeof r.documentation)e.textContent=r.documentation;else{const t=this.renderMarkdownDocs(r.documentation);e.appendChild(t.element)}Mhe(this.domNodes.docs,a3("p",{},e))}if(void 0===i.documentation);else if("string"==typeof i.documentation)Mhe(this.domNodes.docs,a3("p",{},i.documentation));else{const e=this.renderMarkdownDocs(i.documentation);Mhe(this.domNodes.docs,e.element)}const a=this.hasDocs(i,r);if(this.domNodes.signature.classList.toggle("has-docs",a),this.domNodes.docs.classList.toggle("empty",!a),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,r){let e="";const t=i.parameters[s];e=Array.isArray(t.label)?i.label.substring(t.label[0],t.label[1]):t.label,t.documentation&&(e+="string"==typeof t.documentation?`, ${t.documentation}`:`, ${t.documentation.value}`),i.documentation&&(e+="string"==typeof i.documentation?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==e&&(Qhe(Vae(1314,"{0}, hint",e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRendererService.render(e,{context:this.editor,asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&"string"==typeof t.documentation&&mle(t.documentation).length>0||t&&"object"==typeof t.documentation&&mle(t.documentation).value.length>0||e.documentation&&"string"==typeof e.documentation&&mle(e.documentation).length>0||e.documentation&&"object"==typeof e.documentation&&mle(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,o]=this.getParameterLabelOffsets(t,i),s=document.createElement("span");s.textContent=t.label.substring(0,n);const r=document.createElement("span");r.textContent=t.label.substring(n,o),r.className="parameter active";const a=document.createElement("span");a.textContent=t.label.substring(o),Mhe(e,s,r,a)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const t=new RegExp(`(\\W|^)${Ble(i.label)}(?=\\W|$)`,"g");t.test(e.label);const n=t.lastIndex-i.label.length;return n>=0?[n,t.lastIndex]:[0,0]}return[0,0]}return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return r3.ID}updateMaxHeight(){if(!this.domNodes)return;const e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;const t=this.domNodes.element.getElementsByClassName("phwrapper");t.length&&(t[0].style.maxHeight=e)}},r3=n3,n3.ID="editor.widget.parameterHintsWidget",c3=n3,c3=r3=o3([s3(2,es),s3(3,LA)],c3),mpe("editorHoverWidget.highlightForeground",Bg,Vae(1315,"Foreground color of the active item in the parameter hint.")),u3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},g3=function(e,t){return function(i,n){t(i,n,e)}},h3=class extends Ie{static get(e){return e.getContribution(p3.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new i3(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(e=>{e?(this.widget.value.show(),this.widget.value.render(e)):this.widget.rawValue?.hide()})),this.widget=new Nt(()=>this._register(t.createInstance(c3,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}},p3=h3,h3.ID="editor.controller.parameterHints",m3=h3,m3=p3=u3([g3(1,Jn),g3(2,Tx)],m3),f3=class extends rr{constructor(){super({id:"editor.action.triggerParameterHints",label:zae(1311,"Trigger Parameter Hints"),precondition:jl.hasSignatureHelpProvider,kbOpts:{kbExpr:jl.editorTextFocus,primary:3082,weight:100}})}run(e,t){m3.get(t)?.trigger({triggerKind:Cb.Invoke})}},Iue(m3.ID,m3,2),kue(f3),xue(new(_3=sr.bindToContribution(m3.get))({id:"closeParameterHints",precondition:e3.Visible,handler:e=>e.cancel(),kbOpts:{weight:175,kbExpr:jl.focus,primary:9,secondary:[1033]}})),xue(new _3({id:"showPrevParameterHint",precondition:Po.and(e3.Visible,e3.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:175,kbExpr:jl.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),xue(new _3({id:"showNextParameterHint",precondition:Po.and(e3.Visible,e3.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:175,kbExpr:jl.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}})),(b3=class extends Ie{constructor(e){var t;super(),this._editor=e,this._editorObs=bwe(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=Nce({owner:this,equalsFn:yce},e=>{const t=this._placeholderText.read(e);if(t&&this._editorObs.valueIsEmpty.read(e))return{placeholder:t}}),this._shouldViewBeAlive=(t=e=>void 0!==this._state.read(e)?.placeholder,qce(this,(e,i)=>!0===i||t(e))),this._view=Dce(e=>{if(!this._shouldViewBeAlive.read(e))return;const t=Vhe("div.editorPlaceholder");e.store.add(Rce(e=>{const i=this._state.read(e),n=void 0!==i?.placeholder;t.root.style.display=n?"block":"none",t.root.innerText=i?.placeholder??""})),e.store.add(Rce(e=>{const i=this._editorObs.layoutInfo.read(e);t.root.style.left=`${i.contentLeft}px`,t.root.style.width=i.contentWidth-i.verticalScrollbarWidth+"px",t.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),e.store.add(Rce(e=>{t.root.style.fontFamily=this._editorObs.getOption(58).read(e),t.root.style.fontSize=this._editorObs.getOption(61).read(e)+"px",t.root.style.lineHeight=this._editorObs.getOption(75).read(e)+"px"})),e.store.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:z_e(0),position:z_e(null),domNode:t.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}}).ID="editor.contrib.placeholderText",v3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},w3=function(e,t){return function(i,n){t(i,n,e)}},C3=class{constructor(e){this.instantiationService=e}init(...e){}},y3=class extends C3{constructor(e,t){super(t),this.init(e)}},y3=v3([w3(1,Jn)],y3),Iue(b3.ID,b3,0),mpe("editor.placeholder.foreground",i_,Vae(1334,"Foreground color of the placeholder text in the editor.")),S3=eue("textResourceConfigurationService"),x3=eue("textResourcePropertiesService"),k3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},L3=function(e,t){return function(i,n){t(i,n,e)}},D3=new Jo("renameInputVisible",!1,Vae(1391,"Whether the rename input widget is visible")),new Jo("renameInputFocused",!1,Vae(1392,"Whether the rename input widget is focused")),I3=class{constructor(e,t,i,n,o,s){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=s,this.allowEditorOverflow=!0,this._disposables=new De,this._visibleContextKey=D3.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new Fe,this._inputWithButton=new E3,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(59)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new N3(this._domNode,{fontInfo:this._editor.getOption(59),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{void 0!==this._renameCandidateListView?.focusedCandidate&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),!1===this._renameCandidateProvidersCts?.token.isCancellationRequested&&this._renameCandidateProvidersCts.cancel(),this._renameCandidateListView?.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(ru),i=e.getColor(au);this._domNode.style.backgroundColor=String(e.getColor(yh)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(Ou)??"");const n=e.getColor(Au);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(Ru)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(Ru)??""),this._inputWithButton.domNode.style.borderWidth=n?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=n?"solid":"none",this._inputWithButton.domNode.style.borderColor=n?.toString()??"none"}_updateFont(){if(void 0===this._domNode)return;ple(void 0!==this._label,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(59);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return.8*e}getPosition(){if(!this._visible)return null;if(!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=rhe(this.getDomNode().ownerDocument.body),t=lhe(this._editor.getDomNode());this._nPxAvailableAbove=this._getTopForPosition()+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const i=this._editor.getOption(75),{totalHeight:n}=M3.getLayoutInfo({lineHeight:i}),o=this._nPxAvailableBelow>6*n?[2,1]:[1,2];return{position:this._position,preference:o}}beforeRender(){const[e,t]=this._acceptKeybindings;return this._label.innerText=Vae(1393,"{0} to Rename, {1} to Preview",this._keybindingService.lookupKeybinding(e)?.getLabel(),this._keybindingService.lookupKeybinding(t)?.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(null===e)return void this.cancelInput(!0,"afterRender (because position is null)");if(!this._editor.hasModel()||!this._editor.getDomNode())return;ple(this._renameCandidateListView),ple(void 0!==this._nPxAvailableAbove),ple(void 0!==this._nPxAvailableBelow);const t=ghe(this._inputWithButton.domNode),i=ghe(this._label);let n;n=2===e?this._nPxAvailableBelow:this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:che(this._inputWithButton.domNode)})}acceptInput(e){this._trace("invoking acceptInput"),this._currentAcceptInput?.(e)}cancelInput(e,t){this._currentCancelInput?.(e)}focusNextRenameSuggestion(){this._renameCandidateListView?.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){this._renameCandidateListView?.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,n,o){const{start:s,end:r}=this._getSelection(e,t);this._renameCts=o;const a=new De;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,void 0===n?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=n,this._requestRenameCandidates(t,!1),a.add(ehe(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),a.add(ehe(this._inputWithButton.button,On.KEY_DOWN,e=>{const i=new we(e);(i.equals(3)||i.equals(10))&&(i.stopPropagation(),i.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new to(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",s.toString()),this._inputWithButton.input.setAttribute("selectionEnd",r.toString()),this._inputWithButton.input.size=Math.max(1.1*(e.endColumn-e.startColumn),20),this._beforeFirstInputFieldEditSW.reset(),a.add(Dle(()=>{this._renameCts=void 0,o.dispose(!0)})),a.add(Dle(()=>{void 0!==this._renameCandidateProvidersCts&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),a.add(Dle(()=>this._candidates.clear()));const l=new Ct;return l.p.finally(()=>{a.dispose(),this._hide()}),this._currentCancelInput=e=>(this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView?.clearCandidates(),l.complete(e),!0),this._currentAcceptInput=e=>{this._trace("invoking _currentAcceptInput"),ple(void 0!==this._renameCandidateListView);const n=this._renameCandidateListView.nCandidates;let o,s;const r=this._renameCandidateListView.focusedCandidate;void 0!==r?(this._trace("using new name from renameSuggestion"),o=r,s={k:"renameSuggestion"}):(this._trace("using new name from inputField"),o=this._inputWithButton.input.value,s=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),o!==t&&0!==o.trim().length?(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),l.complete({newName:o,wantsPreview:i&&e,stats:{source:s,nRenameSuggestions:n,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})):this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)")},a.add(o.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),a.add(this._editor.onDidBlurEditorWidget(()=>this.cancelInput(!this._domNode?.ownerDocument.hasFocus(),"editor.onDidBlurEditorWidget"))),this._show(),l.p}_requestRenameCandidates(e,t){if(void 0!==this._requestRenameCandidatesOnce&&(void 0!==this._renameCandidateProvidersCts&&this._renameCandidateProvidersCts.dispose(!0),ple(this._renameCts),"stop"!==this._inputWithButton.buttonState)){this._renameCandidateProvidersCts=new ot;const i=t?Db.Invoke:Db.Automatic,n=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(0===n.length)return void this._inputWithButton.setSparkleButton();t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(n,e,this._renameCts.token)}}_getSelection(e,t){ple(this._editor.hasModel());const i=this._editor.getSelection();let n=0,o=t.length;return mr.isEmpty(i)||mr.spansMultipleLines(i)||!mr.containsRange(e,i)||(n=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const n=(...e)=>this._trace("_updateRenameCandidates",...e);n("start");const o=await Mle(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),void 0===o)return void n("returning early - received updateRenameCandidates results - undefined");const s=o.flatMap(e=>"fulfilled"===e.status&&ule(e.value)?e.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${s.length} candidates.`);const r=rce(s,e=>e.newSymbolName);n(`distinct candidates - ${r.length} candidates.`);const a=r.filter(({newSymbolName:e})=>e.trim().length>0&&e!==this._inputWithButton.input.value&&e!==t&&!this._candidates.has(e));n(`valid distinct candidates - ${s.length} candidates.`),a.forEach(e=>this._candidates.add(e.newSymbolName)),a.length<1?n("returning early - no valid distinct candidates"):(n("setting candidates"),this._renameCandidateListView.setCandidates(a),n("asking editor to re-layout"),this._editor.layoutContentWidget(this))}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}},I3=k3([L3(2,Sf),L3(3,xw),L3(4,es),L3(5,Ks)],I3),N3=class e{constructor(t,i){this._disposables=new De,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=i.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=i.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",t.appendChild(this._listContainer),this._listWidget=e._createListWidget(this._listContainer,this._candidateViewHeight,i.fontInfo),this._disposables.add(this._listWidget.onDidChangeFocus(e=>{1===e.elements.length&&i.onFocusChange(e.elements[0].newSymbolName)},this._disposables)),this._disposables.add(this._listWidget.onDidChangeSelection(e=>{1===e.elements.length&&i.onSelectionChange()},this._disposables)),this._disposables.add(this._listWidget.onDidBlur(e=>{this._listWidget.setFocus([])})),this._listWidget.style(ywe({listInactiveFocusForeground:dp,listInactiveFocusBackground:hp}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Xhe(Vae(1394,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(0===this._listWidget.length)return;const e=this._listWidget.getSelectedElements()[0];if(void 0!==e)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];return void 0!==t?t.newSymbolName:void 0}focusNext(){if(0===this._listWidget.length)return!1;const e=this._listWidget.getFocus();if(0===e.length)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const e=this._listWidget.getFocus()[0];return this._listWidget.reveal(e),!0}}focusPrevious(){if(0===this._listWidget.length)return!1;const e=this._listWidget.getFocus();if(0===e.length){this._listWidget.focusLast();const e=this._listWidget.getFocus()[0];return this._listWidget.reveal(e),!0}if(0===e[0])return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const e=this._listWidget.getFocus()[0];return this._listWidget.reveal(e),!0}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=M3.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,7*this._candidateViewHeight)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(e=>e.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){return new bE("NewSymbolNameCandidates",e,new class{getTemplateId(e){return"candidate"}getHeight(e){return t}},[new class{constructor(){this.templateId="candidate"}renderTemplate(e){return new M3(e,i)}renderElement(e,t,i){i.populate(e)}disposeTemplate(e){e.dispose()}}],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}},E3=class{constructor(){this._buttonHoverContent="",this._onDidInputChange=new je,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new De}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",Vae(1395,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=Vae(1396,"Generate New Name Suggestions"),this._buttonCancelHoverText=Vae(1397,"Cancel"),this._buttonHoverContent=this._buttonGenHoverText,this._disposables.add(Bve().setupDelayedHover(this._buttonNode,()=>({content:this._buttonHoverContent,style:1}))),this._domNode.appendChild(this._buttonNode),this._disposables.add(ehe(this.input,On.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(ehe(this.input,On.KEY_DOWN,e=>{const t=new we(e);15!==t.keyCode&&17!==t.keyCode||this._onDidInputChange.fire()})),this._disposables.add(ehe(this.input,On.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(ehe(this.input,On.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(ehe(this.input,On.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return ple(this._inputNode),this._inputNode}get button(){return ple(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??(this._sparkleIcon=pve(go.sparkle)),Jce(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHoverContent=this._buttonGenHoverText,this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??(this._stopIcon=pve(go.stopCircle)),Jce(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHoverContent=this._buttonCancelHoverText,this.input.focus()}dispose(){this._disposables.dispose()}},(M3=class e{constructor(t,i){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${i.lineHeight}px`,this._domNode.style.padding=`${e._PADDING}px`;const n=document.createElement("div");n.style.display="flex",n.style.alignItems="center",n.style.width=n.style.height=.8*i.lineHeight+"px",this._domNode.appendChild(n),this._icon=pve(go.sparkle),this._icon.style.display="none",n.appendChild(this._icon),this._label=document.createElement("div"),Wge(this._label,i),this._domNode.appendChild(this._label),t.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){const t=!!e.tags?.includes(Lb.AIGenerated);this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:t}){return{totalHeight:t+2*e._PADDING}}dispose(){}})._PADDING=2,R3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},O3=function(e,t){return function(i,n){t(i,n,e)}},P3=class{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const i=this._providers[this._providerRenameIdx];if(!i.resolveRenameLocation)break;const n=await i.resolveRenameLocation(this.model,this.position,e);if(n){if(!n.rejectReason)return n;t.push(n.rejectReason)}}this._providerRenameIdx=0;const i=this.model.getWordAtPosition(this.position);return i?{range:new mr(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join("\n"):void 0}:{range:mr.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join("\n"):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join("\n")};const s=await o.provideRenameEdits(this.model,this.position,e,n);return s?s.rejectReason?this._provideRenameEdits(e,t+1,i.concat(s.rejectReason),n):s:this._provideRenameEdits(e,t+1,i.concat(Vae(1380,"No result.")),n)}},T3=class{static get(e){return e.getContribution(A3.ID)}constructor(e,t,i,n,o,s,r,a){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=s,this._configService=r,this._languageFeaturesService=a,this._disposableStore=new De,this._cts=new ot,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(I3,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new ot,!this.editor.hasModel())return void e("editor has no model");const t=this.editor.getPosition(),i=new P3(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider())return void e("skeleton has no provider");const n=new fA(this.editor,5,void 0,this._cts.token);let o;try{e("resolving rename location");const t=i.resolveRenameLocation(n.token);this._progressService.showWhile(t,250),o=await t,e("resolved rename location")}catch(Fae){return void(Fae instanceof v?e("resolve rename location cancelled",JSON.stringify(Fae,null,"\t")):(e("resolve rename location failed",Fae instanceof Error?Fae:JSON.stringify(Fae,null,"\t")),("string"==typeof Fae||Hbe(Fae))&&TA.get(this.editor)?.showMessage(Fae||Vae(1381,"An unknown error occurred while resolving rename location"),t)))}finally{n.dispose()}if(!o)return void e("returning early - no loc");if(o.rejectReason)return e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),void TA.get(this.editor)?.showMessage(o.rejectReason,t);if(n.token.isCancellationRequested)return void e("returning early - cts1 cancelled");const s=new fA(this.editor,5,o.range,this._cts.token),r=this.editor.getModel(),a=this._languageFeaturesService.newSymbolNamesProvider.all(r),l=await Promise.all(a.map(async e=>[e,await e.supportsAutomaticNewSymbolNamesTriggerKind??!1]));e("creating rename input field and awaiting its result");const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),c=await this._renameWidget.getInput(o.range,o.text,d,a.length>0?(e,t)=>{let i=l.slice();return e===Db.Automatic&&(i=i.filter(([e,t])=>t)),i.map(([i])=>i.provideNewSymbolNames(r,o.range,e,t))}:void 0,s);if(e("received response from rename input field"),"boolean"==typeof c)return e(`returning early - rename input field response - ${c}`),c&&this.editor.focus(),void s.dispose();this.editor.focus(),e("requesting rename edits");const h=Mle(i.provideRenameEdits(c.newName,s.token),s.token).then(async t=>{if(t)if(this.editor.hasModel()){if(t.rejectReason)return e(`returning early - rejected with reason: ${t.rejectReason}`),void this._notificationService.info(t.rejectReason);this.editor.setSelection(mr.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(t,{editor:this.editor,showPreview:c.wantsPreview,label:Vae(1382,"Renaming '{0}' to '{1}'",o?.text,c.newName),code:"undoredo.rename",quotableLabel:Vae(1383,"Renaming {0} to {1}",o?.text,c.newName),respectAutoSaveConfig:!0,reason:Vy.rename()}).then(t=>{e("edits applied"),t.ariaSummary&&Qhe(Vae(1384,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,c.newName,t.ariaSummary))}).catch(t=>{e(`error when applying edits ${JSON.stringify(t,null,"\t")}`),this._notificationService.error(Vae(1385,"Rename failed to apply edits")),this._logService.error(t)})}else e("returning early - no model after rename edits are provided");else e("returning early - no rename edits result")},t=>{e("error when providing rename edits",JSON.stringify(t,null,"\t")),this._notificationService.error(Vae(1386,"Rename failed to compute edits")),this._logService.error(t)}).finally(()=>{s.dispose()});return e("returning rename operation"),this._progressService.showWhile(h,250),h}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}},A3=T3,T3.ID="editor.contrib.renameController",F3=T3,F3=A3=R3([O3(1,Jn),O3(2,Xv),O3(3,lA),O3(4,AL),O3(5,Ks),O3(6,S3),O3(7,Tx)],F3),W3=class extends rr{constructor(){super({id:"editor.action.rename",label:zae(1388,"Rename Symbol"),precondition:Po.and(jl.writable,jl.hasRenameProvider),kbOpts:{kbExpr:jl.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1},canTriggerInlineEdits:!0})}runCommand(e,t){const i=e.get(eo),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return _i.isUri(n)&&to.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(e=>{e&&(e.setPosition(o),e.invokeWithinContext(t=>(this.reportTelemetry(t,e),this.run(t,e))))},$ae):super.runCommand(e,t)}run(e,t){const i=e.get(Ks),n=F3.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}},Iue(F3.ID,F3,4),kue(W3),xue(new(B3=sr.bindToContribution(F3.get))({id:"acceptRenameInput",precondition:D3,handler:e=>e.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:Po.and(jl.focus,Po.not("isComposing")),primary:3}})),xue(new B3({id:"acceptRenameInputWithPreview",precondition:Po.and(D3,Po.has("config.editor.rename.enablePreview")),handler:e=>e.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:Po.and(jl.focus,Po.not("isComposing")),primary:2051}})),xue(new B3({id:"cancelRenameInput",precondition:D3,handler:e=>e.cancelRenameInput(),kbOpts:{weight:199,kbExpr:jl.focus,primary:9,secondary:[1033]}})),mue(class extends ms{constructor(){super({id:"focusNextRenameSuggestion",title:{...zae(1389,"Focus Next Rename Suggestion")},precondition:D3,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(eo).getFocusedCodeEditor();if(!t)return;const i=F3.get(t);i&&i.focusNextRenameSuggestion()}}),mue(class extends ms{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...zae(1390,"Focus Previous Rename Suggestion")},precondition:D3,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(eo).getFocusedCodeEditor();if(!t)return;const i=F3.get(t);i&&i.focusPreviousRenameSuggestion()}}),Sue("_executeDocumentRenameProvider",function(e,t,i,...n){const[o]=n;ple("string"==typeof o);const{renameProvider:s}=e.get(Tx);return async function(e,t,i,n){const o=new P3(t,i,e),s=await o.resolveRenameLocation(it.None);return s?.rejectReason?{edits:[],rejectReason:s.rejectReason}:o.provideRenameEdits(n,it.None)}(s,t,i,o)}),Sue("_executePrepareRename",async function(e,t,i){const{renameProvider:n}=e.get(Tx),o=await new P3(t,i,n).resolveRenameLocation(it.None);if(o?.rejectReason)throw new Error(o.rejectReason);return o}),ts.as(Pa.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:6,description:Vae(1387,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}}),H3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},z3=function(e,t){return function(i,n){t(i,n,e)}},V3=class extends Ie{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(t=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(t=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(t=>{const i=this.editor.getModel()?.getLanguageId();i&&t.affects(i)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(t=>{this.options&&!t.hasChanged(81)||(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(e=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(e=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new ft(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;return i||n?.markers?{foldingRules:n,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}:void 0}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(i=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(i)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(e=>{if(!e.shouldBeInComments)return!0;const i=t.validateRange(e.range),n=t.tokenization.getLineTokens(i.startLineNumber),o=n.findTokenIndexAtOffset(i.startColumn-1),s=n.getStandardTokenType(o);return n.getLanguageId(o)===t.getLanguageId()&&1===s}));const i=Object.values(this.currentOccurrences).map(e=>e.decorationId),n=e.map(e=>function(e){return{range:e.range,options:Lx.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:e.hasSeparatorLine?2:1,sectionHeaderText:e.text}})}}(e));this.editor.changeDecorations(t=>{const o=t.deltaDecorations(i,n);this.currentOccurrences={};for(let i=0,n=o.length;i<n;i++){const t={sectionHeader:e[i],decorationId:o[i]};this.currentOccurrences[t.decorationId]=t}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},V3.ID="editor.sectionHeaderDetector",U3=V3,Iue((U3=H3([z3(1,il),z3(2,DM)],U3)).ID,U3,1),K3=class{constructor(e=5){this.timesPerSecond=e,this._lastRun=0,this._minimumTimeBetweenRuns=1e3/e}runIfNotLimited(e){const t=Date.now();t-this._lastRun>=this._minimumTimeBetweenRuns&&(this._lastRun=t,e())}},q3=class e{static create(t,i){return new e(t,new j3(i))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}toString(){return this._tokens.toString(this._startLineNumber)}_updateEndLineNumber(){this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}isEmpty(){return this._tokens.isEmpty()}getLineTokens(e){return this._startLineNumber<=e&&e<=this._endLineNumber?this._tokens.getLineTokens(e-this._startLineNumber):null}getRange(){const e=this._tokens.getRange();return e?new mr(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn):e}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(t){const i=t.startLineNumber-this._startLineNumber,n=t.endLineNumber-this._startLineNumber,[o,s,r]=this._tokens.split(i,t.startColumn-1,n,t.endColumn-1);return[new e(this._startLineNumber,o),new e(this._startLineNumber+r,s)]}applyEdit(e,t){const[i,n,o]=Rme(t);this.acceptEdit(e,i,n,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new to(e.startLineNumber,e.startColumn),t,i,n,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const e=i-t;return void(this._startLineNumber-=e)}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this._startLineNumber=0,void this._tokens.clear();if(t<0){const n=-t;this._startLineNumber-=n,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,n,o){if(0===t&&0===i)return;const s=e.lineNumber-this._startLineNumber;s<0?this._startLineNumber+=t:s>=this._tokens.getMaxDeltaLine()+1||this._tokens.acceptInsertText(s,e.column-1,t,i,n,o)}reportIfInvalid(e){this._tokens.reportIfInvalid(e,this._startLineNumber)}},j3=class e{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return 0===e?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(0===e)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),n=this._getEndCharacter(e-1);return new mr(0,t+1,i,n+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return 0===this._getTokenCount()}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const n=t+Math.floor((i-t)/2),o=this._getDeltaLine(n);if(o<e)t=n+1;else{if(!(o>e)){let o=n;for(;o>t&&this._getDeltaLine(o-1)===e;)o--;let s=n;for(;s<i&&this._getDeltaLine(s+1)===e;)s++;return new $3(this._tokens.subarray(4*o,4*s+4))}i=n-1}}return this._getDeltaLine(t)===e?new $3(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,n){const o=this._tokens,s=this._tokenCount;let r=0,a=!1,l=0;for(let d=0;d<s;d++){const s=4*d,c=o[s],h=o[s+1],u=o[s+2],g=o[s+3];if((c>e||c===e&&u>=t)&&(c<i||c===i&&h<=n))a=!0;else{if(0===r&&(l=c),a){const e=4*r;o[e]=c-l,o[e+1]=h,o[e+2]=u,o[e+3]=g}else 0!==l&&(o[s]=c-l);r++}}return this._tokenCount=r,l}split(t,i,n,o){const s=this._tokens,r=this._tokenCount,a=[],l=[];let d=a,c=0,h=0;for(let e=0;e<r;e++){const r=4*e,a=s[r],u=s[r+1],g=s[r+2],p=s[r+3];if(a>t||a===t&&g>=i){if(a<n||a===n&&u<=o)continue;d!==l&&(d=l,c=0,h=a)}d[c++]=a-h,d[c++]=u,d[c++]=g,d[c++]=p}return[new e(new Uint32Array(a)),new e(new Uint32Array(l)),h]}acceptDeleteRange(e,t,i,n,o){const s=this._tokens,r=this._tokenCount,a=n-t;let l=0,d=!1;for(let c=0;c<r;c++){const h=4*c;let u=s[h],g=s[h+1],p=s[h+2];const m=s[h+3];if(u<t||u===t&&p<=i){l++;continue}if(u===t&&g<i)u===n&&p>o?p-=o-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>o)){d=!0;continue}p-=o-i}else if(u<n||u===n&&g<o){if(!(u===n&&p>o)){d=!0;continue}u=t,g=i,p=g+(p-o)}else if(u>n){if(0===a&&!d){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=o-i,p-=o-i}const f=4*l;s[f]=u,s[f+1]=g,s[f+2]=p,s[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,o,s){const r=0===i&&1===n&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),a=this._tokens,l=this._tokenCount;for(let d=0;d<l;d++){const s=4*d;let l=a[s],c=a[s+1],h=a[s+2];if(!(l<e||l===e&&h<t)){if(l===e&&h===t){if(!r)continue;h+=1}else if(l===e&&c<t&&t<h)0===i?h+=n:h=t;else{if(l===e&&c===t&&r)continue;if(l===e)if(l+=i,0===i)c+=n,h+=n;else{const e=h-c;c=o+(c-t),h=c+e}else l+=i}a[s]=l,a[s+1]=c,a[s+2]=h}}}reportIfInvalid(t,i){for(let n=0;n<this._tokenCount;n++){const o=this._getDeltaLine(n)+i;o<1?e._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: lineNumber < 1")}):o>t.getLineCount()?e._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()")}):this._getEndCharacter(n)>t.getLineLength(o)&&e._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)")})}}},j3._rateLimiter=new K3(10/60),$3=class{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}},G3=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Z3=function(e,t){return function(i,n){t(i,n,e)}},Y3=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new X3}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,n);let s;if(o)s=o.metadata;else{let o=this._legend.tokenTypes[e];const r=[];if(o){let e=t;for(let t=0;e>0&&t<this._legend.tokenModifiers.length;t++)1&e&&r.push(this._legend.tokenModifiers[t]),e>>=1;const n=this._themeService.getColorTheme().getTokenStyleMetadata(o,r,i);void 0===n?s=2147483647:(s=0,void 0!==n.italic&&(s|=1|(n.italic?1:0)<<11),void 0!==n.bold&&(s|=2|(n.bold?2:0)<<11),void 0!==n.underline&&(s|=4|(n.underline?4:0)<<11),void 0!==n.strikethrough&&(s|=8|(n.strikethrough?8:0)<<11),n.foreground&&(s|=16|n.foreground<<15),0===s&&(s=2147483647))}else s=2147483647,o="not-in-legend";this._hashTable.add(e,t,n,s)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${o}).`))}},Y3=G3([Z3(1,Sf),Z3(2,La),Z3(3,Ks)],Y3),Q3=class{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}},X3=class e{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=e._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<e._SIZES.length?2/3*this._currentLength:0),this._elements=[],e._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const n=this._hashFunc(e,t,i);let o=this._elements[n];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.next}return null}add(t,i,n,o){if(this._elementsCount++,0!==this._growCount&&this._elementsCount>=this._growCount){const t=this._elements;this._currentLengthIndex++,this._currentLength=e._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<e._SIZES.length?2/3*this._currentLength:0),this._elements=[],e._nullOutEntries(this._elements,this._currentLength);for(const e of t){let t=e;for(;t;){const e=t.next;t.next=null,this._add(t),t=e}}}this._add(new Q3(t,i,n,o))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}},X3._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143],J3=eue("semanticTokensStylingService"),e6=class{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}},t6=class{constructor(e,t){this.provider=e,this.tokens=t}},_o.registerCommand("_provideDocumentSemanticTokensLegend",async(e,...t)=>{const[i]=t;ple(i instanceof _i);const n=e.get(io).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(Tx),s=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:null}(o,n);return s?s[0].getLegend():e.get(fo).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)}),_o.registerCommand("_provideDocumentSemanticTokens",async(e,...t)=>{const[i]=t;ple(i instanceof _i);const n=e.get(io).getModel(i);if(!n)return;const{documentSemanticTokensProvider:o}=e.get(Tx);if(!Oxe(o,n))return e.get(fo).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const s=await Axe(o,n,null,null,it.None);if(!s)return;const{provider:r,tokens:a}=s;if(!a||!Txe(a))return;const l=Mxe({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l}),_o.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(e,...t)=>{const[i,n]=t;ple(i instanceof _i);const o=e.get(io).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(Tx),r=Pxe(s,o);if(0===r.length)return;if(1===r.length)return r[0].getLegend();if(!n||!mr.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await Fxe(s,o,mr.lift(n),it.None);return a?a.provider.getLegend():void 0}),_o.registerCommand("_provideDocumentRangeSemanticTokens",async(e,...t)=>{const[i,n]=t;ple(i instanceof _i),ple(mr.isIRange(n));const o=e.get(io).getModel(i);if(!o)return;const{documentRangeSemanticTokensProvider:s}=e.get(Tx),r=await Fxe(s,o,mr.lift(n),it.None);return r&&r.tokens?Mxe({id:0,type:"full",data:r.tokens.data}):void 0}),i6="editor.semanticHighlighting",o6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},s6=function(e,t){return function(i,n){t(i,n,e)}},a6=class extends Ie{constructor(e,t,i,n,o,s){super(),this._watchers=new ys;const r=t=>{this._watchers.get(t.uri)?.dispose(),this._watchers.set(t.uri,new l6(t,e,i,o,s))},a=(e,t)=>{t.dispose(),this._watchers.delete(e.uri)},l=()=>{for(const e of t.getModels()){const t=this._watchers.get(e.uri);Wxe(e,i,n)?t||r(e):t&&a(e,t)}};t.getModels().forEach(e=>{Wxe(e,i,n)&&r(e)}),this._register(t.onModelAdded(e=>{Wxe(e,i,n)&&r(e)})),this._register(t.onModelRemoved(e=>{const t=this._watchers.get(e.uri);t&&a(e,t)})),this._register(n.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.semanticHighlighting")&&l()})),this._register(i.onDidColorThemeChange(l))}dispose(){kle(this._watchers.values()),this._watchers.clear(),super.dispose()}},a6=o6([s6(0,J3),s6(1,io),s6(2,Sf),s6(3,ka),s6(4,vW),s6(5,Tx)],a6),n6=class extends Ie{constructor(e,t,i,n,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:r6.REQUEST_MIN_DELAY,max:r6.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new ft(()=>this._fetchDocumentSemanticTokensNow(),r6.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const s=()=>{kle(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of this._provider.all(e))"function"==typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange(()=>{this._currentDocumentRequestCancellationTokenSource?this._providersChangedDuringRequest=!0:this._fetchDocumentSemanticTokens.schedule(0)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),kle(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Oxe(this._provider,this._model))return void(this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1));if(!this._model.isAttachedToEditor())return;const e=new ot,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=Axe(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent(e=>{o.push(e)}),r=new Fe(!1);n.then(e=>{if(this._debounceInformation.update(this._model,r.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),e){const{provider:t,tokens:i}=e,n=this._semanticTokensStylingService.getStyling(t);this._setDocumentSemanticTokens(t,i||null,n,o)}else this._setDocumentSemanticTokens(null,null,null,o)},e=>{e&&(Yae(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||$ae(e),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,o){o=Math.min(o,i.length-n,e.length-t);for(let s=0;s<o;s++)i[n+s]=e[t+s]}_setDocumentSemanticTokens(e,t,i,n){const o=this._currentDocumentResponse,s=()=>{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed)e&&t&&e.releaseDocumentSemanticTokens(t.resultId);else if(e&&i){if(!t)return this._model.tokenization.setSemanticTokens(null,!0),void s();if(Rxe(t)){if(!o)return void this._model.tokenization.setSemanticTokens(null,!0);if(0===t.edits.length)t={resultId:t.resultId,data:o.data};else{let e=0;for(const i of t.edits)e+=(i.data?i.data.length:0)-i.deleteCount;const n=o.data,s=new Uint32Array(n.length+e);let r=n.length,a=s.length;for(let l=t.edits.length-1;l>=0;l--){const e=t.edits[l];if(e.start>n.length)return i.warnInvalidEditStart(o.resultId,t.resultId,l,e.start,n.length),void this._model.tokenization.setSemanticTokens(null,!0);const d=r-(e.start+e.deleteCount);d>0&&(r6._copy(n,r-d,s,a-d,d),a-=d),e.data&&(r6._copy(e.data,0,s,a-e.data.length,e.data.length),a-=e.data.length),r=e.start}r>0&&r6._copy(n,0,s,0,r),t={resultId:t.resultId,data:s}}}if(Txe(t)){this._currentDocumentResponse=new d6(e,t.resultId,t.data);const o=Exe(t,i,this._model.getLanguageId());if(n.length>0)for(const e of n)for(const t of o)for(const i of e.changes)t.applyEdit(i.range,i.text);this._model.tokenization.setSemanticTokens(o,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}else this._model.tokenization.setSemanticTokens(null,!1)}},r6=n6,n6.REQUEST_MIN_DELAY=300,n6.REQUEST_MAX_DELAY=2e3,l6=n6,l6=r6=o6([s6(1,J3),s6(2,Sf),s6(3,vW),s6(4,Tx)],l6),d6=class{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}},gCe(a6),h6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},u6=function(e,t){return function(i,n){t(i,n,e)}},c6=class extends Ie{constructor(e,t,i,n,o,s){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new ft(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];const r=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},a=()=>{if(this._cleanupProviderListeners(),this._editor.hasModel()){const e=this._editor.getModel();for(const t of this._provider.all(e)){const e=t.onDidChange?.(()=>{this._cancelAll(),r()});e&&this._rangeProvidersChangeListeners.push(e)}}};this._register(this._editor.onDidScrollChange(()=>{r()})),this._register(this._editor.onDidChangeModel(()=>{a(),this._cancelAll(),r()})),this._register(this._editor.onDidChangeModelLanguage(()=>{a(),this._cancelAll(),r()})),this._register(this._editor.onDidChangeModelContent(e=>{this._cancelAll(),r()})),a(),this._register(this._provider.onDidChange(()=>{a(),this._cancelAll(),r()})),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.semanticHighlighting")&&(this._cancelAll(),r())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),r()})),r()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){kle(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e)return void this._outstandingRequests.splice(t,1)}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!Wxe(e,this._themeService,this._configurationService))return void(e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1));if(!function(e,t){return e.has(t)}(this._provider,e))return void(e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1));const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(t=>this._requestRange(e,t)))}_requestRange(e,t){const i=e.getVersionId(),n=Ele(i=>Promise.resolve(Fxe(this._provider,e,t,i))),o=new Fe(!1);return n.then(n=>{if(this._debounceInformation.update(e,o.elapsed()),!n||!n.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:s,tokens:r}=n,a=this._semanticTokensStylingService.getStyling(s);e.tokenization.setPartialSemanticTokens(t,Exe(r,a,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},c6.ID="editor.contrib.viewportSemanticTokens",g6=c6,Iue((g6=h6([u6(1,J3),u6(2,Sf),u6(3,ka),u6(4,vW),u6(5,Tx)],g6)).ID,g6,1),p6=class{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const t=[];i.push(t),this.selectSubwords&&this._addInWordRanges(t,e,n),this._addWordRanges(t,e,n),this._addWhitespaceLine(t,e,n),t.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:s}=n,r=i.column-s;let a=r,l=r,d=0;for(;a>=0;a--){const e=o.charCodeAt(a);if(a!==r&&(95===e||45===e))break;if(ede(e)&&tde(d))break;d=e}for(a+=1;l<o.length;l++){const e=o.charCodeAt(l);if(tde(e)&&ede(d))break;if(95===e||45===e)break;d=e}a<l&&e.push({range:new mr(i.lineNumber,s+a,i.lineNumber,s+l)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new mr(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&0===t.getLineFirstNonWhitespaceColumn(i.lineNumber)&&0===t.getLineLastNonWhitespaceColumn(i.lineNumber)&&e.push({range:new mr(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}},f6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_6=function(e,t){return function(i,n){t(i,n,e)}},v6=class e{constructor(e,t){this.index=e,this.ranges=t}mov(t){const i=this.index+(t?1:-1);if(i<0||i>=this.ranges.length)return this;const n=new e(i,this.ranges);return n.ranges[i].equalsRange(this.ranges[this.index])?n.mov(t):n}},m6=class{static get(e){return e.getContribution(b6.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await Bxe(this._languageFeaturesService.selectionRangeProvider,i,t.map(e=>e.getPosition()),this._editor.getOption(129),it.None).then(e=>{if(sce(e)&&e.length===t.length&&this._editor.hasModel()&&Zde(this._editor.getSelections(),t,(e,t)=>e.equalsSelection(t))){for(let i=0;i<e.length;i++)e[i]=e[i].filter(e=>e.containsPosition(t[i].getStartPosition())&&e.containsPosition(t[i].getEndPosition())),e[i].unshift(t[i]);this._state=e.map(e=>new v6(0,e)),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(t=>t.mov(e));const n=this._state.map(e=>fr.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},b6=m6,m6.ID="editor.contrib.smartSelectController",w6=m6,w6=b6=f6([_6(1,Tx)],w6),C6=class extends rr{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=w6.get(t);i&&await i.run(this._forward)}},y6=class extends C6{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:zae(1400,"Expand Selection"),precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"1_basic",title:Vae(1398,"&&Expand Selection"),order:2}})}},_o.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand"),S6=class extends C6{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:zae(1401,"Shrink Selection"),precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:ds.MenubarSelectionMenu,group:"1_basic",title:Vae(1399,"&&Shrink Selection"),order:3}})}},Iue(w6.ID,w6,4),kue(y6),kue(S6),_o.registerCommand("_executeSelectionRangeProvider",async function(e,...t){const[i,n]=t;var o,s;ple(_i.isUri(i)),ple((o=n,s=e=>to.isIPosition(e),Array.isArray(o)&&o.every(s)));const r=e.get(Tx).selectionRangeProvider,a=await e.get(no).createModelReference(i);try{return Bxe(r,a.object.textEditorModel,n.map(to.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},it.None)}finally{a.dispose()}}),x6=Object.freeze({View:zae(1638,"View"),Help:zae(1639,"Help"),Test:zae(1640,"Test"),File:zae(1641,"File"),Preferences:zae(1642,"Preferences"),Developer:zae(1643,"Developer")}),k6=class extends lr{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...zae(1448,"Toggle Editor Sticky Scroll"),mnemonicTitle:Vae(1444,"&&Toggle Editor Sticky Scroll")},metadata:{description:zae(1449,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:x6.View,toggled:{condition:Po.equals("config.editor.stickyScroll.enabled",!0),title:Vae(1445,"Sticky Scroll"),mnemonicTitle:Vae(1446,"&&Sticky Scroll")},menu:[{id:ds.CommandPalette},{id:ds.MenubarAppearanceMenu,group:"4_editor",order:3},{id:ds.StickyScrollContext}]})}async runEditorCommand(e,t){const i=e.get(ka),n=!i.getValue("editor.stickyScroll.enabled"),o=_0.get(t)?.isFocused();i.updateValue("editor.stickyScroll.enabled",n),o&&t.focus()}},L6=100,D6=class extends lr{constructor(){super({id:"editor.action.focusStickyScroll",title:{...zae(1450,"Focus Editor Sticky Scroll"),mnemonicTitle:Vae(1447,"&&Focus Editor Sticky Scroll")},precondition:Po.and(Po.has("config.editor.stickyScroll.enabled"),jl.stickyScrollVisible),menu:[{id:ds.CommandPalette}]})}runEditorCommand(e,t){_0.get(t)?.focus()}},I6=class extends lr{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:zae(1451,"Select the next editor sticky scroll line"),precondition:jl.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:L6,primary:18}})}runEditorCommand(e,t){_0.get(t)?.focusNext()}},N6=class extends lr{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:zae(1452,"Select the previous sticky scroll line"),precondition:jl.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:L6,primary:16}})}runEditorCommand(e,t){_0.get(t)?.focusPrevious()}},E6=class extends lr{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:zae(1453,"Go to the focused sticky scroll line"),precondition:jl.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:L6,primary:3}})}runEditorCommand(e,t){_0.get(t)?.goToFocused()}},M6=class extends lr{constructor(){super({id:"editor.action.selectEditor",title:zae(1454,"Select Editor"),precondition:jl.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:L6,primary:9}})}runEditorCommand(e,t){_0.get(t)?.selectEditor()}},Iue(_0.ID,_0,1),mue(k6),mue(D6),mue(N6),mue(I6),mue(E6),mue(M6),T6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},R6=function(e,t){return function(i,n){t(i,n,e)}},O6=class{constructor(e,t,i,n,o,s,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.gutterMenuLinkAction=s,this.completion=r}},A6=class extends Ee{constructor(e,t,i,n,o,s){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=s}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&0===this.completionModel.getIncompleteProvider().size}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=ke.slice(t,i),o=ke.slice(t,0,i);let s=5;for(const r of ke.concat(n,o)){if(r.score===rD.Default)continue;const t=new mr(r.editStart.lineNumber,r.editStart.column,r.editInsertEnd.lineNumber,r.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),i=r.completion.insertTextRules&&4&r.completion.insertTextRules?{snippet:r.completion.insertText}:r.completion.insertText;e.push(new O6(t,i,r.filterTextLow??r.labelLow,r.completion.additionalTextEdits,r.completion.command,r.completion.action,r)),s-- >=0&&r.resolve(it.None)}return e}},A6=T6([R6(5,pJ)],A6),P6=class extends Ie{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){if(i.selectedSuggestionInfo)return;let o;for(const u of this._editorService.listCodeEditors())if(u.getModel()===e){o=u;break}if(!o)return;const s=o.getOption(102);if(fY.isAllOff(s))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const r=e.tokenization.getLineTokens(t.lineNumber),a=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("inline"!==fY.valueFor(s,a))return;let l,d,c=e.getWordAtPosition(t);if(c?.word||(l=this._getTriggerCharacterInfo(e,t)),!c?.word&&!l)return;if(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column)return;const h=e.getValueInRange(new mr(t.lineNumber,1,t.lineNumber,t.column));if(!l&&this._lastResult?.canBeReused(e,t.lineNumber,c)){const e=new EJ(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=e,this._lastResult.acquire(),d=this._lastResult}else{const i=await iSe(this._languageFeatureService.completionProvider,e,t,new gY(void 0,PJ.createSuggestFilter(o).itemKind,l?.providers),l&&{triggerKind:1,triggerCharacter:l.ch},n);let s;i.needsClipboard&&(s=await this._clipboardService.readText());const r=new MJ(i.items,t.column,new EJ(h,0),NJ.None,o.getOption(134),o.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},s);d=new A6(e,t.lineNumber,c,r,i,this._suggestMemoryService)}return this._lastResult=d,d}handleItemDidShow(e,t){t.completion.resolve(it.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){const i=e.getValueInRange(mr.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))o.triggerCharacters?.includes(i)&&n.add(o);if(0!==n.size)return{providers:n,ch:i}}},gCe(P6=T6([R6(0,Tx),R6(1,nT),R6(2,pJ),R6(3,eo)],P6)),F6=class extends rr{constructor(){super({id:"editor.action.forceRetokenize",label:zae(1532,"Developer: Force Retokenize"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new Fe;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}},kue(F6),(W6=class e extends ms{constructor(){super({id:e.ID,title:zae(1530,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:zae(1531,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const e=!Pc.getTabFocusMode();Pc.setTabFocusMode(e),Qhe(e?Vae(1528,"Pressing Tab will now move focus to the next focusable element"):Vae(1529,"Pressing Tab will now insert the tab character"))}}).ID="editor.action.toggleTabFocusMode",mue(W6),B6=class{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),s=new V6(t),r=s.getCandidateCodePoints();let a;a="allNonBasicAscii"===r?new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):new RegExp(`[${Ble(Array.from(r).map(e=>String.fromCodePoint(e)).join(""))}]`,"g");const l=new iS(null,a),d=[];let c,h=!1,u=0,g=0,p=0;e:for(let m=n,f=o;m<=f;m++){const t=e.getLineContent(m),i=t.length;l.reset(0);do{if(c=l.next(t),c){let e=c.index,n=c.index+c[0].length;e>0&&ade(t.charCodeAt(e-1))&&e--,n+1<i&&ade(t.charCodeAt(n-1))&&n++;const o=t.substring(e,n);let r=$ue(e+1,ca,t,0);r&&r.endColumn<=e+1&&(r=null);const a=s.shouldHighlightNonBasicASCII(o,r?r.word:null);if(0!==a){if(3===a?u++:2===a?g++:1===a?p++:ele(),d.length>=1e3){h=!0;break e}d.push(new mr(m,e+1,m,n+1))}}}while(c)}return{ranges:d,hasMore:h,ambiguousCharacterCount:u,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new V6(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const n=e.codePointAt(0),o=i.ambiguousCharacters.getPrimaryConfusable(n),s=Wt.getLocales().filter(e=>!Wt.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(n));return{kind:0,confusableWith:String.fromCodePoint(o),notAmbiguousInLocales:s}}case 1:return{kind:2}}}},V6=class{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Wt.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Bt.codePoints)Vxe(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,o=!1;if(t)for(const s of t){const e=s.codePointAt(0),t=pde(s);n=n||t,t||this.ambiguousCharacters.isAmbiguous(e)||Bt.isInvisibleCharacter(e)||(o=!0)}return!n&&o?0:this.options.invisibleCharacters&&!Vxe(e)&&Bt.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}},H6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},z6=function(e,t){return function(i,n){t(i,n,e)}},U6=class extends Ie{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,o){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Mhe(e,Ahe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??$_e("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const s=this._register(new zm(this.el,"click")),r=this._register(new zm(this.el,"keypress")),a=Be.chain(r.event,e=>e.map(e=>new we(e)).filter(e=>3===e.keyCode)),l=this._register(new zm(this.el,gm.Tap)).event;this._register(pm.addTarget(this.el));const d=Be.any(s.event,a,l);this._register(d(e=>{this.enabled&&(An.stop(e,!0),i?.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}},U6=H6([z6(3,BR),z6(4,SA)],U6),K6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},q6=function(e,t){return function(i,n){t(i,n,e)}},j6=class extends Ie{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance($6))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,26)}},j6=K6([q6(1,Jn)],j6),$6=class extends Ie{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=Ahe("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){return e.ariaLabel?e.ariaLabel:"string"==typeof e.message?e.message:void 0}getBannerMessage(e){if("string"==typeof e){const t=Ahe("span");return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){Jce(this.element)}show(e){Jce(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Mhe(this.element,Ahe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(Ahe(`div${mo.asCSSSelector(e.icon)}`));const n=Mhe(this.element,Ahe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Mhe(this.element,Ahe("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(U6,this.messageActionsContainer,{...s,tabIndex:-1},{}));const o=Mhe(this.element,Ahe("div.action-container"));this.actionBar=this._register(new NE(o)),this.actionBar.push(this._register(new oo("banner.close",Vae(1533,"Close Banner"),mo.asClassName(QE),!0,()=>{"function"==typeof e.onClose&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}},$6=K6([q6(0,Jn),q6(1,LA)],$6),G6=eue("workspaceTrustManagementService"),Q6=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},X6=function(e,t){return function(i,n){t(i,n,e)}},J6=rwe("extensions-warning-message",go.warning,Vae(1534,"Icon shown with a warning message in the extensions editor.")),Z6=class extends Ie{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=e=>{if(e&&e.hasMore){if(this._bannerClosed)return;const t=Math.max(e.ambiguousCharacterCount,e.nonBasicAsciiCharacterCount,e.invisibleCharacterCount);let i;if(e.nonBasicAsciiCharacterCount>=t)i={message:Vae(1535,"This document contains many non-basic ASCII unicode characters"),command:new c9};else if(e.ambiguousCharacterCount>=t)i={message:Vae(1536,"This document contains many ambiguous unicode characters"),command:new l9};else{if(!(e.invisibleCharacterCount>=t))throw new Error("Unreachable");i={message:Vae(1537,"This document contains many invisible unicode characters"),command:new d9}}this._bannerController.show({id:"unicodeHighlightBanner",message:i.message,icon:J6,actions:[{label:i.command.shortLabel,href:`command:${i.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(j6,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(i.onDidChangeTrust(e=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=function(e,t){return{nonBasicASCII:"inUntrustedWorkspace"===t.nonBasicASCII?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:"inUntrustedWorkspace"===t.includeComments?!e:t.includeComments,includeStrings:"inUntrustedWorkspace"===t.includeStrings?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(e=>!1===e))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(e=>e.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(e=>"_os"===e?Hr.NumberFormat().value.resolvedOptions().locale:"_vscode"===e?$:e)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new t9(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new i9(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},Z6.ID="editor.contrib.unicodeHighlighter",e9=Z6,e9=Q6([X6(1,DM),X6(2,G6),X6(3,Jn)],e9),t9=class extends Ie{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ft(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII())return void this._decorations.clear();const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed())return;if(this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const e of t.ranges)i.push({range:e,options:s9.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();return tme(t,e)?{reason:Uxe(t.getValueInRange(e.range),this._options),inComment:ime(t,e),inString:nme(t,e)}:null}},t9=Q6([X6(3,DM)],t9),i9=class extends Ie{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ft(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII())return void this._decorations.clear();const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const e=B6.computeUnicodeHighlights(this._model,this._options,n);for(const t of e.ranges)i.ranges.push(t);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||e.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:s9.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return tme(t,e)?{reason:Uxe(i,this._options),inComment:ime(t,e),inString:nme(t,e)}:null}},n9=Vae(1538,"Configure Unicode Highlight Options"),o9=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=this._editor.getContribution(e9.ID);if(!n)return[];const o=[],s=new Set;let r=300;for(const a of t){const e=n.getDecorationInfo(a);if(!e)continue;const t=i.getValueInRange(a.range).codePointAt(0),l=zxe(t);let d;switch(e.reason.kind){case 0:d=pde(e.reason.confusableWith)?Vae(1539,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",l,zxe(e.reason.confusableWith.codePointAt(0))):Vae(1540,"The character {0} could be confused with the character {1}, which is more common in source code.",l,zxe(e.reason.confusableWith.codePointAt(0)));break;case 1:d=Vae(1541,"The character {0} is invisible.",l);break;case 2:d=Vae(1542,"The character {0} is not a basic ASCII character.",l)}if(s.has(d))continue;s.add(d);const c={codePoint:t,reason:e.reason,inComment:e.inComment,inString:e.inString},h=Vae(1543,"Adjust settings"),u=Kbe(h9.ID,c),g=new pD("",!0).appendMarkdown(d).appendText(" ").appendLink(u,h,n9);o.push(new mH(this,a.range,[g],!1,r++))}return o}renderHoverParts(e,t){return function(e,t,i,n){t.sort(fce(e=>e.ordinal,Oi));const o=[];for(const s of t){const t=ACe(i,s,n,e.onContentsChanged);e.fragment.appendChild(t.hoverElement),o.push(t)}return new MW(o)}(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(e=>e.value).join("\n")}},o9=Q6([X6(1,LA)],o9),(Y6=s9=class{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Lx.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}}).instance=new Y6,r9=class extends rr{constructor(){super({id:l9.ID,label:zae(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=Vae(1544,"Disable Highlight In Comments")}async run(e,t,i){const n=e.get(ka);n&&this.runAction(n)}async runAction(e){await e.updateValue(_c.includeComments,!1,2)}},a9=class extends rr{constructor(){super({id:l9.ID,label:zae(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=Vae(1545,"Disable Highlight In Strings")}async run(e,t,i){const n=e.get(ka);n&&this.runAction(n)}async runAction(e){await e.updateValue(_c.includeStrings,!1,2)}},(l9=class e extends ms{constructor(){super({id:e.ID,title:zae(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=Vae(1546,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e.get(ka);n&&this.runAction(n)}async runAction(e){await e.updateValue(_c.ambiguousCharacters,!1,2)}}).ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters",(d9=class e extends ms{constructor(){super({id:e.ID,title:zae(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=Vae(1547,"Disable Invisible Highlight")}async run(e,t,i){const n=e.get(ka);n&&this.runAction(n)}async runAction(e){await e.updateValue(_c.invisibleCharacters,!1,2)}}).ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters",(c9=class e extends ms{constructor(){super({id:e.ID,title:zae(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=Vae(1548,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e.get(ka);n&&this.runAction(n)}async runAction(e){await e.updateValue(_c.nonBasicASCII,!1,2)}}).ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters",(h9=class e extends ms{constructor(){super({id:e.ID,title:zae(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:n,inString:o,inComment:s}=t,r=String.fromCodePoint(i),a=e.get(tA),l=e.get(ka),d=[];if(0===n.kind)for(const u of n.notAmbiguousInLocales)d.push({label:Vae(1551,'Allow unicode characters that are more common in the language "{0}".',u),run:async()=>{Kxe(l,[u])}});if(d.push({label:function(e){return Bt.isInvisibleCharacter(e)?Vae(1549,"Exclude {0} (invisible character) from being highlighted",Hxe(e)):Vae(1550,"Exclude {0} from being highlighted",`${Hxe(e)} "${r}"`)}(i),run:()=>async function(e,t){const i=e.getValue(_c.allowedCharacters);let n;n="object"==typeof i&&i?i:{};for(const o of t)n[String.fromCodePoint(o)]=!0;await e.updateValue(_c.allowedCharacters,n,2)}(l,[i])}),s){const e=new r9;d.push({label:e.label,run:async()=>e.runAction(l)})}else if(o){const e=new a9;d.push({label:e.label,run:async()=>e.runAction(l)})}function c(e){return"string"==typeof e.desc.title?e.desc.title:e.desc.title.value}if(0===n.kind){const e=new l9;d.push({label:c(e),run:async()=>e.runAction(l)})}else if(1===n.kind){const e=new d9;d.push({label:c(e),run:async()=>e.runAction(l)})}else if(2===n.kind){const e=new c9;d.push({label:c(e),run:async()=>e.runAction(l)})}else!function(e){throw new Error(`Unexpected value: ${e}`)}(n);const h=await a.pick(d,{title:n9});h&&await h.run()}}).ID="editor.action.unicodeHighlight.showExcludeOptions",mue(l9),mue(d9),mue(c9),mue(h9),Iue(e9.ID,e9,1),TW.register(o9),u9=eue("dialogService"),p9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},m9=function(e,t){return function(i,n){t(i,n,e)}},f9="ignoreUnusualLineTerminators",(g9=class extends Ie{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(e=>{e.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if("off"===this._config)return;if(!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators())return;if(!0===function(e,t){return e.getModelProperty(t.uri,f9)}(this._codeEditorService,e))return;if(this._editor.getOption(104))return;if("auto"===this._config)return void e.removeUnusualLineTerminators(this._editor.getSelections());if(this._isPresentingDialog)return;let t;try{this._isPresentingDialog=!0,t=await this._dialogService.confirm({title:Vae(1558,"Unusual Line Terminators"),message:Vae(1559,"Detected unusual line terminators"),detail:Vae(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Os(e.uri)),primaryButton:Vae(1561,"&&Remove Unusual Line Terminators"),cancelButton:Vae(1562,"Ignore")})}finally{this._isPresentingDialog=!1}t.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):function(e,t,i){e.setModelProperty(t.uri,f9,i)}(this._codeEditorService,e,!0)}}).ID="editor.contrib.unusualLineTerminatorsDetector",_9=g9,Iue((_9=p9([m9(1,u9),m9(2,eo)],_9)).ID,_9,1),b9="[/\\\\]",v9="[^/\\\\]",w9=/\//g,C9=/^\*\*\/\*\.[\w\.-]+$/,y9=/^\*\*\/([\w\.-]+)\/?$/,S9=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,x9=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,k9=/^\*\*((\/[\w\.-]+)+)\/?$/,L9=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,D9=new Ls(1e4),I9=function(){return!1},N9=function(){return null},E9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},M9=function(e,t){return function(i,n){t(i,n,e)}},T9=class{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return n?e.isDisposed()?void 0:e.findMatches(n.word,!0,!1,!0,da,!1).map(e=>({range:e.range,kind:yb.Text})):Promise.resolve([])}provideMultiDocumentHighlights(e,t,i,n){const o=new ys,s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!s)return Promise.resolve(o);for(const r of[e,...i]){if(r.isDisposed())continue;const e=r.findMatches(s.word,!0,!1,!0,da,!1).map(e=>({range:e.range,kind:yb.Text}));e&&o.set(r.uri,e)}return o}},R9=class extends Ie{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new T9)),this._register(e.multiDocumentHighlightProvider.register("*",new T9))}},R9=E9([M9(0,Tx)],R9),P9=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},F9=function(e,t){return function(i,n){t(i,n,e)}},V9=new Jo("hasWordHighlights",!1),H9=class{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Ele(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new mr(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}},z9=class extends H9{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return tke(this._providers,e,t.getPosition(),n).then(e=>e||new ys)}},U9=class extends H9{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return function(e,t,i,n,o){return Ole(e.ordered(t).map(e=>()=>{const s=o.filter(e=>Kue(e)).filter(t=>eke(e.selector,t.uri,t.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(e.provideMultiDocumentHighlights(t,i,s,n)).then(void 0,Gae)}),e=>null!=e)}(this._providers,e,t.getPosition(),n,this._otherModels).then(e=>e||new ys)}},Sue("_executeDocumentHighlights",async(e,t,i)=>(await tke(e.get(Tx).documentHighlightProvider,t,i,it.None))?.get(t.uri)),O9=class{constructor(e,t,i,n,o,s,r,a){this.toUnhook=new De,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new ys,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new ht(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=s,this.textModelService=o,this.configurationService=r,this.logService=a,this._hasWordHighlights=V9.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(e=>{this._ignorePositionChangeEvent||"off"!==this.occurrencesHighlightEnablement&&this.runDelayer.trigger(()=>{this._onPositionChanged(e)})})),this.toUnhook.add(e.onDidFocusEditorText(e=>{"off"!==this.occurrencesHighlightEnablement&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(e=>{Ade(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(e=>{!e.newModelUrl&&e.oldModelUrl?this._stopSingular():W9.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(e=>{const t=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==t)switch(this.occurrencesHighlightEnablement=t,t){case"off":this._stopAll();break;case"singleFile":this._stopAll(W9.query?.modelInfo?.modelURI);break;case"multiFile":W9.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",t)}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration("editor.occurrencesHighlightDelay")){const e=r.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==e&&(this.occurrencesHighlightDelay=e)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{const e=this.codeEditorService.getFocusedCodeEditor();e?e.getModel()?.uri.scheme===yi.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==yi.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,W9.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){"off"!==this.occurrencesHighlightEnablement&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}))}stop(){"off"!==this.occurrencesHighlightEnablement&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(mr.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))+1)%e.length,i=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(i.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(i);const n=this._getWord();n&&Qhe(`${this.editor.getModel().getLineContent(i.startLineNumber)}, ${t+1} of ${e.length} for '${n.word}'`)}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,i=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(i.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(i);const n=this._getWord();n&&Qhe(`${this.editor.getModel().getLineContent(i.startLineNumber)}, ${t+1} of ${e.length} for '${n.word}'`)}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=W9.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),W9.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||Ts(n.getModel().uri,e))continue;const t=W9.storedDecorationIDs.get(n.getModel().uri);if(!t)continue;n.removeDecorations(t),i.push(n.getModel().uri);const o=q9.get(n);o?.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)W9.storedDecorationIDs.delete(n)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==yi.vscodeNotebookCell&&W9.query?.modelInfo?.modelURI.scheme!==yi.vscodeNotebookCell?(W9.query=null,this._run()):W9.query?.modelInfo&&(W9.query.modelInfo=null)),void 0!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),void 0!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){"off"===this.occurrencesHighlightEnablement||"api"!==e.source&&3!==e.reason?this._stopAll():this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===yi.vscodeNotebookCell){const t=[],i=this.codeEditorService.listCodeEditors();for(const n of i){const i=n.getModel();i&&i!==e&&i.uri.scheme===yi.vscodeNotebookCell&&t.push(i)}return t}const t=[],i=this.codeEditorService.listCodeEditors();for(const n of i){if(!zCe(n))continue;const i=n.getModel();i&&e===i.modified&&t.push(i.modified)}if(t.length)return t;if("singleFile"===this.occurrencesHighlightEnablement)return[];for(const n of i){const i=n.getModel();i&&i!==e&&t.push(i)}return t}async _run(e,t){if(this.editor.hasTextFocus()){const e=this.editor.getSelection();if(!e||e.startLineNumber!==e.endLineNumber)return W9.query=null,void this._stopAll();const t=e.startColumn,i=e.endColumn,n=this._getWord();if(!n||n.startColumn>t||n.endColumn<i)return W9.query=null,void this._stopAll();W9.query={modelInfo:{modelURI:this.model.uri,selection:e}}}else if(!W9.query)return void this._stopAll();if(this.lastCursorPositionChangeTime=(new Date).getTime(),Ts(this.editor.getModel().uri,W9.query.modelInfo?.modelURI)){if(!e){const e=this.decorations.getRanges();for(const t of e)if(t.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);const i=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const n=this.getOtherModelsToHighlight(this.editor.getModel());if(!W9.query||!W9.query.modelInfo)return;const o=await this.textModelService.createModelReference(W9.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(o.object.textEditorModel,W9.query.modelInfo.selection,n),this.workerRequest?.result.then(e=>{i===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=e||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},$ae)}catch(Fae){this.logService.error("Unexpected error during occurrence request. Log: ",Fae)}finally{o.dispose()}}else if(this.model.uri.scheme===yi.vscodeNotebookCell){const e=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!W9.query||!W9.query.modelInfo)return;const i=await this.textModelService.createModelReference(W9.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(i.object.textEditorModel,W9.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(i=>{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=i||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},$ae)}catch(Fae){this.logService.error("Unexpected error during occurrence request. Log: ",Fae)}finally{i.dispose()}}}computeWithModel(e,t,i){return i.length?function(e,t,i,n,o){return new U9(t,i,n,e,o)}(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):function(e,t,i,n){return new z9(t,i,n,e)}(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=(new Date).getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const t of e){const e=q9.get(t);if(!e)continue;const i=[],n=t.getModel()?.uri;if(n&&this.workerRequestValue.has(n)){const o=W9.storedDecorationIDs.get(n),s=this.workerRequestValue.get(n);if(s)for(const e of s)e.range&&i.push({range:e.range,options:Sxe(e.kind)});let r=[];t.changeDecorations(e=>{r=e.deltaDecorations(o??[],i)}),W9.storedDecorationIDs=W9.storedDecorationIDs.set(n,r),i.length>0&&(e.wordHighlighter?.decorations.set(i),e.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}},W9=O9,O9.storedDecorationIDs=new ys,O9.query=null,K9=O9,K9=W9=P9([F9(4,no),F9(5,eo),F9(6,ka),F9(7,Ks)],K9),A9=class extends Ie{static get(e){return e.getContribution(B9.ID)}constructor(e,t,i,n,o,s,r){super(),this._wordHighlighter=null;const a=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==yi.accessibleView&&(this._wordHighlighter=new K9(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,o,n,s,r))};this._register(e.onDidChangeModel(e=>{this._wordHighlighter&&(e.newModelUrl||e.oldModelUrl?.scheme===yi.vscodeNotebookCell||this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),this._wordHighlighter=null),a()})),a()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!(!this._wordHighlighter||!this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},B9=A9,A9.ID="editor.contrib.wordHighlighter",q9=A9,q9=B9=P9([F9(1,es),F9(2,Tx),F9(3,eo),F9(4,no),F9(5,ka),F9(6,Ks)],q9),j9=class extends rr{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=q9.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}},$9=class extends j9{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:zae(1572,"Go to Next Symbol Highlight"),precondition:V9,kbOpts:{kbExpr:jl.editorTextFocus,primary:65,weight:100}})}},G9=class extends j9{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:zae(1573,"Go to Previous Symbol Highlight"),precondition:V9,kbOpts:{kbExpr:jl.editorTextFocus,primary:1089,weight:100}})}},Z9=class extends rr{constructor(){super({id:"editor.action.wordHighlight.trigger",label:zae(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:jl.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=q9.get(t);n&&n.restoreViewState(!0)}},Iue(q9.ID,q9,0),kue($9),kue(G9),kue(Z9),gCe(R9),Y9=class extends sr{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Fue(t.getOption(148),t.getOption(147)),o=t.getModel(),s=t.getSelections(),r=s.length>1,a=s.map(e=>{const t=new to(e.positionLineNumber,e.positionColumn),i=this._move(n,o,t,this._wordNavigationType,r);return this._moveTo(e,i,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(e=>xr.fromModelSelection(e))),1===a.length){const e=new to(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,i){return i?new fr(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new fr(t.lineNumber,t.column,t.lineNumber,t.column)}},Q9=class extends Y9{_move(e,t,i,n,o){return jr.moveWordLeft(e,t,i,n,o)}},X9=class extends Y9{_move(e,t,i,n,o){return jr.moveWordRight(e,t,i,n)}},J9=class extends Q9{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}},e7=class extends Q9{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}},t7=class extends Q9{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Po.and(jl.textInputFocus,Po.and(Wc,MU)?.negate()),primary:2063,mac:{primary:527},weight:100}})}},i7=class extends Q9{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}},n7=class extends Q9{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}},o7=class extends Q9{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Po.and(jl.textInputFocus,Po.and(Wc,MU)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}},s7=class extends Q9{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,o){return super._move(Fue(Ec.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}},r7=class extends Q9{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(Fue(Ec.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}},a7=class extends X9{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}},l7=class extends X9{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Po.and(jl.textInputFocus,Po.and(Wc,MU)?.negate()),primary:2065,mac:{primary:529},weight:100}})}},d7=class extends X9{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}},c7=class extends X9{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}},h7=class extends X9{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Po.and(jl.textInputFocus,Po.and(Wc,MU)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}},u7=class extends X9{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}},g7=class extends X9{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,o){return super._move(Fue(Ec.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}},p7=class extends X9{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(Fue(Ec.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}},m7=class extends sr{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e?.get(il);if(!t.hasModel()||!n)return;const o=Fue(t.getOption(148),t.getOption(147)),s=t.getModel(),r=t.getSelections(),a=t.getOption(10),l=t.getOption(15),d=n.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),c=t._getViewModel(),h=r.map(e=>new Er(this._delete({wordSeparators:o,model:s,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:a,autoClosingQuotes:l,autoClosingPairs:d,autoClosedCharacters:c.getCursorAutoClosedCharacters()},this._wordNavigationType),""));t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}},f7=class extends m7{_delete(e,t){const i=jr.deleteWordLeft(e,t);return i||new mr(1,1,1,1)}},_7=class extends m7{_delete(e,t){const i=jr.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new mr(n,o,n,o)}},b7=class extends f7{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:jl.writable})}},v7=class extends f7{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:jl.writable})}},w7=class extends f7{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:jl.writable,kbOpts:{kbExpr:jl.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}},C7=class extends _7{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:jl.writable})}},y7=class extends _7{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:jl.writable})}},S7=class extends _7{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:jl.writable,kbOpts:{kbExpr:jl.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}},x7=class extends rr{constructor(){super({id:"deleteInsideWord",precondition:jl.writable,label:zae(1575,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const n=Fue(t.getOption(148),t.getOption(147)),o=t.getModel(),s=t.getSelections().map(e=>new Er(jr.deleteInsideWord(n,o,e),""));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}},xue(new J9),xue(new e7),xue(new t7),xue(new i7),xue(new n7),xue(new o7),xue(new a7),xue(new l7),xue(new d7),xue(new c7),xue(new h7),xue(new u7),xue(new s7),xue(new r7),xue(new g7),xue(new p7),xue(new b7),xue(new v7),xue(new w7),xue(new C7),xue(new y7),xue(new S7),kue(x7),k7=class extends m7{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:jl.writable,kbOpts:{kbExpr:jl.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=$r.deleteWordPartLeft(e);return i||new mr(1,1,1,1)}},L7=class extends m7{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:jl.writable,kbOpts:{kbExpr:jl.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=$r.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new mr(n,o,n,o)}},D7=class extends Y9{_move(e,t,i,n,o){return $r.moveWordPartLeft(e,t,i,o)}},I7=class extends D7{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:jl.textInputFocus,primary:0,mac:{primary:783},weight:100}})}},_o.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft"),N7=class extends D7{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:jl.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}},_o.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect"),E7=class extends Y9{_move(e,t,i,n,o){return $r.moveWordPartRight(e,t,i)}},M7=class extends E7{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:jl.textInputFocus,primary:0,mac:{primary:785},weight:100}})}},T7=class extends E7{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:jl.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}},xue(new k7),xue(new L7),xue(new I7),xue(new N7),xue(new M7),xue(new T7),R7=class extends Ie{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=TA.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(t=this.editor.isSimpleWidget?new pD(Vae(1378,"Cannot edit in read-only input")):new pD(Vae(1379,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}},Iue(R7.ID="editor.contrib.readOnlyMessageController",R7,2),O7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},A7=function(e,t){return function(i,n){t(i,n,e)}},P7=class extends Ie{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Qce(this,void 0);const n=cwe("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=cwe("_textModel.onDidChangeContent",Be.debounce(e=>this._textModel.onDidChangeContent(e),()=>{},100));this._register(Pce(async(e,t)=>{n.read(e),o.read(e);const i=t.add(new OE),s=await this._outlineModelService.getOrCreate(this._textModel,i.token);t.isDisposed||this._currentModel.set(s,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(t=>e.contains(t.range.startLineNumber)&&!e.contains(t.range.endLineNumber));return n.sort(_ce(fce(e=>e.range.endLineNumber-e.range.startLineNumber,Oi))),n.map(e=>({name:e.name,kind:e.kind,startLineNumber:e.range.startLineNumber}))}},P7=O7([A7(1,Tx),A7(2,$Z)],P7),iO.setBreadcrumbsSourceFactory((e,t)=>t.createInstance(P7,e)),W7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},B7=function(e,t){return function(i,n){t(i,n,e)}},F7=class extends Ie{constructor(e,t,i,n){super();const o=this._register(bwe(e)),s=this._register(n.createMenu(ds.EditorContent,e.contextKeyService)),r=Hce(this,s.onDidChange,()=>0===s.getActions().length);this._register(Rce(e=>{if(r.read(e))return;const n=Vhe("div.floating-menu-overlay-widget");n.root.style.height="28px";const s=t.createInstance(PR,n.root,ds.EditorContent,{actionViewItemProvider:(e,n)=>{if(!(e instanceof ps))return;const o=i.lookupKeybinding(e.id);return o?t.createInstance(class extends _R{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${o.getLabel()})`)}},e,{...n,keybindingNotRenderedWithLabel:!0}):void 0},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});e.store.add(s),e.store.add(Rce(e=>{s.context=o.model.read(e)?.uri})),e.store.add(o.createOverlayWidget({allowEditorOverflow:!1,domNode:n.root,minContentWidthInPx:z_e(0),position:z_e({preference:1})}))}))}},F7.ID="editor.contrib.floatingToolbar",V7=F7,Iue((V7=W7([B7(1,Jn),B7(2,xw),B7(3,cs)],V7)).ID,V7,1),function(e){e.inspectTokensAction=Vae(786,"Developer: Inspect Tokens")}(H7||(H7={})),function(e){e.gotoLineActionLabel=Vae(787,"Go to Line/Column...")}(z7||(z7={})),function(e){e.helpQuickAccessActionLabel=Vae(788,"Show all Quick Access Providers")}(U7||(U7={})),function(e){e.quickCommandActionLabel=Vae(789,"Command Palette"),e.quickCommandHelp=Vae(790,"Show And Run Commands")}(K7||(K7={})),function(e){e.quickOutlineActionLabel=Vae(791,"Go to Symbol..."),e.quickOutlineByCategoryActionLabel=Vae(792,"Go to Symbol by Category...")}(q7||(q7={})),function(e){e.editorViewAccessibleLabel=Vae(793,"Editor content")}(j7||(j7={})),function(e){e.toggleHighContrast=Vae(794,"Toggle High Contrast Theme")}($7||($7={})),function(e){e.bulkEditServiceSummary=Vae(795,"Made {0} edits in {1} files")}(G7||(G7={})),Z7=class extends Ie{constructor(e){super(),this.editor=e,this.widget=null,U&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new Y7(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}},Z7.ID="editor.contrib.iPadShowKeyboard",Y7=class e extends Ie{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ehe(this._domNode,"touchstart",e=>{this.editor.focus()})),this._register(ehe(this._domNode,"focus",e=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return e.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}},Y7.ID="editor.contrib.ShowKeyboardWidget",Iue(Z7.ID,Z7,3),Q7=eue("themeService"),J7=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},e8=function(e,t){return function(i,n){t(i,n,e)}},X7=class extends Ie{static get(e){return e.getContribution(t8.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(e=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(e=>this.stop())),this._register(Mb.onDidChange(e=>this.stop())),this._register(this._editor.onKeyUp(e=>9===e.keyCode&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new o8(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},t8=X7,X7.ID="editor.contrib.inspectTokens",i8=X7,i8=t8=J7([e8(1,Q7),e8(2,La)],i8),n8=class extends rr{constructor(){super({id:"editor.action.inspectTokens",label:H7.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){i8.get(t)?.launch()}},o8=class e extends Ie{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=function(e,t){const i=Mb.get(t);if(i)return i;const n=e.encodeLanguageId(t);return{getInitialState:()=>SS,tokenize:(e,i,n)=>c_e(t,n),tokenizeEncoded:(e,t,i)=>h_e(n,i)}}(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(e=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return e._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let a=t.tokens1.length-1;a>=0;a--){const n=t.tokens1[a];if(e.column-1>=n.offset){i=a;break}}let n=0;for(let a=t.tokens2.length>>>1;a>=0;a--)if(e.column-1>=t.tokens2[a<<1]){n=a;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(i<t.tokens1.length){const e=t.tokens1[i].offset,n=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;s=o.substring(e,n)}Rhe(this._domNode,Ahe("h2.tm-token",void 0,function(e){let t="";for(let i=0,n=e.length;i<n;i++){const n=e.charCodeAt(i);switch(n){case 9:t+="→";break;case 32:t+="·";break;default:t+=String.fromCharCode(n)}}return t}(s),Ahe("span.tm-token-length",void 0,`${s.length} ${1===s.length?"char":"chars"}`))),Mhe(this._domNode,Ahe("hr.tokens-inspect-separator",{style:"clear:both"}));const r=1+(n<<1)<t.tokens2.length?this._decodeMetadata(t.tokens2[1+(n<<1)]):null;Mhe(this._domNode,Ahe("table.tm-metadata-table",void 0,Ahe("tbody",void 0,Ahe("tr",void 0,Ahe("td.tm-metadata-key",void 0,"language"),Ahe("td.tm-metadata-value",void 0,`${r?r.languageId:"-?-"}`)),Ahe("tr",void 0,Ahe("td.tm-metadata-key",void 0,"token type"),Ahe("td.tm-metadata-value",void 0,`${r?this._tokenTypeToString(r.tokenType):"-?-"}`)),Ahe("tr",void 0,Ahe("td.tm-metadata-key",void 0,"font style"),Ahe("td.tm-metadata-value",void 0,`${r?this._fontStyleToString(r.fontStyle):"-?-"}`)),Ahe("tr",void 0,Ahe("td.tm-metadata-key",void 0,"foreground"),Ahe("td.tm-metadata-value",void 0,`${r?eh.Format.CSS.formatHex(r.foreground):"-?-"}`)),Ahe("tr",void 0,Ahe("td.tm-metadata-key",void 0,"background"),Ahe("td.tm-metadata-value",void 0,`${r?eh.Format.CSS.formatHex(r.background):"-?-"}`))))),Mhe(this._domNode,Ahe("hr.tokens-inspect-separator")),i<t.tokens1.length&&Mhe(this._domNode,Ahe("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=Mb.getColorMap(),i=cl.getLanguageId(e),n=cl.getTokenType(e),o=cl.getFontStyle(e),s=cl.getForeground(e),r=cl.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:o,foreground:t[s],background:t[r]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return 1&e&&(t+="italic "),2&e&&(t+="bold "),4&e&&(t+="underline "),8&e&&(t+="strikethrough "),0===t.length&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}},o8._ID="editor.contrib.inspectTokensWidget",Iue(i8.ID,i8,4),kue(n8),function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(s8||(s8={})),r8={Quickaccess:"workbench.contributions.quickaccess"},a8=class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort((e,t)=>t.prefix.length-e.prefix.length),Dle(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return ice([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(t=>e.startsWith(t.prefix))||this.defaultProvider}},ts.add(r8.Quickaccess,new a8),d8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},c8=function(e,t){return function(i,n){t(i,n,e)}},h8=l8=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=ts.as(r8.Quickaccess)}provide(e){const t=new De;return t.add(e.onDidAccept(()=>{const[t]=e.selectedItems;t&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(e=>{const t=this.registry.getQuickAccessProvider(e.substr(h8.PREFIX.length));t&&t.prefix&&t.prefix!==h8.PREFIX&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(e=>e.prefix!==h8.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((e,t)=>e.prefix.localeCompare(t.prefix)).flatMap(e=>this.createPicks(e))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:Vae(1747,"{0}, {1}",n,t.description),description:t.description}})}},l8.PREFIX="?",u8=l8,u8=h8=d8([c8(0,tA),c8(1,xw)],u8),ts.as(r8.Quickaccess).registerQuickAccessProvider({ctor:u8,prefix:"",helpEntries:[{description:U7.helpQuickAccessActionLabel}]}),g8=class{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){const n=new De;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new Ne);return o.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new De,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},r=UCe(o);if(r){let e=o.saveViewState()??void 0;n.add(r.onDidChangeCursorPosition(()=>{e=o.saveViewState()??void 0})),s.restoreViewState=()=>{e&&o===this.activeTextEditorControl&&o.restoreViewState(e)},n.add(Sle(t.onCancellationRequested)(()=>s.restoreViewState?.()))}n.add(Dle(()=>this.clearDecorations(o))),n.add(this.provideWithTextEditor(s,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Xhe(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){return zCe(e)?e.getModel()?.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(e=>{const i=[];this.rangeHighlightDecorationId&&(i.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),i.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const n=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Hpe(n_),position:Zr.Full}}}],[o,s]=e.deltaDecorations(i,n);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:s}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(e=>{e.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}},m8=class e extends g8{constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(e.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(t){this.storageService.store(e.ZERO_BASED_OFFSET_STORAGE_KEY,t,-1,0)}provideWithoutTextEditor(e){const t=Vae(1335,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,Ie.None}provideWithTextEditor(t,i,n){const o=t.editor,s=new De;s.add(i.onDidAccept(e=>{const[n]=i.selectedItems;if(n){if(!n.lineNumber)return;this.gotoLocation(t,{range:this.toRange(n.lineNumber,n.column),keyMods:i.keyMods,preserveFocus:e.inBackground}),e.inBackground||i.hide()}}));const r=()=>{const t=i.value.trim().substring(e.PREFIX.length),{inOffsetMode:n,lineNumber:s,column:r,label:l}=this.parsePosition(o,t);if(a.visible=!!n,i.items=[{lineNumber:s,column:r,label:l}],i.ariaLabel=l,!s)return void this.clearDecorations(o);const d=this.toRange(s,r);o.revealRangeInCenter(d,0),this.addDecorations(o,d)},a=new PB({title:Vae(1336,"Use Zero-Based Offset"),icon:go.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:gpe(Pu),inputActiveOptionForeground:gpe(Bu),inputActiveOptionBackground:gpe(Wu)});s.add(a.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,r()})),i.toggles=[a],r(),s.add(i.onDidChangeValue(()=>r()));const l=UCe(o);return l&&2===l.getOptions().get(76).renderType&&(l.updateOptions({lineNumbers:"on"}),s.add(Dle(()=>l.updateOptions({lineNumbers:"relative"})))),s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=this.getModel(e);if(!i)return{label:Vae(1337,"Open a text editor first to go to a line.")};if(t.startsWith(":")){let e=parseInt(t.substring(1),10);const n=i.getValueLength();if(isNaN(e))return{inOffsetMode:!0,label:this.useZeroBasedOffset?Vae(1338,"Type a character position to go to (from 0 to {0}).",n-1):Vae(1339,"Type a character position to go to (from 1 to {0}).",n)};{const t=e<0;this.useZeroBasedOffset||(e-=Math.sign(e)),t&&(e+=n);const o=i.getPositionAt(e);return{...o,inOffsetMode:!0,label:Vae(1340,"Press 'Enter' to go to line {0} at column {1}.",o.lineNumber,o.column)}}}{const e=t.split(/,|:|#/),n=i.getLineCount();let o=parseInt(e[0]?.trim(),10);if(e.length<1||isNaN(o))return{label:Vae(1341,"Type a line number to go to (from 1 to {0}).",n)};o=o>=0?o:n+1+o,o=Math.min(Math.max(1,o),n);const s=i.getLineMaxColumn(o);let r=parseInt(e[1]?.trim(),10);return e.length<2||isNaN(r)?{lineNumber:o,column:1,label:e.length<2?Vae(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",o):Vae(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",o,s)}:(r=r>=0?r:s+r,r=Math.min(Math.max(1,r),s),{lineNumber:o,column:r,label:Vae(1344,"Press 'Enter' to go to line {0} at column {1}.",o,r)})}}},(p8=m8).PREFIX=":",p8.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset",f8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_8=function(e,t){return function(i,n){t(i,n,e)}},b8=class extends m8{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=Be.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}},b8=f8([_8(0,eo),_8(1,eR)],b8),(v8=class e extends rr{constructor(){super({id:e.ID,label:z7.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(tA).quickAccess.show(b8.PREFIX)}}).ID="editor.action.gotoLine",kue(v8),ts.as(r8.Quickaccess).registerQuickAccessProvider({ctor:b8,prefix:b8.PREFIX,helpEntries:[{description:z7.gotoLineActionLabel,commandId:v8.ID}]}),w8=[void 0,[]],C8=" ",S8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},x8=function(e,t){return function(i,n){t(i,n,e)}},y8=class extends g8{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,Vae(1345,"To go to a symbol, first open a text editor with symbol information.")),Ie.None}provideWithTextEditor(e,t,i,n){const o=e.editor,s=this.getModel(o);return s?this._languageFeaturesService.documentSymbolProvider.has(s)?this.doProvideWithEditorSymbols(e,s,t,i,n):this.doProvideWithoutEditorSymbols(e,s,t,i):Ie.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new De;return this.provideLabelPick(i,Vae(1346,"The active text editor does not provide symbol information.")),(async()=>{await this.waitForLanguageSymbolRegistry(t,o)&&!n.isCancellationRequested&&o.add(this.doProvideWithEditorSymbols(e,t,i,n))})(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new Ct,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(Dle(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,o){const s=e.editor,r=new De;r.add(i.onDidAccept(t=>{const[n]=i.selectedItems;n&&n.range&&(this.gotoLocation(e,{range:n.range.selection,keyMods:i.keyMods,preserveFocus:t.inBackground}),o?.handleAccept?.(n,t.inBackground),t.inBackground||i.hide())})),r.add(i.onDidTriggerItemButton(({item:t})=>{t&&t.range&&(this.gotoLocation(e,{range:t.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const a=this.getDocumentSymbols(t,n),l=r.add(new Ne),d=async e=>{l?.value?.cancel(),i.busy=!1,l.value=new ot,i.busy=!0;try{const o=ake(i.value.substr(k8.PREFIX.length).trim()),s=await this.doGetSymbolPicks(a,o,void 0,l.value.token,t);if(n.isCancellationRequested)return;if(s.length>0){if(i.items=s,e&&0===o.original.length){const t=Kpe(s,t=>Boolean("separator"!==t.type&&t.range&&mr.containsPosition(t.range.decoration,e)));t&&(i.activeItems=[t])}}else o.original.length>0?this.provideLabelPick(i,Vae(1347,"No matching editor symbols")):this.provideLabelPick(i,Vae(1348,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return r.add(i.onDidChangeValue(()=>d(void 0))),d(s.getSelection()?.getPosition()),r.add(i.onDidChangeActive(()=>{const[e]=i.activeItems;e&&e.range&&(s.revealRangeInCenter(e.range.selection,0),this.addDecorations(s,e.range.decoration))})),r}async doGetSymbolPicks(e,t,i,n,o){const s=await e;if(n.isCancellationRequested)return[];const r=0===t.original.indexOf(k8.SCOPE_PREFIX),a=r?1:0;let l,d,c;t.values&&t.values.length>1?(l=dke(t.values[0]),d=dke(t.values.slice(1))):l=t;const h=this.options?.openSideBySideDirection?.();h&&(c=[{iconClass:"right"===h?mo.asClassName(go.splitHorizontal):mo.asClassName(go.splitVertical),tooltip:"right"===h?Vae(1349,"Open to the Side"):Vae(1350,"Open to the Bottom")}]);const u=[];for(let m=0;m<s.length;m++){const f=s[m],_=Vle(f.name),b=`$(${xb.toIcon(f.kind).id}) ${_}`,v=b.length-_.length;let w,C,y,S,x=f.containerName;if(i?.extraContainerLabel&&(x=x?`${i.extraContainerLabel} • ${x}`:i.extraContainerLabel),t.original.length>a){let L=!1;if(l!==t&&([w,C]=ike(b,{...t,values:void 0},a,v),"number"==typeof w&&(L=!0)),"number"!=typeof w&&([w,C]=ike(b,l,a,v),"number"!=typeof w))continue;if(!L&&d){if(x&&d.original.length>0&&([y,S]=ike(x,d)),"number"!=typeof y)continue;"number"==typeof w&&(w+=y)}}const k=f.tags&&f.tags.indexOf(1)>=0;u.push({index:m,kind:f.kind,score:w,label:b,ariaLabel:eme(f.name,f.kind),description:x,highlights:k?void 0:{label:C,description:S},range:{selection:mr.collapseToStart(f.selectionRange),decoration:f.range},uri:o.uri,symbolName:_,strikethrough:k,buttons:c})}const g=u.sort((e,t)=>r?this.compareByKindAndScore(e,t):this.compareByScore(e,t));let p=[];if(r){let D,I,N=0;function E(){I&&"number"==typeof D&&N>0&&(I.label=Fle(I8[D]||D8,N))}for(const M of g)D!==M.kind?(E(),D=M.kind,N=1,I={type:"separator"},p.push(I)):N++,p.push(M);E()}else g.length>0&&(p=[{label:Vae(1351,"symbols ({0})",u.length),type:"separator"},...g]);return p}compareByScore(e,t){if("number"!=typeof e.score&&"number"==typeof t.score)return 1;if("number"==typeof e.score&&"number"!=typeof t.score)return-1;if("number"==typeof e.score&&"number"==typeof t.score){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=I8[e.kind]||D8,n=I8[t.kind]||D8,o=i.localeCompare(n);return 0===o?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},k8=y8,y8.PREFIX="@",y8.SCOPE_PREFIX=":",y8.PREFIX_BY_CATEGORY=`${y8.PREFIX}${y8.SCOPE_PREFIX}`,L8=y8,L8=k8=S8([x8(0,Tx),x8(1,$Z)],L8),D8=Vae(1352,"properties ({0})"),I8={5:Vae(1353,"methods ({0})"),11:Vae(1354,"functions ({0})"),8:Vae(1355,"constructors ({0})"),12:Vae(1356,"variables ({0})"),4:Vae(1357,"classes ({0})"),22:Vae(1358,"structs ({0})"),23:Vae(1359,"events ({0})"),24:Vae(1360,"operators ({0})"),10:Vae(1361,"interfaces ({0})"),2:Vae(1362,"namespaces ({0})"),3:Vae(1363,"packages ({0})"),25:Vae(1364,"type parameters ({0})"),1:Vae(1365,"modules ({0})"),6:Vae(1366,"properties ({0})"),9:Vae(1367,"enumerations ({0})"),21:Vae(1368,"enumeration members ({0})"),14:Vae(1369,"strings ({0})"),0:Vae(1370,"files ({0})"),17:Vae(1371,"arrays ({0})"),15:Vae(1372,"numbers ({0})"),16:Vae(1373,"booleans ({0})"),18:Vae(1374,"objects ({0})"),19:Vae(1375,"keys ({0})"),7:Vae(1376,"fields ({0})"),13:Vae(1377,"constants ({0})")},N8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},E8=function(e,t){return function(i,n){t(i,n,e)}},M8=class extends L8{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=Be.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}},M8=N8([E8(0,eo),E8(1,Tx),E8(2,$Z)],M8),(T8=class e extends rr{constructor(){super({id:e.ID,label:q7.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:jl.hasDocumentSymbolProvider,kbOpts:{kbExpr:jl.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(tA).quickAccess.show(L8.PREFIX,{itemActivation:XO.NONE})}}).ID="editor.action.quickOutline",kue(T8),ts.as(r8.Quickaccess).registerQuickAccessProvider({ctor:M8,prefix:L8.PREFIX,helpEntries:[{description:q7.quickOutlineActionLabel,prefix:L8.PREFIX,commandId:T8.ID},{description:q7.quickOutlineByCategoryActionLabel,prefix:L8.PREFIX_BY_CATEGORY}]}),R8=class e{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,o=[];for(const[s,r]of this.documents){if(t.isCancellationRequested)return[];for(const e of r.chunks){const t=this.computeSimilarityScore(e,i,n);t>0&&o.push({key:s,score:t})}}return o}static termFrequencies(t){return function(e){const t=new Map;for(const i of e)t.set(i,(t.get(i)??0)+1);return t}(e.splitTerms(t))}static*splitTerms(e){const t=e=>e.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const e=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(e.length>1)for(const i of e)i.length>2&&/\p{Letter}{3,}/gu.test(i)&&(yield t(i))}}updateDocuments(t){for(const{key:e}of t)this.deleteDocument(e);for(const i of t){const t=[];for(const n of i.textChunks){const i=e.termFrequencies(n);for(const e of i.keys())this.chunkOccurrences.set(e,(this.chunkOccurrences.get(e)??0)+1);t.push({text:n,tf:i})}this.chunkCount+=t.length,this.documents.set(i.key,{chunks:t})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const e of t.chunks)for(const t of e.tf.keys()){const e=this.chunkOccurrences.get(t);if("number"==typeof e){const i=e-1;i<=0?this.chunkOccurrences.delete(t):this.chunkOccurrences.set(t,i)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[o,s]of Object.entries(t)){const t=e.tf.get(o);if(!t)continue;let r=i.get(o);"number"!=typeof r&&(r=this.computeIdf(o),i.set(o,r)),n+=t*r*s}return n}computeEmbedding(t){const i=e.termFrequencies(t);return this.computeTfidf(i)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const e=this.computeIdf(i);e>0&&(t[i]=n*e)}return t}},function(e){e[e.NO_ACTION=0]="NO_ACTION",e[e.CLOSE_PICKER=1]="CLOSE_PICKER",e[e.REFRESH_PICKER=2]="REFRESH_PICKER",e[e.REMOVE_ITEM=3]="REMOVE_ITEM"}(O8||(O8={})),A8=class extends Ie{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){const n=new De;let o;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=n.add(new Ne),r=async()=>{o?.dispose(!0),e.busy=!1;const n=s.value=new De;o=n.add(new ot(t));const r=o.token;let a=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(a=a.trim());const l=this._getPicks(a,n,r,i),d=(t,i)=>{let n,o;if(cke(t)?(n=t.items,o=t.active):n=t,0===n.length){if(i)return!1;(a.length>0||e.hideInput)&&this.options?.noResultsPick&&(n=fle(this.options.noResultsPick)?[this.options.noResultsPick(a)]:[this.options.noResultsPick])}return e.items=n,o&&(e.activeItems=[o]),!0},c=async t=>{let i=!1,n=!1;await Promise.all([(async()=>{"number"==typeof t.mergeDelay&&(await Tle(t.mergeDelay),r.isCancellationRequested)||n||(i=d(t.picks,!0))})(),(async()=>{e.busy=!0;try{const n=await t.additionalPicks;if(r.isCancellationRequested)return;let o,s,a,l;if(cke(t.picks)?(o=t.picks.items,s=t.picks.active):o=t.picks,cke(n)?(a=n.items,l=n.active):a=n,a.length>0||!i){let t;if(!s&&!l){const i=e.activeItems[0];i&&-1!==o.indexOf(i)&&(t=i)}d({items:[...o,...a],active:s||l||t})}}finally{r.isCancellationRequested||(e.busy=!1),n=!0}})()])};if(null===l);else if(hke(l))await c(l);else if(l instanceof Promise){e.busy=!0;try{const e=await l;if(r.isCancellationRequested)return;hke(e)?await c(e):d(e)}finally{r.isCancellationRequested||(e.busy=!1)}}else d(l)};n.add(e.onDidChangeValue(()=>r())),r(),n.add(e.onDidAccept(t=>{if(i?.handleAccept)return t.inBackground||e.hide(),void i.handleAccept?.(e.activeItems[0],t.inBackground);const[n]=e.selectedItems;"function"==typeof n?.accept&&(t.inBackground||e.hide(),n.accept(e.keyMods,t))}));const a=async(i,n)=>{if("function"!=typeof n.trigger)return;const o=n.buttons?.indexOf(i)??-1;if(o>=0){const i=n.trigger(o,e.keyMods),s="number"==typeof i?i:await i;if(t.isCancellationRequested)return;switch(s){case O8.NO_ACTION:break;case O8.CLOSE_PICKER:e.hide();break;case O8.REFRESH_PICKER:r();break;case O8.REMOVE_ITEM:{const t=e.items.indexOf(n);if(-1!==t){const i=e.items.slice(),n=i.splice(t,1),o=e.activeItems.filter(e=>e!==n[0]),s=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=i,o&&(e.activeItems=o),e.keepScrollPosition=s}break}}}};return n.add(e.onDidTriggerItemButton(({button:e,item:t})=>a(e,t))),n.add(e.onDidTriggerSeparatorButton(({button:e,separator:t})=>a(e,t))),n}},new Ls(1e4),P8=new Ls(1e4),F8=/[^\u0000-\u0080]/,W8=function(){const e=/[\u0300-\u036f]/g;return function(t){return uke(t).replace(e,"")}}(),H8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},z8=function(e,t){return function(i,n){t(i,n,e)}},B8=class extends A8{constructor(e,t,i,n,o,s){super(U8.PREFIX,e),this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(t.createInstance(j8)),this.options=e}async _getPicks(e,t,i,n){const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const s=Sle(()=>{const t=new R8;return t.updateDocuments(o.map(e=>({key:e.commandId,textChunks:[this.getTfIdfChunk(e)]}))),function(e){const t=e.slice(0);t.sort((e,t)=>t.score-e.score);const i=t[0]?.score??0;if(i>0)for(const n of t)n.score/=i;return t}(t.calculateScores(e,i)).filter(e=>e.score>U8.TFIDF_THRESHOLD).slice(0,U8.TFIDF_MAX_RESULTS)}),r=this.normalizeForFiltering(e),a=[];for(const g of o){g.labelNoAccents??(g.labelNoAccents=this.normalizeForFiltering(g.label));const t=U8.WORD_FILTER(r,g.labelNoAccents)??void 0;let n;if(g.commandAlias&&(g.aliasNoAccents??(g.aliasNoAccents=this.normalizeForFiltering(g.commandAlias)),n=U8.WORD_FILTER(r,g.aliasNoAccents)??void 0),t||n)g.highlights={label:t,detail:this.options.showAlias?n:void 0},a.push(g);else if(e===g.commandId)a.push(g);else if(e.length>=3){const e=s();if(i.isCancellationRequested)return[];const t=e.find(e=>e.key===g.commandId);t&&(g.tfIdfScore=t.score,a.push(g))}}const l=new Map;for(const g of a){const e=l.get(g.label);e?(g.description=g.commandId,e.description=e.commandId):l.set(g.label,g)}a.sort((e,t)=>{if(e.tfIdfScore&&t.tfIdfScore)return e.tfIdfScore===t.tfIdfScore?e.label.localeCompare(t.label):t.tfIdfScore-e.tfIdfScore;if(e.tfIdfScore)return 1;if(t.tfIdfScore)return-1;const i=this.commandsHistory.peek(e.commandId),n=this.commandsHistory.peek(t.commandId);if(i&&n)return i>n?-1:1;if(i)return-1;if(n)return 1;if(this.options.suggestedCommandIds){const i=this.options.suggestedCommandIds.has(e.commandId),n=this.options.suggestedCommandIds.has(t.commandId);if(i&&n)return 0;if(i)return-1;if(n)return 1}const o=e.commandCategory===x6.Developer.value,s=t.commandCategory===x6.Developer.value;return o&&!s?1:!o&&s?-1:e.label.localeCompare(t.label)});const d=[];let c=!1,h=!0,u=!!this.options.suggestedCommandIds;for(let g=0;g<a.length;g++){const e=a[g];0===g&&this.commandsHistory.peek(e.commandId)&&(d.push({type:"separator",label:Vae(1740,"recently used")}),c=!0),h&&void 0!==e.tfIdfScore&&(d.push({type:"separator",label:Vae(1741,"similar commands")}),h=!1),u&&void 0===e.tfIdfScore&&!this.commandsHistory.peek(e.commandId)&&this.options.suggestedCommandIds?.has(e.commandId)&&(d.push({type:"separator",label:Vae(1742,"commonly used")}),c=!0,u=!1),!c||void 0!==e.tfIdfScore||this.commandsHistory.peek(e.commandId)||this.options.suggestedCommandIds?.has(e.commandId)||(d.push({type:"separator",label:Vae(1743,"other commands")}),c=!1),d.push(this.toCommandPick(e,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{const t=await this.getAdditionalCommandPicks(o,a,e,i);if(i.isCancellationRequested)return[];const s=t.map(e=>this.toCommandPick(e,n));return h&&"separator"!==s[0]?.type&&s.unshift({type:"separator",label:Vae(1744,"similar commands")}),s})()}:d}toCommandPick(e,t){if("separator"===e.type)return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?Vae(1745,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:t?.from??"quick open"});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(i){Yae(i)||this.dialogService.error(Vae(1746,"Command '{0}' resulted in an error",e.label),Xwe(i))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}normalizeForFiltering(e){const t=W8(e);return t.length!==e.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:e.length,normalizedLength:t.length}),e):t}},U8=B8,B8.PREFIX=">",B8.TFIDF_THRESHOLD=.5,B8.TFIDF_MAX_RESULTS=5,B8.WORD_FILTER=nbe(GL,wbe,sbe),q8=B8,q8=U8=H8([z8(1,Jn),z8(2,xw),z8(3,fo),z8(4,fs),z8(5,u9)],q8),V8=class extends Ie{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===tR.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=K8.getConfiguredCommandHistoryLength(this.configurationService),K8.cache&&K8.cache.limit!==this.configuredCommandsHistoryLength&&(K8.cache.limit=this.configuredCommandsHistoryLength,K8.hasChanges=!0))}load(){const e=this.storageService.get(K8.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=K8.cache=new Ls(this.configuredCommandsHistoryLength,1);if(t){let e;e=t.usesLRU?t.entries:t.entries.sort((e,t)=>e.value-t.value),e.forEach(e=>i.set(e.key,e.value))}K8.counter=this.storageService.getNumber(K8.PREF_KEY_COUNTER,0,K8.counter)}push(e){K8.cache&&(K8.cache.set(e,K8.counter++),K8.hasChanges=!0)}peek(e){return K8.cache?.peek(e)}saveState(){if(!K8.cache)return;if(!K8.hasChanges)return;const e={usesLRU:!0,entries:[]};K8.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(K8.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(K8.PREF_KEY_COUNTER,K8.counter,0,0),K8.hasChanges=!1}static getConfiguredCommandHistoryLength(e){const t=e.getValue().workbench?.commandPalette?.history;return"number"==typeof t?t:K8.DEFAULT_COMMANDS_HISTORY_LENGTH}},K8=V8,V8.DEFAULT_COMMANDS_HISTORY_LENGTH=50,V8.PREF_KEY_CACHE="commandPalette.mru.cache",V8.PREF_KEY_COUNTER="commandPalette.mru.counter",V8.counter=1,V8.hasChanges=!1,j8=V8,j8=K8=H8([z8(0,eR),z8(1,ka),z8(2,Ks)],j8),$8=class extends q8{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions()){let e;i.metadata?.description&&(e=Cwe(i.metadata.description)?i.metadata.description:{original:i.metadata.description,value:i.metadata.description}),t.push({commandId:i.id,commandAlias:i.alias,commandDescription:e,label:Pbe(i.label)||i.id})}return t}},G8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Z8=function(e,t){return function(i,n){t(i,n,e)}},Y8=class extends $8{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,o,s){super({showAlias:!1},e,i,n,o,s),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}},Y8=G8([Z8(0,Jn),Z8(1,eo),Z8(2,xw),Z8(3,fo),Z8(4,fs),Z8(5,u9)],Y8),(Q8=class e extends rr{constructor(){super({id:e.ID,label:K7.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:jl.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(tA).quickAccess.show(Y8.PREFIX)}}).ID="editor.action.quickCommand",kue(Q8),ts.as(r8.Quickaccess).registerQuickAccessProvider({ctor:Y8,prefix:Y8.PREFIX,helpEntries:[{description:K7.quickCommandHelp,commandId:Q8.ID}]}),X8=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},J8=function(e,t){return function(i,n){t(i,n,e)}},eee=class extends pq{constructor(e,t,i,n,o,s,r){super(!0,e,t,i,n,o,s,r)}},eee=X8([J8(1,es),J8(2,eo),J8(3,Xv),J8(4,Jn),J8(5,eR),J8(6,ka)],eee),Iue(pq.ID,eee,4),tee=class{constructor(e,t,i,n,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}},iee=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/,nee=class{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(iee);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=eh.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}},oee=class{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];const t=[];let i=0;for(let n=0,o=e.length;n<o;n++){const o=e[n];let s=-1;if("string"==typeof o.fontStyle){s=0;const e=o.fontStyle.split(" ");for(let t=0,i=e.length;t<i;t++)switch(e[t]){case"italic":s|=1;break;case"bold":s|=2;break;case"underline":s|=4;break;case"strikethrough":s|=8}}let r=null;"string"==typeof o.foreground&&(r=o.foreground);let a=null;"string"==typeof o.background&&(a=o.background),t[i++]=new tee(o.token||"",n,s,r,a)}return t}(e),t)}static createFromParsedTokenTheme(e,t){return function(e,t){e.sort((e,t)=>{const i=function(e,t){return e<t?-1:e>t?1:0}(e.token,t.token);return 0!==i?i:e.index-t.index});let i=0,n="000000",o="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(o=t.background)}const s=new nee;for(const d of t)s.getId(d);const r=s.getId(n),a=s.getId(o),l=new aee(new ree(i,r,a));for(let d=0,c=e.length;d<c;d++){const t=e[d];l.insert(t.token,t.fontStyle,s.getId(t.foreground),s.getId(t.background))}return new oee(s,l)}(e,t)}constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(void 0===i){const e=this._match(t),n=function(e){const t=e.match(see);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}(t);i=(e.metadata|n<<8)>>>0,this._cache.set(t,i)}return(i|e|0)>>>0}},see=/\b(comment|string|regex|regexp)\b/,ree=class e{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new e(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}},aee=class e{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;const t=e.indexOf(".");let i,n;-1===t?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const o=this._children.get(i);return void 0!==o?o.match(n):this._mainRule}insert(t,i,n,o){if(""===t)return void this._mainRule.acceptOverwrite(i,n,o);const s=t.indexOf(".");let r,a;-1===s?(r=t,a=""):(r=t.substring(0,s),a=t.substring(s+1));let l=this._children.get(r);void 0===l&&(l=new e(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,i,n,o)}},lee={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[wh]:"#FFFFFE",[Ch]:"#000000",[Ph]:"#E5EBF1",[Bf]:"#D3D3D3",[qf]:"#939393",[Fh]:"#ADD6FF4D"}},dee={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[wh]:"#1E1E1E",[Ch]:"#D4D4D4",[Ph]:"#3A3D41",[Bf]:"#404040",[qf]:"#707070",[Fh]:"#ADD6FF26"}},cee={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[wh]:"#000000",[Ch]:"#FFFFFF",[Bf]:"#FFFFFF",[qf]:"#FFFFFF"}},hee={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[wh]:"#FFFFFF",[Ch]:"#292929",[Bf]:"#292929",[qf]:"#292929"}},uee=class{getIcon(e){const t=awe();let i=e.defaults;for(;mo.isThemeIcon(i);){const e=t.getIcon(i.id);if(!e)return;i=e.defaults}return i}},gee="vs-dark",pee="hc-black",mee="hc-light",fee=ts.as(th.ColorContribution),_ee=ts.as(xf.ThemingContribution),bee=class{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(gke(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,eh.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=pke(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,eh.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);return i||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=fee.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case"vs":return Kp.LIGHT;case pee:return Kp.HIGH_CONTRAST_DARK;case mee:return Kp.HIGH_CONTRAST_LIGHT;default:return Kp.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const i=pke(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=oee.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=cl.getForeground(n),s=cl.getFontStyle(n);return{foreground:o,italic:Boolean(1&s),bold:Boolean(2&s),underline:Boolean(4&s),strikethrough:Boolean(8&s)}}get tokenColorMap(){return[]}},vee=class extends Ie{constructor(){super(),this._onColorThemeChange=this._register(new je),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new je),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new uee,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set("vs",mke("vs")),this._knownThemes.set(gee,mke(gee)),this._knownThemes.set(pee,mke(pee)),this._knownThemes.set(mee,mke(mee));const e=this._register(function(e){const t=new De,i=t.add(new je),n=awe();return t.add(n.onDidChange(()=>i.fire())),e&&t.add(e.onDidProductIconThemeChange(()=>i.fire())),{dispose:()=>t.dispose(),onDidChange:i.event,getCSS(){const t=e?e.getProductIconTheme():new uee,i={},o=new HL,s=new HL;for(const e of n.getIcons()){const n=t.getIcon(e);if(!n)continue;const r=n.font,a=ebe`--vscode-icon-${J_e(e.id)}-font-family`,l=ebe`--vscode-icon-${J_e(e.id)}-content`;r?(i[r.id]=r.definition,s.push(ebe`${a}: ${Q_e(r.id)};`,ebe`${l}: ${Q_e(n.fontCharacter)};`),o.push(ebe`.codicon-${J_e(e.id)}:before { content: ${Q_e(n.fontCharacter)}; font-family: ${Q_e(r.id)}; }`)):(s.push(ebe`${l}: ${Q_e(n.fontCharacter)}; ${a}: 'codicon';`),o.push(ebe`.codicon-${J_e(e.id)}:before { content: ${Q_e(n.fontCharacter)}; }`))}for(const e in i){const t=i[e],n=t.weight?ebe`font-weight: ${Y_e(t.weight)};`:ebe``,s=t.style?ebe`font-style: ${Y_e(t.style)};`:ebe``,r=new HL;for(const e of t.src)r.push(ebe`${X_e(e.location)} format(${Q_e(e.format)})`);o.push(ebe`@font-face { src: ${r.join(", ")}; font-family: ${Q_e(e)};${n}${s} font-display: block; }`)}return o.push(ebe`:root { ${s.join(" ")} }`),o.join("\n")}}}(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme("vs"),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Uae(r,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return _he(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=npe(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),Ie.None}_registerShadowDomContainer(e){const t=npe(e,e=>{e.className="monaco-colors",e.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let e=0;e<this._styleElements.length;e++)if(this._styleElements[e]===t)return void this._styleElements.splice(e,1)}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!gke(t.base)&&!gke(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new bee(e,t)),gke(e)&&this._knownThemes.forEach(t=>{t.base===e&&t.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get("vs"),this._updateActualTheme(t)}_updateActualTheme(e){e&&this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=r.matchMedia("(forced-colors: active)").matches;if(e!==Npe(this._theme.type)){let t;t=Epe(this._theme.type)?e?pee:gee:e?mee:"vs",this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};_ee.getThemingParticipants().forEach(e=>e(this._theme,i,this._environment));const n=[];for(const s of fee.getColors()){const e=this._theme.getColor(s.id,!0);e&&n.push(`${upe(s.id)}: ${e.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join("\n")} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){const t=[];for(let i=1,n=e.length;i<n;i++){const n=e[i];t[i]=`.mtk${i} { color: ${n}; }`}return t.push(".mtki { font-style: italic; }"),t.push(".mtkb { font-weight: bold; }"),t.push(".mtku { text-decoration: underline; text-underline-position: under; }"),t.push(".mtks { text-decoration: line-through; }"),t.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),t.join("\n")}(o)),i.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"),this._themeCSS=e.join("\n"),this._updateCSS(),Mb.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}},kue(class extends rr{constructor(){super({id:"editor.action.toggleHighContrast",label:$7.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Q7),n=i.getColorTheme();Npe(n.type)?(i.setTheme(this._originalThemeName||(Epe(n.type)?"vs-dark":"vs")),this._originalThemeName=null):(i.setTheme(Epe(n.type)?pee:mee),this._originalThemeName=n.themeName)}}),function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(wee||(wee={})),function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"}(Cee||(Cee={})),function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(yee||(yee={})),function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Tool=27]="Tool",e[e.Snippet=28]="Snippet"}(See||(See={})),function(e){e[e.Deprecated=1]="Deprecated"}(xee||(xee={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(kee||(kee={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(Lee||(Lee={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(Dee||(Dee={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Iee||(Iee={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(Nee||(Nee={})),function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"}(Eee||(Eee={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.allowOverflow=4]="allowOverflow",e[e.allowVariableLineHeights=5]="allowVariableLineHeights",e[e.allowVariableFonts=6]="allowVariableFonts",e[e.allowVariableFontsInAccessibilityMode=7]="allowVariableFontsInAccessibilityMode",e[e.ariaLabel=8]="ariaLabel",e[e.ariaRequired=9]="ariaRequired",e[e.autoClosingBrackets=10]="autoClosingBrackets",e[e.autoClosingComments=11]="autoClosingComments",e[e.screenReaderAnnounceInlineSuggestion=12]="screenReaderAnnounceInlineSuggestion",e[e.autoClosingDelete=13]="autoClosingDelete",e[e.autoClosingOvertype=14]="autoClosingOvertype",e[e.autoClosingQuotes=15]="autoClosingQuotes",e[e.autoIndent=16]="autoIndent",e[e.autoIndentOnPaste=17]="autoIndentOnPaste",e[e.autoIndentOnPasteWithinString=18]="autoIndentOnPasteWithinString",e[e.automaticLayout=19]="automaticLayout",e[e.autoSurround=20]="autoSurround",e[e.bracketPairColorization=21]="bracketPairColorization",e[e.guides=22]="guides",e[e.codeLens=23]="codeLens",e[e.codeLensFontFamily=24]="codeLensFontFamily",e[e.codeLensFontSize=25]="codeLensFontSize",e[e.colorDecorators=26]="colorDecorators",e[e.colorDecoratorsLimit=27]="colorDecoratorsLimit",e[e.columnSelection=28]="columnSelection",e[e.comments=29]="comments",e[e.contextmenu=30]="contextmenu",e[e.copyWithSyntaxHighlighting=31]="copyWithSyntaxHighlighting",e[e.cursorBlinking=32]="cursorBlinking",e[e.cursorSmoothCaretAnimation=33]="cursorSmoothCaretAnimation",e[e.cursorStyle=34]="cursorStyle",e[e.cursorSurroundingLines=35]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=36]="cursorSurroundingLinesStyle",e[e.cursorWidth=37]="cursorWidth",e[e.cursorHeight=38]="cursorHeight",e[e.disableLayerHinting=39]="disableLayerHinting",e[e.disableMonospaceOptimizations=40]="disableMonospaceOptimizations",e[e.domReadOnly=41]="domReadOnly",e[e.dragAndDrop=42]="dragAndDrop",e[e.dropIntoEditor=43]="dropIntoEditor",e[e.editContext=44]="editContext",e[e.emptySelectionClipboard=45]="emptySelectionClipboard",e[e.experimentalGpuAcceleration=46]="experimentalGpuAcceleration",e[e.experimentalWhitespaceRendering=47]="experimentalWhitespaceRendering",e[e.extraEditorClassName=48]="extraEditorClassName",e[e.fastScrollSensitivity=49]="fastScrollSensitivity",e[e.find=50]="find",e[e.fixedOverflowWidgets=51]="fixedOverflowWidgets",e[e.folding=52]="folding",e[e.foldingStrategy=53]="foldingStrategy",e[e.foldingHighlight=54]="foldingHighlight",e[e.foldingImportsByDefault=55]="foldingImportsByDefault",e[e.foldingMaximumRegions=56]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=57]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=58]="fontFamily",e[e.fontInfo=59]="fontInfo",e[e.fontLigatures=60]="fontLigatures",e[e.fontSize=61]="fontSize",e[e.fontWeight=62]="fontWeight",e[e.fontVariations=63]="fontVariations",e[e.formatOnPaste=64]="formatOnPaste",e[e.formatOnType=65]="formatOnType",e[e.glyphMargin=66]="glyphMargin",e[e.gotoLocation=67]="gotoLocation",e[e.hideCursorInOverviewRuler=68]="hideCursorInOverviewRuler",e[e.hover=69]="hover",e[e.inDiffEditor=70]="inDiffEditor",e[e.inlineSuggest=71]="inlineSuggest",e[e.letterSpacing=72]="letterSpacing",e[e.lightbulb=73]="lightbulb",e[e.lineDecorationsWidth=74]="lineDecorationsWidth",e[e.lineHeight=75]="lineHeight",e[e.lineNumbers=76]="lineNumbers",e[e.lineNumbersMinChars=77]="lineNumbersMinChars",e[e.linkedEditing=78]="linkedEditing",e[e.links=79]="links",e[e.matchBrackets=80]="matchBrackets",e[e.minimap=81]="minimap",e[e.mouseStyle=82]="mouseStyle",e[e.mouseWheelScrollSensitivity=83]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=84]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=85]="multiCursorMergeOverlapping",e[e.multiCursorModifier=86]="multiCursorModifier",e[e.mouseMiddleClickAction=87]="mouseMiddleClickAction",e[e.multiCursorPaste=88]="multiCursorPaste",e[e.multiCursorLimit=89]="multiCursorLimit",e[e.occurrencesHighlight=90]="occurrencesHighlight",e[e.occurrencesHighlightDelay=91]="occurrencesHighlightDelay",e[e.overtypeCursorStyle=92]="overtypeCursorStyle",e[e.overtypeOnPaste=93]="overtypeOnPaste",e[e.overviewRulerBorder=94]="overviewRulerBorder",e[e.overviewRulerLanes=95]="overviewRulerLanes",e[e.padding=96]="padding",e[e.pasteAs=97]="pasteAs",e[e.parameterHints=98]="parameterHints",e[e.peekWidgetDefaultFocus=99]="peekWidgetDefaultFocus",e[e.placeholder=100]="placeholder",e[e.definitionLinkOpensInPeek=101]="definitionLinkOpensInPeek",e[e.quickSuggestions=102]="quickSuggestions",e[e.quickSuggestionsDelay=103]="quickSuggestionsDelay",e[e.readOnly=104]="readOnly",e[e.readOnlyMessage=105]="readOnlyMessage",e[e.renameOnType=106]="renameOnType",e[e.renderRichScreenReaderContent=107]="renderRichScreenReaderContent",e[e.renderControlCharacters=108]="renderControlCharacters",e[e.renderFinalNewline=109]="renderFinalNewline",e[e.renderLineHighlight=110]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=111]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=112]="renderValidationDecorations",e[e.renderWhitespace=113]="renderWhitespace",e[e.revealHorizontalRightPadding=114]="revealHorizontalRightPadding",e[e.roundedSelection=115]="roundedSelection",e[e.rulers=116]="rulers",e[e.scrollbar=117]="scrollbar",e[e.scrollBeyondLastColumn=118]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=119]="scrollBeyondLastLine",e[e.scrollPredominantAxis=120]="scrollPredominantAxis",e[e.selectionClipboard=121]="selectionClipboard",e[e.selectionHighlight=122]="selectionHighlight",e[e.selectionHighlightMaxLength=123]="selectionHighlightMaxLength",e[e.selectionHighlightMultiline=124]="selectionHighlightMultiline",e[e.selectOnLineNumbers=125]="selectOnLineNumbers",e[e.showFoldingControls=126]="showFoldingControls",e[e.showUnused=127]="showUnused",e[e.snippetSuggestions=128]="snippetSuggestions",e[e.smartSelect=129]="smartSelect",e[e.smoothScrolling=130]="smoothScrolling",e[e.stickyScroll=131]="stickyScroll",e[e.stickyTabStops=132]="stickyTabStops",e[e.stopRenderingLineAfter=133]="stopRenderingLineAfter",e[e.suggest=134]="suggest",e[e.suggestFontSize=135]="suggestFontSize",e[e.suggestLineHeight=136]="suggestLineHeight",e[e.suggestOnTriggerCharacters=137]="suggestOnTriggerCharacters",e[e.suggestSelection=138]="suggestSelection",e[e.tabCompletion=139]="tabCompletion",e[e.tabIndex=140]="tabIndex",e[e.trimWhitespaceOnDelete=141]="trimWhitespaceOnDelete",e[e.unicodeHighlighting=142]="unicodeHighlighting",e[e.unusualLineTerminators=143]="unusualLineTerminators",e[e.useShadowDOM=144]="useShadowDOM",e[e.useTabStops=145]="useTabStops",e[e.wordBreak=146]="wordBreak",e[e.wordSegmenterLocales=147]="wordSegmenterLocales",e[e.wordSeparators=148]="wordSeparators",e[e.wordWrap=149]="wordWrap",e[e.wordWrapBreakAfterCharacters=150]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=151]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=152]="wordWrapColumn",e[e.wordWrapOverride1=153]="wordWrapOverride1",e[e.wordWrapOverride2=154]="wordWrapOverride2",e[e.wrappingIndent=155]="wrappingIndent",e[e.wrappingStrategy=156]="wrappingStrategy",e[e.showDeprecated=157]="showDeprecated",e[e.inertialScroll=158]="inertialScroll",e[e.inlayHints=159]="inlayHints",e[e.wrapOnEscapedLineFeeds=160]="wrapOnEscapedLineFeeds",e[e.effectiveCursorStyle=161]="effectiveCursorStyle",e[e.editorClassName=162]="editorClassName",e[e.pixelRatio=163]="pixelRatio",e[e.tabFocusMode=164]="tabFocusMode",e[e.layoutInfo=165]="layoutInfo",e[e.wrappingInfo=166]="wrappingInfo",e[e.defaultColorDecorators=167]="defaultColorDecorators",e[e.colorDecoratorsActivatedOn=168]="colorDecoratorsActivatedOn",e[e.inlineCompletionsAccessibilityVerbose=169]="inlineCompletionsAccessibilityVerbose",e[e.effectiveEditContext=170]="effectiveEditContext",e[e.scrollOnMiddleClick=171]="scrollOnMiddleClick",e[e.effectiveAllowVariableFonts=172]="effectiveAllowVariableFonts"}(Mee||(Mee={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(Tee||(Tee={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(Ree||(Ree={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=3]="Right"}(Oee||(Oee={})),function(e){e[e.Increase=0]="Increase",e[e.Decrease=1]="Decrease"}(Aee||(Aee={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(Pee||(Pee={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(Fee||(Fee={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(Wee||(Wee={})),function(e){e[e.Accepted=0]="Accepted",e[e.Rejected=1]="Rejected",e[e.Ignored=2]="Ignored"}(Bee||(Bee={})),function(e){e[e.Code=1]="Code",e[e.Label=2]="Label"}(Vee||(Vee={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(Hee||(Hee={})),function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"}(zee||(zee={})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(Uee||(Uee={})),function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(Kee||(Kee={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(qee||(qee={})),function(e){e[e.Normal=1]="Normal",e[e.Underlined=2]="Underlined"}(jee||(jee={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}($ee||($ee={})),function(e){e[e.AIGenerated=1]="AIGenerated"}(Gee||(Gee={})),function(e){e[e.Invoke=0]="Invoke",e[e.Automatic=1]="Automatic"}(Zee||(Zee={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(Yee||(Yee={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(Qee||(Qee={})),function(e){e[e.Word=0]="Word",e[e.Line=1]="Line",e[e.Suggest=2]="Suggest"}(Xee||(Xee={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"}(Jee||(Jee={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(ete||(ete={})),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(tte||(tte={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(ite||(ite={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(nte||(nte={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(ote||(ote={})),function(e){e.Off="off",e.OnCode="onCode",e.On="on"}(ste||(ste={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(rte||(rte={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(ate||(ate={})),function(e){e[e.Deprecated=1]="Deprecated"}(lte||(lte={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(dte||(dte={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(cte||(cte={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(hte||(hte={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(ute||(ute={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(gte||(gte={})),(pte=mte=class{static chord(e,t){return vle(e,t)}}).CtrlCmd=2048,pte.Shift=1024,pte.Alt=512,pte.WinCtrl=256,fte="default",_te=!1,bte=class{constructor(e,t,i,n,o){this.vsWorker=e,this.req=t,this.channel=i,this.method=n,this.args=o,this.type=0}},vte=class{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}},wte=class{constructor(e,t,i,n,o){this.vsWorker=e,this.req=t,this.channel=i,this.eventName=n,this.arg=o,this.type=2}},Cte=class{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}},yte=class{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}},Ste=class{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}async sendMessage(e,t,i){const n=String(++this._lastSentReq);return new Promise((o,s)=>{this._pendingReplies[n]={resolve:o,reject:s},this._send(new bte(this._workerId,n,e,t,i))})}listen(e,t,i){let n=null;const o=new je({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,o),this._send(new wte(this._workerId,n,e,t,i))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new yte(this._workerId,n)),n=null}});return o.event}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}createProxyToRemoteChannel(e,t){return new Proxy(Object.create(null),{get:(i,n)=>("string"!=typeof n||i[n]||(vke(n)?i[n]=t=>this.listen(e,n,t):bke(n)?i[n]=this.listen(e,n,void 0):36===n.charCodeAt(0)&&(i[n]=async(...i)=>(await(t?.()),this.sendMessage(e,n,i)))),i[n])})}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq])return void console.warn("Got reply to unknown seq");const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;if(e.err.$isError){const t=new Error;t.name=e.err.name,t.message=e.err.message,t.stack=e.err.stack,i=t}return void t.reject(i)}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.channel,e.method,e.args).then(e=>{this._send(new vte(this._workerId,t,e,void 0))},e=>{e.detail instanceof Error&&(e.detail=Zae(e.detail)),this._send(new vte(this._workerId,t,void 0,Zae(e)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.channel,e.eventName,e.arg)(e=>{this._send(new Cte(this._workerId,t,e))});this._pendingEvents.set(t,i)}_handleEventMessage(e){this._pendingEmitters.has(e.req)?this._pendingEmitters.get(e.req).fire(e.event):console.warn("Got event for unknown req")}_handleUnsubscribeEventMessage(e){this._pendingEvents.has(e.req)?(this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)):console.warn("Got unsubscribe for unknown req")}_send(e){const t=[];if(0===e.type)for(let i=0;i<e.args.length;i++){const n=e.args[i];n instanceof ArrayBuffer&&t.push(n)}else 1===e.type&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}},xte=class extends Ie{constructor(e){super(),this._localChannels=new Map,this._worker=this._register(e),this._register(this._worker.onMessage(e=>{this._protocol.handleMessage(e)})),this._register(this._worker.onError(e=>{_ke(e),$ae(e)})),this._protocol=new Ste({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t,i)=>this._handleMessage(e,t,i),handleEvent:(e,t,i)=>this._handleEvent(e,t,i)}),this._protocol.setWorkerId(this._worker.getId()),this._onModuleLoaded=this._protocol.sendMessage(fte,"$initialize",[this._worker.getId()]).then(()=>{}),this.proxy=this._protocol.createProxyToRemoteChannel(fte,async()=>{await this._onModuleLoaded}),this._onModuleLoaded.catch(e=>{this._onError("Worker failed to load ",e)})}_handleMessage(e,t,i){const n=this._localChannels.get(e);if(!n)return Promise.reject(new Error(`Missing channel ${e} on main thread`));const o=n[t];if("function"!=typeof o)return Promise.reject(new Error(`Missing method ${t} on main thread channel ${e}`));try{return Promise.resolve(o.apply(n,i))}catch(Fae){return Promise.reject(Fae)}}_handleEvent(e,t,i){const n=this._localChannels.get(e);if(!n)throw new Error(`Missing channel ${e} on main thread`);if(vke(t)){const o=n[t];if("function"!=typeof o)throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);const s=o.call(n,i);if("function"!=typeof s)throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);return s}if(bke(t)){const i=n[t];if("function"!=typeof i)throw new Error(`Missing event ${t} on main thread channel ${e}.`);return i}throw new Error(`Malformed event name ${t}`)}setChannel(e,t){this._localChannels.set(e,t)}_onError(e,t){console.error(e),console.info(t)}},kte="object"==typeof self&&self.constructor&&"DedicatedWorkerGlobalScope"===self.constructor.name&&void 0!==globalThis.workerttPolicy?globalThis.workerttPolicy:Bpe("defaultWorkerFactory",{createScriptURL:e=>e}),Lte=class e extends Ie{constructor(t){super(),this._onMessage=this._register(new je),this.onMessage=this._onMessage.event,this._onError=this._register(new je),this.onError=this._onError.event,this.id=++e.LAST_WORKER_ID;const i=t instanceof Worker||"then"in t?t:wke(t,this.id);var n;(n=i)&&"function"==typeof n.then?this.worker=i:this.worker=Promise.resolve(i),this.postMessage("-please-ignore-",[]);const o=e=>{this._onError.fire(e)};this.worker.then(e=>{e.onmessage=e=>{this._onMessage.fire(e.data)},e.onmessageerror=e=>{this._onError.fire(e)},"function"==typeof e.addEventListener&&e.addEventListener("error",o)}),this._register(Dle(()=>{this.worker?.then(e=>{e.onmessage=null,e.onmessageerror=null,e.removeEventListener("error",o),e.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(n){$ae(n),$ae(new Error("FAILED to post message to worker",{cause:n}))}})}},Lte.LAST_WORKER_ID=0,Dte=class{constructor(e,t){this.esmModuleLocation=e,this.label=t}},Ite=class{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,s=e*t;o<s;o++)n[o]=i;this._data=n,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}},Nte=class{constructor(e){let t=0,i=0;for(let o=0,s=e.length;o<s;o++){const[n,s,r]=e[o];s>t&&(t=s),n>i&&(i=n),r>i&&(i=r)}t++,i++;const n=new Ite(i,t,0);for(let o=0,s=e.length;o<s;o++){const[t,i,s]=e[o];n.set(t,i,s)}this._states=n,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}},Ete=null,Mte=null,Tte=class e{static _createLink(e,t,i,n,o){let s=o-1;do{const i=t.charCodeAt(s);if(2!==e.get(i))break;s--}while(s>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(s);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&s--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:s+2},url:t.substring(n,s+1)}}static computeLinks(t,i=function(){return null===Ete&&(Ete=new Nte([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Ete}()){const n=function(){if(null===Mte){Mte=new zr(0);const e=" \t<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…|";for(let i=0;i<36;i++)Mte.set(e.charCodeAt(i),1);const t=".,;:";for(let i=0;i<4;i++)Mte.set(t.charCodeAt(i),2)}return Mte}(),o=[];for(let s=1,r=t.getLineCount();s<=r;s++){const r=t.getLineContent(s),a=r.length;let l=0,d=0,c=0,h=1,u=!1,g=!1,p=!1,m=!1;for(;l<a;){let t=!1;const a=r.charCodeAt(l);if(13===h){let i;switch(a){case 40:u=!0,i=0;break;case 41:i=u?0:1;break;case 91:p=!0,g=!0,i=0;break;case 93:p=!1,i=g?0:1;break;case 123:m=!0,i=0;break;case 125:i=m?0:1;break;case 39:case 34:case 96:i=c===a?1:39===c||34===c||96===c?0:1;break;case 42:i=42===c?1:0;break;case 32:i=p?0:1;break;default:i=n.get(a)}1===i&&(o.push(e._createLink(n,r,s,d,l)),t=!0)}else if(12===h){let e;91===a?(g=!0,e=0):e=n.get(a),1===e?t=!0:h=13}else h=i.nextState(h,a),0===h&&(t=!0);t&&(h=1,u=!1,g=!1,m=!1,d=l+1,c=a),l++}13===h&&o.push(e._createLink(n,r,s,d,a))}return o}},Ote=class{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,n,o){if(e&&t){const i=this.doNavigateValueSet(t,o);if(i)return{range:e,value:i}}if(i&&n){const e=this.doNavigateValueSet(n,o);if(e)return{range:i,value:e}}return null}doNavigateValueSet(e,t){const i=this.numberReplace(e,t);return null!==i?i:this.textReplace(e,t)}numberReplace(e,t){const i=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let n=Number(e);const o=parseFloat(e);return isNaN(n)||isNaN(o)||n!==o?null:0!==n||t?(n=Math.floor(n*i),n+=t?i:-i,String(n/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let n=null;for(let o=0,s=e.length;null===n&&o<s;o++)n=this.valueSetReplace(e[o],t,i);return n}valueSetReplace(e,t,i){let n=e.indexOf(t);return n>=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}},(Rte=Ote).INSTANCE=new Rte,Ate=/^-+|-+$/g,Pte=100,Fte=5,Wte=class{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const i of t)this._acceptDeleteRange(i.range),this._acceptInsertText(new to(i.range.startLineNumber,i.range.startColumn),i.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n<t;n++)i[n]=this._lines[n].length+e;this._lineStarts=new $k(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber!==e.endLineNumber)this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber);else{if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1))}}_acceptInsertText(e,t){if(0===t.length)return;const i=qle(t);if(1===i.length)return void this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));i[i.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]);const n=new Uint32Array(i.length-1);for(let o=1;o<i.length;o++)this._lines.splice(e.lineNumber+o-1,0,i[o]),n[o-1]=i[o].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}},Bte=class extends Ie{constructor(e,t,i=!1){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const e=new mt;e.cancelAndSet(()=>this._checkStopModelSync(),Math.round(3e4)),this._register(e)}}dispose(){for(const e in this._syncedModels)kle(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t=!1){for(const i of e){const e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i)return;if(!t&&i.isTooLargeForSyncing())return;const n=e.toString();this._proxy.$acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new De;o.add(i.onDidChangeContent(e=>{this._proxy.$acceptModelChanged(n.toString(),e)})),o.add(i.onWillDispose(()=>{this._stopModelSync(n)})),o.add(Dle(()=>{this._proxy.$acceptRemovedModel(n)})),this._syncedModels[n]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],kle(t)}},Vte=class{constructor(){this._models=Object.create(null)}getModel(e){return this._models[e]}getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}$acceptNewModel(e){this._models[e.url]=new Hte(_i.parse(e.url),e.lines,e.EOL,e.versionId)}$acceptModelChanged(e,t){this._models[e]&&this._models[e].onEvents(t)}$acceptRemovedModel(e){this._models[e]&&delete this._models[e]}},Hte=class extends Wte{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;i<this._lines.length;i++){const n=this._lines[i],o=this.offsetAt(new to(i+1,1)),s=n.matchAll(e);for(const e of s)(e.index||0===e.index)&&(e.index=e.index+o),t.push(e)}return t}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const i=$ue(e.column,jue(t),this._lines[e.lineNumber-1],0);return i?new mr(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,o="",s=0,r=[];return{*[Symbol.iterator](){for(;;)if(s<r.length){const e=o.substring(r[s].start,r[s].end);s+=1,yield e}else{if(!(n<t.length))break;o=t[n],r=i(o,e),s=0,n+=1}}}}getLineWords(e,t){const i=this._lines[e-1],n=this._wordenize(i,t),o=[];for(const s of n)o.push({word:i.substring(s.start,s.end),startColumn:s.start+1,endColumn:s.end+1});return o}_wordenize(e,t){const i=[];let n;for(t.lastIndex=0;(n=t.exec(e))&&0!==n[0].length;)i.push({start:n.index,end:n.index+n[0].length});return i}getValueInRange(e){if((e=this._validateRange(e)).startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let s=i+1;s<n;s++)o.push(this._lines[s]);return o.push(this._lines[n].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!to.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,n=!1;if(t<1)t=1,i=1,n=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{const e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}},Ute=class e{constructor(e=null){this._foreignModule=e,this._requestHandlerBrand=void 0,this._workerTextModelSyncServer=new Vte}dispose(){}async $ping(){return"pong"}_getModel(e){return this._workerTextModelSyncServer.getModel(e)}getModels(){return this._workerTextModelSyncServer.getModels()}$acceptNewModel(e){this._workerTextModelSyncServer.$acceptNewModel(e)}$acceptModelChanged(e,t){this._workerTextModelSyncServer.$acceptModelChanged(e,t)}$acceptRemovedModel(e){this._workerTextModelSyncServer.$acceptRemovedModel(e)}async $computeUnicodeHighlights(e,t,i){const n=this._getModel(e);return n?B6.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async $findSectionHeaders(e,t){const i=this._getModel(e);return i?Nke(i,t):[]}async $computeDiff(t,i,n,o){const s=this._getModel(t),r=this._getModel(i);return s&&r?e.computeDiff(s,r,n,o):null}static computeDiff(e,t,i,n){const o="advanced"===n?vX.getDefault():vX.getLegacy(),s=e.getLinesContent(),r=t.getLinesContent(),a=o.computeDiff(s,r,i);function l(e){return e.map(e=>[e.original.startLineNumber,e.original.endLineNumberExclusive,e.modified.startLineNumber,e.modified.endLineNumberExclusive,e.innerChanges?.map(e=>[e.originalRange.startLineNumber,e.originalRange.startColumn,e.originalRange.endLineNumber,e.originalRange.endColumn,e.modifiedRange.startLineNumber,e.modifiedRange.startColumn,e.modifiedRange.endLineNumber,e.modifiedRange.endColumn])])}return{identical:!(a.changes.length>0)&&this._modelsAreIdentical(e,t),quitEarly:a.hitTimeout,changes:l(a.changes),moves:a.moves.map(e=>[e.lineRangeMapping.original.startLineNumber,e.lineRangeMapping.original.endLineNumberExclusive,e.lineRangeMapping.modified.startLineNumber,e.lineRangeMapping.modified.endLineNumberExclusive,l(e.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++)if(e.getLineContent(n)!==t.getLineContent(n))return!1;return!0}async $computeMoreMinimalEdits(t,i,n){const o=this._getModel(t);if(!o)return i;const s=[];let r;i=i.slice(0).sort((e,t)=>e.range&&t.range?mr.compareRangesUsingStarts(e.range,t.range):(e.range?0:1)-(t.range?0:1));let a=0;for(let e=1;e<i.length;e++)mr.getEndPosition(i[a].range).equals(mr.getStartPosition(i[e].range))?(i[a].range=mr.fromPositions(mr.getStartPosition(i[a].range),mr.getEndPosition(i[e].range)),i[a].text+=i[e].text):(a++,i[a]=i[e]);i.length=a+1;for(let{range:l,text:d,eol:c}of i){if("number"==typeof c&&(r=c),mr.isEmpty(l)&&!d)continue;const t=o.getValueInRange(l);if(d=d.replace(/\r\n|\n|\r/g,o.eol),t===d)continue;if(Math.max(d.length,t.length)>e._diffLimit){s.push({range:l,text:d});continue}const i=qCe(t,d,n),a=o.offsetAt(mr.lift(l).getStartPosition());for(const e of i){const t=o.positionAt(a+e.originalStart),i=o.positionAt(a+e.originalStart+e.originalLength),n={text:d.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}};o.getValueInRange(n.range)!==n.text&&s.push(n)}}return"number"==typeof r&&s.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}async $computeLinks(e){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?Tte.computeLinks(e):[]}(t):null}async $computeDefaultDocumentColors(e){const t=this._getModel(e);return t?Ike(t):null}async $textualSuggest(t,i,n,o){const s=new Fe,r=new RegExp(n,o),a=new Set;e:for(const l of t){const t=this._getModel(l);if(t)for(const n of t.words(r))if(n!==i&&isNaN(Number(n))&&(a.add(n),a.size>e._suggestionsLimit))break e}return{words:Array.from(a),duration:s.elapsed()}}async $computeWordRanges(e,t,i,n){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,n),r=Object.create(null);for(let a=t.startLineNumber;a<t.endLineNumber;a++){const e=o.getLineWords(a,s);for(const t of e){if(!isNaN(Number(t.word)))continue;let e=r[t.word];e||(e=[],r[t.word]=e),e.push({startLineNumber:a,startColumn:t.startColumn,endLineNumber:a,endColumn:t.endColumn})}}return r}async $navigateValueSet(e,t,i,n,o){const s=this._getModel(e);if(!s)return null;const r=new RegExp(n,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const a=s.getValueInRange(t),l=s.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},r);if(!l)return null;const d=s.getValueInRange(l);return Ote.INSTANCE.navigateValueSet(t,a,l,d,i)}$fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(Fae){return Promise.reject(Fae)}}},(zte=Ute)._diffLimit=1e5,zte._suggestionsLimit=1e4,"function"==typeof importScripts&&(globalThis.monaco=fke()),(Kte=class e{static getChannel(t){return t.getChannel(e.CHANNEL_NAME)}static setChannel(t,i){t.setChannel(e.CHANNEL_NAME,i)}}).CHANNEL_NAME="editorWorkerHost",qte=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jte=function(e,t){return function(i,n){t(i,n,e)}},$te=3e5,Gte=class extends Ie{constructor(e,t,i,n,o,s){super(),this._languageConfigurationService=o,this._modelService=t,this._workerManager=this._register(new Yte(e,this._modelService)),this._logService=n,this._register(s.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:async(e,t)=>{if(!Mke(this._modelService,e.uri))return Promise.resolve({links:[]});const i=await(await this._workerWithResources([e.uri])).$computeLinks(e.uri.toString());return i&&{links:i}}})),this._register(s.completionProvider.register("*",new Zte(this._workerManager,i,this._modelService,this._languageConfigurationService,this._logService)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return Mke(this._modelService,e)}async computedUnicodeHighlights(e,t,i){return(await this._workerWithResources([e])).$computeUnicodeHighlights(e.toString(),t,i)}async computeDiff(e,t,i,n){const o=await(await this._workerWithResources([e,t],!0)).$computeDiff(e.toString(),t.toString(),i,n);return o?{identical:o.identical,quitEarly:o.quitEarly,changes:s(o.changes),moves:o.moves.map(e=>new iX(new WE(new Qw(e[0],e[1]),new Qw(e[2],e[3])),s(e[4])))}:null;function s(e){return e.map(e=>new BE(new Qw(e[0],e[1]),new Qw(e[2],e[3]),e[4]?.map(e=>new VE(new mr(e[0],e[1],e[2],e[3]),new mr(e[4],e[5],e[6],e[7])))))}}async computeMoreMinimalEdits(e,t,i=!1){if(sce(t)){if(!Mke(this._modelService,e))return Promise.resolve(t);const n=Fe.create(),o=this._workerWithResources([e]).then(n=>n.$computeMoreMinimalEdits(e.toString(),t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([o,Tle(1e3).then(()=>t)])}return Promise.resolve(void 0)}canNavigateValueSet(e){return Mke(this._modelService,e)}async navigateValueSet(e,t,i){const n=this._modelService.getModel(e);if(!n)return null;const o=this._languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),s=o.source,r=o.flags;return(await this._workerWithResources([e])).$navigateValueSet(e.toString(),t,i,s,r)}canComputeWordRanges(e){return Mke(this._modelService,e)}async computeWordRanges(e,t){const i=this._modelService.getModel(e);if(!i)return Promise.resolve(null);const n=this._languageConfigurationService.getLanguageConfiguration(i.getLanguageId()).getWordDefinition(),o=n.source,s=n.flags;return(await this._workerWithResources([e])).$computeWordRanges(e.toString(),t,o,s)}async findSectionHeaders(e,t){return(await this._workerWithResources([e])).$findSectionHeaders(e.toString(),t)}async computeDefaultDocumentColors(e){return(await this._workerWithResources([e])).$computeDefaultDocumentColors(e.toString())}async _workerWithResources(e,t=!1){return await(await this._workerManager.withWorker()).workerWithSyncedResources(e,t)}},Gte=qte([jte(1,io),jte(2,S3),jte(3,Ks),jte(4,il),jte(5,Tx)],Gte),Zte=class{constructor(e,t,i,n,o){this.languageConfigurationService=n,this.logService=o,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){const i=this._configurationService.getValue(e.uri,t,"editor");if("off"===i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestions)Mke(this._modelService,e.uri)&&n.push(e.uri);else for(const d of this._modelService.getModels())Mke(this._modelService,d.uri)&&(d===e?n.unshift(d.uri):"allDocuments"!==i.wordBasedSuggestions&&d.getLanguageId()!==e.getLanguageId()||n.push(d.uri));if(0===n.length)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),r=s?new mr(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):mr.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column);this.logService.trace("[WordBasedCompletionItemProvider]",`word: "${s?.word||""}", wordDef: "${o}", replace: [${r.toString()}], insert: [${a.toString()}]`);const l=await(await this._workerManager.withWorker()).textualSuggest(n,s?.word,o);return l?{duration:l.duration,suggestions:l.words.map(e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}}))}:void 0}},Yte=class extends Ie{constructor(e,t){super(),this._workerDescriptor=e,this._modelService=t,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime(),this._register(new Nn).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(15e4),r),this._register(this._modelService.onModelRemoved(e=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){this._editorWorkerClient&&0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){this._editorWorkerClient&&(new Date).getTime()-this._lastWorkerUsedTime>$te&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Xte(this._workerDescriptor,!1,this._modelService)),Promise.resolve(this._editorWorkerClient)}},Yte=qte([jte(1,io)],Yte),Qte=class{constructor(e){this._instance=e,this.proxy=this._instance}dispose(){this._instance.dispose()}setChannel(e,t){throw new Error("Not supported")}},Xte=class extends Ie{constructor(e,t,i){super(),this._workerDescriptorOrWorker=e,this._disposed=!1,this._modelService=i,this._keepIdleModels=t,this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register((e=this._workerDescriptorOrWorker,new xte(new Lte(_i.isUri(e)?new Dte(e,t):e)))),Kte.setChannel(this._worker,this._createEditorWorkerHost())}catch(i){_ke(i),this._worker=this._createFallbackLocalWorker()}var e,t;return this._worker}async _getProxy(){try{const e=this._getOrCreateWorker().proxy;return await e.$ping(),e}catch(e){return _ke(e),this._worker=this._createFallbackLocalWorker(),this._worker.proxy}}_createFallbackLocalWorker(){return new Qte(new Ute(null))}_createEditorWorkerHost(){return{$fhr:(e,t)=>this.fhr(e,t)}}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new Bte(e,this._modelService,this._keepIdleModels))),this._modelManager}async workerWithSyncedResources(e,t=!1){if(this._disposed)return Promise.reject(function(){const e=new Error(b);return e.name=e.message,e}());const i=await this._getProxy();return this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i}async textualSuggest(e,t,i){const n=await this.workerWithSyncedResources(e),o=i.source,s=i.flags;return n.$textualSuggest(e.map(e=>e.toString()),t,o,s)}dispose(){super.dispose(),this._disposed=!0}},Xte=qte([jte(2,io)],Xte),Jte=class extends Xte{constructor(e,t){super(t.worker,t.keepIdleModels||!1,e),this._foreignModuleHost=t.host||null,this._foreignProxy=this._getProxy().then(e=>new Proxy({},{get(t,i,n){if("then"!==i){if("string"!=typeof i)throw new Error("Not supported");return(...t)=>e.$fmr(i,t)}}}))}fhr(e,t){if(!this._foreignModuleHost||"function"!=typeof this._foreignModuleHost[e])return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(Fae){return Promise.reject(Fae)}}getProxy(){return this._foreignProxy}withSyncedResources(e){return this.workerWithSyncedResources(e).then(e=>this.getProxy())}},iie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},nie=function(e,t){return function(i,n){t(i,n,e)}},(eie=sie=class{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new rie(e,t);let i=rie.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new rie(e,t),this._entries[i]=n,n)}})._INSTANCE=new eie(5),rie=class e{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(t){return e._equals(this,t)}push(e){return sie.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return sie.create(this.parent,e)}},aie=class e{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new e(this.languageId,this.state)}},(tie=lie=class{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==t)return new die(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new die(e,t);const i=rie.getStackElementId(e);let n=this._entries[i];return n||(n=new die(e,null),this._entries[i]=n,n)}})._INSTANCE=new tie(5),die=class e{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:lie.create(this.stack,this.embeddedLanguageData)}equals(t){return t instanceof e&&!!this.stack.equals(t.stack)&&(null===this.embeddedLanguageData&&null===t.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==t.embeddedLanguageData&&this.embeddedLanguageData.equals(t.embeddedLanguageData))}},cie=class{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new cb(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const o=i.languageId,s=i.state,r=Mb.get(o);if(!r)return this.enterLanguage(o),this.emit(n,""),s;const a=r.tokenize(e,t,s);if(0!==n)for(const l of a.tokens)this._tokens.push(new cb(l.offset+n,l.type,l.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new hb(this._tokens,e)}},hie=class e{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=1024|this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=null!==e?e.length:0,o=t.length,s=null!==i?i.length:0;if(0===n&&0===o&&0===s)return new Uint32Array(0);if(0===n&&0===o)return i;if(0===o&&0===s)return e;const r=new Uint32Array(n+o+s);null!==e&&r.set(e);for(let a=0;a<o;a++)r[n+a]=t[a];return null!==i&&r.set(i,n+o),r}nestedLanguageTokenize(t,i,n,o){const s=n.languageId,r=n.state,a=Mb.get(s);if(!a)return this.enterLanguage(s),this.emit(o,""),r;const l=a.tokenizeEncoded(t,i,r);if(0!==o)for(let e=0,d=l.tokens.length;e<d;e+=2)l.tokens[e]+=o;return this._prependTokens=e._merge(this._prependTokens,this._tokens,l.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,l.endState}finalize(t){return new ub(e._merge(this._prependTokens,this._tokens,null),t)}},uie=oie=class extends Ie{constructor(e,t,i,n,o){super(),this._configurationService=o,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=n,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let s=!1;this._register(Mb.onDidChange(e=>{if(s)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i<n;i++){const n=e.changedLanguages[i];if(this._embeddedLanguages[n]){t=!0;break}}t&&(s=!0,Mb.handleChange([this._languageId]),s=!1)})),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=Mb.get(t);if(i){if(i instanceof oie){const t=i.getLoadStatus();!1===t.loaded&&e.push(t.promise)}}else Mb.isResolved(t)||e.push(Mb.getOrCreate(t))}return 0===e.length?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(e=>{})}}getInitialState(){const e=sie.create(null,this._lexer.start);return lie.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return c_e(this._languageId,i);const n=new cie,o=this._tokenize(e,t,i,n);return n.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return h_e(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new hie(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,n);return n.finalize(o)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=Hke(this._lexer,t.stack.state),!i))throw Bke(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const s of i){if(!Oke(s.action)||"@pop"!==s.action.nextEmbedded&&!s.action.hasEmbeddedEndInCases)continue;o=!0;let i=s.resolveRegex(t.stack.state);const r=i.source;if("^(?:"===r.substr(0,4)&&")"===r.substr(r.length-1,1)){const e=(i.ignoreCase?"i":"")+(i.unicode?"u":"");i=new RegExp(r.substr(4,r.length-5),e)}const a=e.search(i);-1===a||0!==a&&s.matchOnlyAtLineStart||(-1===n||a<n)&&(n=a)}if(!o)throw Bke(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return n}_nestedTokenize(e,t,i,n,o){const s=this._findLeavingNestedLanguageOffset(e,i);if(-1===s){const s=o.nestedLanguageTokenize(e,t,i.embeddedLanguageData,n);return lie.create(i.stack,new aie(i.embeddedLanguageData.languageId,s))}const r=e.substring(0,s);r.length>0&&o.nestedLanguageTokenize(r,!1,i.embeddedLanguageData,n);const a=e.substring(s);return this._myTokenize(a,t,i,n+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,o){o.enterLanguage(this._languageId);const s=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedLanguageData,d=i.stack,c=0,h=null,u=!0;for(;u||c<a;){const i=c,g=d.depth,p=h?h.groups.length:0,m=d.state;let f=null,_=null,b=null,v=null,w=null;if(h){f=h.matches;const e=h.groups.shift();_=e.matched,b=e.action,v=h.rule,0===h.groups.length&&(h=null)}else{if(!u&&c>=a)break;u=!1;let e=this._lexer.tokenizer[m];if(!e&&(e=Hke(this._lexer,m),!e))throw Bke(this._lexer,"tokenizer state is not defined: "+m);const t=r.substr(c);for(const i of e)if((0===c||!i.matchOnlyAtLineStart)&&(f=t.match(i.resolveRegex(m)),f)){_=f[0],b=i.action;break}}if(f||(f=[""],_=""),b||(c<a&&(f=[r.charAt(c)],_=f[0]),b=this._lexer.defaultToken),null===_)break;for(c+=_.length;Tke(b)&&Oke(b)&&b.test;)b=b.test(_,f,m,c===a);let C=null;if("string"==typeof b||Array.isArray(b))C=b;else if(b.group)C=b.group;else if(null!==b.token&&void 0!==b.token){if(C=b.tokenSubst?Vke(this._lexer,b.token,_,f,m):b.token,b.nextEmbedded)if("@pop"===b.nextEmbedded){if(!l)throw Bke(this._lexer,"cannot pop embedded language if not inside one");l=null}else{if(l)throw Bke(this._lexer,"cannot enter embedded language from within an embedded language");w=Vke(this._lexer,b.nextEmbedded,_,f,m)}if(b.goBack&&(c=Math.max(0,c-b.goBack)),b.switchTo&&"string"==typeof b.switchTo){let e=Vke(this._lexer,b.switchTo,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!Hke(this._lexer,e))throw Bke(this._lexer,"trying to switch to a state '"+e+"' that is undefined in rule: "+this._safeRuleName(v));d=d.switchTo(e)}else{if(b.transform&&"function"==typeof b.transform)throw Bke(this._lexer,"action.transform not supported");if(b.next)if("@push"===b.next){if(d.depth>=this._lexer.maxStack)throw Bke(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(m)}else if("@pop"===b.next){if(d.depth<=1)throw Bke(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(v));d=d.pop()}else if("@popall"===b.next)d=d.popall();else{let e=Vke(this._lexer,b.next,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!Hke(this._lexer,e))throw Bke(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(v));d=d.push(e)}}b.log&&"string"==typeof b.log&&Wke(this._lexer,this._lexer.languageId+": "+Vke(this._lexer,b.log,_,f,m))}if(null===C)throw Bke(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(v));const y=i=>{const s=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,r=this._getNestedEmbeddedLanguageData(s);if(c<a){const i=e.substr(c);return this._nestedTokenize(i,t,lie.create(d,r),n+c,o)}return lie.create(d,r)};if(Array.isArray(C)){if(h&&h.groups.length>0)throw Bke(this._lexer,"groups cannot be nested: "+this._safeRuleName(v));if(f.length!==C.length+1)throw Bke(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(v));let e=0;for(let t=1;t<f.length;t++)e+=f[t].length;if(e!==_.length)throw Bke(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(v));h={rule:v,matches:f,groups:[]};for(let t=0;t<C.length;t++)h.groups[t]={action:C[t],matched:f[t+1]};c-=_.length;continue}{if("@rematch"===C&&(c-=_.length,_="",f=null,C="",null!==w))return y(w);if(0===_.length){if(0===a||g!==d.depth||m!==d.state||(h?h.groups.length:0)!==p)continue;throw Bke(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(v))}let e=null;if(Rke(C)&&0===C.indexOf("@brackets")){const t=C.substr(9),i=zke(this._lexer,_);if(!i)throw Bke(this._lexer,"@brackets token returned but no bracket defined as: "+_);e=Fke(i.token+t)}else e=Fke(""===C?"":C+this._lexer.tokenPostfix);i<s&&o.emit(i+n,e)}if(null!==w)return y(w)}return lie.create(d,l)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new aie(e,SS);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),Mb.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=Mb.get(e);return new aie(e,t?t.getInitialState():SS)}},uie=oie=iie([nie(4,ka)],uie),gie=Bpe("standaloneColorizer",{createHTML:e=>e}),pie=class{static colorizeElement(e,t,i,n){const o=(n=n||{}).theme||"vs",s=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const r=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const a=i.firstChild?i.firstChild.nodeValue:"";return i.className+=" "+o,this.colorize(t,a||"",r,n).then(e=>{i.innerHTML=gie?.createHTML(e)??e},e=>console.error(e))}static async colorize(e,t,i,n){const o=e.languageIdCodec;let s=4;n&&"number"==typeof n.tabSize&&(s=n.tabSize),bde(t)&&(t=t.substr(1));const r=qle(t);if(!e.isRegisteredLanguageId(i))return Kke(r,s,o);const a=await Mb.getOrCreate(i);return a?Uke(r,s,a,o):Kke(r,s,o)}static colorizeLine(e,t,i,n,o=4){const s=iv.isBasicASCII(e,t);return Lpe(new Wp(!1,!0,e,!1,s,iv.containsRTL(e,s,i),0,n,[],o,0,0,0,0,-1,"none",!1,!1,null,null,0)).html}static colorizeModelLine(e,t,i=4){const n=e.getLineContent(t);e.tokenization.forceTokenization(t);const o=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),o,i)}},mie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},fie=function(e,t){return function(i,n){t(i,n,e)}},_ie=class extends Ie{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new je),this._onCodeEditorAdd=this._register(new je),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new je),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new je),this._onDiffEditorAdd=this._register(new je),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new je),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Ae,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(t=>t.removeDecorationsByType(e))))}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(const n of this._codeEditorOpenHandlers){const o=await n(e,t,i);if(null!==o)return o}return null}registerCodeEditorOpenHandler(e){return Dle(this._codeEditorOpenHandlers.unshift(e))}},_ie=mie([fie(0,Sf)],_ie),bie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},vie=function(e,t){return function(i,n){t(i,n,e)}},wie=class extends _ie{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(e,t,i)=>t?this.doOpenEditor(t,e):null))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const i=t.resource.scheme;if(i===yi.http||i===yi.https)return Bhe(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}},wie=bie([vie(0,es),vie(1,Sf)],wie),dge(eo,wie,0),Cie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},yie=function(e,t){return function(i,n){t(i,n,e)}},Sie=class{get mainContainer(){return this._codeEditorService.listCodeEditors().at(0)?.getContainerDomNode()??r.document.body}get activeContainer(){return(this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor())?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return rhe(this.mainContainer)}get activeContainerDimension(){return rhe(this.activeContainer)}get containers(){return ice(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=Be.None,this.onDidLayoutActiveContainer=Be.None,this.onDidLayoutContainer=Be.None,this.onDidChangeActiveContainer=Be.None,this.onDidAddContainer=Be.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}},Sie=Cie([yie(0,eo)],Sie),xie=class extends Sie{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}},xie=Cie([yie(1,eo)],xie),dge(_P,Sie,1),kie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Lie=function(e,t){return function(i,n){t(i,n,e)}},Die=0,Iie=class{constructor(e,t,i,n,o,s,r){this.id=++Die,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}},Nie=class{constructor(e,t){this.resourceLabel=e,this.reason=t}},Eie=class{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements)(0===n.reason?e:t).push(n.resourceLabel);const i=[];return e.length>0&&i.push(Vae(2030,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(Vae(2031,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}},Mie=class{constructor(e,t,i,n,o,s,r){this.id=++Die,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=o,this.sourceId=s,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new Eie),this.removedResources.has(t)||this.removedResources.set(t,new Nie(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new Eie),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Nie(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}},Tie=class{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)1===t.type&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new rx(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let r=0,a=this._past.length;r<a;r++,n++){const s=this._past[r];i&&(n>=t||s.id!==e.elements[n])&&(i=!1,o=0),i||1!==s.type||s.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let r=this._future.length-1;r>=0;r--,n++){const o=this._future[r];i&&(n>=t||o.id!==e.elements[n])&&(i=!1,s=r),i||1!==o.type||o.removeResource(this.resourceLabel,this.strResource,0)}-1!==o&&(this._past=this._past.slice(0,o)),-1!==s&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}},Rie=class{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}},(Oie=new Tie("","")).locked=!0,Aie=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join("\n"))}pushElement(e,t=ax.None,i=lx.None){if(0===e.type){const n=qke(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new Iie(e,n,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,o=[],s=[];for(const t of e.resources){const e=qke(t),i=this.getUriComparisonKey(t);n.has(i)||(n.add(i),o.push(e),s.push(i))}1===o.length?this._pushElement(new Iie(e,o[0],s[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new Mie(e,o,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const i=e.resourceLabels[t],n=e.strResources[t];let o;this._editStacks.has(n)?o=this._editStacks.get(n):(o=new Tie(i,n),this._editStacks.set(n,o)),o.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);if(e.hasFutureElements())return null;const i=e.getClosestPastElement();return i?i.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const o of i){const e=new Iie(o,qke(o.resource),this.getUriComparisonKey(o.resource),0,0,0,0);n.set(e.strResource,e)}for(const o of e.strResources)t&&t.has(o)||this._editStacks.get(o).splitPastWorkspaceElement(e,n)}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const o of i){const e=new Iie(o,qke(o.resource),this.getUriComparisonKey(o.resource),0,0,0,0);n.set(e.strResource,e)}for(const o of e.strResources)t&&t.has(o)||this._editStacks.get(o).splitFutureWorkspaceElement(e,n)}removeElements(e){const t="string"==typeof e?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new rx(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),i.hasPastElements()||i.hasFutureElements()||(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.sourceId===e&&(!t||s.sourceOrder>t.sourceOrder)&&(t=s,i=n)}return[t,i]}canUndo(e){if(e instanceof lx){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasPastElements()}_onError(e,t){$ae(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,o){const s=this._acquireLocks(i);let r;try{r=t()}catch(a){return s(),n.dispose(),this._onError(a,e)}return r?r.then(()=>(s(),n.dispose(),o()),t=>(s(),n.dispose(),this._onError(t,e))):(s(),n.dispose(),o())}async _invokeWorkspacePrepare(e){if(void 0===e.actual.prepareUndoRedo)return Ie.None;const t=e.actual.prepareUndoRedo();return void 0===t?Ie.None:t}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(Ie.None);const i=e.actual.prepareUndoRedo();return i?xle(i)?t(i):i.then(e=>t(e)):t(Ie.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||Oie);return new Rie(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new Pie(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new Pie}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,Vae(2032,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,Vae(2033,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const r of i.editStacks)r.getClosestPastElement()!==t&&o.push(r.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,Vae(2034,"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const r of i.editStacks)r.locked&&s.push(r.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,Vae(2035,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,Vae(2036,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const n=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,n,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let o;!function(e){e[e.All=0]="All",e[e.This=1]="This",e[e.Cancel=2]="Cancel"}(o||(o={}));const{result:s}=await this._dialogService.prompt({type:Yv.Info,message:Vae(2037,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:Vae(2038,"&&Undo in {0} Files",i.editStacks.length),run:()=>o.All},{label:Vae(2039,"Undo this &&File"),run:()=>o.This}],cancelButton:{run:()=>o.Cancel}});if(s===o.Cancel)return;if(s===o.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const r=this._checkWorkspaceUndo(e,t,i,!1);if(r)return r.returnValue;n=!0}let o;try{o=await this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const s=this._checkWorkspaceUndo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,n))}_resourceUndo(e,t,i){if(t.isValid){if(e.locked){const e=Vae(2040,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);return void this._notificationService.warn(e)}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new Rie([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof lx){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const n=this._editStacks.get(e),o=n.getClosestPastElement();if(o){if(o.groupId){const[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{}}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:Vae(2041,"Would you like to undo '{0}'?",i.label),primaryButton:Vae(2042,"&&Yes"),cancelButton:Vae(2043,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder<t.sourceOrder)&&(t=s,i=n)}return[t,i]}canRedo(e){if(e instanceof lx){const[,t]=this._findClosestRedoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasFutureElements()}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new Pie(this._redo(e));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new Pie}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,Vae(2044,"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,Vae(2045,"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const r of i.editStacks)r.getClosestFutureElement()!==t&&o.push(r.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,Vae(2046,"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const s=[];for(const r of i.editStacks)r.locked&&s.push(r.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,Vae(2047,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,s.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,Vae(2048,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return n.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(t.isValid){if(e.locked){const e=Vae(2049,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);return void this._notificationService.warn(e)}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new Rie([e]),i,()=>this._continueRedoInGroup(t.groupId))))}e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder<t.groupOrder)&&(t=s,i=n)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);return t?this._redo(t):void 0}redo(e){if(e instanceof lx){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return"string"==typeof e?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[e,t]=this._findClosestRedoElementInGroup(i.groupId);if(i!==e&&t)return this._redo(t)}try{return 1===i.type?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}},Aie=kie([Lie(0,u9),Lie(1,Xv)],Aie),Pie=class{constructor(e){this.returnValue=e}},dge(sx,Aie,1),Fie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Wie=function(e,t){return function(i,n){t(i,n,e)}},Bie=class extends Ie{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new Y3(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}},Bie=Fie([Wie(0,Sf),Wie(1,Ks),Wie(2,La)],Bie),dge(J3,Bie,1),Vie=class{constructor(e,t,i,n,o){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=o}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()&&this.recursive===e.recursive}},Hie=class e{get onDidChange(){return this._onDidChange.event}constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new je}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Dle(()=>{if(i){const e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e,!1);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e,t=!1){const i=[];return this._orderedForEach(e,t,e=>i.push(e.provider)),i}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,!1,e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))}),t}_orderedForEach(e,t,i){this._updateScores(e,t);for(const n of this._entries)n._score>0&&i(n)}_updateScores(t,i){const n=this._notebookInfoResolver?.(t.uri),o=n?new Vie(t.uri,t.getLanguageId(),n.uri,n.type,i):new Vie(t.uri,t.getLanguageId(),void 0,void 0,i);if(!this._lastCandidate?.equals(o)){this._lastCandidate=o;for(const e of this._entries)if(e._score=eke(e.selector,o.uri,o.languageId,Kue(t),o.notebookUri,o.notebookType),jke(e.selector)&&e._score>0){if(!i){for(const e of this._entries)e._score=0;e._score=1e3;break}e._score=0}this._entries.sort(e._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:$ke(e.selector)&&!$ke(t.selector)?1:!$ke(e.selector)&&$ke(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}},dge(Tx,class{constructor(){this.referenceProvider=new Hie(this._score.bind(this)),this.renameProvider=new Hie(this._score.bind(this)),this.newSymbolNamesProvider=new Hie(this._score.bind(this)),this.codeActionProvider=new Hie(this._score.bind(this)),this.definitionProvider=new Hie(this._score.bind(this)),this.typeDefinitionProvider=new Hie(this._score.bind(this)),this.declarationProvider=new Hie(this._score.bind(this)),this.implementationProvider=new Hie(this._score.bind(this)),this.documentSymbolProvider=new Hie(this._score.bind(this)),this.inlayHintsProvider=new Hie(this._score.bind(this)),this.colorProvider=new Hie(this._score.bind(this)),this.codeLensProvider=new Hie(this._score.bind(this)),this.documentFormattingEditProvider=new Hie(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Hie(this._score.bind(this)),this.onTypeFormattingEditProvider=new Hie(this._score.bind(this)),this.signatureHelpProvider=new Hie(this._score.bind(this)),this.hoverProvider=new Hie(this._score.bind(this)),this.documentHighlightProvider=new Hie(this._score.bind(this)),this.multiDocumentHighlightProvider=new Hie(this._score.bind(this)),this.selectionRangeProvider=new Hie(this._score.bind(this)),this.foldingRangeProvider=new Hie(this._score.bind(this)),this.linkProvider=new Hie(this._score.bind(this)),this.inlineCompletionsProvider=new Hie(this._score.bind(this)),this.completionProvider=new Hie(this._score.bind(this)),this.linkedEditingRangeProvider=new Hie(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Hie(this._score.bind(this)),this.documentSemanticTokensProvider=new Hie(this._score.bind(this)),this.documentDropEditProvider=new Hie(this._score.bind(this)),this.documentPasteEditProvider=new Hie(this._score.bind(this))}_score(e){return this._notebookTypeResolver?.(e)}},1),zie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Uie=function(e,t){return function(i,n){t(i,n,e)}},Kie=Ahe,qie=class extends mm{get _targetWindow(){return pn(this._target.targetElements[0])}get _targetDocumentElement(){return pn(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return 2===this._hoverPosition?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,o){if(super(),this._keybindingService=t,this._configurationService=i,this._markdownRenderer=n,this._accessibilityService=o,this._messageListeners=new De,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._maxHeightRatioRelativeToWindow=.5,this._onDispose=this._register(new je),this._onRequestLayout=this._register(new je),this._linkHandler=e.linkHandler,this._target="targetElements"in e.target?e.target:new $ie(e.target),e.style)switch(e.style){case 1:var s,r;e.appearance??(e.appearance={}),(s=e.appearance).compact??(s.compact=!0),(r=e.appearance).showPointer??(r.showPointer=!0);break;case 2:var a;e.appearance??(e.appearance={}),(a=e.appearance).compact??(a.compact=!0)}this._hoverPointer=e.appearance?.showPointer?Kie("div.workbench-hover-pointer"):void 0,this._hover=this._register(new vB(!e.appearance?.skipFadeInAnimation)),this._hover.containerDomNode.classList.add("workbench-hover"),e.appearance?.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),e.position?.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0);const l=e.appearance?.maxHeightRatio;void 0!==l&&l>0&&l<=1&&(this._maxHeightRatioRelativeToWindow=l),this._hoverPosition=void 0===e.position?.hoverPosition?3:lle(e.position.hoverPosition)?e.position.hoverPosition:2,this.onmousedown(this._hover.containerDomNode,e=>e.stopPropagation()),this.onkeydown(this._hover.containerDomNode,e=>{e.equals(9)&&this.dispose()}),this._register(ehe(this._targetWindow,"blur",()=>this.dispose()));const d=Kie("div.hover-row.markdown-hover"),c=Kie("div.hover-contents");if("string"==typeof e.content)c.textContent=e.content,c.style.whiteSpace="pre-wrap";else if(xhe(e.content))c.appendChild(e.content),c.classList.add("html-hover-contents");else{const t=e.content,{element:i}=this._register(this._markdownRenderer.render(t,{actionHandler:this._linkHandler,asyncRenderCallback:()=>{c.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}}));c.appendChild(i)}if(d.appendChild(c),this._hover.contentsDomNode.appendChild(d),e.actions&&e.actions.length>0){const t=Kie("div.hover-row.status-bar"),i=Kie("div.actions");e.actions.forEach(e=>{const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;this._register(wB.render(i,{label:e.label,commandId:e.commandId,run:t=>{e.run(t),this.dispose()},iconClass:e.iconClass},n))}),t.appendChild(i),this._hover.containerDomNode.appendChild(t)}let h;if(this._hoverContainer=Kie("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode),h=!(e.actions&&e.actions.length>0)&&(void 0===e.persistence?.hideOnHover?"string"==typeof e.content||Hbe(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes("</a>"):e.persistence.hideOnHover),e.appearance?.showHoverHint){const e=Kie("div.hover-row.status-bar"),t=Kie("div.info");t.textContent=Vae(1699,"Hold {0} key to mouse over",F?"Option":"Alt"),e.appendChild(t),this._hover.containerDomNode.appendChild(e)}const u=[...this._target.targetElements];h||u.push(this._hoverContainer);const g=this._register(new jie(u));if(this._register(g.onMouseOut(()=>{this._isLocked||this.dispose()})),h){const e=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new jie(e)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=g}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=The(this._hoverContainer,Kie("div")),n=Mhe(this._hoverContainer,Kie("div"));i.tabIndex=0,n.tabIndex=0,this._register(ehe(n,"focus",t=>{e.focus(),t.preventDefault()})),this._register(ehe(i,"focus",e=>{t.focus(),e.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t<e.childNodes.length;t++){const i=e.childNodes.item(e.childNodes.length-t-1);if(i.nodeType===i.ELEMENT_NODE){const e=i;if("number"==typeof e.tabIndex&&e.tabIndex>=0)return e}const n=this.findLastFocusableChild(i);if(n)return n}}render(e){e.appendChild(this._hoverContainer);const t=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&wCe(!0===this._configurationService.getValue("accessibility.verbosity.hover")&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel());t&&Xhe(t),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const{top:e,right:t,bottom:i,left:n}=this._target.targetElements.map(e=>(e=>{const t=dhe(e),i=e.getBoundingClientRect();return{top:i.top*t,bottom:i.bottom*t,right:i.right*t,left:i.left*t}})(e))[0],o=t-n,s=i-e,r={top:e,right:t,bottom:i,left:n,width:o,height:s,center:{x:n+o/2,y:e+s/2}};if(this.adjustHorizontalHoverPosition(r),this.adjustVerticalHoverPosition(r),this.adjustHoverMaxHeight(r),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:r.left+=3,r.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:r.left-=3,r.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:r.top+=3,r.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:r.top-=3,r.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px"}r.center.x=r.left+o/2,r.center.y=r.top+s/2}this.computeXCordinate(r),this.computeYCordinate(r),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(r)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;void 0!==this._target.x?this._x=this._target.x:1===this._hoverPosition?this._x=e.right:0===this._hoverPosition?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._x<this._targetDocumentElement.clientLeft&&(this._x=e.left+2)}computeYCordinate(e){void 0!==this._target.y?this._y=this._target.y:3===this._hoverPosition?this._y=e.top:2===this._hoverPosition?this._y=e.bottom-2:this._hoverPointer?this._y=e.center.y+this._hover.containerDomNode.clientHeight/2:this._y=e.bottom,this._y>this._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(void 0!==this._target.x)return;const t=this._hoverPointer?3:0;if(this._forcePosition){const i=t+2;return void(1===this._hoverPosition?this._hover.containerDomNode.style.maxWidth=this._targetDocumentElement.clientWidth-e.right-i+"px":0===this._hoverPosition&&(this._hover.containerDomNode.style.maxWidth=e.left-i+"px"))}1===this._hoverPosition?this._targetDocumentElement.clientWidth-e.right<this._hover.containerDomNode.clientWidth+t&&(e.left>=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):0===this._hoverPosition&&(e.left<this._hover.containerDomNode.clientWidth+t&&(this._targetDocumentElement.clientWidth-e.right>=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(void 0!==this._target.y||this._forcePosition)return;const t=this._hoverPointer?3:0;3===this._hoverPosition?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):2===this._hoverPosition&&e.bottom+this._hover.containerDomNode.offsetHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight*this._maxHeightRatioRelativeToWindow;if(this._forcePosition){const i=2+(this._hoverPointer?3:0);3===this._hoverPosition?t=Math.min(t,e.top-i):2===this._hoverPosition&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeight<this._hover.contentsDomNode.scrollHeight){const e=`${this._hover.scrollbar.options.verticalScrollbarSize}px`;this._hover.contentsDomNode.style.paddingRight!==e&&(this._hover.contentsDomNode.style.paddingRight=e)}}setHoverPointerPosition(e){if(this._hoverPointer)switch(this._hoverPosition){case 0:case 1:{this._hoverPointer.classList.add(0===this._hoverPosition?"right":"left");const t=this._hover.containerDomNode.clientHeight;t>e.height?this._hoverPointer.style.top=e.center.y-(this._y-t)-3+"px":this._hoverPointer.style.top=Math.round(t/2)-3+"px";break}case 3:case 2:{this._hoverPointer.classList.add(3===this._hoverPosition?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const n=this._x+i;(n<e.left||n>e.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._target.dispose?.(),this._hoverContainer.remove(),this._messageListeners.dispose(),super.dispose()),this._isDisposed=!0}},qie=zie([Uie(1,xw),Uie(2,ka),Uie(3,LA),Uie(4,Fc)],qie),jie=class extends mm{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e,t=200){super(),this._elements=e,this._eventDebounceDelay=t,this._isMouseIn=!0,this._mouseTimer=this._register(new Ne),this._onMouseOut=this._register(new je);for(const i of this._elements)this.onmouseover(i,()=>this._onTargetMouseOver()),this.onmouseleave(i,()=>this._onTargetMouseLeave())}_onTargetMouseOver(){this._isMouseIn=!0,this._mouseTimer.clear()}_onTargetMouseLeave(){this._isMouseIn=!1,this._mouseTimer.value=new pt(()=>this._fireIfMouseOutside(),this._eventDebounceDelay)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}},$ie=class{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}},function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"}(Zie||(Zie={})),(Gie=Yie=class e extends Ie{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=Ie.None,this.toDisposeOnSetContainer=Ie.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Ahe(".context-view"),Fhe(this.view),this.setContainer(e,t),this._register(Dle(()=>this.setContainer(null,1)))}setContainer(t,i){this.useFixedPosition=1!==i;const n=this.useShadowDOM;if(this.useShadowDOM=3===i,(t!==this.container||n!==this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null),this.container=null),t)){if(this.container=t,this.useShadowDOM){this.shadowRootHostElement=Ahe(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=Qie,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Ahe("slot"))}else this.container.appendChild(this.view);const i=new De;e.BUBBLE_UP_EVENTS.forEach(e=>{i.add(xn(this.container,e,e=>{this.onDOMEvent(e,!1)}))}),e.BUBBLE_DOWN_EVENTS.forEach(e=>{i.add(xn(this.container,e,e=>{this.onDOMEvent(e,!0)},!0))}),this.toDisposeOnSetContainer=i}}show(e){this.isVisible()&&this.hide(),Jce(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",Phe(this.view),this.toDisposeOnClean=e.render(this.view)||Ie.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||U&&oe.pointerEvents?(this.delegate?.layout?.(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(xhe(e)){const i=lhe(e),n=dhe(e);t={top:i.top*n,left:i.left*n,width:i.width*n,height:i.height*n}}else t=function(e){const t=e;return!!t&&"number"==typeof t.x&&"number"==typeof t.y}(e)?{top:e.y,left:e.x,width:e.width||1,height:e.height||2}:{top:e.posy,left:e.posx,width:2,height:2};const i=che(this.view),n=ghe(this.view),o=this.delegate.anchorPosition??0,s=this.delegate.anchorAlignment??0,r=this.delegate.anchorAxisAlignment??0;let a,l;const d=She();if(0===r){const e={offset:t.top-d.pageYOffset,size:t.height,position:0===o?0:1},r={offset:t.left,size:t.width,position:0===s?0:1,mode:Zie.ALIGN};a=Gke(d.innerHeight,n,e)+d.pageYOffset,HN.intersects({start:a,end:a+n},{start:e.offset,end:e.offset+e.size})&&(r.mode=Zie.AVOID),l=Gke(d.innerWidth,i,r)}else{const e={offset:t.left,size:t.width,position:0===s?0:1},r={offset:t.top,size:t.height,position:0===o?0:1,mode:Zie.ALIGN};l=Gke(d.innerWidth,i,e),HN.intersects({start:l,end:l+i},{start:e.offset,end:e.offset+e.size})&&(r.mode=Zie.AVOID),a=Gke(d.innerHeight,n,r)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===s?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const c=lhe(this.container),h=this.container.scrollTop||0,u=this.container.scrollLeft||0;this.view.style.top=`${a-(this.useFixedPosition?lhe(this.view).top:c.top)+h}px`,this.view.style.left=`${l-(this.useFixedPosition?lhe(this.view).left:c.left)+u}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Fhe(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,pn(e).document.activeElement):t&&!phe(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}).BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],Gie.BUBBLE_DOWN_EVENTS=["click"],Qie='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Nanum Gothic", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }\n',Xie=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Jie=function(e,t){return function(i,n){t(i,n,e)}},ene=class extends Ie{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Yie(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;n=t?t===this.layoutService.getContainer(pn(t))?1:i?3:2:1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}},ene=Xie([Jie(0,_P)],ene),tne=class extends ene{getContextViewElement(){return this.contextView.getViewElement()}},ine=class{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(sle(e)||xhe(e)||void 0===e)n=e;else{this._cancellationTokenSource=new ot;const o=this._cancellationTokenSource.token;let s;if(s=Zke(e)?fle(e.markdown)?e.markdown(o).then(t=>t??e.markdownNotSupportedFallback):e.markdown??e.markdownNotSupportedFallback:e.element(o),s instanceof Promise?(this._hoverWidget||this.show(Vae(1700,"Loading..."),t,i),n=await s):n=s,this.isDisposed||o.isCancellationRequested)return}this.show(n,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,actions:i?.actions,linkHandler:i?.linkHandler,trapFocus:i?.trapFocus,appearance:{showPointer:"element"===this.hoverDelegate.placement,skipFadeInAnimation:!this.fadeInAnimation||!!n,showHoverHint:i?.appearance?.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(o,t)}n?.dispose()}hasContent(e){return!(!e||Hbe(e)&&!e.value)}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}},nne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},one=function(e,t){return function(i,n){t(i,n,e)}},sne=class extends Ie{constructor(e,t,i,n,o,s){super(),this._instantiationService=e,this._configurationService=t,this._keybindingService=n,this._layoutService=o,this._accessibilityService=s,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(i.onDidShowContextMenu(()=>this.hideHover())),this._contextViewHandler=this._register(new ene(this._layoutService)),this._register(ns.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:0,primary:vle(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(e,t,i,n){const o=this._createHover(e,i);if(o)return this._showHover(o,e,t),o}showDelayedHover(e,t){if(void 0===e.id&&(e.id=Qke(e.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if(this._currentHover?.isLocked)return;if(Yke(this._currentHoverOptions)===Yke(e))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&void 0!==this._currentDelayedHoverGroupId&&this._currentDelayedHoverGroupId===t?.groupId)return this.showInstantHover({...e,appearance:{...e.appearance,skipFadeInAnimation:!0}})}else if(this._currentDelayedHover&&Yke(this._currentHoverOptions)===Yke(e))return this._currentDelayedHover;const i=this._createHover(e,void 0);return i?(this._currentDelayedHover=i,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=t?.groupId,Tle(this._configurationService.getValue("workbench.hover.delay")).then(()=>{i&&!i.isDisposed&&(this._currentDelayedHoverWasShown=!0,this._showHover(i,e))}),i):(this._currentDelayedHover=void 0,this._currentDelayedHoverWasShown=!1,void(this._currentDelayedHoverGroupId=void 0))}setupDelayedHover(e,t,i){return this._setupDelayedHover(e,()=>({..."function"==typeof t?t():t,target:e}),i)}setupDelayedHoverAtMouse(e,t,i){return this._setupDelayedHover(e,i=>({..."function"==typeof t?t():t,target:{targetElements:[e],x:void 0!==i?i.x+10:void 0}}),i)}_setupDelayedHover(e,t,i){const n=new De;return n.add(ehe(e,On.MOUSE_OVER,e=>{this.showDelayedHover(t(e),{groupId:i?.groupId})})),i?.setupKeyboardEvents&&n.add(ehe(e,On.KEY_DOWN,e=>{const i=new we(e);(i.equals(10)||i.equals(3))&&this.showInstantHover(t(),!0)})),this._delayedHovers.set(e,{show:e=>{this.showInstantHover(t(),e)}}),n.add(Dle(()=>this._delayedHovers.delete(e))),n}_createHover(e,t){if(this._currentDelayedHover=void 0,""===e.content)return;if(this._currentHover?.isLocked)return;if(void 0===e.id&&(e.id=Qke(e.content)),Yke(this._currentHoverOptions)===Yke(e))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const i=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),n=vhe();t||(i&&n?n.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=n):this._lastFocusedElementBeforeOpen=void 0);const o=new De,s=this._instantiationService.createInstance(qie,e);if(e.persistence?.sticky&&(s.isLocked=!0),e.position?.hoverPosition&&!lle(e.position.hoverPosition)&&(e.target={targetElements:xhe(e.target)?[e.target]:e.target.targetElements,x:e.position.hoverPosition.x+10}),s.onDispose(()=>{this._currentHover?.domNode&&Che(this._currentHover.domNode)&&this._lastFocusedElementBeforeOpen?.focus(),Yke(this._currentHoverOptions)===Yke(e)&&this.doHideHover(),o.dispose()},void 0,o),!e.container){const t=xhe(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(pn(t))}if(s.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,o),e.persistence?.sticky)o.add(ehe(pn(e.container).document,On.MOUSE_DOWN,e=>{phe(e.target,s.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const i of e.target.targetElements)o.add(ehe(i,On.CLICK,()=>this.hideHover()));else o.add(ehe(e.target,On.CLICK,()=>this.hideHover()));const t=vhe();if(t){const i=pn(t).document;o.add(ehe(t,On.KEY_DOWN,t=>this._keyDown(t,s,!!e.persistence?.hideOnKeyDown))),o.add(ehe(i,On.KEY_DOWN,t=>this._keyDown(t,s,!!e.persistence?.hideOnKeyDown))),o.add(ehe(t,On.KEY_UP,e=>this._keyUp(e,s))),o.add(ehe(i,On.KEY_UP,e=>this._keyUp(e,s)))}}if("IntersectionObserver"in r){const t=new IntersectionObserver(e=>this._intersectionChange(e,s),{threshold:0}),i="targetElements"in e.target?e.target.targetElements[0]:e.target;t.observe(i),o.add(Dle(()=>t.disconnect()))}return this._currentHover=s,s}_showHover(e,t,i){this._contextViewHandler.showContextView(new rne(e,i),t.container)}hideHover(e){!e&&this._currentHover?.isLocked||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showInstantHover(this._lastHoverOptions,!0,!0)}_showAndFocusHoverForActiveElement(){let e=vhe();for(;e;){const t=this._delayedHovers.get(e)??this._managedHovers.get(e);if(t)return void t.show(!0);e=e.parentElement}}_keyDown(e,t,i){if("Alt"===e.key)return void(t.isLocked=!0);const n=new we(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some(e=>!!e)||0!==this._keybindingService.softDispatch(n,n.target).kind||!i||this._currentHoverOptions?.trapFocus&&"Tab"===e.key||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){"Alt"===e.key&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupManagedHover(e,t,i,n){if(e.showNativeHover)return function(e,t){function i(t){t?e.setAttribute("title",t):e.removeAttribute("title")}return i(Xke(t)),{update:e=>i(Xke(e)),show:()=>{},hide:()=>{},dispose:()=>i(void 0)}}(t,i);let o,s;t.setAttribute("custom-hover","true"),""!==t.title&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");const r=(t,i)=>{const n=void 0!==s;t&&(s?.dispose(),s=void 0),i&&(o?.dispose(),o=void 0),n&&(e.onDidHideHover?.(),s=void 0)},a=(o,r,a,l)=>new pt(async()=>{s&&!s.isDisposed||(s=new ine(e,a||t,o>0),await s.update("function"==typeof i?i():i,r,{...n,trapFocus:l}))},o),l=new De;let d=!1;l.add(ehe(t,On.MOUSE_DOWN,()=>{d=!0,r(!0,!0)},!0)),l.add(ehe(t,On.MOUSE_UP,()=>{d=!1},!0)),l.add(ehe(t,On.MOUSE_LEAVE,e=>{d=!1,r(!1,e.fromElement===t)},!0)),l.add(ehe(t,On.MOUSE_OVER,n=>{if(o)return;const s=new De,l={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>{l.x=e.x+10,Jke(e,t)||r(!0,!0)};s.add(ehe(t,On.MOUSE_MOVE,e,!0))}o=s,Jke(n,t)&&s.add(a("function"==typeof e.delay?e.delay(i):e.delay,!1,l))},!0)),zhe(t)||l.add(ehe(t,On.FOCUS,n=>{if(d||o)return;if(!Jke(n,t))return;const s={targetElements:[t],dispose:()=>{}},l=new De;l.add(ehe(t,On.BLUR,()=>r(!0,!0),!0)),l.add(a("function"==typeof e.delay?e.delay(i):e.delay,!1,s)),o=l},!0));const c={show:e=>{r(!1,!0),a(0,e,void 0,e)},hide:()=>{r(!0,!0)},update:async(e,t)=>{i=e,await(s?.update(i,void 0,t))},dispose:()=>{this._managedHovers.delete(t),l.dispose(),r(!0,!0)}};return this._managedHovers.set(t,c),c}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}},sne=nne([one(0,Jn),one(1,ka),one(2,sT),one(3,xw),one(4,_P),one(5,Fc)],sne),rne=class{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}},dge(BR,sne,1),Upe((e,t)=>{const i=e.getColor(qh);i&&(t.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${i.transparent(.5)}; }`))}),ane=class e{static createEmptyModel(t){return new e({},[],[],void 0,t)}constructor(e,t,i,n,o){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.logService=o,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const t=(Array.isArray(this.raw)?this.raw:[this.raw]).map(t=>{if(t instanceof e)return t;const i=new lne("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=t.reduce((e,t)=>t===e?t:e.merge(t),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?lge(this.contents,e):this.contents}inspect(t,i){const n=this;return{get value(){return eLe(n.rawConfiguration.getValue(t))},get override(){return i?eLe(n.rawConfiguration.getOverrideValue(t,i)):void 0},get merged(){return eLe(i?n.rawConfiguration.override(i).getValue(t):n.rawConfiguration.getValue(t))},get overrides(){const i=[];for(const{contents:o,identifiers:s,keys:r}of n.rawConfiguration.overrides){const a=new e(o,r,[],void 0,n.logService).getValue(t);void 0!==a&&i.push({identifiers:s,value:a})}return i.length?eLe(i):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?lge(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...t){const i=Bue(this.contents),n=Bue(this.overrides),o=[...this.keys],s=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const e of t)if(s.push(...e.raw?Array.isArray(e.raw)?e.raw:[e.raw]:[e]),!e.isEmpty()){this.mergeContents(i,e.contents);for(const t of e.overrides){const[e]=n.filter(e=>Zde(e.identifiers,t.identifiers));e?(this.mergeContents(e.contents,t.contents),e.keys.push(...t.keys),e.keys=rce(e.keys)):n.push(Bue(t))}for(const t of e.keys)-1===o.indexOf(t)&&o.push(t)}return new e(i,o,n,!s.length||s.every(t=>t instanceof e)?void 0:s,this.logService)}createOverrideConfigurationModel(t){const i=this.getContentsForOverrideIdentifer(t);if(!i||"object"!=typeof i||!Object.keys(i).length)return this;const n={};for(const e of rce([...Object.keys(this.contents),...Object.keys(i)])){let t=this.contents[e];const o=i[e];o&&("object"==typeof t&&"object"==typeof o?(t=Bue(t),this.mergeContents(t,o)):t=o),n[e]=t}return new e(n,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&rle(e[i])&&rle(t[i])?this.mergeContents(e[i],t[i]):e[i]=Bue(t[i])}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=e=>{e&&(i?this.mergeContents(i,e):i=Bue(e))};for(const o of this.overrides)1===o.identifiers.length&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&n(o.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);-1!==t&&(this.keys.splice(t,1),rge(this.contents,e),za.test(e)&&this.overrides.splice(this.overrides.findIndex(t=>Zde(t.identifiers,hge(e))),1))}updateValue(e,t,i){if(sge(this.contents,e,t,e=>this.logService.error(e)),(i=i||-1===this.keys.indexOf(e))&&this.keys.push(e),za.test(e)){const t=hge(e),i={identifiers:t,keys:Object.keys(this.contents[e]),contents:oge(this.contents[e],e=>this.logService.error(e))},n=this.overrides.findIndex(e=>Zde(e.identifiers,t));-1!==n?this.overrides[n]=i:this.overrides.push(i)}}},lne=class{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||ane.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:o,restricted:s,hasExcludedProperties:r}=this.doParseRaw(e,t);this._configurationModel=new ane(i,n,o,r?[e]:void 0,this.logService),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const i=ts.as(Pa.Configuration),n=i.getConfigurationProperties(),o=i.getExcludedConfigurationProperties(),s=this.filter(e,n,o,!0,t);return{contents:oge(e=s.raw,e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`)),keys:Object.keys(e),overrides:this.toOverrides(e,e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`)),restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,n,o){let s=!1;if(!(o?.scopes||o?.skipRestricted||o?.skipUnregistered||o?.exclude?.length))return{raw:e,restricted:[],hasExcludedProperties:s};const r={},a=[];for(const l in e)if(za.test(l)&&n){const n=this.filter(e[l],t,i,!1,o);r[l]=n.raw,s=s||n.hasExcludedProperties,a.push(...n.restricted)}else{const n=t[l];n?.restricted&&a.push(l),this.shouldInclude(l,n,i,o)?r[l]=e[l]:s=!0}return{raw:r,restricted:a,hasExcludedProperties:s}}shouldInclude(e,t,i,n){if(n.exclude?.includes(e))return!1;if(n.include?.includes(e))return!0;if(n.skipRestricted&&t?.restricted)return!1;if(n.skipUnregistered&&!t)return!1;const o=t??i[e],s=o?void 0!==o.scope?o.scope:4:void 0;return void 0===s||void 0===n.scopes||n.scopes.includes(s)}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(za.test(n)){const o={};for(const t in e[n])o[t]=e[n][t];i.push({identifiers:hge(n),keys:Object.keys(o),contents:oge(o,t)})}return i}},dne=class{constructor(e,t,i,n,o,s,r,a,l,d,c,h,u){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=r,this.userConfiguration=a,this.localUserConfiguration=l,this.remoteUserConfiguration=d,this.workspaceConfiguration=c,this.folderConfigurationModel=h,this.memoryConfigurationModel=u}toInspectValue(e){return void 0!==e?.value||void 0!==e?.override||void 0!==e?.overrides?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}},cne=class e{constructor(e,t,i,n,o,s,r,a,l,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=r,this._memoryConfiguration=a,this._memoryConfigurationByResource=l,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new ys,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=ane.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),s=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,r=new Set;for(const a of n.overrides)for(const t of a.identifiers)void 0!==n.getOverrideValue(e,t)&&r.add(t);return new dne(e,t,n.getValue(e),r.size?[...r]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new ane(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);if(t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&void 0!==this._policyConfiguration.getValue(e)){n=n.merge();for(const e of this._policyConfiguration.keys)n.setValue(e,this._policyConfiguration.getValue(e))}return n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:n,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:o}]),e},[])}}static parse(t,i){return new e(this.parseConfigurationModel(t.defaults,i),this.parseConfigurationModel(t.policy,i),this.parseConfigurationModel(t.application,i),this.parseConfigurationModel(t.userLocal,i),this.parseConfigurationModel(t.userRemote,i),this.parseConfigurationModel(t.workspace,i),t.folders.reduce((e,t)=>(e.set(_i.revive(t[0]),this.parseConfigurationModel(t[1],i)),e),new ys),ane.createEmptyModel(i),new ys,i)}static parseConfigurationModel(e,t){return new ane(e.contents,e.keys,e.overrides,e.raw,t)}},hne=class{constructor(e,t,i,n,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=o,this._marker="\n",this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const s of e.keys)this.affectedKeys.add(s);for(const[,s]of e.overrides)for(const e of s)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(const s of this.affectedKeys)this._affectsConfigStr+=s+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=cne.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;const o=n+i.length;if(o>=this._affectsConfigStr.length)return!1;const s=this._affectsConfigStr.charCodeAt(o);return!(s!==this._markerCode1&&s!==this._markerCode2||t&&Uue(this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace)))}},une={kind:0},gne={kind:1},pne=class e{constructor(t,i,n){this._log=n,this._defaultKeybindings=t,this._defaultBoundCommands=new Map;for(const e of t){const t=e.command;t&&"-"!==t.charAt(0)&&this._defaultBoundCommands.set(t,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=e.handleRemovals([].concat(t).concat(i));for(let e=0,o=this._keybindings.length;e<o;e++){const t=this._keybindings[e];if(0===t.chords.length)continue;const i=t.when?.substituteConstants();i&&0===i.type||this._addKeyPress(t.chords[0],t)}}static _isTargetedForRemoval(e,t,i){if(t)for(let n=0;n<t.length;n++)if(t[n]!==e.chords[n])return!1;if(i&&1!==i.type){if(!e.when)return!1;if(!function(e,t){const i=e?e.substituteConstants():void 0,n=t?t.substituteConstants():void 0;return!i&&!n||!(!i||!n)&&i.equals(n)}(i,e.when))return!1}return!0}static handleRemovals(e){const t=new Map;for(let n=0,o=e.length;n<o;n++){const i=e[n];if(i.command&&"-"===i.command.charAt(0)){const e=i.command.substring(1);t.has(e)?t.get(e).push(i):t.set(e,[i])}}if(0===t.size)return e;const i=[];for(let n=0,o=e.length;n<o;n++){const o=e[n];if(!o.command||0===o.command.length){i.push(o);continue}if("-"===o.command.charAt(0))continue;const s=t.get(o.command);if(!s||!o.isDefault){i.push(o);continue}let r=!1;for(const e of s){const t=e.when;if(this._isTargetedForRemoval(o,e.chords,t)){r=!0;break}}r||i.push(o)}return i}_addKeyPress(t,i){const n=this._map.get(t);if(void 0===n)return this._map.set(t,[i]),void this._addToLookupMap(i);for(let o=n.length-1;o>=0;o--){const t=n[o];if(t.command===i.command)continue;let s=!0;for(let e=1;e<t.chords.length&&e<i.chords.length;e++)if(t.chords[e]!==i.chords[e]){s=!1;break}s&&e.whenIsEntirelyIncluded(t.when,i.when)&&this._removeFromLookupMap(t)}n.push(i),this._addToLookupMap(i)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(void 0!==t)for(let i=0,n=t.length;i<n;i++)if(t[i]===e)return void t.splice(i,1)}static whenIsEntirelyIncluded(e,t){return!t||1===t.type||!(!e||1===e.type)&&cue(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t,i=!1){const n=this._lookupMap.get(e);if(void 0===n||0===n.length)return null;if(1===n.length&&!i)return n[0];for(let o=n.length-1;o>=0;o--){const e=n[o];if(t.contextMatchesRules(e.when))return e}return i?null:n[n.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const o=this._map.get(n[0]);if(void 0===o)return this._log("\\ No keybinding entries."),une;let s=null;if(n.length<2)s=o;else{s=[];for(let e=0,t=o.length;e<t;e++){const t=o[e];if(n.length>t.chords.length)continue;let i=!0;for(let e=1;e<n.length;e++)if(t.chords[e]!==n[e]){i=!1;break}i&&s.push(t)}}const r=this._findCommand(e,s);return r?n.length<r.chords.length?(this._log(`\\ From ${s.length} keybinding entries, awaiting ${r.chords.length-n.length} more chord(s), when: ${tLe(r.when)}, source: ${iLe(r)}.`),gne):(this._log(`\\ From ${s.length} keybinding entries, matched ${r.command}, when: ${tLe(r.when)}, source: ${iLe(r)}.`),a=r.command,l=r.commandArgs,d=r.bubble,{kind:2,commandId:a,commandArgs:l,isBubble:d}):(this._log(`\\ From ${s.length} keybinding entries, no when clauses matched the context.`),une);var a,l,d}_findCommand(t,i){for(let n=i.length-1;n>=0;n--){const o=i[n];if(e._contextMatchesRules(t,o.when))return o}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}},fne=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/,_ne=class extends Ie{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:Be.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=o,this._onDidUpdateKeybindings=this._register(new je),this._currentChords=[],this._currentChordChecker=new mt,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=bne.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new pt,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t,i=!1){const n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService,i);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),une;const[n]=i.getDispatchChords();if(null===n)return this._log("\\ Keyboard event cannot be dispatched"),une;const o=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:e})=>e);return this._getResolver().resolve(o,s,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{this._documentHasFocus()?Date.now()-e>5e3&&this._leaveChordMode():this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw Xae("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(Vae(1701,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const e=this._currentChords.map(({label:e})=>e).join(", ");this._currentChordStatusMessage=this._notificationService.status(Vae(1702,"({0}) was pressed. Waiting for next key of chord...",e))}}this._scheduleLeaveChordMode(),Sw.enabled&&Sw.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],Sw.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=bne.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=bne.EMPTY,null===this._currentSingleModifier?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new bne(o),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let n=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,s=null;if(i){const[t]=e.getSingleModifierDispatchChords();o=t,s=t?[t]:[]}else[o]=e.getDispatchChords(),s=this._currentChords.map(({keypress:e})=>e);if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;const r=this._contextKeyService.getContext(t),a=e.getLabel(),l=this._getResolver().resolve(r,s,o);switch(l.kind){case 0:if(this._logService.trace("KeybindingService#dispatch",a,"[ No matching keybinding ]"),this.inChordMode){const e=this._currentChords.map(({label:e})=>e).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${e}, ${a}".`),this._notificationService.status(Vae(1703,"The key combination ({0}, {1}) is not a command.",e,a),{hideAfter:1e4}),this._leaveChordMode(),n=!0}return n;case 1:return this._logService.trace("KeybindingService#dispatch",a,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(o,a),this._log(1===this._currentChords.length?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case 2:if(this._logService.trace("KeybindingService#dispatch",a,`[ Will dispatch command ${l.commandId} ]`),null===l.commandId||""===l.commandId){if(this.inChordMode){const e=this._currentChords.map(({label:e})=>e).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${e}, ${a}".`),this._notificationService.status(Vae(1704,"The key combination ({0}, {1}) is not a command.",e,a),{hideAfter:1e4}),this._leaveChordMode(),n=!0}}else{this.inChordMode&&this._leaveChordMode(),l.isBubble||(n=!0),this._log(`+ Invoking command ${l.commandId}.`),this._currentlyDispatchingCommandId=l.commandId;try{void 0===l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,e=>this._notificationService.warn(e)):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,e=>this._notificationService.warn(e))}finally{this._currentlyDispatchingCommandId=null}fne.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return n}}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}},(mne=bne=class{constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}).EMPTY=new mne(null),vne=class{constructor(e,t,i,n,o,s,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?nLe(e.getDispatchChords()):[],e&&0===this.chords.length&&(this.chords=nLe(e.getSingleModifierDispatchChords())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=r}},wne=class extends _e{constructor(e,t){if(super(),0===t.length)throw Qae("chords");this._os=e,this._chords=t}getLabel(){return qT.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return jT.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:$T.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return GT.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new fe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}},Cne=class e extends wne{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return ge.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":ge.toString(e.keyCode)}_getElectronAccelerator(e){return ge.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=ge.toUserSettingsUS(e.keyCode);return t?t.toLowerCase():t}_getChordDispatch(t){return e.getDispatchStr(t)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=ge.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=ue[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof pe)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new pe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(t,i){const n=nLe(t.chords.map(e=>this._toKeyCodeChord(e)));return n.length>0?[new e(n,i)]:[]}},yne=[],Sne=[],xne=[],kne=Object.prototype.hasOwnProperty,Lne="vs.editor.nullLanguage",Dne=class{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Lne,0),this._register(Ga,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||Lne}},Ine=class e extends Ie{constructor(t=!0,i=!1){super(),this._onDidChange=this._register(new je),this.onDidChange=this._onDidChange.event,e.instanceCount++,this._warnOnOverwrite=i,this.languageIdCodec=new Dne,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},t&&(this._initializeFromRegistry(),this._register($a.onDidChangeLanguages(e=>{this._initializeFromRegistry()})))}dispose(){e.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},yne=yne.filter(e=>e.userConfigured),Sne=[];const e=[].concat($a.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach(e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier}),t.mimetypes.forEach(e=>{this._mimeTypesMap[e]=t.identifier})}),ts.as(Pa.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;kne.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const e of t.extensions)oLe({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)oLe({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)oLe({id:i,mime:n,filepattern:a},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);Kle(t)||oLe({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(r){console.warn(`[${t.id}]: Invalid regular expression \`${e}\`: `,r)}}e.aliases.push(i);let o=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const a of o)a&&0!==a.length&&e.aliases.push(a);const s=null!==o&&o.length>0;if(s&&null===o[0]);else{const t=(s?o[0]:null)||i;!s&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&kne.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return kne.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&kne.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return e||t?sLe(e,t):[]}},Ine.instanceCount=0;(Nne=class e extends Ie{constructor(t=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new je),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new je),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new je({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,e.instanceCount++,this._registry=this._register(new Ine(!0,t)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){e.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return this._registry.guessLanguageIdByFilepathOrFirstLine(e,t).at(0)??null}createById(e){return new Ene(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Ene(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e=Ga),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),Mb.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}).instanceCount=0,Ene=class{constructor(e,t){this._value=Hce(this,e,()=>t()),this.onDidChange=Be.fromObservable(this._value)}get languageId(){return this._value.get()}},Mne=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Tne=/(&amp;)?(&amp;)([^\s&])/g,function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(Rne||(Rne={})),function(e){e[e.Above=0]="Above",e[e.Below=1]="Below"}(One||(One={})),Ane=class e extends NE{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,s),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...F||W?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(pm.addTarget(o)),this._register(ehe(o,On.KEY_DOWN,e=>{new we(e).equals(2)&&e.preventDefault()})),i.enableMnemonics&&this._register(ehe(o,On.KEY_DOWN,e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){An.stop(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof Fne&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}})),W&&this._register(ehe(o,On.KEY_DOWN,e=>{const t=new we(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),An.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),An.stop(e,!0))})),this._register(ehe(this.domNode,On.MOUSE_OUT,e=>{phe(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())})),this._register(ehe(this.actionsList,On.MOUSE_OVER,e=>{let t=e.target;if(t&&phe(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})),this._register(pm.addTarget(this.actionsList)),this._register(ehe(this.actionsList,gm.Tap,e=>{let t=e.initialTarget;if(t&&phe(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new Tm(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this.styleScrollElement(r,n),this._register(ehe(o,gm.Change,e=>{An.stop(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})})),this._register(ehe(r,On.MOUSE_UP,e=>{e.preventDefault()}));const a=pn(e);o.style.maxHeight=`${Math.max(10,a.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((e,n)=>{if(i.submenuIds?.has(e.id))return console.warn(`Found submenu cycle: ${e.id}`),!1;if(e instanceof ro){if(n===t.length-1||0===n)return!1;if(t[n-1]instanceof ro)return!1}return!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(e=>!(e instanceof Wne)).forEach((e,t,i)=>{e.updatePositionInSet(t+1,i.length)})}initializeOrUpdateStyleSheet(t,i){this.styleSheet||(_he(t)?this.styleSheet=npe(t):(e.globalStyleSheet||(e.globalStyleSheet=npe()),this.styleSheet=e.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`\n.monaco-menu {\n\tfont-size: 13px;\n\tborder-radius: 5px;\n\tmin-width: 160px;\n}\n\n${aLe(go.menuSelection)}\n${aLe(go.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-menu-separatorBackground);\n\tpadding-top: 1px;\n\tpadding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 0 4px;\n\tborder-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n\topacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n\topacity: 0.7;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\twidth: 100%;\n\theight: 0px !important;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n\tmax-height: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tmargin: 5px 0 !important;\n\tpadding: 0;\n\tborder-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){i+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t/* Fix for https://github.com/microsoft/vscode/issues/103170 */\n\t\t\t.monaco-menu .action-item .monaco-submenu {\n\t\t\t\tz-index: 1;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const n=e.scrollbarSliderBackground;n&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${n};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderHoverBackground;o&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`);const s=e.scrollbarSliderActiveBackground;s&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${s};\n\t\t\t\t}\n\t\t\t`)}return i}(i,_he(t))}styleScrollElement(e,t){const i=t.foregroundColor??"",n=t.backgroundColor??"",o=t.borderColor?`1px solid ${t.borderColor}`:"",s=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=o,e.style.borderRadius="5px",e.style.color=i,e.style.backgroundColor=n,e.style.boxShadow=s}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++)if(e===this.actionsList.children[t]){this.focusedItem=t;break}}updateFocus(e){super.updateFocus(e,!0,!0),void 0!==this.focusedItem&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof ro)return new Wne(t.context,e,{icon:!0},this.menuStyles);if(e instanceof ao){const n=new Fne(e,e.actions,i,{...t,submenuIds:new Set([...t.submenuIds||[],e.id])},this.menuStyles);if(t.enableMnemonics){const e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}{const i=t.getKeyBinding?.(e)?.getLabel(),n={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext,keybinding:i},o=new Pne(t.context,e,n,this.menuStyles);if(t.enableMnemonics){const e=o.getMnemonic();if(e&&o.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(o),this.mnemonics.set(e,t)}}return o}}},Pne=class extends LE{constructor(e,t,i,n){if(super(t,t,i={...i,isMenu:!0,icon:void 0!==i.icon&&i.icon,label:void 0===i.label||i.label}),this.menuStyle=n,this.options=i,this.cssClass="",this.options.label&&i.enableMnemonics){const e=this.action.label;if(e){const t=Mne.exec(e);t&&(this.mnemonic=(t[1]?t[1]:t[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new ft(()=>{this.element&&(this._register(ehe(this.element,On.MOUSE_UP,e=>{if(An.stop(e,!0),c){if(new Se(pn(this.element),e).rightButton)return;this.onClick(e)}else setTimeout(()=>{this.onClick(e)},0)})),this._register(ehe(this.element,On.CONTEXT_MENU,e=>{An.stop(e,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Mhe(this.element,Ahe("a.action-menu-item")),this._action.id===ro.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Mhe(this.item,Ahe("span.menu-item-check"+mo.asCSSSelector(go.menuSelection))),this.check.setAttribute("role","none"),this.label=Mhe(this.item,Ahe("span.action-label")),this.options.label&&this.options.keybinding&&(Mhe(this.item,Ahe("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item?.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){Jce(this.label);let e=Pbe(this.action.label);if(e){const t=function(e){const t=Mne,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=Mne.exec(e);if(i){e=Wle(e),Tne.lastIndex=0;let t=Tne.exec(e);for(;t&&t[1];)t=Tne.exec(e);const n=e=>e.replace(/&amp;&amp;/g,"&amp;");t?this.label.append(Hle(n(e.substr(0,t.index))," "),Ahe("u",{"aria-hidden":"true"},t[3]),zle(n(e.substr(t.index+t[0].length))," ")):this.label.textContent=n(e).trim(),this.item?.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.textContent=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),void 0!==e?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=n,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}},Fne=class extends Pne{constructor(e,t,i,n,o){super(e,e,n,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new De),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:{horizontal:Rne.Right,vertical:One.Below},this.showScheduler=new ft(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new ft(()=>{this.element&&!phe(vhe(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=Mhe(this.item,Ahe("span.submenu-indicator"+mo.asCSSSelector(go.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(ehe(this.element,On.KEY_UP,e=>{const t=new we(e);(t.equals(17)||t.equals(3))&&(An.stop(e,!0),this.createSubmenu(!0))})),this._register(ehe(this.element,On.KEY_DOWN,e=>{const t=new we(e);vhe()===this.item&&(t.equals(17)||t.equals(3))&&An.stop(e,!0)})),this._register(ehe(this.element,On.MOUSE_OVER,e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(ehe(this.element,On.MOUSE_LEAVE,e=>{this.mouseOver=!1})),this._register(ehe(this.element,On.FOCUS_OUT,e=>{this.element&&!phe(vhe(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){An.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const o={top:0,left:0};return o.left=Gke(e.width,t.width,{position:n.horizontal===Rne.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=Gke(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=Mhe(this.element,Ahe("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=pn(this.parentData.parent.domNode).getComputedStyle(this.parentData.parent.domNode),i=parseFloat(t.paddingTop||"0")||0;this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.submenuContainer.style.zIndex="1",this.parentData.submenu=new Ane(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new lo],this.submenuOptions,this.menuStyle);const n=this.element.getBoundingClientRect(),o={top:n.top-i,left:n.left,height:n.height+2*i,width:n.width},s=this.submenuContainer.getBoundingClientRect(),r=pn(this.element),{top:a,left:l}=this.calculateSubmenuMenuLayout(new Tn(r.innerWidth,r.innerHeight),Tn.lift(s),o,this.expandDirection);this.submenuContainer.style.left=l-s.left+"px",this.submenuContainer.style.top=a-s.top+"px",this.submenuDisposables.add(ehe(this.submenuContainer,On.KEY_UP,e=>{new we(e).equals(15)&&(An.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(ehe(this.submenuContainer,On.KEY_DOWN,e=>{new we(e).equals(15)&&An.stop(e,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){this.item&&this.item?.setAttribute("aria-expanded",e)}applyStyle(){super.applyStyle();const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=e??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}},Wne=class extends DE{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}},Bne=class{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;let i;this.focusToReturn=vhe();const n=xhe(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,layer:e.layer,render:n=>{this.lastContainer=n;const o=e.getMenuClassName?e.getMenuClassName():"";o&&(n.className+=" "+o),this.options.blockMouse&&(this.block=n.appendChild(Ahe(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=ehe(this.block,On.MOUSE_DOWN,e=>e.stopPropagation()));const s=new De,r=e.actionRunner||s.add(new so);r.onWillRun(t=>this.onActionRun(t,!e.skipTelemetry),this,s),r.onDidRun(this.onDidActionRun,this,s),i=new Ane(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:r,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)},pR),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,s),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,s);const a=pn(n);return s.add(ehe(a,On.BLUR,()=>this.contextViewService.hideContextView(!0))),s.add(ehe(a,On.MOUSE_DOWN,e=>{if(e.defaultPrevented)return;const t=new Se(a,e);let i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}})),Lle(s,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:t=>{e.onHide?.(!!t),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(vhe()===this.lastContainer||phe(vhe(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Yae(e.error)&&this.notificationService.error(e.error)}},Vne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Hne=function(e,t){return function(i,n){t(i,n,e)}},zne=class extends Ie{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Bne(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new je),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new je),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Une.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),Bn.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}},zne=Vne([Hne(0,fs),Hne(1,Xv),Hne(2,oT),Hne(3,xw),Hne(4,cs),Hne(5,es)],zne),function(e){e.transform=function(e,t,i){if(!((n=e)&&n.menuId instanceof ds))return e;var n;const{menuId:o,menuActionOptions:s,contextKeyService:r}=e;return{...e,getActions:()=>{let n=[];return o&&(n=kwe(t.getMenuActions(o,r??i,s))),e.getActions?ro.join(e.getActions(),n):n}}}}(Une||(Une={})),function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(Kne||(Kne={})),qne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},jne=function(e,t){return function(i,n){t(i,n,e)}},$ne=class{constructor(e){this._commandService=e}async open(e,t){if(!Ade(e,yi.command))return!1;if(!t?.allowCommands)return!0;if("string"==typeof e&&(e=_i.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path))return!0;let i=[];try{i=eve(decodeURIComponent(e.query))}catch{try{i=eve(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}},$ne=qne([jne(0,fo)],$ne),Gne=class{constructor(e){this._editorService=e}async open(e,t){"string"==typeof e&&(e=_i.parse(e));const{selection:i,uri:n}=function(e){let t;const i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);return(e=n).scheme===yi.file&&(e=Ws(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?Kne.USER:Kne.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}},Gne=qne([jne(0,eo)],Gne),Zne=class{constructor(e,t){this._openers=new Ae,this._validators=new Ae,this._resolvers=new Ae,this._resolvedUriTargets=new ys(e=>e.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Ae,this._defaultExternalOpener={openExternal:async e=>(Pde(e,yi.http,yi.https)?Bhe(e):r.location.href=e,!0)},this._openers.push({open:async(e,t)=>!(!t?.openExternal&&!Pde(e,yi.mailto,yi.http,yi.https,yi.vsls)||(await this._doOpenExternal(e,t),0))}),this._openers.push(new $ne(t)),this._openers.push(new Gne(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){if(!t?.skipValidation){const i="string"==typeof e?_i.parse(e):e,n=this._resolvedUriTargets.get(i)??e;for(const e of this._validators)if(!(await e.shouldOpen(n,t)))return!1}for(const i of this._openers)if(await i.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i="string"==typeof e?_i.parse(e):e;let n,o;try{n=(await this.resolveExternalUri(i,t)).resolved}catch{n=i}if(o="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),t?.allowContributedOpeners){const e="string"==typeof t?.allowContributedOpeners?t?.allowContributedOpeners:void 0;for(const t of this._externalOpeners)if(await t.openExternal(o,{sourceUri:i,preferredOpenerId:e},it.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},it.None)}dispose(){this._validators.clear()}},Zne=qne([jne(0,eo),jne(1,fo)],Zne),Yne=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Qne=function(e,t){return function(i,n){t(i,n,e)}},Xne=class extends Ie{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new je),this._suppressedRanges=new ys,this._markerDecorations=new ys,e.getModels().forEach(e=>this._onModelAdded(e)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)})}_onModelAdded(e){const t=new Jne(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==yi.inMemory&&e.uri.scheme!==yi.internal&&e.uri.scheme!==yi.vscode||this._markerService?.read({resource:e.uri}).map(e=>e.owner).forEach(t=>this._markerService.remove(t,[e.uri]))}_updateDecorations(e){let t=this._markerService.read({resource:e.model.uri,take:500});const i=this._suppressedRanges.get(e.model.uri);i&&(t=t.filter(e=>!ke.some(i,t=>mr.areIntersectingOrTouching(t,e)))),e.update(t)&&this._onDidChangeMarker.fire(e.model)}},Xne=Yne([Qne(0,io),Qne(1,CF)],Xne),Jne=class extends Ie{constructor(e){super(),this.model=e,this._map=new Ds,this._register(Dle(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=function(e,t){const i=[],n=[];for(const o of e)t.has(o)||i.push(o);for(const o of t)e.has(o)||n.push(o);return{removed:i,added:n}}(new Set(this._map.keys()),new Set(e));if(0===t.length&&0===i.length)return!1;const n=i.map(e=>this._map.get(e)),o=t.map(e=>({range:this._createDecorationRange(this.model,e),options:this._createDecorationOption(e)})),s=this.model.deltaDecorations(n,o);for(const r of i)this._map.delete(r);for(let r=0;r<s.length;r++)this._map.set(t[r],s[r]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=mr.lift(t);if(t.severity!==vF.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const t=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(1===t||i.endColumn>=t)return i;const n=e.getWordAtPosition(i.getStartPosition());n&&(i=new mr(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new mr(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,o,s;switch(e.severity){case vF.Hint:t=this._hasMarkerTag(e,2)?void 0:this._hasMarkerTag(e,1)?"squiggly-unnecessary":"squiggly-hint",n=0;break;case vF.Info:t="squiggly-info",i=Hpe(r_),n=10,s={color:Hpe(Iu),position:1};break;case vF.Warning:t="squiggly-warning",i=Hpe(s_),n=20,s={color:Hpe(Nu),position:1};break;case vF.Error:default:t="squiggly-error",i=Hpe(o_),n=30,s={color:Hpe(Eu),position:1}}return e.tags&&(-1!==e.tags.indexOf(1)&&(o="squiggly-inline-unnecessary"),-1!==e.tags.indexOf(2)&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:Zr.Right},minimap:s,zIndex:n,inlineClassName:o}}_hasMarkerTag(e,t){return!!e.tags&&e.tags.indexOf(t)>=0}},toe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},ioe=function(e,t){return function(i,n){t(i,n,e)}},ooe=class{constructor(e,t,i){this.model=e,this._modelEventListeners=new De,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(t=>i(e,t)))}dispose(){this._modelEventListeners.dispose()}},soe=W||F?1:2,roe=class{constructor(e,t,i,n,o,s,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=o,this.sha1=s,this.versionId=r,this.alternativeVersionId=a}},eoe=class extends Ie{constructor(e,t,i,n){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._instantiationService=n,this._onModelAdded=this._register(new je),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new je),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new je),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(e=>this._updateModelOptions(e))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=wd.tabSize;e.editor&&void 0!==e.editor.tabSize&&(i=Hge(e.editor.tabSize,wd.tabSize,1,100));let n="tabSize";e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize&&(n=Hge(e.editor.indentSize,"tabSize",1,100));let o=wd.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(o="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let s=soe;const r=e.eol;"\r\n"===r?s=2:"\n"===r&&(s=1);let a=wd.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(a="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let l=wd.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(l="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let d=wd.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let c=wd.bracketPairColorizationOptions;if(e.editor?.bracketPairColorization&&"object"==typeof e.editor.bracketPairColorization){const t=e.editor.bracketPairColorization;c={enabled:!!t.enabled,independentColorPoolPerBracketType:!!t.independentColorPoolPerBracketType}}return{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:o,detectIndentation:l,defaultEOL:s,trimAutoWhitespace:a,largeFileOptimizations:d,bracketPairColorizationOptions:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===Y||2===Y?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(e,t,i){const n="string"==typeof e?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[n+t];if(!o){const e=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),s=this._getEOL(t,n);o=noe._readModelOptions({editor:e,eol:s},i),this._modelCreationOptionsByLanguageAndResource[n+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;n<o;n++){const o=i[n],s=this._models[o],r=s.model.getLanguageId(),a=s.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:r,resource:a})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:r,resource:a}))continue;const l=t[r+a],d=this.getCreationOptions(r,a,s.model.isForSimpleWidget);noe._setModelOptionsForModel(s.model,d,l)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&1===e.getLineCount()&&e.setEOL(1===t.defaultEOL?0:1),i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&Uue(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions)||(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(lLe(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(lLe(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(lLe(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(e=>{e.sharesUndoRedoStack||t.push(e)}),t.sort((e,t)=>e.time-t.time);t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),s=this._instantiationService.createInstance(vx,e,t,o,i);if(i&&this._disposedModels.has(lLe(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=this._getSHA1Computer(),o=!!n.canComputeSHA1(s)&&n.computeSHA1(s)===e.sha1;if(o||e.sharesUndoRedoStack){for(const e of t.past)gfe(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)gfe(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,e=>gfe(e)&&e.matchesResource(i)),o&&(s._overwriteVersionId(e.versionId),s._overwriteAlternativeVersionId(e.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=lLe(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new ooe(s,e=>this._onWillDispose(e),(e,t)=>this._onDidChangeLanguage(e,t));return this._models[r]=a,a}createModel(e,t,i,n=!1){let o;return o=t?this._createModelData(e,t,i,n):this._createModelData(e,Ga,i,n),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(this._models[n].model)}return e}getModel(e){const t=lLe(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===yi.file||e.scheme===yi.vscodeRemote||e.scheme===yi.vscodeUserData||e.scheme===yi.vscodeNotebookCell||"fake-fs"===e.scheme}_onWillDispose(e){const t=lLe(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,s=0;if(n||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){const t=this._undoRedoService.getElements(e.uri);if(t.past.length>0||t.future.length>0){for(const i of t.past)gfe(i)&&i.matchesResource(e.uri)&&(o=!0,s+=i.heapSize(e.uri),i.setModel(e.uri));for(const i of t.future)gfe(i)&&i.matchesResource(e.uri)&&(o=!0,s+=i.heapSize(e.uri),i.setModel(e.uri))}}const r=noe.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,a=this._getSHA1Computer();if(o)if(n||!(s>r)&&a.canComputeSHA1(e))this._ensureDisposedModelsHeapSize(r-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,t=>gfe(t)&&t.matchesResource(e.uri)),this._insertDisposedModel(new roe(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,s,a.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else{const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else if(!n){const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,n=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);noe._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new loe}},noe=eoe,eoe.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,aoe=eoe,aoe=noe=toe([ioe(0,ka),ioe(1,x3),ioe(2,sx),ioe(3,Jn)],aoe),loe=class e{canComputeSHA1(t){return t.getValueLength()<=e.MAX_MODEL_SIZE}computeSHA1(e){const t=new Mi,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}},loe.MAX_MODEL_SIZE=10485760,doe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},coe=function(e,t){return function(i,n){t(i,n,e)}},hoe=class extends Ie{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=ts.as(r8.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register(Dle(()=>{for(const e of this.mapProviderToDescriptor.values())xle(e)&&e.dispose();this.visibleQuickAccess?.picker.dispose()}))}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){const[n,o]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),s=this.visibleQuickAccess,r=s?.descriptor;if(s&&o&&r===o)return e===o.prefix||i?.preserveValue||(s.picker.value=e),void this.adjustValueSelection(s.picker,o,i);if(o&&!i?.preserveValue){let t;if(s&&r&&r!==o){const e=s.value.substr(r.prefix.length);e&&(t=`${o.prefix}${e}`)}if(!t){const e=n?.defaultFilterValue;e===s8.LAST?t=this.lastAcceptedPickerValues.get(o):"string"==typeof e&&(t=`${o.prefix}${e}`)}"string"==typeof t&&(e=t)}const a=s?.picker?.valueSelection,l=s?.picker?.value,d=new De,c=d.add(this.quickInputService.createQuickPick({useSeparators:!0}));let h;c.value=e,this.adjustValueSelection(c,o,i),c.placeholder=i?.placeholder??o?.placeholder,c.quickNavigate=i?.quickNavigateConfiguration,c.hideInput=!!c.quickNavigate&&!s,("number"==typeof i?.itemActivation||i?.quickNavigateConfiguration)&&(c.itemActivation=i?.itemActivation??XO.SECOND),c.contextKey=o?.contextKey,c.filterValue=e=>e.substring(o?o.prefix.length:0),t&&(h=new Ct,d.add(Be.once(c.onWillAccept)(e=>{e.veto(),c.hide()}))),d.add(this.registerPickerListeners(c,n,o,e,i));const u=d.add(new ot);return n&&d.add(n.provide(c,u.token,i?.providerOptions)),Be.once(c.onDidHide)(()=>{0===c.selectedItems.length&&u.cancel(),d.dispose(),h?.complete(c.selectedItems.slice(0))}),c.show(),a&&l===e&&(c.valueSelection=a),t?h?.p:void 0}adjustValueSelection(e,t,i){let n;n=i?.preserveValue?[e.value.length,e.value.length]:[t?.prefix.length??0,e.value.length],e.valueSelection=n}registerPickerListeners(e,t,i,n,o){const s=new De,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return s.add(Dle(()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(e=>{const[i]=this.getOrInstantiateProvider(e,o?.enabledProviderPrefixes);i!==t?this.show(e,{enabledProviderPrefixes:o?.enabledProviderPrefixes,preserveValue:!0,providerOptions:o?.providerOptions}):r.value=e})),i&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),s}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!t?.includes(i.prefix))return[void 0,void 0];let n=this.mapProviderToDescriptor.get(i);return n||(n=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,n)),[n,i]}},hoe=doe([coe(0,tA),coe(1,Jn)],hoe),uoe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},uoe([Ape],(goe=class{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>"string"==typeof e?e:e.label).join("")}}).prototype,"toString",null),poe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi,moe={},foe=new mD("quick-input-button-icon-"),_oe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},boe=function(e,t){return function(i,n){t(i,n,e)}},woe=new Jo(voe="inQuickInput",!1,Vae(1748,"Whether keyboard focus is inside the quick input control")),Coe=Po.has(voe),yoe=new Jo("quickInputAlignment","top",Vae(1749,"The alignment of the quick input")),xoe=new Jo(Soe="quickInputType",void 0,Vae(1750,"The type of the currently visible quick input")),Loe=new Jo(koe="cursorAtEndOfQuickInputBox",!1,Vae(1751,"Whether the cursor in the quick input is at the end of the input box")),Doe=Po.has(koe),Ioe={iconClass:mo.asClassName(go.quickInputBack),tooltip:Vae(1752,"Back")},(Noe=class e extends Ie{constructor(t){super(),this.ui=t,this._visible=Qce("visible",!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=e.noPromptMessage,this._severity=Yv.Ignore,this.onDidTriggerButtonEmitter=this._register(new je),this.onDidHideEmitter=this._register(new je),this.onWillHideEmitter=this._register(new je),this.onDisposeEmitter=this._register(new je),this.visibleDisposables=this._register(new De),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!U;this._ignoreFocusOut=e&&!U,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(e=>e===Ioe),this._rightButtons=e.filter(e=>e!==Ioe&&e.location!==eA.Inline),this._inlineButtons=e.filter(e=>e.location===eA.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this._visible.set(!0,void 0),this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=QO.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=QO.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||"&nbsp;"===this.ui.title.innerHTML||(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Rhe(this.ui.widget,this._widget):Rhe(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new pt,this.busyDelay.setIfNotSet(()=>{this.visible&&(this.ui.progressBar.infinite(),this.ui.progressBar.getContainer().removeAttribute("aria-hidden"))},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.ui.progressBar.getContainer().setAttribute("aria-hidden","true"),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const e=this._leftButtons.map((e,t)=>dLe(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.leftActionBar.push(e,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this._rightButtons.map((e,t)=>dLe(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.rightActionBar.push(t,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const i=this._inlineButtons.map((e,t)=>dLe(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.inlineActionBar.push(i,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const e=this.toggles?.filter(e=>e instanceof PB)??[];this.ui.inputBox.toggles=e;const t=22*e.length;this.ui.countContainer.style.right=t>0?`${4+t}px`:"4px",this.ui.visibleCountContainer.style.right=t>0?`${4+t}px`:"4px"}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,Rhe(this.ui.message),i&&cLe(i,this.ui.message,{callback:e=>{this.ui.linkOpenerDelegate(e)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?Vae(1754,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Yv.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}).noPromptMessage=Vae(1753,"Press 'Enter' to confirm your input or 'Escape' to cancel"),Eoe=class e extends Noe{constructor(e){super(e),this._value="",this.onDidChangeValueEmitter=this._register(new je),this.onWillAcceptEmitter=this._register(new je),this.onDidAcceptEmitter=this._register(new je),this.onDidCustomEmitter=this._register(new je),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=XO.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new je),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new je),this.onDidTriggerItemButtonEmitter=this._register(new je),this.onDidTriggerSeparatorButtonEmitter=this._register(new je),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new Je,this.type="quickPick",this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event,this.noValidationMessage=void 0}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get prompt(){return this.noValidationMessage}set prompt(e){this.noValidationMessage=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?YO:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get okLabel(){return this._okLabel??Vae(1756,"OK")}set okLabel(e){this._okLabel=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(JO.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Zde(e,this._activeItems,(e,t)=>e===t)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{!this.canSelectMany||e.some(e=>!1===e.pickable)?this.selectedItemsToConfirm!==this._selectedItems&&Zde(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(Dhe(t)&&1===t.button)):e.length&&this.ui.list.setSelectedElements([])})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&this.visible&&(this.selectedItemsToConfirm!==this._selectedItems&&Zde(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return ehe(this.ui.container,On.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new we(e),i=t.keyCode;this._quickNavigate.keybindings.some(e=>{const n=e.getChords();return!(n.length>1||(n[0].shiftKey&&4===i?t.ctrlKey||t.altKey||t.metaKey:!(n[0].altKey&&6===i||n[0].ctrlKey&&5===i||n[0].metaKey&&57===i)))})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const t=this.keepScrollPosition?this.scrollTop:0,i=!!this.description,n={title:!!this.title||!!this.step||!!this.titleButtons.length,description:i,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||i,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage||!!this.prompt,customButton:this.customButton};this.ui.setVisibilities(n),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let o=this.ariaLabel;!o&&n.inputBox&&(o=this.placeholder,this.title&&(o=o?`${o} - ${this.title}`:this.title),o||(o=e.DEFAULT_ARIA_LABEL)),this.ui.list.ariaLabel!==o&&(this.ui.list.ariaLabel=o??null),this.ui.inputBox.ariaLabel!==o&&(this.ui.inputBox.ariaLabel=o??"input"),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case XO.NONE:this._itemActivation=XO.FIRST;break;case XO.SECOND:this.ui.list.focus(JO.Second),this._itemActivation=XO.FIRST;break;case XO.LAST:this.ui.list.focus(JO.Last),this._itemActivation=XO.FIRST;break;default:this.trySelectFirst()}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.ok.label=this.okLabel||"",this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",n.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(JO.First)),this.keepScrollPosition&&(this.scrollTop=t)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||(this.activeItems[0]&&!this._canSelectMany&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(e??!1))}},Eoe.DEFAULT_ARIA_LABEL=Vae(1755,"Type to narrow down results."),Moe=class extends Noe{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new je),this.onDidAcceptEmitter=this._register(new je),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?Vae(1757,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):Noe.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password);let t=this.ariaLabel;!t&&e.inputBox&&(t=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:"input"),this.ui.inputBox.ariaLabel!==t&&(this.ui.inputBox.ariaLabel=t||"input")}},Toe=class extends VR{constructor(e,t){super("mouse",void 0,e=>this.getOverrideOptions(e),e,t)}getOverrideOptions(e){return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:(xhe(e.content)?e.content.textContent??"":"string"==typeof e.content?e.content:e.content.value).includes("\n"),skipFadeInAnimation:!0}}}},Toe=_oe([boe(0,ka),boe(1,BR)],Toe),Roe="done",Ooe="active",Aoe="infinite",Poe="infinite-long-running",Foe="discrete",(Woe=class e extends Ie{constructor(t,i){super(),this.progressSignal=this._register(new Ne),this.workedVal=0,this.showDelayedScheduler=this._register(new ft(()=>Phe(this.element),0)),this.longRunningScheduler=this._register(new ft(()=>this.infiniteLongRunning(),e.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(t,i)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Ooe,Aoe,Poe,Foe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Roe),this.element.classList.contains(Aoe)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(Foe,Roe,Poe),this.element.classList.add(Ooe,Aoe),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(Poe)}getContainer(){return this.element}}).LONG_RUNNING_INFINITE_THRESHOLD=1e4,Boe=Ahe,Voe=class extends Ie{constructor(e,t,i){super(),this.parent=e,this.onDidChange=e=>this.findInput.onDidChange(e),this.container=Mhe(this.parent,Boe(".quick-input-box")),this.findInput=this._register(new _V(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const n=this.findInput.inputBox.inputElement;n.role="textbox",n.ariaHasPopup="menu",n.ariaAutoComplete="list"}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return"password"===this.findInput.inputBox.inputElement.type}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute("aria-label")||""}set ariaLabel(e){this.findInput.inputBox.inputElement.setAttribute("aria-label",e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===Yv.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Yv.Info?1:e===Yv.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Yv.Info?1:e===Yv.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}},Hoe=new Nt(()=>{const e=Hr.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}),new Nt(()=>({collator:Hr.Collator(void 0,{numeric:!0}).value})),new Nt(()=>({collator:Hr.Collator(void 0,{numeric:!0,sensitivity:"accent"}).value})),Uoe=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Koe=function(e,t){return function(i,n){t(i,n,e)}},joe=Ahe,$oe=class{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new Nt(()=>{const e=i.label??"";return{saneLabel:e,saneSortLabel:Wbe(e).text.trim(),saneAriaLabel:i.ariaLabel||[e,this.saneDescription,this.saneDetail].map(e=>Fbe(e)).filter(e=>!!e).join(", ")}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}},Goe=class extends $oe{constructor(e,t,i,n,o,s,r){super(e,i,s),this.childIndex=t,this.fireButtonTriggered=n,this._onChecked=o,this.item=s,this._separator=r,this._checked=!1,this.onChecked=i?Be.map(Be.filter(this._onChecked.event,e=>e.element===this),e=>e.checked):Be.None,this._saneDetail=s.detail,this._labelHighlights=s.highlights?.label,this._descriptionHighlights=s.highlights?.description,this._detailHighlights=s.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}},function(e){e[e.NONE=0]="NONE",e[e.MOUSE_HOVER=1]="MOUSE_HOVER",e[e.ACTIVE_ITEM=2]="ACTIVE_ITEM"}(Zoe||(Zoe={})),Yoe=class extends $oe{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=Zoe.NONE}},Qoe=class{getHeight(e){return e instanceof Yoe?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof Goe?ese.ID:tse.ID}},Xoe=class{getWidgetAriaLabel(){return Vae(1770,"Quick Input")}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox&&e instanceof Goe)return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}},Joe=class{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new De,t.toDisposeTemplate=new De,t.entry=Mhe(e,joe(".quick-input-list-entry"));const i=Mhe(t.entry,joe("label.quick-input-list-label"));t.outerLabel=i,t.checkbox=t.toDisposeTemplate.add(new Ne),t.toDisposeTemplate.add(xn(i,On.CLICK,e=>{if(t.checkbox.value&&!e.defaultPrevented&&t.checkbox.value.enabled){const e=!t.checkbox.value.checked;t.checkbox.value.checked=e,t.element.checked=e}}));const n=Mhe(i,joe(".quick-input-list-rows")),o=Mhe(n,joe(".quick-input-list-row")),s=Mhe(n,joe(".quick-input-list-row"));return t.label=new BK(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=The(t.label.element,joe(".quick-input-list-icon")),t.keybinding=new fP(Mhe(o,joe(".quick-input-list-entry-keybinding")),Y),t.toDisposeTemplate.add(t.keybinding),t.detail=new BK(Mhe(s,joe(".quick-input-list-label-meta")),{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=Mhe(t.entry,joe(".quick-input-list-separator")),t.actionBar=new NE(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}},qoe=zoe=class extends Joe{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return qoe.ID}ensureCheckbox(e,t){if(!e.hasCheckbox)return t.checkbox.value?.domNode.remove(),void t.checkbox.clear();let i=t.checkbox.value;i?i.setTitle(e.saneLabel):(i=new WB(e.saneLabel,e.checked,{...lR,size:15}),t.checkbox.value=i,t.outerLabel.prepend(i.domNode)),e.checkboxDisabled?i.disable():i.enable(),i.checked=e.checked,t.toDisposeElement.add(e.onChecked(e=>i.checked=e)),t.toDisposeElement.add(i.onChange(()=>e.checked=i.checked))}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0;const o=n.item;n.element.classList.toggle("not-pickable",!1===n.item.pickable),this.ensureCheckbox(n,i);const{labelHighlights:s,descriptionHighlights:r,detailHighlights:a}=n;if(o.iconPath){const e=Epe(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,t=_i.revive(e);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=X_e(t)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let l;!n.saneTooltip&&n.saneDescription&&(l={markdown:{value:Wle(n.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const d={matches:s||[],descriptionTitle:l,descriptionMatches:r||[],labelEscapeNewLines:!0};if(d.extraClasses=o.iconClasses,d.italic=o.italic,d.strikethrough=o.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,d),i.keybinding.set(o.keybinding),n.saneDetail){let e;n.saneTooltip||(e={markdown:{value:Wle(n.saneDetail),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(n.saneDetail,void 0,{matches:a,title:e,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";n.separator?.label?(i.separator.textContent=n.separator.label,i.separator.style.display="",this.addItemWithSeparator(n)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!n.separator&&0!==n.childIndex);const c=o.buttons;c&&c.length?(i.actionBar.push(c.map((e,t)=>dLe(e,`id-${t}`,()=>n.fireButtonTriggered({button:e,item:n.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}},zoe.ID="quickpickitem",ese=zoe,ese=qoe=Uoe([Koe(1,Sf)],ese),tse=class e extends Joe{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return e.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const n=e.element;i.element=n,n.element=i.entry??void 0,n.element.classList.toggle("focus-inside",!!n.focusInsideSeparator);const o=n.separator,{labelHighlights:s,descriptionHighlights:r}=n;let a;i.icon.style.backgroundImage="",i.icon.className="",!n.saneTooltip&&n.saneDescription&&(a={markdown:{value:Wle(n.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:n.saneDescription});const l={matches:s||[],descriptionTitle:a,descriptionMatches:r||[],labelEscapeNewLines:!0};i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(n.saneLabel,n.saneDescription,l),i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const d=o.buttons;d&&d.length?(i.actionBar.push(d.map((e,t)=>dLe(e,`id-${t}`,()=>n.fireSeparatorButtonTriggered({button:e,separator:n.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(n)}disposeElement(e,t,i){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}},tse.ID="quickpickseparator",ise=class extends Ie{constructor(e,t,i,n,o,s){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=s,this._onKeyDown=new je,this._onLeave=new je,this.onLeave=this._onLeave.event,this._visibleCountObservable=Qce("VisibleCount",0),this.onChangedVisibleCount=Be.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=Qce("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=Be.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=Qce("CheckedCount",0),this.onChangedCheckedCount=Be.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=i_e({equalsFn:Zde},new Array),this.onChangedCheckedElements=Be.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new je,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new je,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new je,this._elementCheckedEventBufferer=new Je,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new De),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=Mhe(this.parent,joe(".quick-input-list")),this._separatorRenderer=new tse(t),this._itemRenderer=o.createInstance(ese,t),this._tree=this._register(o.createInstance(LK,"QuickInput",this._container,new Qoe,[this._itemRenderer,this._separatorRenderer],{filter:{filter:e=>e.hidden?0:e instanceof Yoe?2:1},sorter:{compare:(e,t)=>this.sortByLabel&&this._lastQueryString?function(e,t,i){const n=e.labelHighlights||[],o=t.labelHighlights||[];return n.length&&!o.length?-1:!n.length&&o.length?1:0===n.length&&0===o.length?0:hLe(e.saneSortLabel,t.saneSortLabel,i)}(e,t,this._lastQueryString.toLowerCase()):0},accessibilityProvider:new Xoe,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:Kz.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return Be.map(this._tree.onDidChangeFocus,e=>e.elements.filter(e=>e instanceof Goe).map(e=>e.item),this._store)}get onDidChangeSelection(){return Be.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(e=>e instanceof Goe).map(e=>e.item),event:e.browserEvent}),this._store)}get displayed(){return"none"!==this._container.style.display}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new we(e);10===t.keyCode&&this.toggleCheckbox(),this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(ehe(this._container,On.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(ehe(this._container,On.AUXCLICK,e=>{1===e.button&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(e=>!e.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new ut("function"==typeof this.hoverDelegate.delay?this.hoverDelegate.delay():this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(khe(t.browserEvent.target))e.cancel();else if(khe(t.browserEvent.relatedTarget)||!phe(t.browserEvent.relatedTarget,t.element?.element))try{await e.trigger(async()=>{t.element instanceof Goe&&this.showHover(t.element)})}catch(t){if(!Yae(t))throw t}})),this._register(this._tree.onMouseOut(t=>{phe(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const e=i===t;!!(i.focusInsideSeparator&Zoe.ACTIVE_ITEM)!==e&&(e?i.focusInsideSeparator|=Zoe.ACTIVE_ITEM:i.focusInsideSeparator&=~Zoe.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators)i===t&&(i.focusInsideSeparator&Zoe.MOUSE_HOVER||(i.focusInsideSeparator|=Zoe.MOUSE_HOVER,this._tree.rerender(i)))})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators)i===t&&i.focusInsideSeparator&Zoe.MOUSE_HOVER&&(i.focusInsideSeparator&=~Zoe.MOUSE_HOVER,this._tree.rerender(i))}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(e=>e instanceof Goe);t.length!==e.elements.length&&(1===e.elements.length&&e.elements[0]instanceof Yoe&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{t.hidden||t.checkboxDisabled||!1===t.item.pickable||(t.checked=e)})})}setElements(e){let t;this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes"),this._itemElements=new Array,this._elementTree=e.reduce((i,n,o)=>{let s;if("separator"===n.type){if(!n.buttons)return i;t=new Yoe(o,e=>this._onSeparatorButtonTriggered.fire(e),n),s=t}else{const r=o>0?e[o-1]:void 0;let a;r&&"separator"===r.type&&!r.buttons&&(a=r);const l=new Goe(o,t?.children?t.children.length:o,this._hasCheckboxes&&!1!==n.pickable,e=>this._onButtonTriggered.fire(e),this._elementChecked,n,a);if(this._itemElements.push(l),t)return t.children.push(l),i;s=l}return i.push(s),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const e=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),t=e?.parentNode;if(e&&t){const i=e.nextSibling;e.remove(),t.insertBefore(e,i)}},0)}setFocusedElements(e){const t=e.map(e=>this._itemElements.find(t=>t.item===e)).filter(e=>!!e).filter(e=>!e.hidden);if(this._tree.setFocus(t),e.length>0){const e=this._tree.getFocus()[0];e&&this._tree.reveal(e)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map(e=>this._itemElements.find(t=>t.item===e)).filter(e=>!!e);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const e of this._itemElements)e.checked=t.has(e.item)})}focus(e){if(this._itemElements.length)switch(e===JO.Second&&this._itemElements.length<2&&(e=JO.First),e){case JO.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,e=>e.element instanceof Goe);break;case JO.Second:{this._tree.scrollTop=0;let e=!1;this._tree.focusFirst(void 0,t=>t.element instanceof Goe&&(!!e||(e=!e,!1)));break}case JO.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,e=>e.element instanceof Goe);break;case JO.Next:{const e=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,e=>e.element instanceof Goe&&(this._tree.reveal(e.element),!0));const t=this._tree.getFocus();e.length&&e[0]===t[0]&&this._onLeave.fire();break}case JO.Previous:{const e=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,e=>{if(!(e.element instanceof Goe))return!1;const t=this._tree.getParentElement(e.element);return null===t||t.children[0]!==e.element?this._tree.reveal(e.element):this._tree.reveal(t),!0});const t=this._tree.getFocus();e.length&&e[0]===t[0]&&this._onLeave.fire();break}case JO.NextPage:this._tree.focusNextPage(void 0,e=>e.element instanceof Goe&&(this._tree.reveal(e.element),!0));break;case JO.PreviousPage:this._tree.focusPreviousPage(void 0,e=>{if(!(e.element instanceof Goe))return!1;const t=this._tree.getParentElement(e.element);return null===t||t.children[0]!==e.element?this._tree.reveal(e.element):this._tree.reveal(t),!0});break;case JO.NextSeparator:{let e=!1;const t=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,t=>{if(e)return!0;if(t.element instanceof Yoe)e=!0,this._separatorRenderer.isSeparatorVisible(t.element)?this._tree.reveal(t.element.children[0]):this._tree.reveal(t.element,0);else if(t.element instanceof Goe){if(t.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(t.element)?this._tree.reveal(t.element):this._tree.reveal(t.element,0),!0;if(t.element===this._elementTree[0])return this._tree.reveal(t.element,0),!0}return!1}),t===this._tree.getFocus()[0]&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,e=>e.element instanceof Goe));break}case JO.PreviousSeparator:{let e,t=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,i=>{if(i.element instanceof Yoe)t?e||(this._separatorRenderer.isSeparatorVisible(i.element)?this._tree.reveal(i.element):this._tree.reveal(i.element,0),e=i.element.children[0]):t=!0;else if(i.element instanceof Goe&&!e)if(i.element.separator)this._itemRenderer.isItemWithSeparatorVisible(i.element)?this._tree.reveal(i.element):this._tree.reveal(i.element,0),e=i.element;else if(i.element===this._elementTree[0])return this._tree.reveal(i.element,0),!0;return!1}),e&&this._tree.setFocus([e]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?44*Math.floor(e/44)+6+"px":"",this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let i;this._itemElements.forEach(n=>{let o;o="fuzzy"===this.matchOnLabelMode?this.matchOnLabel?Bbe(e,Wbe(n.saneLabel))??void 0:void 0:this.matchOnLabel?function(e,t){const{text:i,iconOffsets:n}=t;if(!n||0===n.length)return uLe(e,i);const o=Hle(i," "),s=i.length-o.length,r=uLe(e,o);if(r)for(const a of r){const e=n[a.start+s]+s;a.start+=e,a.end+=e}return r}(t,Wbe(n.saneLabel))??void 0:void 0;const s=this.matchOnDescription?Bbe(e,Wbe(n.saneDescription||""))??void 0:void 0,r=this.matchOnDetail?Bbe(e,Wbe(n.saneDetail||""))??void 0:void 0;if(o||s||r?(n.labelHighlights=o,n.descriptionHighlights=s,n.detailHighlights=r,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item||!n.item.alwaysShow),n.item?n.separator=void 0:n.separator&&(n.hidden=!0),!this.sortByLabel){const e=n.index&&this._inputElements[n.index-1]||void 0;"separator"!==e?.type||e.buttons||(i=e),i&&!n.hidden&&(n.separator=i,i=void 0)}})}else this._itemElements.forEach(e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this._inputElements[e.index-1];e.item&&(e.separator=t&&"separator"===t.type&&!t.buttons?t:void 0)});return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(e=>e instanceof Goe),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!(e?.saneTooltip&&e instanceof Goe))return;if(this._lastHover&&!this._lastHover.isDisposed)return void this._lastHover.dispose();this.showHover(e);const t=new De;t.add(this._tree.onDidChangeFocus(e=>{e.elements[0]instanceof Goe&&this.showHover(e.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof Yoe?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(e=>({element:e,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i<n;i++){const n=e[i];if(!n.hidden&&!1!==n.item.pickable){if(!n.checked)return!1;t=!0}}return t}_updateCheckedObservables(){Wce(e=>{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);const t=this._itemElements.filter(e=>e.checked).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)})}showHover(e){this._lastHover&&!this._lastHover.isDisposed&&(this.hoverDelegate.onDidHideHover?.(),this._lastHover?.dispose()),e.element&&e.saneTooltip&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:e=>{this.linkOpenerDelegate(e)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}},Uoe([Ape],ise.prototype,"onDidChangeFocus",null),Uoe([Ape],ise.prototype,"onDidChangeSelection",null),ise=Uoe([Koe(4,Jn),Koe(5,Fc)],ise),nse=F?256:2048,gLe({id:"quickInput.pageNext",primary:12,handler:mLe(JO.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),gLe({id:"quickInput.pagePrevious",primary:11,handler:mLe(JO.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),gLe({id:"quickInput.first",primary:nse+14,handler:mLe(JO.First)},{withAltMod:!0,withCmdMod:!0}),gLe({id:"quickInput.last",primary:nse+13,handler:mLe(JO.Last)},{withAltMod:!0,withCmdMod:!0}),gLe({id:"quickInput.next",primary:18,handler:mLe(JO.Next)},{withCtrlMod:!0}),gLe({id:"quickInput.previous",primary:16,handler:mLe(JO.Previous)},{withCtrlMod:!0}),ose=Vae(1760,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),sse=Vae(1761,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator."),F?(gLe({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:mLe(JO.NextSeparator,JO.Next),metadata:{description:ose}}),gLe({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:mLe(JO.NextSeparator)},{withCtrlMod:!0}),gLe({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:mLe(JO.PreviousSeparator,JO.Previous),metadata:{description:sse}}),gLe({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:mLe(JO.PreviousSeparator)},{withCtrlMod:!0})):(gLe({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:mLe(JO.NextSeparator,JO.Next),metadata:{description:ose}}),gLe({id:"quickInput.nextSeparator",primary:2578,handler:mLe(JO.NextSeparator)}),gLe({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:mLe(JO.PreviousSeparator,JO.Previous),metadata:{description:sse}}),gLe({id:"quickInput.previousSeparator",primary:2576,handler:mLe(JO.PreviousSeparator)})),ns.registerCommandAndKeybindingRule({id:"quickInput.accept",primary:3,weight:200,when:Po.and(Po.notEquals(Soe,"quickWidget"),Coe,Po.not("isComposing")),metadata:{description:Vae(1762,"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},handler:e=>{e.get(tA).currentQuickInput?.accept()},secondary:pLe(3,[],{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0})}),gLe({id:"quickInput.acceptInBackground",when:Po.and(Coe,Po.equals(Soe,"quickPick"),Po.or(OU.negate(),Doe)),primary:17,weight:250,handler:e=>{e.get(tA).currentQuickInput?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),function(e,t={}){ns.registerCommandAndKeybindingRule({weight:200,when:Coe,metadata:{description:Vae(1758,"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...e,secondary:pLe(e.primary,e.secondary??[],t)})}({id:"quickInput.hide",primary:9,handler:e=>{e.get(tA).currentQuickInput?.hide()}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),gLe({id:"quickInput.toggleHover",primary:10|nse,handler:e=>{e.get(tA).toggleHover()}}),ase=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},lse=function(e,t){return function(i,n){t(i,n,e)}},cse=Ahe,rse=class extends Ie{constructor(e,t,i,n){super(),this._hoverDelegate=e,this._buttonTriggeredEmitter=t,this.onCheckedEvent=i,this._themeService=n,this.templateId=dse.ID}renderTemplate(e){const t=new De,i=Mhe(e,cse(".quick-input-tree-entry")),n=t.add(new BB("",!1,{...lR,size:15}));i.appendChild(n.domNode);const o=Mhe(Mhe(Mhe(i,cse("label.quick-input-tree-label")),cse(".quick-input-tree-rows")),cse(".quick-input-tree-row")),s=The(o,cse(".quick-input-tree-icon")),r=t.add(new BK(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this._hoverDelegate})),a=t.add(new NE(i,this._hoverDelegate?{hoverDelegate:this._hoverDelegate}:void 0));return a.domNode.classList.add("quick-input-tree-entry-action-bar"),{toDisposeTemplate:t,entry:i,checkbox:n,icon:s,label:r,actionBar:a,toDisposeElement:new De}}renderElement(e,t,i,n){const o=i.toDisposeElement,s=e.element;if(!1===s.pickable?i.checkbox.domNode.style.display="none":(i.checkbox.domNode.style.display="",i.checkbox.checked=s.checked??!1,o.add(Be.filter(this.onCheckedEvent,e=>e.item===s)(e=>i.checkbox.checked=e.checked)),s.disabled&&i.checkbox.disable()),s.iconPath){const e=Epe(this._themeService.getColorTheme().type)?s.iconPath.dark:s.iconPath.light??s.iconPath.dark,t=_i.revive(e);i.icon.className="quick-input-tree-icon",i.icon.style.backgroundImage=X_e(t)}else i.icon.style.backgroundImage="",i.icon.className=s.iconClass?`quick-input-tree-icon ${s.iconClass}`:"";const{labelHighlights:r,descriptionHighlights:a}=e.filterData||{};let l;s.description&&(l={markdown:{value:Wle(s.description),supportThemeIcons:!0},markdownNotSupportedFallback:s.description}),i.label.setLabel(s.label,s.description,{matches:r,descriptionMatches:a,extraClasses:s.iconClasses,italic:s.italic,strikethrough:s.strikethrough,labelEscapeNewLines:!0,descriptionTitle:l});const d=s.buttons;d&&d.length?(i.actionBar.push(d.map((e,t)=>dLe(e,`tree-${t}`,()=>this._buttonTriggeredEmitter.fire({item:s,button:e}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i,n){i.toDisposeElement.clear(),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}},dse=rse,rse.ID="quickInputTreeElement",hse=rse,hse=dse=ase([lse(3,Sf)],hse),use=class{getHeight(e){return 22}getTemplateId(e){return hse.ID}},gse=class{constructor(e){this.onCheckedEvent=e}getWidgetAriaLabel(){return Vae(1772,"Quick Tree")}getAriaLabel(e){return e.ariaLabel||[e.label,e.description].map(e=>Fbe(e)).filter(e=>!!e).join(", ")}getWidgetRole(){return"tree"}getRole(e){return"checkbox"}isChecked(e){return{get value(){return"mixed"===e.checked?"mixed":!!e.checked},onDidChange:t=>Be.filter(this.onCheckedEvent,t=>t.item===e)(e=>t())}}},pse=class{constructor(){this.filterValue="",this.matchOnLabel=!0,this.matchOnDescription=!1}filter(e,t){if(!this.filterValue||!this.matchOnLabel&&!this.matchOnDescription)return e.children?{visibility:2,data:{}}:{visibility:1,data:{}};const i=this.matchOnLabel?Bbe(this.filterValue,Wbe(e.label))??void 0:void 0,n=this.matchOnDescription?Bbe(this.filterValue,Wbe(e.description||""))??void 0:void 0;return{visibility:1===t||i||n?1:e.children?2:0,data:{labelHighlights:i,descriptionHighlights:n}}}},mse=class extends Ie{constructor(){super(...arguments),this._sortByLabel=!0}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}compare(e,t){if(!this._sortByLabel)return 0;if(e.label<t.label)return-1;if(e.label>t.label)return 1;if(e.description&&t.description){if(e.description<t.description)return-1;if(e.description>t.description)return 1}else{if(e.description)return-1;if(t.description)return 1}return 0}},fse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},_se=function(e,t){return function(i,n){t(i,n,e)}},bse=Ahe,vse=class extends Ie{constructor(e,t,i){super(),this.instantiationService=i,this._onDidTriggerButton=this._register(new je),this._onDidChangeCheckboxState=this._register(new je),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidCheckedLeafItemsChange=this._register(new je),this._onLeave=new je,this.onLeave=this._onLeave.event,this._onDidAccept=this._register(new je),this.onDidAccept=this._onDidAccept.event,this._container=Mhe(e,bse(".quick-input-tree")),this._renderer=this._register(this.instantiationService.createInstance(hse,t,this._onDidTriggerButton,this.onDidChangeCheckboxState)),this._filter=this.instantiationService.createInstance(pse),this._sorter=this._register(new mse),this._tree=this._register(this.instantiationService.createInstance(LK,"QuickInputTree",this._container,new use,[this._renderer],{accessibilityProvider:new gse(this.onDidChangeCheckboxState),horizontalScrolling:!1,multipleSelectionSupport:!1,findWidgetEnabled:!1,alwaysConsumeMouseWheel:!0,hideTwistiesOfChildlessElements:!0,renderIndentGuides:Kz.None,expandOnDoubleClick:!0,expandOnlyOnTwistieClick:!0,disableExpandOnSpacebar:!0,sorter:this._sorter,filter:this._filter})),this.registerOnOpenListener()}get tree(){return this._tree}get displayed(){return"none"!==this._container.style.display}set displayed(e){this._container.style.display=e?"":"none"}get sortByLabel(){return this._sorter.sortByLabel}set sortByLabel(e){this._sorter.sortByLabel=e,this._tree.resort(null,!0)}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}updateFilterOptions(e){void 0!==e.matchOnLabel&&(this._filter.matchOnLabel=e.matchOnLabel),void 0!==e.matchOnDescription&&(this._filter.matchOnDescription=e.matchOnDescription),this._tree.refilter()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?44*Math.floor(e/44)+6+"px":"",this._tree.layout()}registerOnOpenListener(){this._register(this._tree.onDidOpen(e=>{const t=e.element;if(!t)return;if(t.disabled)return;if(!1===t.pickable)return this._tree.setFocus([t]),void this._onDidAccept.fire();const i=!0!==t.checked;if((t.checked??!1)===i)return;t.checked=i,this._tree.rerender(t);const n=new Set,o=[...this._tree.getNode(t).children];for(;o.length;){const e=o.shift();e?.element&&!n.has(e.element)&&(n.add(e.element),(e.element.checked??!1)!==t.checked&&(e.element.checked=t.checked,this._tree.rerender(e.element)),o.push(...e.children))}let s=this._tree.getParentElement(t);for(;s;){const e=fLe([...this._tree.getNode(s).children]);(s.checked??!1)!==e&&(s.checked=e,this._tree.rerender(s)),s=this._tree.getParentElement(s)}this._onDidChangeCheckboxState.fire({item:t,checked:t.checked??!1}),this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems())}))}getCheckedLeafItems(){const e=new Set,t=[...this._tree.getNode().children],i=new Array;for(;t.length;){const n=t.shift();n?.element&&!e.has(n.element)&&n.element.checked&&(e.add(n.element),t.push(...n.children),n.element.children||i.push(n.element))}return i}},vse=fse([_se(2,Jn)],vse),Cse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},yse=function(e,t){return function(i,n){t(i,n,e)}},xse=Ahe,kse="workbench.quickInput.viewState",wse=class extends Ie{get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,n,o){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.storageService=o,this.enabled=!0,this.onDidAcceptEmitter=this._register(new je),this.onDidCustomEmitter=this._register(new je),this.onDidTriggerButtonEmitter=this._register(new je),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new je),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new je),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=woe.bindTo(n),this.quickInputTypeContext=xoe.bindTo(n),this.endOfQuickInputBoxContext=Loe.bindTo(n),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(Be.runAndSubscribe(wn,({window:e,disposables:t})=>this.registerKeyModsListeners(e,t),{window:r,disposables:this._store})),this._register(Cn(e=>{this.ui&&pn(this.ui.container)===e&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))})),this.viewState=this.loadViewState()}registerKeyModsListeners(e,t){const i=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};for(const n of[On.KEY_DOWN,On.KEY_UP,On.MOUSE_DOWN])t.add(ehe(e,n,i,!0))}getUI(e){if(this.ui)return e&&pn(this._container)!==pn(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=Mhe(this._container,xse(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=npe(t),n=Mhe(t,xse(".quick-input-titlebar")),o=this._register(new NE(n,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const s=Mhe(n,xse(".quick-input-title")),r=this._register(new NE(n,{hoverDelegate:this.options.hoverDelegate}));r.domNode.classList.add("quick-input-right-action-bar");const a=Mhe(t,xse(".quick-input-header")),l=this._register(new BB(Vae(1763,"Toggle all checkboxes"),!1,{...lR,size:15}));Mhe(a,l.domNode),this._register(l.onChange(()=>{const e=l.checked;D.setAllVisibleChecked(!0===e)})),this._register(ehe(l.domNode,On.CLICK,e=>{(e.x||e.y)&&u.setFocus()}));const d=Mhe(a,xse(".quick-input-description")),c=Mhe(a,xse(".quick-input-and-message")),h=Mhe(c,xse(".quick-input-filter")),u=this._register(new Voe(h,this.styles.inputBox,this.styles.toggle));u.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=Mhe(h,xse(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=this._register(new PK(g,{countFormat:Vae(1764,"{0} Results")},this.styles.countBadge)),m=Mhe(h,xse(".quick-input-count"));m.setAttribute("aria-live","polite");const f=this._register(new PK(m,{countFormat:Vae(1765,"{0} Selected")},this.styles.countBadge)),_=this._register(new NE(a,{hoverDelegate:this.options.hoverDelegate}));_.domNode.classList.add("quick-input-inline-action-bar");const b=Mhe(a,xse(".quick-input-action")),v=this._register(new gP(b,this.styles.button));v.label=Vae(1766,"OK"),this._register(v.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));const w=Mhe(a,xse(".quick-input-action")),C=this._register(new gP(w,{...this.styles.button,supportIcons:!0}));C.label=Vae(1767,"Custom"),this._register(C.onDidClick(e=>{this.onDidCustomEmitter.fire()}));const y=Mhe(c,xse(`#${this.idPrefix}message.quick-input-message`)),S=this._register(new Woe(t,this.styles.progressBar));S.getContainer().classList.add("quick-input-progress");const x=Mhe(t,xse(".quick-input-html-widget"));x.tabIndex=-1;const k=Mhe(t,xse(".quick-input-description")),L=this.idPrefix+"list",D=this._register(this.instantiationService.createInstance(ise,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,L));u.setAttribute("aria-controls",L),this._register(D.onDidChangeFocus(()=>{u.hasFocus()&&u.setAttribute("aria-activedescendant",D.getActiveDescendant()??"")})),this._register(D.onChangedAllVisibleChecked(e=>{l.checked=e})),this._register(D.onChangedVisibleCount(e=>{p.setCount(e)})),this._register(D.onChangedCheckedCount(e=>{Z(()=>f.setCount(e))})),this._register(D.onLeave(()=>{setTimeout(()=>{this.controller&&(u.setFocus(),this.controller instanceof Eoe&&this.controller.canSelectMany&&D.clearFocus())},0)}));const I=this._register(this.instantiationService.createInstance(vse,t,this.options.hoverDelegate));this._register(I.tree.onDidChangeFocus(()=>{u.hasFocus()&&u.setAttribute("aria-activedescendant",I.getActiveDescendant()??"")})),this._register(I.onLeave(()=>{setTimeout(()=>{this.controller&&(u.setFocus(),I.tree.setFocus([]))},0)})),this._register(I.onDidAccept(()=>{this.onDidAcceptEmitter.fire()})),this._register(I.tree.onDidChangeContentHeight(()=>this.updateLayout()));const N=Ehe(t);return this._register(N),this._register(ehe(t,On.FOCUS,e=>{const t=this.getUI();if(phe(e.relatedTarget,t.inputContainer)){const e=t.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==e&&this.endOfQuickInputBoxContext.set(e)}phe(e.relatedTarget,t.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=xhe(e.relatedTarget)?e.relatedTarget:void 0)},!0)),this._register(N.onDidBlur(()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(QO.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(u.onKeyDown(e=>{const t=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==t&&this.endOfQuickInputBoxContext.set(t),u.removeAttribute("aria-activedescendant")})),this._register(ehe(t,On.FOCUS,e=>{u.setFocus()})),this.dndController=this._register(this.instantiationService.createInstance(Dse,this._container,t,[{node:n,includeChildren:!0},{node:a,includeChildren:!1}],this.viewState)),this._register(Rce(e=>{const t=this.dndController?.dndViewState.read(e);t&&(void 0!==t.top&&void 0!==t.left?this.viewState={...this.viewState,top:t.top,left:t.left}:this.viewState=void 0,this.updateLayout(),t.done&&this.saveViewState(this.viewState))})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:n,title:s,description1:k,description2:d,widget:x,rightActionBar:r,inlineActionBar:_,checkAll:l,inputContainer:c,filterContainer:h,inputBox:u,visibleCountContainer:g,visibleCount:p,countContainer:m,count:f,okContainer:b,ok:v,message:y,customButtonContainer:w,customButton:C,list:D,tree:I,progressBar:S,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e),linkOpenerDelegate:e=>this.options.linkOpenerDelegate(e)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,Mhe(this._container,this.ui.container),this.dndController?.reparentUI(this._container))}pick(e,t={},i=it.None){return new Promise((n,o)=>{let s=e=>{s=n,t.onKeyMods?.(r.keyMods),n(e)};if(i.isCancellationRequested)return void s(void 0);const r=this.createQuickPick({useSeparators:!0});let a;const l=[r,r.onDidAccept(()=>{if(r.canSelectMany)s(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(s(e),r.hide())}}),r.onDidChangeActive(e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)}),r.onDidChangeSelection(e=>{if(!r.canSelectMany){const t=e[0];t&&(s(t),r.hide())}}),r.onDidTriggerItemButton(e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...e,removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter(e=>e!==i[0]),o=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=o}}})),r.onDidTriggerSeparatorButton(e=>t.onDidTriggerSeparatorButton?.(e)),r.onDidChangeValue(e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])}),i.onCancellationRequested(()=>{r.hide()}),r.onDidHide(()=>{kle(l),s(void 0)})];r.title=t.title,t.value&&(r.value=t.value),r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.prompt=t.prompt,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,void 0!==t.sortByLabel&&(r.sortByLabel=t.sortByLabel),r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.quickNavigate=t.quickNavigate,r.hideInput=!!t.hideInput,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then(([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter(e=>"separator"!==e.type&&e.picked)),a&&(r.activeItems=[a])}),r.show(),Promise.resolve(e).then(void 0,e=>{o(e),r.hide()})})}setValidationOnInput(e,t){t&&sle(t)?(e.severity=Yv.Error,e.validationMessage=t):t&&!sle(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=Yv.Ignore,e.validationMessage=void 0)}input(e={},t=it.None){return new Promise(i=>{if(t.isCancellationRequested)return void i(void 0);const n=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),s=Be.debounce(n.onDidChangeValue,(e,t)=>t,100);let r=e.value||"",a=Promise.resolve(o(r));const l=[n,s(e=>{e!==r&&(a=Promise.resolve(o(e)),r=e),a.then(t=>{e===r&&this.setValidationOnInput(n,t)})}),n.onDidAccept(()=>{const e=n.value;e!==r&&(a=Promise.resolve(o(e)),r=e),a.then(t=>{!t||!sle(t)&&t.severity!==Yv.Error?(i(e),n.hide()):e===r&&this.setValidationOnInput(n,t)})}),t.onCancellationRequested(()=>{n.hide()}),n.onDidHide(()=>{kle(l),i(void 0)})];n.title=e.title,n.value=e.value||"",n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.placeholder=e.placeHolder,n.password=!!e.password,n.ignoreFocusOut=!!e.ignoreFocusLost,n.show()})}createQuickPick(e={useSeparators:!1}){return new Eoe(this.getUI(!0))}createInputBox(){return new Moe(this.getUI(!0))}show(e){const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",Rhe(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Yv.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Rhe(t.message),t.progressBar.stop(),t.progressBar.getContainer().setAttribute("aria-hidden","true"),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.tree.updateFilterOptions({matchOnDescription:!1,matchOnLabel:!0}),t.tree.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const n=this.options.backKeybindingLabel();Ioe.tooltip=n?Vae(1768,"Back ({0})",n):Vae(1769,"Back"),t.container.style.display="",this.updateLayout(),this.dndController?.layoutContainer(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&"none"!==this.ui.container.style.display}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.domNode.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.displayed=!!e.list,t.tree.displayed=!!e.tree,t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;const t=this.getUI();for(const i of t.leftActionBar.viewItems)i.action.enabled=e;for(const i of t.rightActionBar.viewItems)i.action.enabled=e;e?t.checkAll.enable():t.checkAll.disable(),t.inputBox.enabled=e,t.ok.enabled=e,t.list.enabled=e}}hide(e){const t=this.controller;if(!t)return;t.willHide(e);const i=this.ui?.container,n=i&&!Che(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!n){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=e.parentElement??void 0;e?.offsetParent?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}toggleHover(){this.isVisible()&&this.controller instanceof Eoe&&this.getUI().list.toggleHover()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,Sse.MAX_WIDTH);e.width=t+"px",e.top=`${this.viewState?.top?Math.round(this.dimension.height*this.viewState.top):this.titleBarOffset}px`,e.left=`${Math.round(this.dimension.width*(this.viewState?.left??.5)-t/2)}px`,this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height),this.ui.tree.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list),this.ui.tree.tree.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}loadViewState(){try{const e=JSON.parse(this.storageService.get(kse,-1,"{}"));if(void 0!==e.top||void 0!==e.left)return e}catch{}}saveViewState(e){this.layoutService.activeContainer===this.layoutService.mainContainer&&(void 0!==e?this.storageService.store(kse,JSON.stringify(e),-1,1):this.storageService.remove(kse,-1))}},Sse=wse,wse.MAX_WIDTH=600,Lse=wse,Lse=Sse=Cse([yse(1,_P),yse(2,Jn),yse(3,es),yse(4,eR)],Lse),Dse=class extends Ie{constructor(e,t,i,n,o,s,r){super(),this._container=e,this._quickInputContainer=t,this._quickInputDragAreas=i,this._layoutService=o,this.configurationService=r,this.dndViewState=Qce(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=yoe.bindTo(s);const a="custom"===function(e){if(V||F||"native"===xwe(e))return"native";const t=e.getValue("window")?.controlsStyle;return"custom"===t||"hidden"===t?t:"native"}(this.configurationService);this._controlsOnLeft=a&&1===q,this._controlsOnRight=a&&(3===q||2===q),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...n,done:!0},void 0)}reparentUI(e){this._container=e}layoutContainer(e=this._layoutService.activeContainerDimension){const t=this.dndViewState.get(),i=this._quickInputContainer.getBoundingClientRect();if(t?.top&&t?.left){const n=Math.round(100*t.left)/100*e.width-i.width/2;this._layout(t.top*e.height,n)}}_registerLayoutListener(){this._register(Be.filter(this._layoutService.onDidLayoutContainer,e=>e.container===this._container)(e=>this.layoutContainer(e.dimension)))}registerMouseListeners(){const e=this._quickInputContainer;this._register(nhe(e,t=>{const i=new Se(pn(e),t);2===i.detail&&this._quickInputDragAreas.some(({node:e,includeChildren:t})=>t?phe(i.target,e):i.target===e)&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)})),this._register(ihe(e,e=>{const t=pn(this._layoutService.activeContainer),i=new Se(t,e);if(!this._quickInputDragAreas.some(({node:e,includeChildren:t})=>t?phe(i.target,e):i.target===e))return;const n=this._quickInputContainer.getBoundingClientRect(),o=i.browserEvent.clientX-n.left,s=i.browserEvent.clientY-n.top;let r=!1;const a=(l=e=>{new Se(t,e).preventDefault(),r||(r=!0),this._layout(e.clientY-s,e.clientX-o)},ehe(t,U&&oe.pointerEvents?On.POINTER_MOVE:On.MOUSE_MOVE,l,d));var l,d;const c=nhe(t,e=>{if(r){const e=this.dndViewState.get();this.dndViewState.set({top:e?.top,left:e?.left,done:!0},void 0)}a.dispose(),c.dispose()})}))}_layout(e,t){const i=this._getTopSnapValue(),n=this._getCenterYSnapValue(),o=this._getCenterXSnapValue();(e=Math.max(0,Math.min(e,this._container.clientHeight-this._quickInputContainer.clientHeight)))<this._layoutService.activeContainerOffset.top&&(this._controlsOnLeft?t=Math.max(t,80/Kae(She())):this._controlsOnRight&&(t=Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth-140/Kae(She()))));const s=Math.abs(e-i)<this._snapThreshold;e=s?i:e;const r=Math.abs(e-n)<this._snapThreshold,a=(e=r?n:e)/this._container.clientHeight;t=Math.max(0,Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth));const l=Math.abs(t-o)<this._snapThreshold;t=l?o:t;const d=this._container.clientWidth,c=(t+this._quickInputContainer.clientWidth/2)/d;if(this.dndViewState.set({top:a,left:c,done:!1},void 0),l){if(s)return void this._quickInputAlignmentContext.set("top");if(r)return void this._quickInputAlignmentContext.set("center")}this._quickInputAlignmentContext.set(void 0)}_getTopSnapValue(){return this._layoutService.activeContainerOffset.quickPickTop}_getCenterYSnapValue(){return Math.round(this._container.clientHeight*this._snapLineHorizontalRatio)}_getCenterXSnapValue(){return Math.round(this._container.clientWidth/2)-Math.round(this._quickInputContainer.clientWidth/2)}},Dse=Cse([yse(4,_P),yse(5,es),yse(6,ka)],Dse),Ise=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Nse=function(e,t){return function(i,n){t(i,n,e)}},Ese=class extends Lf{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(hoe))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=o,this._onShow=this._register(new je),this._onHide=this._register(new je),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),linkOpenerDelegate:e=>{this.instantiationService.invokeFunction(t=>{t.get(SA).open(e,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(Toe))},n=this._register(this.instantiationService.createInstance(Lse,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(t=>{pn(e.activeContainer)===pn(n.container)&&n.layout(t,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Jo(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,i=it.None){return this.controller.pick(e,t,i)}input(e={},t=it.None){return this.controller.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}toggleHover(){this.hasController&&this.controller.toggleHover()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:gpe(np),quickInputForeground:gpe(op),quickInputTitleBackground:gpe(sp),widgetBorder:gpe(au),widgetShadow:gpe(ru)},inputBox:dR,toggle:aR,countBadge:hR,button:sR,progressBar:rR,keybindingLabel:oR,list:ywe({listBackground:np,listFocusBackground:hp,listFocusForeground:dp,listInactiveFocusForeground:dp,listInactiveSelectionIconForeground:cp,listInactiveFocusBackground:hp,listFocusOutline:hh,listInactiveFocusOutline:hh,treeStickyScrollBackground:np}),pickerGroup:{pickerGroupBorder:gpe(ap),pickerGroupForeground:gpe(rp)}}}},Ese=Ise([Nse(0,Jn),Nse(1,es),Nse(2,Sf),Nse(3,_P),Nse(4,ka)],Ese),Mse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Tse=function(e,t){return function(i,n){t(i,n,e)}},Rse=class extends Ese{constructor(e,t,i,n,o,s){super(t,i,n,new xie(e.getContainerDomNode(),o),s),this.host=void 0;const r=Ase.get(e);if(r){const t=r.widget;this.host={_serviceBrand:void 0,get mainContainer(){return t.getDomNode()},getContainer:()=>t.getDomNode(),whenContainerStylesLoaded(){},get containers(){return[t.getDomNode()]},get activeContainer(){return t.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return Be.map(e.onDidLayoutChange,e=>({container:t.getDomNode(),dimension:e}))},get onDidChangeActiveContainer(){return Be.None},get onDidAddContainer(){return Be.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}},Rse=Mse([Tse(1,Jn),Tse(2,es),Tse(3,Sf),Tse(4,eo),Tse(5,ka)],Rse),Ose=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(Rse,e);this.mapEditorToService.set(e,t),Sle(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,i=it.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}toggleHover(){return this.activeService.toggleHover()}},Ose=Mse([Tse(0,Jn),Tse(1,eo)],Ose),Ase=class e{static get(t){return t.getContribution(e.ID)}constructor(e){this.editor=e,this.widget=new Pse(this.editor)}dispose(){this.widget.dispose()}},Ase.ID="editor.controller.quickInput",(Pse=class e{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return e.ID}getDomNode(){return this.domNode}getPosition(){return{preference:{top:0,left:0}}}dispose(){this.codeEditor.removeOverlayWidget(this)}}).ID="editor.contrib.quickInputWidget",Iue(Ase.ID,Ase,4),Fse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Wse=function(e,t){return function(i,n){t(i,n,e)}},Bse=class extends Ie{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new je,this._onDidChangeReducedMotion=new je,this._onDidChangeLinkUnderline=new je,this._accessibilityModeEnabledContext=Wc.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const o=r.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(o),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(ehe(e,"change",()=>{this._systemMotionReduced=e.matches,"auto"===this._configMotionReduced&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const e=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("monaco-reduce-motion",e),this._layoutService.mainContainer.classList.toggle("monaco-enable-motion",!e)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("accessibility.underlineLinks")&&(this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this._onDidChangeLinkUnderline.fire())}));const e=()=>{const e=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",e)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return"on"===e||"auto"===e&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}},Bse=Fse([Wse(0,es),Wse(1,_P),Wse(2,ka)],Bse),Hse=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},zse=function(e,t){return function(i,n){t(i,n,e)}},Kse="application/vnd.code.resources",Vse=class extends Ie{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(g||p)&&this.installWebKitWriteTextWorkaround(),this._register(Be.runAndSubscribe(wn,({window:e,disposables:t})=>{t.add(ehe(e.document,"copy",()=>this.clearResourcesState()))},{window:r,disposables:this._store}))}triggerPaste(){this.logService.trace("BrowserClipboardService#triggerPaste")}installWebKitWriteTextWorkaround(){const e=()=>{const e=new Ct;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,She().navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch(async t=>{t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)})};this._register(Be.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(ehe(t,"click",e)),i.add(ehe(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.logService.trace("BrowserClipboardService#writeText called with type:",t," text.length:",e.length),this.clearResourcesState(),t)return this.mapTextToType.set(t,e),void this.logService.trace("BrowserClipboardService#writeText");if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return this.logService.trace("before navigator.clipboard.writeText"),await She().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){this.logService.trace("BrowserClipboardService#fallbackWriteText");const t=yhe(),i=t.activeElement,n=t.body.appendChild(Ahe("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),xhe(i)&&i.focus(),n.remove()}async readText(e){if(this.logService.trace("BrowserClipboardService#readText called with type:",e),e){const t=this.mapTextToType.get(e)||"";return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}try{const e=await She().navigator.clipboard.readText();return this.logService.trace("BrowserClipboardService#readText text.length:",e.length),e}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async readResources(){try{const e=await She().navigator.clipboard.read();for(const t of e)if(t.types.includes(`web ${Kse}`)){const e=await t.getType(`web ${Kse}`);return JSON.parse(await e.text()).map(e=>_i.from(e))}}catch(t){}const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(0!==this.resources.length)return Ude((await this.readText()).substring(0,Use.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}},Use=Vse,Vse.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,qse=Vse,qse=Use=Hse([zse(0,_P),zse(1,Ks)],qse),$se=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Gse=function(e,t){return function(i,n){t(i,n,e)}},Zse="data-keybinding-context",Yse=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}},(jse=Qse=class extends Yse{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}).INSTANCE=new jse,(Xse=class e extends Yse{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=VA.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(e=>{if(7===e.source){const e=Array.from(this._values,([e])=>e);this._values.clear(),i.fire(new tre(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...ke.map(n,([e])=>e)),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new tre(t))}})}dispose(){this._listener.dispose()}getValue(t){if(0!==t.indexOf(e._keyPrefix))return super.getValue(t);if(this._values.has(t))return this._values.get(t);const i=t.substr(e._keyPrefix.length),n=this._configurationService.getValue(i);let o;switch(typeof n){case"number":case"boolean":case"string":o=n;break;default:o=Array.isArray(n)?JSON.stringify(n):n}return this._values.set(t,o),o}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}})._keyPrefix="config.",Jse=class{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}},ere=class{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}},tre=class{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}},ire=class{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}},nre=class extends Ie{get onDidChangeContext(){return this._onDidChangeContext.event}constructor(e){super(),this._onDidChangeContext=this._register(new Ze({merge:e=>new ire(e)})),this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Jse(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new sre(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return!e||e.evaluate(t)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new ere(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new ere(e))}getContext(e){return this._isDisposed?Qse.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(Zse)){const t=e.getAttribute(Zse);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}dispose(){super.dispose(),this._isDisposed=!0}},ore=class extends nre{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0,this.inputFocusedContext=OU.bindTo(this);const t=this._register(new Xse(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t),this._register(Be.runAndSubscribe(wn,({window:e,disposables:t})=>{const i=t.add(new Ne);t.add(ehe(e,On.FOCUS_IN,()=>{i.value=new De,this.updateInputContextKeys(e.document,i.value)},!0))},{window:r,disposables:this._store}))}updateInputContextKeys(e,t){function i(){return!!e.activeElement&&zhe(e.activeElement)}const n=i();if(this.inputFocusedContext.set(n),n){const n=t.add(Ehe(e.activeElement));Be.once(n.onDidBlur)(()=>{She().document===e&&this.inputFocusedContext.set(i()),n.dispose()},void 0,t)}}getContextValuesContainer(e){return this._isDisposed?Qse.INSTANCE:this._contexts.get(e)||Qse.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new Yse(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}},ore=$se([Gse(0,ka)],ore),sre=class extends nre{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Ne),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(Zse)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute"+(e?": "+e:""))}this._domNode.setAttribute(Zse,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const t=this._parent.getContextValuesContainer(this._myContextId).value;var i;i=t,e.allKeysContainedIn(new Set(Object.keys(i)))||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(Zse),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Qse.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}},_o.registerCommand("_setContext",_Le),_o.registerCommand({id:"getContextKeyInfo",handler:()=>[...Jo.all()].sort((e,t)=>e.key.localeCompare(t.key)),metadata:{description:Vae(1674,"A command that returns information about context keys"),args:[]}}),_o.registerCommand("_generateContextKeyInfo",function(){const e=[],t=new Set;for(const i of Jo.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort((e,t)=>e.key.localeCompare(t.key)),console.log(JSON.stringify(e,void 0,2))}),rre=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}},are=class{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new rre(t,e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...i.incoming.keys()].join(", ")}]\n\t(outgoing ->)[${[...i.outgoing.keys()].join(",")}]\n`);return e.join("\n")}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const e=this._findCycle(n,t);if(e)return e;t.delete(i)}}},dre=class extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}},cre=class e{constructor(e=new dL,t=!1,i,n=!1){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(Jn,this),this._globalGraph=n?i?._globalGraph??new are(e=>e):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,kle(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)xle(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(t,i){this._throwIfDisposed();const n=this,o=new class extends e{dispose(){n._children.delete(o),super.dispose()}}(t,this._strict,this,this._enableTracing);return this._children.add(o),i?.add(o),o}invokeFunction(e,...t){this._throwIfDisposed();const i=hre.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:e=>{if(n)throw Xae("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(e,i);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t},getIfExists:e=>{if(n)throw Xae("service accessor is only valid during the invocation of its target method");return this._getOrCreateServiceInstance(e,i)}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return this._throwIfDisposed(),e instanceof Da?(i=hre.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=hre.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=Xn.getServiceDependencies(e).sort((e,t)=>e.index-t.index),o=[];for(const r of n){const t=this._getOrCreateServiceInstance(r.id,i);t||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${r.id}.`,!1),o.push(t)}const s=n.length>0?n[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const i=s-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,s)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Da)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setCreatedServiceInstance(e,t)}}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof Da?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const n=new are(e=>e.id.toString());let o=0;const s=[{id:e,desc:t,_trace:i}],r=new Set;for(;s.length;){const t=s.pop();if(!r.has(String(t.id))){if(r.add(String(t.id)),n.lookupOrInsertNode(t),o++>1e3)throw new dre(n);for(const i of Xn.getServiceDependencies(t.desc.ctor)){const o=this._getServiceInstanceOrDescriptor(i.id);if(o||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(t.id),String(i.id)),o instanceof Da){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};n.insertEdge(t,e),s.push(e)}}}}for(;;){const e=n.roots();if(0===e.length){if(!n.isEmpty())throw new dre(n);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof Da){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setCreatedServiceInstance(t.id,e)}n.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof Da)return this._createServiceInstance(e,t,i,n,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(t,i,n=[],o,s,r){if(o){const o=new e(void 0,this._strict,this,this._enableTracing);o._globalGraphImplicitDependency=String(t);const a=new Map,l=new wt(()=>{const e=o._createInstance(i,n,s);for(const[t,i]of a){const n=e[t];if("function"==typeof n)for(const t of i)t.disposable=n.apply(e,t.listener)}return a.clear(),r.add(e),e});return new Proxy(Object.create(null),{get(e,t){if(!l.isInitialized&&"string"==typeof t&&(t.startsWith("onDid")||t.startsWith("onWill"))){let e=a.get(t);return e||(e=new Ae,a.set(t,e)),(i,n,o)=>{if(l.isInitialized)return l.value[t](i,n,o);{const t={listener:[i,n,o],disposable:void 0},s=e.push(t);return Dle(()=>{s(),t.disposable?.dispose()})}}}if(t in e)return e[t];const i=l.value;let n=i[t];return"function"!=typeof n||(n=n.bind(i),e[t]=n),n},set:(e,t,i)=>(l.value[t]=i,!0),getPrototypeOf:e=>i.prototype})}{const e=this._createInstance(i,n,s);return r.add(e),e}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}},hre=class e{static traceInvocation(t,i){return t?new e(2,i.name||(new Error).stack.split("\n").slice(3,4).join("\n")):e._None}static traceCreation(t,i){return t?new e(1,i.name):e._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(t,i){const n=new e(3,t.toString());return this._dep.push([t,i,n]),n}stop(){const t=Date.now()-this._start;e._totals+=t;let i=!1;const n=[`${1===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(t,n){const o=[],s=new Array(t+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){i=!0,o.push(`${s}CREATES -> ${r}`);const n=e(t+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}(1,this)}`,`DONE, took ${t.toFixed(2)}ms (grand total ${e._totals.toFixed(2)}ms)`];(t>2||i)&&e.all.add(n.join("\n"))}},(lre=hre).all=new Set,lre._None=new class extends lre{constructor(){super(0,null)}stop(){}branch(){return this}},lre._totals=0,ure=new Set([yi.inMemory,yi.vscodeSourceControl,yi.walkThrough,yi.walkThroughSnippet,yi.vscodeChatCodeBlock,yi.vscodeTerminal]),gre=class{constructor(){this._byResource=new ys,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let o=this._byOwner.get(t);o||(o=new ys,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){return this._byResource.get(e)?.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const s=this._byOwner.get(t);if(s&&(n=s.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){return"string"==typeof e?this._byOwner.get(e)?.values()??ke.empty():_i.isUri(e)?this._byResource.get(e)?.values()??ke.empty():ke.map(ke.concat(...this._byOwner.values()),e=>e[1])}},pre=class{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ys,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(ure.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===vF.Error?t.errors+=1:i===vF.Warning?t.warnings+=1:i===vF.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}},mre=class e{constructor(){this._onMarkerChanged=new Ye({delay:0,merge:e._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new gre,this._stats=new pre(this),this._filteredResources=new ys}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(t,i,n){if(oce(n))this._data.delete(i,t)&&this._onMarkerChanged.fire([i]);else{const o=[];for(const s of n){const n=e._toMarker(t,i,s);n&&o.push(n)}this._data.set(i,t,o),this._onMarkerChanged.fire([i])}}static _toMarker(e,t,i){let{code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:d,endColumn:c,relatedInformation:h,tags:u,origin:g}=i;if(s)return a=a>0?a:1,l=l>0?l:1,d=d>=a?d:a,c=c>0?c:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:d,endColumn:c,relatedInformation:h,tags:u,origin:g}}changeAll(t,i){const n=[],o=this._data.values(t);if(o)for(const e of o){const i=ke.first(e);i&&(n.push(i.resource),this._data.delete(i.resource,t))}if(sce(i)){const o=new ys;for(const{resource:s,marker:r}of i){const i=e._toMarker(t,s,r);if(!i)continue;const a=o.get(s);a?a.push(i):(o.set(s,[i]),n.push(s))}for(const[e,i]of o)this._data.set(e,t,i)}n.length>0&&this._onMarkerChanged.fire(n)}_createFilteredMarker(e,t){const i=1===t.length?Vae(1738,'Problems are paused because: "{0}"',t[0]):Vae(1739,'Problems are paused because: "{0}" and {1} more',t[0],t.length-1);return{owner:"markersFilter",resource:e,severity:vF.Info,message:i,startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1}}read(t=Object.create(null)){let{owner:i,resource:n,severities:o,take:s}=t;if((!s||s<0)&&(s=-1),i&&n){const r=t.ignoreResourceFilters?void 0:this._filteredResources.get(n);if(r?.length)return[this._createFilteredMarker(n,r)];const a=this._data.get(n,i);if(!a)return[];const l=[];for(const i of a){if(s>0&&l.length===s)break;const r=t.ignoreResourceFilters?void 0:this._filteredResources.get(n);r?.length?l.push(this._createFilteredMarker(n,r)):e._accept(i,o)&&l.push(i)}return l}{const r=i||n?this._data.values(n??i):this._data.values(),a=[],l=new Ss;for(const i of r)for(const n of i){if(l.has(n.resource))continue;if(s>0&&a.length===s)break;const i=t.ignoreResourceFilters?void 0:this._filteredResources.get(n.resource);i?.length?(a.push(this._createFilteredMarker(n.resource,i)),l.add(n.resource)):e._accept(n,o)&&a.push(n)}return a}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new ys;for(const i of e)for(const e of i)t.set(e,!0);return Array.from(t.keys())}},fre=class extends Ie{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=ane.createEmptyModel(e)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=ane.createEmptyModel(this.logService);const e=ts.as(Pa.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const e=i[n],o=t[n];void 0!==e?this._configurationModel.setValue(n,e):o?this._configurationModel.setValue(n,Bue(o.default)):this._configurationModel.removeValue(n)}}},_re=class extends Ie{constructor(e,t=[]){super(),this.logger=new Ys([e,...t]),this._register(e.onDidChangeLogLevel(e=>this.setLevel(e)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}},bre=class{getParserClass(){throw new Error("not implemented in StandaloneTreeSitterLibraryService")}supportsLanguage(e,t){return!1}getLanguage(e,t,i){}getInjectionQueries(e,t){return null}getHighlightingQueries(e,t){return null}},vre=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},wre=function(e,t){return function(i,n){t(i,n,e)}},Cre=class{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new je}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}},yre=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Me(new Cre(t))):Promise.reject(new Error("Model not found"))}},yre=vre([wre(0,io)],yre),(Sre=class e{show(){return e.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}).NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}},xre=class{withProgress(e,t,i){return t({report:()=>{}})}},kre=class{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}},Lre=class{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+"\n\n"+t),r.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){const i=[...e.buttons??[]];e.cancelButton&&"string"!=typeof e.cancelButton&&"boolean"!=typeof e.cancelButton&&i.push(e.cancelButton),t=await(i[0]?.run({checkboxChecked:!1}))}return{result:t}}async error(e,t){await this.prompt({type:Yv.Error,message:e,detail:t})}},(Dre=class e{info(e){return this.notify({severity:Yv.Info,message:e})}warn(e){return this.notify({severity:Yv.Warning,message:e})}error(e){return this.notify({severity:Yv.Error,message:e})}notify(t){switch(t.severity){case Yv.Error:console.error(t.message);break;case Yv.Warning:console.warn(t.message);break;default:console.log(t.message)}return e.NO_OP}prompt(t,i,n,o){return e.NO_OP}status(e,t){return{close:()=>{}}}}).NO_OP=new Jv,Ire=class{constructor(e){this._onWillExecuteCommand=new je,this._onDidExecuteCommand=new je,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=_o.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}},Ire=vre([wre(0,Jn)],Ire),Nre=class extends _ne{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const r=e=>{const t=new De;t.add(ehe(e,On.KEY_DOWN,e=>{const t=new we(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())})),t.add(ehe(e,On.KEY_UP,e=>{const t=new we(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()})),this._domNodeListeners.push(new Ere(e,t))},a=e=>{for(let t=0;t<this._domNodeListeners.length;t++){const i=this._domNodeListeners[t];i.domNode===e&&(this._domNodeListeners.splice(t,1),i.dispose())}},l=e=>{e.getOption(70)||r(e.getContainerDomNode())};this._register(s.onCodeEditorAdd(l)),this._register(s.onCodeEditorRemove(e=>{e.getOption(70)||a(e.getContainerDomNode())})),s.listCodeEditors().forEach(l);const d=e=>{r(e.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(e=>{a(e.getContainerDomNode())})),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,i,n){return Lle(_o.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(e=>({keybinding:wle(e.keybinding,Y),command:e.command??null,commandArgs:e.commandArgs,when:e.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Dle(()=>{for(let e=0;e<this._dynamicKeybindings.length;e++)if(this._dynamicKeybindings[e]===t[0])return this._dynamicKeybindings.splice(e,t.length),void this.updateResolver()})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){return this._cachedResolver||(this._cachedResolver=new pne(this._toNormalizedKeybindingItems(ns.getDefaultKeybindings(),!0),this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1),e=>this._log(e))),this._cachedResolver}_documentHasFocus(){return r.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const e=o.when||void 0,s=o.keybinding;if(s){const r=Cne.resolveKeybinding(s,Y);for(const s of r)i[n++]=new vne(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new vne(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){return new Cne([new pe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode)],Y)}},Nre=vre([wre(0,es),wre(1,fo),wre(2,fs),wre(3,Xv),wre(4,Ks),wre(5,eo)],Nre),Ere=class extends Ie{constructor(e,t){super(),this.domNode=e,this._register(t)}},Mre=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new je,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new fre(e);this._configuration=new cne(t.reload(),ane.createEmptyModel(e),ane.createEmptyModel(e),ane.createEmptyModel(e),ane.createEmptyModel(e),ane.createEmptyModel(e),new ys,ane.createEmptyModel(e),new ys,e),t.dispose()}getValue(e,t){const i="string"==typeof e?e:void 0,n=bLe(e)?e:bLe(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const n of e){const[e,t]=n;this.getValue(e)!==t&&(this._configuration.updateValue(e,t),i.push(e))}if(i.length>0){const e=new hne({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);e.source=8,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}},Mre=vre([wre(0,Ks)],Mre),Tre=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new je,this.configurationService.onDidChangeConfiguration(e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})})}getValue(e,t,i){const n=to.isIPosition(t)?t:null,o=n?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0,s=e?this.getLanguage(e,n):void 0;return void 0===o?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}},Tre=vre([wre(0,ka),wre(1,io),wre(2,La)],Tre),Rre=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:W||F?"\n":"\r\n"}},Rre=vre([wre(0,ka)],Rre),Ore=class{publicLog2(){}},(Are=class e{constructor(){this.workspace={id:KA,folders:[new UA({uri:_i.from({scheme:e.SCHEME,authority:"model",path:"/"}),name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(t){return t&&t.scheme===e.SCHEME?this.workspace.folders[0]:null}}).SCHEME="inmemory",Pre=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:dA.convert(e),n=new Map;for(const r of i){if(!(r instanceof cA))throw new Error("bad edit - only text edits are supported");const e=this._modelService.getModel(r.resource);if(!e)throw new Error("bad edit - model not found");if("number"==typeof r.versionId&&e.getVersionId()!==r.versionId)throw new Error("bad state - model changed in the meantime");let t=n.get(e);t||(t=[],n.set(e,t)),t.push(VH.replaceMove(mr.lift(r.textEdit.range),r.textEdit.text))}let o=0,s=0;for(const[r,a]of n)r.pushStackElement(),r.pushEditOperations([],a,()=>[]),r.pushStackElement(),s+=1,o+=a.length;return{ariaSummary:Fle(G7.bulkEditServiceSummary,o,s),isApplied:o>0}}},Pre=vre([wre(0,io)],Pre),Fre=class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}getUriBasenameLabel(e){return Os(e)}},Wre=class extends tne{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}},Wre=vre([wre(0,_P),wre(1,eo)],Wre),Bre=class{constructor(){this._neverEmitter=new je,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}},Vre=class extends Nne{constructor(){super()}},Hre=class extends _re{constructor(){super(new Zs)}},zre=class extends zne{constructor(e,t,i,n,o,s){super(e,t,i,n,o,s),this.configure({blockMouse:!1})}},zre=vre([wre(0,fs),wre(1,Xv),wre(2,oT),wre(3,xw),wre(4,cs),wre(5,es)],zre),Ure={esmModuleLocation:void 0,label:"editorWorkerService"},Kre=class extends Gte{constructor(e,t,i,n,o){super(Ure,e,t,i,n,o)}},Kre=vre([wre(0,io),wre(1,S3),wre(2,Ks),wre(3,il),wre(4,Tx)],Kre),qre=class{async playSignal(e,t){}},dge(Ks,Hre,0),dge(ka,Mre,0),dge(S3,Tre,0),dge(x3,Rre,0),dge(HA,Are,0),dge(zK,Fre,0),dge(fs,Ore,0),dge(u9,Lre,0),dge(fW,kre,0),dge(Xv,Dre,0),dge(CF,mre,0),dge(La,Vre,0),dge(Q7,vee,0),dge(io,aoe,0),dge(id,Xne,0),dge(es,ore,0),dge(RL,xre,0),dge(AL,Sre,0),dge(eR,nR,0),dge(DM,Kre,0),dge(lA,Pre,0),dge(G6,Bre,0),dge(no,yre,0),dge(Fc,Bse,0),dge(FU,WU,0),dge(fo,Ire,0),dge(xw,Nre,0),dge(tA,Ose,0),dge(oT,Wre,0),dge(SA,Zne,0),dge(nT,qse,0),dge(sT,zre,0),dge(cs,DR,0),dge(NL,qre,0),dge(zS,bre,0),dge(qs,Js,0),dge(aQ,lQ,0),function(e){const t=new dL;for(const[r,a]of cge())t.set(r,a);const i=new cre(t,!0);t.set(Jn,i),e.get=function(e){n||s({});const o=t.get(e);if(!o)throw new Error("Missing service "+e);return o instanceof Da?i.invokeFunction(t=>t.get(e)):o};let n=!1;const o=new je;function s(e){if(n)return i;n=!0;for(const[i,n]of cge())t.get(i)||t.set(i,n);for(const i in e)if(e.hasOwnProperty(i)){const n=eue(i);t.get(n)instanceof Da&&t.set(n,e[i])}const s=pCe();for(const t of s)try{i.createInstance(t)}catch(r){$ae(r)}return o.fire(),i}e.initialize=s,e.withServices=function(e){if(n)return e();const t=new De,i=t.add(o.event(()=>{i.dispose(),t.add(e())}));return t}}(jre||(jre={})),Gre=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Zre=function(e,t){return function(i,n){t(i,n,e)}},$re=class{constructor(e,t){this._configurationService=e,this._languageService=t}async renderCodeBlock(e,t,i){const n=HCe(i.context)?i.context:void 0;let o;e?o=this._languageService.getLanguageIdByLanguageName(e):n&&(o=n.getModel()?.getLanguageId()),o||(o=Ga);const s=await async function(e,t,i){if(!i)return A_e(t,e.languageIdCodec,Ik);const n=await Mb.getOrCreate(i);return A_e(t,e.languageIdCodec,n||Ik)}(this._languageService,t,o),r=Yre._ttpTokenizer?Yre._ttpTokenizer.createHTML(s)??s:s,a=document.createElement("span");a.innerHTML=r;const l=a.querySelector(".monaco-tokenized-source");return xhe(l)?(Wge(l,this.getFontInfo(n)),a):document.createElement("span")}getFontInfo(e){return e?e.getOption(59):function(e,t,i=!1){const n=Ec.fontFamily.validate(e.fontFamily),o=Ec.fontWeight.validate(e.fontWeight),s=Ec.fontSize.validate(e.fontSize),r=Ec.fontLigatures2.validate(e.fontLigatures),a=Ec.fontVariations.validate(e.fontVariations),l=Ec.lineHeight.validate(e.lineHeight),d=Ec.letterSpacing.validate(e.letterSpacing);return fd._create(n,o,s,r,a,l,d,t,i)}({fontFamily:this._configurationService.getValue("editor").fontFamily},1)}},Yre=$re,$re._ttpTokenizer=Bpe("tokenizeToString",{createHTML:e=>e}),Qre=$re,Qre=Yre=Gre([Zre(0,ka),Zre(1,La)],Qre),Xre=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},Jre=function(e,t){return function(i,n){t(i,n,e)}},eae=0,tae=!1,iae=class extends pL{constructor(e,t,i,n,o,s,r,a,l,d,c,h,u,g){const p={...t};p.ariaLabel=p.ariaLabel||j7.editorViewAccessibleLabel,super(e,p,{},i,n,o,s,l,d,c,h,u),this._standaloneKeybindingService=a instanceof Nre?a:null,wLe(p.ariaContainerElement),WL=(e,t)=>i.createInstance(VR,e,{instantHover:t},{}),PN=r,g.setDefaultCodeBlockRenderer(i.createInstance(Qre))}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++eae,o=Po.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,o),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Ie.None;const t=e.id,i=e.label,n=Po.and(Po.equals("editorId",this.getId()),Po.deserialize(e.precondition)),o=e.keybindings,s=Po.and(n,Po.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),d=new De,c=this.getId()+":"+t;if(d.add(_o.registerCommand(c,l)),r){const e={command:{id:c,title:i},when:n,group:r,order:a};d.add(us.appendMenuItem(ds.EditorContext,e))}if(Array.isArray(o))for(const u of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(c,u,l,s));const h=new GC(c,i,i,void 0,n,(...t)=>Promise.resolve(e.run(this,...t)),this._contextKeyService);return this._actions.set(t,h),d.add(Dle(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof wie)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}},iae=Xre([Jre(2,Jn),Jre(3,eo),Jre(4,fo),Jre(5,es),Jre(6,BR),Jre(7,xw),Jre(8,Sf),Jre(9,Xv),Jre(10,Fc),Jre(11,il),Jre(12,Tx),Jre(13,LA)],iae),nae=class extends iae{constructor(e,t,i,n,o,s,r,a,l,d,c,h,u,g,p,m,f){const _={...t};vLe(c,_,!1);const b=l.registerEditorContainer(e);"string"==typeof _.theme&&l.setTheme(_.theme),void 0!==_.autoDetectHighContrast&&l.setAutoDetectHighContrast(Boolean(_.autoDetectHighContrast));const v=_.model;let w;if(delete _.model,super(e,_,i,n,o,s,r,a,l,d,h,p,m,f),this._configurationService=c,this._standaloneThemeService=l,this._register(b),void 0===v){const e=g.getLanguageIdByMimeType(_.language)||_.language||"plaintext";w=CLe(u,g,_.value||"",e,void 0),this._ownsModel=!0}else w=v,this._ownsModel=!1;if(this._attachModel(w),w){const e={oldModelUrl:null,newModelUrl:w.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){vLe(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}},nae=Xre([Jre(2,Jn),Jre(3,eo),Jre(4,fo),Jre(5,es),Jre(6,BR),Jre(7,xw),Jre(8,Q7),Jre(9,Xv),Jre(10,ka),Jre(11,Fc),Jre(12,io),Jre(13,La),Jre(14,il),Jre(15,Tx),Jre(16,LA)],nae),oae=class extends cO{constructor(e,t,i,n,o,s,r,a,l,d,c,h){const u={...t};vLe(a,u,!0);const g=s.registerEditorContainer(e);"string"==typeof u.theme&&s.setTheme(u.theme),void 0!==u.autoDetectHighContrast&&s.setAutoDetectHighContrast(Boolean(u.autoDetectHighContrast)),super(e,u,{},n,i,o,h,d),this._configurationService=a,this._standaloneThemeService=s,this._register(g)}dispose(){super.dispose()}updateOptions(e){vLe(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(iae,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}},oae=Xre([Jre(2,Jn),Jre(3,es),Jre(4,eo),Jre(5,Q7),Jre(6,Xv),Jre(7,ka),Jre(8,sT),Jre(9,AL),Jre(10,nT),Jre(11,NL)],oae),mpe("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},Vae(142,"The background color of the diff editor's header")),mpe("multiDiffEditor.background",wh,Vae(143,"The background color of the multi file diff editor")),mpe("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},Vae(144,"The border color of the multi file diff editor")),sae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},rae=function(e,t){return function(i,n){t(i,n,e)}},aae=class{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}},lae=class extends Ie{constructor(e,t,i,n,o){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=Qce(this,void 0),this._collapsed=Dce(this,e=>this._viewModel.read(e)?.collapsed.read(e)),this._editorContentHeight=Qce(this,500),this.contentHeight=Dce(this,e=>(this._collapsed.read(e)?0:this._editorContentHeight.read(e))+this._outerEditorHeight),this._modifiedContentWidth=Qce(this,0),this._modifiedWidth=Qce(this,0),this._originalContentWidth=Qce(this,0),this._originalWidth=Qce(this,0),this.maxScroll=Dce(this,e=>{const t=this._modifiedContentWidth.read(e)-this._modifiedWidth.read(e),i=this._originalContentWidth.read(e)-this._originalWidth.read(e);return t>i?{maxScroll:t,width:this._modifiedWidth.read(e)}:{maxScroll:i,width:this._originalWidth.read(e)}}),this._elements=Vhe("div.multiDiffEntry",[Vhe("div.header@header",[Vhe("div.header-content",[Vhe("div.collapse-button@collapseButton"),Vhe("div.file-path",[Vhe("div.title.modified.show-file-icons@primaryPath",[]),Vhe("div.status.deleted@status",["R"]),Vhe("div.title.original.show-file-icons@secondaryPath",[])]),Vhe("div.actions@actions")])]),Vhe("div.editorParent",[Vhe("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(cO,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode,fixedOverflowWidgets:!0},{})),this.isModifedFocused=bwe(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=bwe(this.editor.getOriginalEditor()).isFocused,this.isFocused=Dce(this,e=>this.isModifedFocused.read(e)||this.isOriginalFocused.read(e)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new De),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const s=new gP(this._elements.collapseButton,{});this._register(Rce(e=>{s.element.className="",s.icon=this._collapsed.read(e)?go.chevronRight:go.chevronDown})),this._register(s.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(Rce(e=>{this._elements.editor.style.display=this._collapsed.read(e)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(e=>{const t=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(t,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(e=>{const t=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(t,void 0)})),this._register(this.editor.onDidContentSizeChange(e=>{Bce(t=>{this._editorContentHeight.set(e.contentHeight,t),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),t),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),t)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(e=>{if(this._isSettingScrollTop)return;if(!e.scrollTopChanged||!this._data)return;const t=e.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(t)})),this._register(Rce(e=>{const t=this._viewModel.read(e)?.isActive.read(e);this._elements.root.classList.toggle("active",t)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(o.createScoped(this._elements.actions));const r=this._register(this._instantiationService.createChild(new dL([es,this._contextKeyService])));this._register(r.createInstance(PR,this._elements.actions,ds.MultiDiffEditorFileToolbar,{actionRunner:this._register(new UR(()=>this._viewModel.get()?.modifiedUri??this._viewModel.get()?.originalUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:e=>e.startsWith("navigation")},actionViewItemProvider:(e,t)=>Nwe(r,e,t)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){function t(e){return{...e,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(this._data=e,!e)return void Bce(e=>{this._viewModel.set(void 0,e),this.editor.setDiffModel(null,e),this._dataStore.clear()});const i=e.viewModel.documentDiffItem;if(Bce(n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:void 0===e.viewModel.modifiedUri});let o=!1,s=!1,r=!1,a="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(a="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(a="A",r=!0):(a="D",s=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",s),this._elements.status.classList.toggle("added",r),this._elements.status.innerText=a,this._resourceLabel2?.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,e=>{e||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[n,o]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(n,o)}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,s=Math.max(0,Math.min(n.start-e.start,o));this._elements.header.style.transform=`translateY(${s}px)`,Bce(i=>{this.editor.layout({width:t-16-2,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",s>0||i>0),this._elements.header.classList.toggle("collapsed",s===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}},lae=sae([rae(3,Jn),rae(4,es)],lae),dae=class{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(0===this._unused.size)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(t=>this._itemData.get(t).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}},cae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},hae=function(e,t){return function(i,n){t(i,n,e)}},uae=class extends Ie{constructor(e,t,i,n,o,s){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=o,this._parentInstantiationService=s,this._scrollableElements=Vhe("div.scrollContent",[Vhe("div@content",{style:{overflow:"hidden"}}),Vhe("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new Sm({forceIntegerValues:!1,scheduleAtNextAnimationFrame:e=>In(pn(this._element),e),smoothScrollDuration:100})),this._scrollableElement=this._register(new Mm(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=Vhe("div.monaco-component.multiDiffEditor",{},[Vhe("div",{},[this._scrollableElement.getDomNode()]),Vhe("div.placeholder@placeholder",{},[Vhe("div")])]),this._sizeObserver=this._register(new EE(this._element,void 0)),this._objectPool=this._register(new dae(e=>{const t=this._instantiationService.createInstance(lae,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return t.setData(e),t})),this.scrollTop=Hce(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Hce(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=Dce(this,e=>{const t=this._viewModel.read(e);if(!t)return{items:[],getItem:e=>{throw new y}};const i=t.items.read(e),n=new Map;return{items:i.map(t=>{const i=e.store.add(new gae(t,this._objectPool,this.scrollLeft,e=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+e})})),o=this._lastDocStates?.[i.getKey()];return o&&Wce(e=>{i.setViewState(o,e)}),n.set(t,i),i}),getItem:e=>n.get(e)}}),this._viewItems=this._viewItemsInfo.map(this,e=>e.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(e,t)=>e.reduce((e,i)=>e+i.contentHeight.read(t)+this._spaceBetweenPx,0)),this.activeControl=Dce(this,e=>{const t=this._viewModel.read(e)?.activeDiffItem.read(e);if(t)return this._viewItemsInfo.read(e).getItem(t).template.read(e)?.editor}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new dL([es,this._contextKeyService]))),this._contextKeyService.createKey(jl.inMultiDiffEditor.key,!0),this._lastDocStates={},this._register(Pce((e,t)=>{const i=this._viewModel.read(e);if(i&&i.contextKeys)for(const[n,o]of Object.entries(i.contextKeys)){const e=this._contextKeyService.createKey(n,void 0);e.set(o),t.add(Dle(()=>e.reset()))}}));const r=this._parentContextKeyService.createKey(jl.multiDiffEditorAllCollapsed.key,!1);this._register(Rce(e=>{const t=this._viewModel.read(e);if(t){const i=t.items.read(e).every(t=>t.collapsed.read(e));r.set(i)}})),this._register(Rce(e=>{const t=this._dimension.read(e);this._sizeObserver.observe(t)}));const a=Dce(e=>{if(this._viewItems.read(e).length>0)return;const t=this._viewModel.read(e);return!t||t.isLoading.read(e)?Vae(145,"Loading..."):Vae(146,"No Changed Files")});this._register(Rce(e=>{const t=a.read(e);this._elements.placeholder.innerText=t??"",this._elements.placeholder.classList.toggle("visible",!!t)})),this._scrollableElements.content.style.position="relative",this._register(Rce(e=>{const t=this._sizeObserver.height.read(e);this._scrollableElements.root.style.height=`${t}px`;const i=this._totalHeight.read(e);this._scrollableElements.content.style.height=`${i}px`;const n=this._sizeObserver.width.read(e);let o=n;const s=Gpe(this._viewItems.read(e),fce(t=>t.maxScroll.read(e).maxScroll,Oi));s&&(o=n+s.maxScroll.read(e).maxScroll),this._scrollableElement.setScrollDimensions({width:n,height:t,scrollHeight:i,scrollWidth:o})})),e.replaceChildren(this._elements.root),this._register(Dle(()=>{e.replaceChildren()})),this._register(Rce(e=>{const t=this._viewModel.read(e);if(t&&!t.isLoading.read(e)){if(0===t.items.read(e).length)return;if(t.activeDiffItem.read(e))return;this.goToNextChange()}})),this._register(this._register(Rce(e=>{Bce(t=>{this.render(e)})})))}reveal(e,t){const i=this._viewItems.get(),n=i.findIndex(t=>t.viewModel.originalUri?.toString()===e.original?.toString()&&t.viewModel.modifiedUri?.toString()===e.modified?.toString());if(-1===n)throw new y("Resource not found in diff editor");const o=i[n];this._viewModel.get().activeDiffItem.setCache(o.viewModel,void 0);let s=0;for(let l=0;l<n;l++)s+=i[l].contentHeight.get()+this._spaceBetweenPx;this._scrollableElement.setScrollPosition({scrollTop:s});const r=o.template.get()?.editor,a="original"in e?r?.getOriginalEditor():r?.getModifiedEditor();a&&t?.range&&(a.revealRangeInCenter(t.range),function(e,t){const i=e.getModel(),n=e.createDecorationsCollection([{range:t,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{e.getModel()===i&&n.clear()},350)}(a,t.range))}goToNextChange(){this._navigateToChange("next")}_navigateToChange(e){const t=this._viewItems.get();if(0===t.length)return;const i=this._viewModel.get()?.activeDiffItem.get(),n=i?t.findIndex(e=>e.viewModel===i):-1;if(-1===n)return void this._goToFile(0,"first");const o=t[n];o.viewModel.collapsed.get()&&o.viewModel.collapsed.set(!1,void 0);const s=o.template.get()?.editor;if(s?.getDiffComputationResult()?.changes2?.length){const t=s.getModifiedEditor().getPosition()?.lineNumber||1,i=s.getDiffComputationResult().changes2;if("next"===e?i.some(e=>e.modified.startLineNumber>t):i.some(e=>e.modified.endLineNumberExclusive<=t))return void s.goToDiff(e)}const r=(n+("next"===e?1:-1)+t.length)%t.length;this._goToFile(r,"next"===e?"first":"last")}_goToFile(e,t){const i=this._viewItems.get()[e];i.viewModel.collapsed.get()&&i.viewModel.collapsed.set(!1,void 0),this.reveal({original:i.viewModel.originalUri,modified:i.viewModel.modifiedUri});const n=i.template.get()?.editor;if(n?.getDiffComputationResult()?.changes2?.length)if("first"===t)n.revealFirstDiff();else{const e=n.getDiffComputationResult().changes2.at(-1),t=n.getModifiedEditor();t.setPosition({lineNumber:e.modified.startLineNumber,column:1}),t.revealLineInCenter(e.modified.startLineNumber)}n?.focus()}render(e){const t=this.scrollTop.read(e);let i=0,n=0,o=0;const s=this._sizeObserver.height.read(e),r=hl.ofStartAndLength(t,s),a=this._sizeObserver.width.read(e);for(const l of this._viewItems.read(e)){const d=l.contentHeight.read(e),c=Math.min(d,s),h=hl.ofStartAndLength(n,c),u=hl.ofStartAndLength(o,d);if(u.isBefore(r))i-=d-c,l.hide();else if(u.isAfter(r))l.hide();else{const e=Math.max(0,Math.min(r.start-u.start,d-c));i-=e;const n=hl.ofStartAndLength(t+i,s);l.render(h,e,a,n)}n+=c+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}},uae=cae([hae(4,es),hae(5,Jn)],uae),gae=class extends Ie{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(Xce(this,void 0)),this.contentHeight=Dce(this,e=>this._templateRef.read(e)?.object.contentHeight?.read(e)??this.viewModel.lastTemplateData.read(e).contentHeight),this.maxScroll=Dce(this,e=>this._templateRef.read(e)?.object.maxScroll.read(e)??{maxScroll:0,scrollWidth:0}),this.template=Dce(this,e=>this._templateRef.read(e)?.object),this._isHidden=Qce(this,!1),this._isFocused=Dce(this,e=>this.template.read(e)?.isFocused.read(e)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(Rce(e=>{const t=this._scrollLeft.read(e);this._templateRef.read(e)?.object.setScrollLeft(t)})),this._register(Rce(e=>{const t=this._templateRef.read(e);t&&this._isHidden.read(e)&&(t.object.isFocused.read(e)||this._clear())}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),n=e.selections?.map(fr.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);const o=this._templateRef.get();o&&n&&o.object.editor.setSelections(n)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&Wce(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new aae(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const e=this.viewModel.lastTemplateData.get().selections;e&&o.object.editor.setSelections(e)}o.object.render(e,i,t,n)}},pae=function(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r},mae=function(e,t){return function(i,n){t(i,n,e)}},fae=class extends Ie{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Qce(this,void 0),this._viewModel=Qce(this,void 0),this._widgetImpl=Dce(this,e=>e.store.add(this._instantiationService.createInstance(U_e(uae),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))),this._register(Kce(this._widgetImpl))}},fae=pae([mae(2,Jn)],fae),_ae=class{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if("string"==typeof t)i=t;else{if(!(t instanceof RegExp))throw Bke(e,"rules must start with a match string or regular expression: "+this.name);i=t.source}this.matchOnlyAtLineStart=i.length>0&&"^"===i[0],this.name=this.name+": "+i,this.regex=sDe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=aDe(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}},bae=class{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return vae.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new ub(n.tokens,n.endState)}},vae=class e{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,s=e.length;o<s;o++){const s=e[o];let r=s.startIndex;0===o?r=0:r<n&&(r=n),i[o]=new cb(r,s.scopes,t),n=r}return i}static adaptTokenize(t,i,n,o){const s=i.tokenize(n,o),r=e._toClassicTokens(s.tokens,t);let a;return a=s.endState.equals(o)?o:s.endState,new hb(r,a)}tokenize(t,i,n){return e.adaptTokenize(this._languageId,this._actual,t,n)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let s=0,r=0;for(let l=0,d=t.length;l<d;l++){const e=t[l],a=1024|n.match(i,e.scopes);if(s>0&&o[s-1]===a)continue;let d=e.startIndex;0===l?d=0:d<r&&(d=r),o[s++]=d,o[s++]=a,r=d}const a=new Uint32Array(s);for(let l=0;l<s;l++)a[l]=o[l];return a}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let s;return s=n.endState.equals(i)?i:n.endState,new ub(o,s)}},e("m",i({CancellationTokenSource:()=>Cae,Emitter:()=>yae,KeyCode:()=>Sae,KeyMod:()=>xae,MarkerSeverity:()=>Nae,MarkerTag:()=>Eae,Position:()=>kae,Range:()=>Lae,Selection:()=>Dae,SelectionDirection:()=>Iae,Token:()=>Tae,Uri:()=>Mae,editor:()=>Rae,languages:()=>Oae})),Ec.wrappingIndent.defaultValue=0,Ec.glyphMargin.defaultValue=!1,Ec.autoIndent.defaultValue=3,Ec.overviewRulerLanes.defaultValue=2,TZ.setFormatterSelector((e,t,i)=>Promise.resolve(e[0])),(wae=fke()).editor={create:SLe,getEditors:LLe,getDiffEditors:DLe,onDidCreateEditor:xLe,onDidCreateDiffEditor:kLe,createDiffEditor:ILe,addCommand:ELe,addEditorAction:MLe,addKeybindingRule:TLe,addKeybindingRules:RLe,createModel:OLe,setModelLanguage:ALe,setModelMarkers:PLe,getModelMarkers:WLe,removeAllMarkers:FLe,onDidChangeMarkers:BLe,getModels:HLe,getModel:VLe,onDidCreateModel:zLe,onWillDisposeModel:ULe,onDidChangeModelLanguage:KLe,createWebWorker:qLe,colorizeElement:jLe,colorize:$Le,colorizeModelLine:GLe,tokenize:ZLe,defineTheme:YLe,setTheme:QLe,remeasureFonts:XLe,registerCommand:JLe,registerLinkOpener:eDe,registerEditorOpener:tDe,AccessibilitySupport:wee,ContentWidgetPositionPreference:Lee,CursorChangeReason:Dee,DefaultEndOfLine:Iee,EditorAutoIndentStrategy:Eee,EditorOption:Mee,EndOfLinePreference:Tee,EndOfLineSequence:Ree,MinimapPosition:qee,MinimapSectionHeaderStyle:jee,MouseTargetType:$ee,OverlayWidgetPositionPreference:Yee,OverviewRulerLane:Qee,GlyphMarginLane:Oee,RenderLineNumbersType:ete,RenderMinimap:tte,ScrollbarVisibility:nte,ScrollType:ite,TextEditorCursorBlinkingStyle:cte,TextEditorCursorStyle:hte,TrackedRangeStickiness:ute,WrappingIndent:gte,InjectedTextCursorStops:Fee,PositionAffinity:Jee,ShowLightbulbIconMode:ste,TextDirection:dte,ConfigurationChangedEvent:xd,BareFontInfo:fd,FontInfo:_d,TextModelResolvedOptions:Jr,FindMatch:ea,ApplyUpdateResult:Dd,EditorZoom:pd,createMultiFileDiffEditor:NLe,EditorType:ZC,EditorOptions:Ec},wae.languages={register:dDe,getLanguages:cDe,onLanguage:uDe,onLanguageEncountered:gDe,getEncodedLanguageId:hDe,setLanguageConfiguration:pDe,setColorMap:fDe,registerTokensProviderFactory:bDe,setTokensProvider:vDe,setMonarchTokensProvider:wDe,registerReferenceProvider:CDe,registerRenameProvider:yDe,registerNewSymbolNameProvider:SDe,registerCompletionItemProvider:WDe,registerSignatureHelpProvider:xDe,registerHoverProvider:kDe,registerDocumentSymbolProvider:LDe,registerDocumentHighlightProvider:DDe,registerLinkedEditingRangeProvider:IDe,registerDefinitionProvider:NDe,registerImplementationProvider:EDe,registerTypeDefinitionProvider:MDe,registerCodeLensProvider:TDe,registerCodeActionProvider:RDe,registerDocumentFormattingEditProvider:ODe,registerDocumentRangeFormattingEditProvider:ADe,registerOnTypeFormattingEditProvider:PDe,registerLinkProvider:FDe,registerColorProvider:BDe,registerFoldingRangeProvider:VDe,registerDeclarationProvider:HDe,registerSelectionRangeProvider:zDe,registerDocumentSemanticTokensProvider:UDe,registerDocumentRangeSemanticTokensProvider:KDe,registerInlineCompletionsProvider:qDe,registerInlayHintsProvider:jDe,DocumentHighlightKind:Nee,CompletionItemKind:See,CompletionItemTag:xee,CompletionItemInsertTextRule:yee,SymbolKind:ate,SymbolTag:lte,IndentAction:Pee,CompletionTriggerKind:kee,SignatureHelpTriggerKind:rte,InlayHintKind:Wee,InlineCompletionTriggerKind:Hee,CodeActionTriggerType:Cee,NewSymbolNameTag:Gee,NewSymbolNameTriggerKind:Zee,PartialAcceptTriggerKind:Xee,HoverVerbosityAction:Aee,InlineCompletionEndOfLifeReasonKind:Bee,InlineCompletionHintStyle:Vee,FoldingRangeKind:kb,SelectedSuggestionInfo:fb,EditDeltaInfo:Hy},e("t",Cae=wae.CancellationTokenSource),e("n",yae=wae.Emitter),e("r",Sae=wae.KeyCode),e("i",xae=wae.KeyMod),e("s",kae=wae.Position),e("c",Lae=wae.Range),e("l",Dae=wae.Selection),e("u",Iae=wae.SelectionDirection),e("a",Nae=wae.MarkerSeverity),e("o",Eae=wae.MarkerTag),e("f",Mae=wae.Uri),e("d",Tae=wae.Token),e("p",Rae=wae.editor),e("h",Oae=wae.languages),Aae=qae(),Pae=globalThis,(Aae?.globalAPI||"function"==typeof Pae.define&&Pae.define.amd)&&(Pae.monaco=wae),void 0!==Pae.require&&"function"==typeof Pae.require.config&&Pae.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]})}}});
//# sourceMappingURL=editor.api2-legacy-a29CXms_.js.map