offsite 0.0.75 → 0.0.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-Bw62YruA.js","assets/editor.api-Rfucz3mk.js","assets/rolldown-runtime-COiEfhsA.js","assets/preload-helper-BLdHbfdN.js","assets/editor-DjpsE8to.css","assets/handlebars-84NJRWd6.js","assets/html-86U_8x8W.js","assets/javascript-MI6i-TIC.js","assets/typescript-Bjj6HU8L.js","assets/liquid-Dcyd1pkL.js","assets/mdx-DR7vQeQJ.js","assets/python-CiSQgsVi.js","assets/razor-WdSU-o-W.js","assets/typescript-Dy13l_qr.js","assets/xml-AovvXo6A.js","assets/yaml-EESuZNdc.js","assets/zoomable-image-DAEgBZCp.js","assets/zoomable-image-C1DMNgds.js","assets/tooltip-CKPboHje.js","assets/utils-U6QfaJBO.js","assets/dist-C_Y10kCd.js","assets/button-CWFREsRn.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{A as t,B as n,F as r,G as i,H as a,I as o,K as s,L as c,O as l,P as u,St as d,U as f,V as p,W as m,_ as h,_t as g,at as _,bt as v,ct as y,d as b,dt as ee,f as te,g as ne,gt as re,h as ie,i as ae,it as oe,j as se,k as ce,lt as le,m as ue,mt as de,ot as fe,p as pe,pt as me,r as he,s as ge,t as _e,tt as ve,ut as ye,v as be,x as xe,y as Se,yt as Ce}from"./context-menu-DtDt9J-Y.js";import{F as we,I as Te,M as Ee,Mt as De,N as Oe,T as ke,m as Ae,nn as je,t as Me,tn as Ne,v as Pe}from"./XIcon-B7qo7ktZ.js";import{a as Fe,t as Ie}from"./button-CWFREsRn.js";import{c as Le,l as Re,n as ze,o as Be,r as Ve,t as He}from"./utils-U6QfaJBO.js";import{a as Ue,l as We,r as Ge,u as Ke}from"./preview-dialog-BXE1icd3.js";import{n as qe,r as Je}from"./TextWrapIcon-BRhMbXe9.js";import{t as Ye}from"./ChevronsDownUpIcon-BNVFd2te.js";import{Wt as Xe}from"./dist-Jliw2AH0.js";import{G as Ze,U as Qe,W as $e,d as et,h as tt,o as nt}from"./dist-TdUDcI9m.js";import{$ as rt,$a as it,$c as at,$d as ot,$i as st,$l as ct,$n as lt,$o as ut,$r as dt,$s as ft,$t as pt,$u as mt,A as ht,Aa as gt,Ac as _t,Ad as x,Ai as vt,Al as yt,An as bt,Ao as xt,Ar as St,As as Ct,At as wt,Au as Tt,B as Et,Ba as Dt,Bc as S,Bd as Ot,Bi as kt,Bl as At,Bn as jt,Bo as Mt,Br as Nt,Bs as Pt,Bt as Ft,Bu as C,C as It,Ca as Lt,Cc as Rt,Cd as zt,Ci as Bt,Cl as Vt,Cn as Ht,Co as Ut,Cr as Wt,Cs as Gt,Ct as Kt,Cu as qt,D as Jt,Da as Yt,Dc as Xt,Dd as Zt,Di as Qt,Dl as $t,Dn as en,Do as tn,Dr as nn,Ds as rn,Dt as an,Du as on,E as sn,Ea as cn,Ec as ln,Ed as un,Ei as dn,El as fn,En as pn,Eo as mn,Er as hn,Es as gn,Et as _n,Eu as vn,F as yn,Fa as bn,Fc as xn,Fd as Sn,Fi as Cn,Fl as wn,Fn as Tn,Fo as En,Fr as Dn,Fs as On,Ft as kn,Fu as An,G as jn,Ga as Mn,Gc as Nn,Gd as Pn,Gi as Fn,Gl as In,Gn as Ln,Go as Rn,Gr as zn,Gs as Bn,Gt as Vn,Gu as Hn,H as Un,Ha as Wn,Hc as Gn,Hd as Kn,Hi as qn,Hl as Jn,Hn as Yn,Ho as Xn,Hr as Zn,Hs as w,Ht as Qn,Hu as $n,Ia as er,Ic as tr,Id as nr,Ii as rr,Il as ir,In as ar,Io as or,Ir as sr,Is as cr,It as lr,Iu as ur,J as dr,Ja as fr,Jc as pr,Jd as mr,Ji as hr,Jl as gr,Jn as _r,Jo as vr,Jr as yr,Js as br,Jt as xr,Ju as T,K as Sr,Ka as Cr,Kc as wr,Kd as Tr,Ki as Er,Kl as Dr,Kn as Or,Ko as kr,Kr as E,Ks as Ar,Kt as jr,Ku as Mr,L as Nr,La as Pr,Lc as Fr,Ld as Ir,Li as Lr,Ll as Rr,Ln as zr,Lo as Br,Lr as Vr,Ls as Hr,Lt as Ur,Lu as Wr,M as Gr,Ma as Kr,Mc as qr,Md as Jr,Mi as Yr,Ml as Xr,Mn as Zr,Mo as Qr,Mr as $r,Ms as ei,Mt as ti,Mu as ni,N as ri,Na as ii,Nc as ai,Nd as oi,Ni as si,Nl as ci,Nn as li,No as ui,Nr as di,Ns as D,Nt as fi,Nu as pi,O as mi,Oa as hi,Oc as gi,Od as _i,Oi as vi,Ol as yi,On as bi,Oo as xi,Or as Si,Os as Ci,Ot as wi,Ou as Ti,P as Ei,Pa as Di,Pc as Oi,Pd as ki,Pi as Ai,Pl as ji,Pn as Mi,Po as Ni,Pr as Pi,Ps as Fi,Pt as Ii,Pu as Li,Q as Ri,Qa as zi,Qc as Bi,Qd as Vi,Qi as Hi,Ql as Ui,Qn as Wi,Qo as Gi,Qr as Ki,Qs as qi,Qt as Ji,Qu as Yi,R as Xi,Ra as O,Rc as Zi,Rd as Qi,Ri as $i,Rl as ea,Rn as ta,Ro as na,Rr as ra,Rs as ia,Rt as aa,Ru as k,S as oa,Sa as sa,Sc as ca,Sd as la,Si as ua,Sl as da,Sn as fa,So as pa,Sr as ma,Ss as ha,St as ga,Su as _a,T as va,Ta as ya,Tc as ba,Td as xa,Ti as Sa,Tl as Ca,Tn as wa,To as Ta,Tr as Ea,Ts as Da,Tt as Oa,Tu as ka,U as Aa,Ua as ja,Uc as Ma,Ud as Na,Ui as Pa,Ul as Fa,Un as Ia,Uo as La,Ur as Ra,Us as za,Ut as Ba,Uu as Va,V as Ha,Va as Ua,Vc as Wa,Vd as Ga,Vi as Ka,Vl as qa,Vn as Ja,Vo as Ya,Vr as Xa,Vs as Za,Vt as Qa,Vu as A,W as $a,Wa as eo,Wc as to,Wd as no,Wi as ro,Wl as io,Wn as ao,Wo as oo,Wr as so,Ws as j,Wt as co,Wu as lo,X as uo,Xa as fo,Xc as po,Xd as mo,Xi as ho,Xl as go,Xn as _o,Xo as vo,Xr as yo,Xs as bo,Xt as xo,Xu as So,Y as Co,Ya as wo,Yc as To,Yd as Eo,Yi as Do,Yl as Oo,Yn as ko,Yo as Ao,Yr as jo,Ys as Mo,Yt as No,Yu as Po,Z as Fo,Za as Io,Zc as Lo,Zd as Ro,Zi as zo,Zl as Bo,Zn as Vo,Zo as Ho,Zr as Uo,Zs as Wo,Zt as Go,Zu as Ko,_ as qo,_a as Jo,_c as Yo,_d as Xo,_f as Zo,_i as Qo,_l as $o,_n as es,_o as ts,_r as ns,_s as rs,_t as is,_u as as,a as os,aa as ss,ac as M,ad as N,af as cs,ai as ls,al as us,an as ds,ao as fs,ar as ps,as as ms,at as hs,au as gs,b as _s,ba as vs,bc as ys,bd as bs,bi as xs,bl as Ss,bn as Cs,bo as ws,br as Ts,bs as Es,bt as Ds,bu as Os,c as ks,ca as As,cc as js,cd as Ms,cf as Ns,ci as Ps,cl as Fs,cn as Is,co as Ls,cr as P,cs as Rs,ct as zs,cu as Bs,d as Vs,da as Hs,dc as Us,dd as F,df as Ws,di as Gs,dl as Ks,dn as qs,do as Js,dr as Ys,ds as Xs,dt as Zs,du as Qs,ea as $s,ec,ef as tc,ei as nc,el as rc,en as ic,eo as ac,er as oc,es as sc,et as cc,eu as lc,f as uc,fa as dc,fc,fd as pc,ff as mc,fi as hc,fl as gc,fn as _c,fo as vc,fr as yc,fs as bc,ft as xc,fu as Sc,g as Cc,ga as wc,gc as Tc,gd as Ec,gf as Dc,gi as Oc,gl as kc,gn as Ac,go as jc,gr as Mc,gs as Nc,gt as Pc,gu as Fc,h as Ic,ha as Lc,hc as I,hd as Rc,hf as zc,hi as Bc,hl as Vc,hn as Hc,ho as Uc,hr as Wc,hs as Gc,ht as Kc,hu as qc,i as Jc,ia as Yc,ic as Xc,id as Zc,if as Qc,ii as $c,il as el,in as tl,io as nl,ir as rl,is as il,it as al,iu as ol,j as sl,ja as cl,jc as ll,jd as L,ji as ul,jl as dl,jn as fl,jo as pl,jr as ml,js as hl,jt as gl,ju as _l,k as vl,ka as yl,kc as bl,kd as xl,ki as Sl,kl as Cl,kn as wl,ko as Tl,kr as El,ks as Dl,kt as Ol,ku as kl,l as Al,la as jl,lc as Ml,ld as Nl,lf as Pl,li as Fl,ll as Il,ln as Ll,lo as R,lr as Rl,ls as zl,lt as Bl,lu as Vl,m as Hl,ma as Ul,mc as Wl,md as Gl,mf as Kl,mi as ql,ml as Jl,mn as Yl,mo as Xl,mr as Zl,ms as Ql,mt as $l,mu as eu,n as tu,na as nu,nc as ru,nd as iu,nf as au,ni as ou,nl as su,nn as cu,no as lu,nr as uu,ns as du,nt as fu,nu as pu,o as mu,oa as hu,oc as gu,od as _u,of as vu,oi as yu,ol as bu,on as xu,oo as Su,or as Cu,os as z,ot as wu,ou as Tu,p as Eu,pa as Du,pc as Ou,pd as ku,pf as Au,pi as ju,pl as B,pn as Mu,po as Nu,pr as Pu,ps as Fu,pt as Iu,pu as Lu,q as Ru,qa as zu,qc as Bu,qd as Vu,qi as Hu,ql as Uu,qn as Wu,qo as Gu,qr as Ku,qs as V,qt as qu,qu as Ju,r as Yu,ra as Xu,rc as Zu,rd as Qu,rf as $u,ri as ed,rl as td,rn as nd,ro as rd,rr as id,rs as ad,rt as od,ru as sd,s as cd,sa as ld,sc as ud,sd as dd,sf as fd,si as pd,sl as md,sn as hd,so as gd,sr as _d,ss as H,st as vd,su as yd,t as bd,ta as xd,tc as U,td as Sd,tf as Cd,ti as wd,tl as Td,tn as Ed,to as Dd,tr as Od,ts as W,tt as kd,tu as Ad,u as jd,ua as Md,uc as Nd,ud as G,uf as Pd,ui as Fd,ul as Id,un as Ld,uo as Rd,ur as zd,us as Bd,ut as Vd,uu as Hd,v as Ud,va as Wd,vc as K,vd as Gd,vf as Kd,vi as qd,vl as Jd,vn as Yd,vo as Xd,vr as Zd,vs as Qd,vt as $d,vu as ef,w as tf,wa as nf,wc as rf,wd as af,wi as of,wl as sf,wn as cf,wo as lf,wr as uf,ws as df,wt as ff,wu as pf,x as mf,xa as hf,xc as gf,xd as _f,xi as vf,xl as yf,xn as bf,xo as xf,xr as Sf,xs as Cf,xt as wf,xu as Tf,y as Ef,ya as Df,yc as Of,yd as kf,yi as Af,yl as jf,yn as Mf,yo as Nf,yr as Pf,ys as Ff,yt as If,yu as Lf,z as Rf,za as zf,zc as Bf,zd as Vf,zi as Hf,zl as Uf,zn as Wf,zo as Gf,zr as Kf,zs as qf,zt as Jf,zu as q}from"./editor.api-Rfucz3mk.js";import{t as J}from"./preload-helper-BLdHbfdN.js";import{i as Yf,t as Xf}from"./langs-DssLtjmH.js";import{t as Zf}from"./engine-oniguruma-BMl9YtsA.js";import{c as Qf,l as $f}from"./tooltip-CKPboHje.js";var ep=[[`path`,{d:`M17.4776 9.01106C17.485 9.01102 17.4925 9.01101 17.5 9.01101C19.9853 9.01101 22 11.0294 22 13.5193C22 15.8398 20.25 17.7508 18 18M17.4776 9.01106C17.4924 8.84606 17.5 8.67896 17.5 8.51009C17.5 5.46695 15.0376 3 12 3C9.12324 3 6.76233 5.21267 6.52042 8.03192M17.4776 9.01106C17.3753 10.1476 16.9286 11.1846 16.2428 12.0165M6.52042 8.03192C3.98398 8.27373 2 10.4139 2 13.0183C2 15.4417 3.71776 17.4632 6 17.9273M6.52042 8.03192C6.67826 8.01687 6.83823 8.00917 7 8.00917C8.12582 8.00917 9.16474 8.38194 10.0005 9.01101`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 21L12 13M12 21C11.2998 21 9.99153 19.0057 9.5 18.5M12 21C12.7002 21 14.0085 19.0057 14.5 18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],tp=[[`path`,{d:`M4 12.0005L4 14.5446C4 17.7896 4 19.4122 4.88607 20.5111C5.06508 20.7331 5.26731 20.9354 5.48933 21.1144C6.58831 22.0005 8.21082 22.0005 11.4558 22.0005C12.1614 22.0005 12.5141 22.0005 12.8372 21.8865C12.9044 21.8627 12.9702 21.8355 13.0345 21.8047C13.3436 21.6569 13.593 21.4075 14.0919 20.9086L18.8284 16.172C19.4065 15.594 19.6955 15.3049 19.8478 14.9374C20 14.5699 20 14.1611 20 13.3436V10.0005C20 6.22922 20 4.34361 18.8284 3.17203C17.7693 2.11287 16.1265 2.01125 13.0345 2.0015M13 21.5005V21.0005C13 18.172 13 16.7578 13.8787 15.8791C14.7574 15.0005 16.1716 15.0005 19 15.0005H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 5.99954H4M8 1.99954V9.99954`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],np=[[`path`,{d:`M13.6656 6.49446H16C18.8284 6.49446 20.2426 6.49446 21.1213 7.37314C22 8.25182 22 9.66603 22 12.4945V14.5C22 17.3284 22 18.7426 21.1213 19.6213C20.2426 20.5 18.8284 20.5 16 20.5H8C5.17157 20.5 3.75736 20.5 2.87868 19.6213C2 18.7426 2 17.3284 2 14.5V8.99183C2 6.65409 2 5.48521 2.61604 4.67881C2.7778 4.46706 2.96706 4.2778 3.17881 4.11604C3.98521 3.5 5.15409 3.5 7.49183 3.5C8.16633 3.5 8.50358 3.5 8.81392 3.60442C8.8976 3.63257 8.97932 3.66623 9.05854 3.70518C9.35239 3.84965 9.59179 4.08719 10.0706 4.56227L10.8483 5.33389C11.4254 5.9066 11.714 6.19295 12.08 6.3437C12.446 6.49446 12.8525 6.49446 13.6656 6.49446Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 10.5H17C18.8692 10.5 19.8038 10.5 20.5 10.9019C20.9561 11.1652 21.3348 11.5439 21.5981 12C22 12.6962 22 13.6308 22 15.5C22 17.3692 22 18.3038 21.5981 19C21.3348 19.4561 20.9561 19.8348 20.5 20.0981C19.8038 20.5 18.8692 20.5 17 20.5H7C5.13077 20.5 4.19615 20.5 3.5 20.0981C3.04394 19.8348 2.66523 19.4561 2.40192 19C2 18.3038 2 17.3692 2 15.5C2 13.6308 2 12.6962 2.40192 12C2.66523 11.5439 3.04394 11.1652 3.5 10.9019C4.19615 10.5 5.13077 10.5 7 10.5Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],rp=[[`path`,{d:`M12 8H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 12H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 20H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12 16H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M3 4V11C3 12.8692 3 13.8038 3.40192 14.5C3.66523 14.9561 4.04394 15.3348 4.5 15.5981C5.19615 16 6.13077 16 8 16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M8 8H7C6.07003 8 5.60504 8 5.22354 7.89778C4.18827 7.62038 3.37962 6.81173 3.10222 5.77646C3 5.39496 3 4.92997 3 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],ip=[[`path`,{d:`M2 11.4C2 10.2417 2.24173 10 3.4 10H20.6C21.7583 10 22 10.2417 22 11.4V12.6C22 13.7583 21.7583 14 20.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2 19.4C2 18.2417 2.24173 18 3.4 18H20.6C21.7583 18 22 18.2417 22 19.4V20.6C22 21.7583 21.7583 22 20.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],ap=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.38886 15.1629C9.89331 15.5 10.5955 15.5 12 15.5C13.4045 15.5 14.1067 15.5 14.6111 15.1629C14.8295 15.017 15.017 14.8295 15.1629 14.6111C15.5 14.1067 15.5 13.4045 15.5 12C15.5 10.5955 15.5 9.89331 15.1629 9.38886C15.017 9.17048 14.8295 8.98298 14.6111 8.83706C14.1067 8.5 13.4045 8.5 12 8.5C10.5955 8.5 9.89331 8.5 9.38886 8.83706C9.17048 8.98298 8.98298 9.17048 8.83706 9.38886C8.5 9.89331 8.5 10.5955 8.5 12C8.5 13.4045 8.5 14.1067 8.83706 14.6111C8.98298 14.8295 9.17048 15.017 9.38886 15.1629Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],op=[[`path`,{d:`M8 2H9.01472C10.241 2 10.8541 2 11.4054 2.22836C11.9567 2.45672 12.3903 2.89027 13.2574 3.75736L21.1262 11.6263C21.6841 12.1867 21.9982 12.9449 22 13.7357L22 13.75L22 13.7643C21.9982 14.5551 21.6841 15.3133 21.1262 15.8737L15.8737 21.1262C15.3133 21.6841 14.5551 21.9982 13.7643 22L13.75 22L13.7357 22C12.9449 21.9982 12.1867 21.6841 11.6263 21.1262L3.75736 13.2574C2.89027 12.3903 2.45672 11.9567 2.22836 11.4054C2 10.8541 2 10.241 2 9.01472V8C2 5.17157 2 3.75736 2.87868 2.87868C3.75736 2 5.17157 2 8 2Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 7.25V7.5M8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],sp=[[`path`,{d:`M3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C8.79275 3 5.97733 4.67765 4.38341 7.20327M3.29339 3.00076L3.46556 5.05452C3.58958 6.53384 3.65159 7.27349 4.13359 7.68914C4.61559 8.10479 5.32673 8.03185 6.74899 7.88595L8.79339 7.67625`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],cp=[[`path`,{d:`M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],Y=e(Re(),1),X=Le();function lp(e){let t=up(e.document,e.view);return t===null?null:(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:t})}function up(e,t){return e===void 0?t===`explorer`?`Open a file from the explorer to start editing.`:`Select a change to see its diff.`:e.status===`large`?`This file is ${dp(e.size)}, too large to open in the editor (limit ${dp(e.limit)}).`:e.status===`binary`?`The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding.`:e.status===`error`?e.message:null}function dp(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function fp(){let e=Oe(e=>e.errors);return e.length===0?null:(0,X.jsxs)(`div`,{role:`alert`,className:`bg-popover text-popover-foreground absolute right-3 bottom-9 z-20 flex w-96 max-w-[calc(100%-1.5rem)] items-start gap-2 rounded-md border p-3 text-[13px] shadow-lg`,children:[(0,X.jsx)(Fe,{icon:d,className:`text-destructive mt-0.5 size-4 shrink-0`}),(0,X.jsx)(`p`,{className:`min-w-0 flex-1 break-words whitespace-pre-wrap`,children:e.at(-1)}),(0,X.jsx)(`button`,{type:`button`,title:`Dismiss`,"aria-label":`Dismiss`,className:`hover:bg-accent grid size-5 shrink-0 cursor-pointer place-items-center rounded-sm`,onClick:Ae,children:(0,X.jsx)(Fe,{icon:Me,className:`size-3.5`})})]})}function pp(e,t){let n=localStorage.getItem(`editorWindow ${e} ${t}`);return n===null?{tabs:[],active:null,expanded:[],settings:{view:`explorer`,sidebar:!0,width:300,tree:!0,sort:`path`,messages:{},graphHeight:240,inline:!1,whitespace:!0,collapse:!1,smartCommit:!0,preview:!1}}:JSON.parse(n)}function mp(e,t,n){localStorage.setItem(`editorWindow ${e} ${t}`,JSON.stringify(n))}function hp(e){let t=(0,Y.useRef)(!1),n=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{let t=e.initial.lastIndexOf(`.`);n.current?.focus(),n.current?.setSelectionRange(0,t>0?t:e.initial.length)},[e.initial]),(0,X.jsx)(`input`,{ref:n,"aria-label":`Name`,defaultValue:e.initial,className:`border-primary bg-background text-foreground h-5 min-w-0 flex-1 border px-1 text-[13px] outline-none`,onKeyDown:n=>{n.key===`Enter`&&(t.current=!0,e.onCommit(n.currentTarget.value)),n.key===`Escape`&&(t.current=!0,e.onCancel())},onBlur:n=>{t.current||(t.current=!0,e.onCommit(n.currentTarget.value))}})}function gp(e){let[n,r]=(0,Y.useState)(null),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(0),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)({path:``,folder:!0}),[f,p]=(0,Y.useState)(null),[m,g]=(0,Y.useState)(null),_=(0,Y.useRef)(null),v=ce();(0,Y.useEffect)(()=>{let t=!0;return je(e.machine,`files.entries`,{projectId:e.projectId}).then(e=>{t&&(r(e),a(null))},e=>{t&&a(Ve(e))}),()=>{t=!1}},[e.machine,e.projectId,o]);let y=(0,Y.useMemo)(()=>_p(n?.files??[],n?.folders??[]),[n]),ee=c??e.active,re=c??(e.active===null?``:vp(e.active));function oe(t,n){let r=t===``?[]:t.split(`/`);e.onExpanded([...new Set([...e.expanded,...r.map((e,t)=>r.slice(0,t+1).join(`/`))])]),p({kind:`create`,parent:t,folder:n})}async function se(t){if(f===null)return;p(null);let n=t.trim();if(n!==``)try{if(f.kind===`create`){let t=f.parent===``?n:`${f.parent}/${n}`;await je(e.machine,`files.create`,{projectId:e.projectId,path:t,folder:f.folder}),f.folder&&e.onExpanded(e=>[...e,t]),f.folder||e.onOpen(t)}if(f.kind===`rename`&&n!==yp(f.path)){let t=vp(f.path),r=t===``?n:`${t}/${n}`;await je(e.machine,`files.rename`,{projectId:e.projectId,path:f.path,to:r}),e.onRenamed(f.path,r)}s(e=>e+1)}catch(e){ke(e)}}async function de(t){try{await je(e.machine,`files.delete`,{projectId:e.projectId,path:t.path}),e.onDeleted(t.path),s(e=>e+1)}catch(e){ke(e)}}function fe(e,t,n){return(0,X.jsxs)(`div`,{className:`flex h-[22px] items-center gap-1.5 pr-2`,style:{paddingLeft:8+e*12},children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),t&&(0,X.jsx)(Fe,{icon:np,className:`text-muted-foreground size-4 shrink-0`}),!t&&(0,X.jsx)(Ke,{path:n}),(0,X.jsx)(hp,{initial:n,onCommit:e=>void se(e),onCancel:()=>p(null)})]},`input`)}function me(t,n,r,i){return f?.kind===`rename`&&f.path===t?fe(n,r,yp(t)):(0,X.jsxs)(`button`,{type:`button`,"data-path":t,"data-folder":r,className:He(`text-sidebar-foreground hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] w-full cursor-pointer items-center gap-1.5 pr-2 text-left text-[13px] outline-none focus-visible:ring-1 focus-visible:ring-inset`,t===ee&&`bg-sidebar-row-active`),style:{paddingLeft:8+n*12},onClick:()=>{r?(l(t),e.onExpanded(i?e.expanded.filter(e=>e!==t):[...e.expanded,t])):(l(null),e.onOpen(t))},children:[Array.from({length:n},(e,t)=>(0,X.jsx)(`span`,{"aria-hidden":!0,className:`border-sidebar-border pointer-events-none absolute inset-y-0 border-l opacity-0 transition-opacity group-hover/tree:opacity-100`,style:{left:16+t*12}},t)),r&&(0,X.jsx)(Fe,{icon:Je,"aria-hidden":!0,className:He(`text-muted-foreground size-4 shrink-0 transition-transform`,i&&`rotate-90`)}),!r&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),r&&(0,X.jsx)(Fe,{icon:i?ye:np,className:`text-muted-foreground size-4 shrink-0`}),!r&&(0,X.jsx)(Ke,{path:t}),(0,X.jsx)(`span`,{className:`truncate`,children:yp(t)})]},t)}function ve(t,n,r){return[f?.kind===`create`&&f.parent===n&&fe(r,f.folder,``),...[...t.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(t=>{let i=n===``?t[0]:`${n}/${t[0]}`,a=e.expanded.includes(i);return(0,X.jsxs)(`div`,{children:[me(i,r,!0,a),a&&ve(t[1],i,r+1)]},`dir:${i}`)}),...[...t.files].sort((e,t)=>e.localeCompare(t)).map(e=>me(e,r,!1,!1))]}return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`New File…`,"aria-label":`New File`,onClick:()=>oe(re,!1),children:(0,X.jsx)(Fe,{icon:tp,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`New Folder…`,"aria-label":`New Folder`,onClick:()=>oe(re,!0),children:(0,X.jsx)(Fe,{icon:le,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Refresh Explorer`,"aria-label":`Refresh Explorer`,onClick:()=>s(o+1),children:(0,X.jsx)(Fe,{icon:qe,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Collapse Folders in Explorer`,"aria-label":`Collapse Folders in Explorer`,onClick:()=>e.onExpanded([]),children:(0,X.jsx)(Fe,{icon:Ye,className:`size-4`})})]}),(0,X.jsxs)(_e,{children:[(0,X.jsx)(b,{asChild:!0,children:(0,X.jsxs)(`div`,{className:`group/tree min-h-0 flex-1 overflow-y-auto pb-6`,onContextMenu:e=>{let t=e.target instanceof Element?e.target.closest(`[data-path]`):null;d(t===null?{path:``,folder:!0}:{path:t.dataset.path??``,folder:t.dataset.folder===`true`})},children:[i!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:i}),i===null&&n===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),i===null&&n!==null&&ve(y,``,0)]})}),(0,X.jsxs)(he,{className:`min-w-48`,onCloseAutoFocus:e=>{_.current!==null&&(e.preventDefault(),_.current(),_.current=null)},children:[!u.folder&&Xe(u.path)===`markdown`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ae,{onSelect:()=>e.onPreview(u.path),children:`Open Preview`}),(0,X.jsx)(ge,{})]}),(0,X.jsx)(ae,{onSelect:()=>{_.current=()=>oe(u.folder?u.path:vp(u.path),!1)},children:`New File…`}),(0,X.jsx)(ae,{onSelect:()=>{_.current=()=>oe(u.folder?u.path:vp(u.path),!0)},children:`New Folder…`}),(0,X.jsx)(ge,{}),(0,X.jsx)(ae,{onSelect:()=>void v.copy(u.path===``?e.root:`${e.root}/${u.path}`),children:`Copy Path`}),u.path!==``&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ae,{onSelect:()=>void v.copy(u.path),children:`Copy Relative Path`}),!u.folder&&(0,X.jsx)(ae,{onSelect:()=>void t(e.machine,e.projectId,u.path).catch(ke),children:`Download`}),(0,X.jsx)(ge,{}),(0,X.jsx)(ae,{onSelect:()=>{_.current=()=>p({kind:`rename`,path:u.path,folder:u.folder})},children:`Rename…`}),(0,X.jsx)(ae,{variant:`destructive`,onSelect:()=>{_.current=()=>g(u)},children:`Delete`})]})]})]}),(0,X.jsx)(te,{open:m!==null,onOpenChange:e=>{e||g(null)},children:(0,X.jsxs)(ie,{children:[(0,X.jsxs)(be,{children:[(0,X.jsx)(Se,{children:`Delete '${m===null?``:yp(m.path)}'?`}),(0,X.jsx)(ne,{children:m?.folder===!0?`This folder and everything in it will be permanently deleted.`:`This file will be permanently deleted.`})]}),(0,X.jsxs)(h,{children:[(0,X.jsx)(ue,{children:`Cancel`}),(0,X.jsx)(pe,{variant:`destructive`,onClick:()=>{m!==null&&de(m)},children:`Delete`})]})]})})]})}function _p(e,t){let n={folders:new Map,files:[]};function r(e){let t=n;for(let n of e){let e=t.folders.get(n)??{folders:new Map,files:[]};t.folders.set(n,e),t=e}return t}for(let e of t)r(e.split(`/`));for(let t of e)r(t.split(`/`).slice(0,-1)).files.push(t);return n}function vp(e){return e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``}function yp(e){return e.slice(e.lastIndexOf(`/`)+1)}function bp(e){return(0,X.jsx)(`div`,{role:`tablist`,className:`flex h-full min-w-0 flex-1 [scrollbar-width:thin] overflow-x-auto`,children:e.tabs.map(t=>{let n=t.id===e.active,r=e.dirty.includes(t.id);return(0,X.jsxs)(`div`,{role:`tab`,tabIndex:0,"aria-selected":n,title:t.path,className:He(`group/tab border-sidebar-border relative flex shrink-0 cursor-pointer items-center gap-1.5 border-r pr-1.5 pl-3 text-[13px] outline-none select-none`,n&&`bg-background text-foreground`,!n&&`text-muted-foreground hover:bg-background/50`),onClick:()=>e.onSelect(t.id),onAuxClick:n=>{n.button===1&&e.onClose(t.id)},onKeyDown:n=>{n.key===`Enter`&&e.onSelect(t.id)},children:[n&&(0,X.jsx)(`span`,{className:`bg-primary absolute inset-x-0 top-0 h-px`}),(0,X.jsx)(Ke,{path:t.path}),(0,X.jsx)(`span`,{className:`max-w-48 truncate`,children:t.label}),e.tabs.some(e=>e!==t&&e.label===t.label)&&(0,X.jsx)(`span`,{className:`text-muted-foreground max-w-40 truncate text-xs`,children:vp(t.path)}),(0,X.jsxs)(`button`,{type:`button`,title:`Close`,"aria-label":`Close ${t.label}`,className:He(`group/close hover:bg-accent flex size-5 cursor-pointer items-center justify-center rounded opacity-0 group-hover/tab:opacity-100 focus-visible:opacity-100`,(n||r)&&`opacity-100`),onClick:n=>{n.stopPropagation(),e.onClose(t.id)},children:[r&&(0,X.jsx)(`span`,{className:`bg-foreground size-2 rounded-full group-hover/close:hidden`}),(0,X.jsx)(Fe,{icon:Me,className:He(`size-3.5`,r&&`hidden group-hover/close:block`)})]})]},t.id)})})}var xp=class e{_ruleStack;constructor(e){this._ruleStack=e}get ruleStack(){return this._ruleStack}clone(){return new e(this._ruleStack)}equals(t){return!(!t||!(t instanceof e)||t!==this||t._ruleStack!==this._ruleStack)}};function Sp(e){if(Array.isArray(e)&&(e=e[0]),e)return e=(e.charCodeAt(0)===35?e.slice(1):e).toLowerCase(),(e.length===3||e.length===4)&&(e=e.split(``).map(e=>e+e).join(``)),e}var Cp=/[\s,]+/;function wp(e){let t=`rules`in e?e.rules:void 0;if(!t){t=[];let n=e.settings||e.tokenColors;for(let{scope:e,settings:{foreground:r,background:i,fontStyle:a}={}}of n){if(!r&&!i&&!a)continue;let n=Array.isArray(e)?e:e?[e]:[],o=kp(a),s=Sp(r),c=Sp(i);t.push(...n.map(e=>({token:e,foreground:s,background:c,fontStyle:o})))}}let n=Object.fromEntries(Object.entries(e.colors||{}).map(([e,t])=>[e,`#${Sp(t)}`]));return{base:e.type===`light`?`vs`:`vs-dark`,inherit:!1,colors:n,rules:t}}function Tp(e,t,n={}){let r=new Map,i=e.getLoadedThemes();for(let n of i){let i=wp(e.getTheme(n));r.set(n,i),t.editor.defineTheme(n,i)}let a=[],o=new Map,s=t.editor.setTheme.bind(t.editor);t.editor.setTheme=t=>{let n=e.setTheme(t),i=r.get(t);a.length=n.colorMap.length;for(let e=0;e<n.colorMap.length;e++)a[e]=n.colorMap[e];o.clear(),i?.rules.forEach(e=>{let t=Sp(e.foreground);if(!t)return;let n=Ap(t,kp(e.fontStyle));o.has(n)||o.set(n,e.token)}),s(t)};let c=t.editor.create;t.editor.create=(e,n,r)=>(n?.theme&&t.editor.setTheme(n.theme),c(e,n,r)),t.editor.setTheme(i[0]);function l(e,t){let n=Ap(e,Ep(t));return o.get(n)}let{tokenizeMaxLineLength:u=2e4,tokenizeTimeLimit:d=500}=n,f=new Set(t.languages.getLanguages().map(e=>e.id));for(let n of e.getLoadedLanguages())f.has(n)&&t.languages.setTokensProvider(n,{getInitialState(){return new xp(Ze)},tokenize(t,r){if(t.length>=u)return{endState:r,tokens:[{startIndex:0,scopes:``}]};let i=e.getLanguage(n).tokenizeLine2(t,r.ruleStack,d);i.stoppedEarly&&console.warn(`Time limit reached when tokenizing line: ${t.substring(0,100)}`);let o=i.tokens.length/2,s=[];for(let e=0;e<o;e++){let t=i.tokens[2*e],n=i.tokens[2*e+1],r=Qe.getForeground(n),o=Sp(a[r]||``),c=Qe.getFontStyle(n),u=o&&l(o,c)||``;s.push({startIndex:t,scopes:u})}return{endState:new xp(i.ruleStack),tokens:s}}})}function Ep(e){if(e<=$e.None)return``;let t=[];return e&$e.Italic&&t.push(`italic`),e&$e.Bold&&t.push(`bold`),e&$e.Underline&&t.push(`underline`),e&$e.Strikethrough&&t.push(`strikethrough`),t.join(` `)}var Dp=[`italic`,`bold`,`underline`,`strikethrough`],Op={"line-through":`strikethrough`};function kp(e){if(!e)return``;let t=new Set(e.split(Cp).map(e=>e.trim().toLowerCase()).map(e=>Op[e]||e).filter(Boolean));return Dp.filter(e=>t.has(e)).join(` `)}function Ap(e,t){return t?`${e}|${t}`:e}var jp={},Mp={},Np=class e{static getOrCreate(t){return Mp[t]||(Mp[t]=new e(t)),Mp[t]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,jp[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Z(e){let t=e.id;jp[t]=e,Jc.register(e);let n=Np.getOrCreate(t);Jc.registerTokensProviderFactory(t,{create:async()=>(await n.load()).language}),Jc.onLanguageEncountered(t,async()=>{let e=await n.load();Jc.setLanguageConfiguration(t,e.conf)})}Z({id:`abap`,extensions:[`.abap`],aliases:[`abap`,`ABAP`],loader:()=>J(()=>import(`./abap-08VXUWAP.js`),[])}),Z({id:`apex`,extensions:[`.cls`],aliases:[`Apex`,`apex`],mimetypes:[`text/x-apex-source`,`text/x-apex`],loader:()=>J(()=>import(`./apex-BWPQTe0t.js`),[])}),Z({id:`azcli`,extensions:[`.azcli`],aliases:[`Azure CLI`,`azcli`],loader:()=>J(()=>import(`./azcli-Bc_sGQ0U.js`),[])}),Z({id:`bat`,extensions:[`.bat`,`.cmd`],aliases:[`Batch`,`bat`],loader:()=>J(()=>import(`./bat-i0X4ZdIN.js`),[])}),Z({id:`bicep`,extensions:[`.bicep`],aliases:[`Bicep`],loader:()=>J(()=>import(`./bicep-B5-_aFwp.js`),[])}),Z({id:`cameligo`,extensions:[`.mligo`],aliases:[`Cameligo`],loader:()=>J(()=>import(`./cameligo-DMUM7wLl.js`),[])}),Z({id:`clojure`,extensions:[`.clj`,`.cljs`,`.cljc`,`.edn`],aliases:[`clojure`,`Clojure`],loader:()=>J(()=>import(`./clojure-Cm7r79vr.js`),[])}),Z({id:`coffeescript`,extensions:[`.coffee`],aliases:[`CoffeeScript`,`coffeescript`,`coffee`],mimetypes:[`text/x-coffeescript`,`text/coffeescript`],loader:()=>J(()=>import(`./coffee-Ba7i2nA0.js`),[])}),Z({id:`c`,extensions:[`.c`,`.h`],aliases:[`C`,`c`],loader:()=>J(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`cpp`,extensions:[`.cpp`,`.cc`,`.cxx`,`.hpp`,`.hh`,`.hxx`],aliases:[`C++`,`Cpp`,`cpp`],loader:()=>J(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`csharp`,extensions:[`.cs`,`.csx`,`.cake`],aliases:[`C#`,`csharp`],loader:()=>J(()=>import(`./csharp-BKxtCVv1.js`),[])}),Z({id:`csp`,extensions:[`.csp`],aliases:[`CSP`,`csp`],loader:()=>J(()=>import(`./csp-bTuwJoIa.js`),[])}),Z({id:`css`,extensions:[`.css`],aliases:[`CSS`,`css`],mimetypes:[`text/css`],loader:()=>J(()=>import(`./css-DIMkf-bt.js`),[])}),Z({id:`cypher`,extensions:[`.cypher`,`.cyp`],aliases:[`Cypher`,`OpenCypher`],loader:()=>J(()=>import(`./cypher-CVaqCwHa.js`),[])}),Z({id:`dart`,extensions:[`.dart`],aliases:[`Dart`,`dart`],mimetypes:[`text/x-dart-source`,`text/x-dart`],loader:()=>J(()=>import(`./dart-onAF5SnQ.js`),[])}),Z({id:`dockerfile`,extensions:[`.dockerfile`],filenames:[`Dockerfile`],aliases:[`Dockerfile`],loader:()=>J(()=>import(`./dockerfile-DZFCIeNp.js`),[])}),Z({id:`ecl`,extensions:[`.ecl`],aliases:[`ECL`,`Ecl`,`ecl`],loader:()=>J(()=>import(`./ecl-94qehhXe.js`),[])}),Z({id:`elixir`,extensions:[`.ex`,`.exs`],aliases:[`Elixir`,`elixir`,`ex`],loader:()=>J(()=>import(`./elixir-6RTg0lbw.js`),[])}),Z({id:`flow9`,extensions:[`.flow`],aliases:[`Flow9`,`Flow`,`flow9`,`flow`],loader:()=>J(()=>import(`./flow9-C5_-GSwl.js`),[])}),Z({id:`fsharp`,extensions:[`.fs`,`.fsi`,`.ml`,`.mli`,`.fsx`,`.fsscript`],aliases:[`F#`,`FSharp`,`fsharp`],loader:()=>J(()=>import(`./fsharp-C8Ef5oNN.js`),[])}),Z({id:`freemarker2`,extensions:[`.ftl`,`.ftlh`,`.ftlx`],aliases:[`FreeMarker2`,`Apache FreeMarker2`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-dollar`,aliases:[`FreeMarker2 (Angle/Dollar)`,`Apache FreeMarker2 (Angle/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAngleInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-dollar`,aliases:[`FreeMarker2 (Bracket/Dollar)`,`Apache FreeMarker2 (Bracket/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagBracketInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-bracket`,aliases:[`FreeMarker2 (Angle/Bracket)`,`Apache FreeMarker2 (Angle/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAngleInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-bracket`,aliases:[`FreeMarker2 (Bracket/Bracket)`,`Apache FreeMarker2 (Bracket/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagBracketInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-dollar`,aliases:[`FreeMarker2 (Auto/Dollar)`,`Apache FreeMarker2 (Auto/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-bracket`,aliases:[`FreeMarker2 (Auto/Bracket)`,`Apache FreeMarker2 (Auto/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`go`,extensions:[`.go`],aliases:[`Go`],loader:()=>J(()=>import(`./go-C-y9NEjX.js`),[])}),Z({id:`graphql`,extensions:[`.graphql`,`.gql`],aliases:[`GraphQL`,`graphql`,`gql`],mimetypes:[`application/graphql`],loader:()=>J(()=>import(`./graphql-fmXr3nnJ.js`),[])}),Z({id:`handlebars`,extensions:[`.handlebars`,`.hbs`],aliases:[`Handlebars`,`handlebars`,`hbs`],mimetypes:[`text/x-handlebars-template`],loader:()=>J(()=>import(`./handlebars-84NJRWd6.js`),__vite__mapDeps([5,1,2,3,4]))}),Z({id:`hcl`,extensions:[`.tf`,`.tfvars`,`.hcl`],aliases:[`Terraform`,`tf`,`HCL`,`hcl`],loader:()=>J(()=>import(`./hcl-CpzslTdj.js`),[])}),Z({id:`html`,extensions:[`.html`,`.htm`,`.shtml`,`.xhtml`,`.mdoc`,`.jsp`,`.asp`,`.aspx`,`.jshtm`],aliases:[`HTML`,`htm`,`html`,`xhtml`],mimetypes:[`text/html`,`text/x-jshtm`,`text/template`,`text/ng-template`],loader:()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))}),Z({id:`ini`,extensions:[`.ini`,`.properties`,`.gitconfig`],filenames:[`config`,`.gitattributes`,`.gitconfig`,`.editorconfig`],aliases:[`Ini`,`ini`],loader:()=>J(()=>import(`./ini-sBoK_t0W.js`),[])}),Z({id:`java`,extensions:[`.java`,`.jav`],aliases:[`Java`,`java`],mimetypes:[`text/x-java-source`,`text/x-java`],loader:()=>J(()=>import(`./java-BEtHBSE6.js`),[])}),Z({id:`javascript`,extensions:[`.js`,`.es6`,`.jsx`,`.mjs`,`.cjs`],firstLine:`^#!.*\\bnode`,filenames:[`jakefile`],aliases:[`JavaScript`,`javascript`,`js`],mimetypes:[`text/javascript`],loader:()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))}),Z({id:`julia`,extensions:[`.jl`],aliases:[`julia`,`Julia`],loader:()=>J(()=>import(`./julia-Bri6UV-V.js`),[])}),Z({id:`kotlin`,extensions:[`.kt`,`.kts`],aliases:[`Kotlin`,`kotlin`],mimetypes:[`text/x-kotlin-source`,`text/x-kotlin`],loader:()=>J(()=>import(`./kotlin-BOotOW0E.js`),[])}),Z({id:`less`,extensions:[`.less`],aliases:[`Less`,`less`],mimetypes:[`text/x-less`,`text/less`],loader:()=>J(()=>import(`./less-B9JPFI3C.js`),[])}),Z({id:`lexon`,extensions:[`.lex`],aliases:[`Lexon`],loader:()=>J(()=>import(`./lexon-CfSJPG6W.js`),[])}),Z({id:`lua`,extensions:[`.lua`],aliases:[`Lua`,`lua`],loader:()=>J(()=>import(`./lua-CsQS60Ue.js`),[])}),Z({id:`liquid`,extensions:[`.liquid`,`.html.liquid`],aliases:[`Liquid`,`liquid`],mimetypes:[`application/liquid`],loader:()=>J(()=>import(`./liquid-Dcyd1pkL.js`),__vite__mapDeps([9,1,2,3,4]))}),Z({id:`m3`,extensions:[`.m3`,`.i3`,`.mg`,`.ig`],aliases:[`Modula-3`,`Modula3`,`modula3`,`m3`],loader:()=>J(()=>import(`./m3-D-oSqn_W.js`),[])}),Z({id:`markdown`,extensions:[`.md`,`.markdown`,`.mdown`,`.mkdn`,`.mkd`,`.mdwn`,`.mdtxt`,`.mdtext`],aliases:[`Markdown`,`markdown`],loader:()=>J(()=>import(`./markdown-Cimd5fb3.js`),[])}),Z({id:`mdx`,extensions:[`.mdx`],aliases:[`MDX`,`mdx`],loader:()=>J(()=>import(`./mdx-DR7vQeQJ.js`),__vite__mapDeps([10,1,2,3,4]))}),Z({id:`mips`,extensions:[`.s`],aliases:[`MIPS`,`MIPS-V`],mimetypes:[`text/x-mips`,`text/mips`,`text/plaintext`],loader:()=>J(()=>import(`./mips-CIPQ_RoX.js`),[])}),Z({id:`msdax`,extensions:[`.dax`,`.msdax`],aliases:[`DAX`,`MSDAX`],loader:()=>J(()=>import(`./msdax-DauUninz.js`),[])}),Z({id:`mysql`,extensions:[],aliases:[`MySQL`,`mysql`],loader:()=>J(()=>import(`./mysql-SOo6toE5.js`),[])}),Z({id:`objective-c`,extensions:[`.m`],aliases:[`Objective-C`],loader:()=>J(()=>import(`./objective-c-FvmIjYaQ.js`),[])}),Z({id:`pascal`,extensions:[`.pas`,`.p`,`.pp`],aliases:[`Pascal`,`pas`],mimetypes:[`text/x-pascal-source`,`text/x-pascal`],loader:()=>J(()=>import(`./pascal-DrH0SRf2.js`),[])}),Z({id:`pascaligo`,extensions:[`.ligo`],aliases:[`Pascaligo`,`ligo`],loader:()=>J(()=>import(`./pascaligo-D-ptJ9y-.js`),[])}),Z({id:`perl`,extensions:[`.pl`,`.pm`],aliases:[`Perl`,`pl`],loader:()=>J(()=>import(`./perl-oz_6vUea.js`),[])}),Z({id:`pgsql`,extensions:[],aliases:[`PostgreSQL`,`postgres`,`pg`,`postgre`],loader:()=>J(()=>import(`./pgsql-DTj74zXo.js`),[])}),Z({id:`php`,extensions:[`.php`,`.php4`,`.php5`,`.phtml`,`.ctp`],aliases:[`PHP`,`php`],mimetypes:[`application/x-php`],loader:()=>J(()=>import(`./php-nr791fC2.js`),[])}),Z({id:`pla`,extensions:[`.pla`],loader:()=>J(()=>import(`./pla-CopQ2nXW.js`),[])}),Z({id:`postiats`,extensions:[`.dats`,`.sats`,`.hats`],aliases:[`ATS`,`ATS/Postiats`],loader:()=>J(()=>import(`./postiats-43DmfD33.js`),[])}),Z({id:`powerquery`,extensions:[`.pq`,`.pqm`],aliases:[`PQ`,`M`,`Power Query`,`Power Query M`],loader:()=>J(()=>import(`./powerquery-D3hlyOfw.js`),[])}),Z({id:`powershell`,extensions:[`.ps1`,`.psm1`,`.psd1`],aliases:[`PowerShell`,`powershell`,`ps`,`ps1`],loader:()=>J(()=>import(`./powershell-DmHpPYUd.js`),[])}),Z({id:`proto`,extensions:[`.proto`],aliases:[`protobuf`,`Protocol Buffers`],loader:()=>J(()=>import(`./protobuf-C531GsRP.js`),[])}),Z({id:`pug`,extensions:[`.jade`,`.pug`],aliases:[`Pug`,`Jade`,`jade`],loader:()=>J(()=>import(`./pug-Z5eAx3Zn.js`),[])}),Z({id:`python`,extensions:[`.py`,`.rpy`,`.pyw`,`.cpy`,`.gyp`,`.gypi`],aliases:[`Python`,`py`],firstLine:`^#!/.*\\bpython[0-9.-]*\\b`,loader:()=>J(()=>import(`./python-CiSQgsVi.js`),__vite__mapDeps([11,1,2,3,4]))}),Z({id:`qsharp`,extensions:[`.qs`],aliases:[`Q#`,`qsharp`],loader:()=>J(()=>import(`./qsharp-DkqhCAOL.js`),[])}),Z({id:`r`,extensions:[`.r`,`.rhistory`,`.rmd`,`.rprofile`,`.rt`],aliases:[`R`,`r`],loader:()=>J(()=>import(`./r-BwWrilGY.js`),[])}),Z({id:`razor`,extensions:[`.cshtml`],aliases:[`Razor`,`razor`],mimetypes:[`text/x-cshtml`],loader:()=>J(()=>import(`./razor-WdSU-o-W.js`),__vite__mapDeps([12,1,2,3,4]))}),Z({id:`redis`,extensions:[`.redis`],aliases:[`redis`],loader:()=>J(()=>import(`./redis-ClamHrr6.js`),[])}),Z({id:`redshift`,extensions:[],aliases:[`Redshift`,`redshift`],loader:()=>J(()=>import(`./redshift-DT7zqm-g.js`),[])}),Z({id:`restructuredtext`,extensions:[`.rst`],aliases:[`reStructuredText`,`restructuredtext`],loader:()=>J(()=>import(`./restructuredtext-BYgofb2h.js`),[])}),Z({id:`ruby`,extensions:[`.rb`,`.rbx`,`.rjs`,`.gemspec`,`.pp`],filenames:[`rakefile`,`Gemfile`],aliases:[`Ruby`,`rb`],loader:()=>J(()=>import(`./ruby-DezsRK8O.js`),[])}),Z({id:`rust`,extensions:[`.rs`,`.rlib`],aliases:[`Rust`,`rust`],loader:()=>J(()=>import(`./rust-DdL9SqIa.js`),[])}),Z({id:`sb`,extensions:[`.sb`],aliases:[`Small Basic`,`sb`],loader:()=>J(()=>import(`./sb-CcwsVR0C.js`),[])}),Z({id:`scala`,extensions:[`.scala`,`.sc`,`.sbt`],aliases:[`Scala`,`scala`,`SBT`,`Sbt`,`sbt`,`Dotty`,`dotty`],mimetypes:[`text/x-scala-source`,`text/x-scala`,`text/x-sbt`,`text/x-dotty`],loader:()=>J(()=>import(`./scala-DHpiXF5c.js`),[])}),Z({id:`scheme`,extensions:[`.scm`,`.ss`,`.sch`,`.rkt`],aliases:[`scheme`,`Scheme`],loader:()=>J(()=>import(`./scheme-BeGwcela.js`),[])}),Z({id:`scss`,extensions:[`.scss`],aliases:[`Sass`,`sass`,`scss`],mimetypes:[`text/x-scss`,`text/scss`],loader:()=>J(()=>import(`./scss-gp-XZpBa.js`),[])}),Z({id:`shell`,extensions:[`.sh`,`.bash`],aliases:[`Shell`,`sh`],loader:()=>J(()=>import(`./shell-CC2rA5mh.js`),[])}),Z({id:`sol`,extensions:[`.sol`],aliases:[`sol`,`solidity`,`Solidity`],loader:()=>J(()=>import(`./solidity-BEEn4gHE.js`),[])}),Z({id:`aes`,extensions:[`.aes`],aliases:[`aes`,`sophia`,`Sophia`],loader:()=>J(()=>import(`./sophia-CRfGWb83.js`),[])}),Z({id:`sparql`,extensions:[`.rq`],aliases:[`sparql`,`SPARQL`],loader:()=>J(()=>import(`./sparql-D_Lu-MrJ.js`),[])}),Z({id:`sql`,extensions:[`.sql`],aliases:[`SQL`],loader:()=>J(()=>import(`./sql-NEE52Syq.js`),[])}),Z({id:`st`,extensions:[`.st`,`.iecst`,`.iecplc`,`.lc3lib`,`.TcPOU`,`.TcDUT`,`.TcGVL`,`.TcIO`],aliases:[`StructuredText`,`scl`,`stl`],loader:()=>J(()=>import(`./st-DbInun42.js`),[])}),Z({id:`swift`,aliases:[`Swift`,`swift`],extensions:[`.swift`],mimetypes:[`text/swift`],loader:()=>J(()=>import(`./swift-Bxkupp3x.js`),[])}),Z({id:`systemverilog`,extensions:[`.sv`,`.svh`],aliases:[`SV`,`sv`,`SystemVerilog`,`systemverilog`],loader:()=>J(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`verilog`,extensions:[`.v`,`.vh`],aliases:[`V`,`v`,`Verilog`,`verilog`],loader:()=>J(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`tcl`,extensions:[`.tcl`],aliases:[`tcl`,`Tcl`,`tcltk`,`TclTk`,`tcl/tk`,`Tcl/Tk`],loader:()=>J(()=>import(`./tcl-DISqw1ZD.js`),[])}),Z({id:`twig`,extensions:[`.twig`],aliases:[`Twig`,`twig`],mimetypes:[`text/x-twig`],loader:()=>J(()=>import(`./twig-De2hgUGE.js`),[])}),Z({id:`typescript`,extensions:[`.ts`,`.tsx`,`.cts`,`.mts`],aliases:[`TypeScript`,`ts`,`typescript`],mimetypes:[`text/typescript`],loader:()=>J(()=>import(`./typescript-Dy13l_qr.js`),__vite__mapDeps([13,8,1,2,3,4]))}),Z({id:`typespec`,extensions:[`.tsp`],aliases:[`TypeSpec`],loader:()=>J(()=>import(`./typespec-B8J7ngcE.js`),[])}),Z({id:`vb`,extensions:[`.vb`],aliases:[`Visual Basic`,`vb`],loader:()=>J(()=>import(`./vb-DV3o63ZY.js`),[])}),Z({id:`wgsl`,extensions:[`.wgsl`],aliases:[`WebGPU Shading Language`,`WGSL`,`wgsl`],loader:()=>J(()=>import(`./wgsl-DpFanUEy.js`),[])}),Z({id:`xml`,extensions:[`.xml`,`.xsd`,`.dtd`,`.ascx`,`.csproj`,`.config`,`.props`,`.targets`,`.wxi`,`.wxl`,`.wxs`,`.xaml`,`.svg`,`.svgz`,`.opf`,`.xslt`,`.xsl`],firstLine:`(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)`,aliases:[`XML`,`xml`],mimetypes:[`text/xml`,`application/xml`,`application/xaml+xml`,`application/xml-dtd`],loader:()=>J(()=>import(`./xml-AovvXo6A.js`),__vite__mapDeps([14,1,2,3,4]))}),Z({id:`yaml`,extensions:[`.yaml`,`.yml`],aliases:[`YAML`,`yaml`,`YML`,`yml`],mimetypes:[`application/x-yaml`,`text/x-yaml`],loader:()=>J(()=>import(`./yaml-EESuZNdc.js`),__vite__mapDeps([15,1,2,3,4]))});var Pp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Fp=function(e,t){return function(n,r){t(n,r,e)}},Ip,Lp=new j(`selectionAnchorSet`,!1),Rp=class{static{Ip=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(Ip.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Lp.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){let e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(q.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new Mi().appendText(x(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),wo(x(850,`Anchor set at {0}:{1}`,e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){let t=this.editor.getPosition();this.editor.setSelection(q.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){let e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Rp=Ip=Pp([Fp(1,za)],Rp);var zp=class extends W{constructor(){super({id:`editor.action.setSelectionAnchor`,label:L(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:Mr(2089,2080),weight:100}})}async run(e,t){Rp.get(t)?.setSelectionAnchor()}},Bp=class extends W{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:L(852,`Go to Selection Anchor`),precondition:Lp})}async run(e,t){Rp.get(t)?.goToSelectionAnchor()}},Vp=class extends W{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:L(853,`Select from Anchor to Cursor`),precondition:Lp,kbOpts:{kbExpr:E.editorTextFocus,primary:Mr(2089,2089),weight:100}})}async run(e,t){Rp.get(t)?.selectFromAnchorToCursor()}},Hp=class extends W{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:L(854,`Cancel Selection Anchor`),precondition:Lp,kbOpts:{kbExpr:E.editorTextFocus,primary:9,weight:100}})}async run(e,t){Rp.get(t)?.cancelSelectionAnchor()}};Rs(Rp.ID,Rp,4),z(zp),z(Bp),z(Vp),z(Hp);var Up=O(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,x(855,`Overview ruler marker color for matching brackets.`)),Wp=class extends W{constructor(){super({id:`editor.action.jumpToBracket`,label:L(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:3165,weight:100}})}run(e,t){Jp.get(t)?.jumpToBracket()}},Gp=class extends W{constructor(){super({id:`editor.action.selectToBracket`,label:L(858,`Select to Bracket`),precondition:void 0,metadata:{description:L(859,`Select the text inside and including the brackets or curly braces`),args:[{name:`args`,schema:{type:`object`,properties:{selectBrackets:{type:`boolean`,default:!0}}}}]}})}run(e,t,n){let r=!0;n&&n.selectBrackets===!1&&(r=!1),Jp.get(t)?.selectToBracket(r)}},Kp=class extends W{constructor(){super({id:`editor.action.removeBrackets`,label:L(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Jp.get(t)?.removeBrackets(this.id)}},qp=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Jp=class e extends G{static{this.ID=`editor.contrib.bracketMatchingController`}static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Rr(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{this._matchBrackets!==`never`&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;let e=this._editor.getModel(),t=this._editor.getSelections().map(t=>{let n=t.getStartPosition(),r=e.bracketPairs.matchBracket(n),i=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?i=r[1].getStartPosition():r[1].containsPosition(n)&&(i=r[0].getStartPosition());else{let t=e.bracketPairs.findEnclosingBrackets(n);if(t)i=t[1].getStartPosition();else{let t=e.bracketPairs.findNextBracket(n);t&&t.range&&(i=t.range.getStartPosition())}}return i?new q(i.lineNumber,i.column,i.lineNumber,i.column):new q(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{let i=r.getStartPosition(),a=t.bracketPairs.matchBracket(i);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(i),!a)){let e=t.bracketPairs.findNextBracket(i);e&&e.range&&(a=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let o=null,s=null;if(a){a.sort(C.compareRangesUsingStarts);let[t,n]=a;if(o=e?t.getStartPosition():t.getEndPosition(),s=e?n.getEndPosition():n.getStartPosition(),n.containsPosition(i)){let e=o;o=s,s=e}}o&&s&&n.push(new q(o.lineNumber,o.column,s.lineNumber,s.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(n=>{let r=n.getPosition(),i=t.bracketPairs.matchBracket(r);i||=t.bracketPairs.findEnclosingBrackets(r),i&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:i[0],text:``},{range:i[1],text:``}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=P.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:so(Up),position:na.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=P.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`})}_updateBrackets(){if(this._matchBrackets===`never`)return;this._recomputeBrackets();let e=[],t=0;for(let n of this._lastBracketsData){let r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getSelections();if(t.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let n=this._editor.getModel(),r=n.getVersionId(),i=[];this._lastVersionId===r&&(i=this._lastBracketsData);let a=[],o=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];n.isEmpty()&&(a[o++]=n.getStartPosition())}a.length>1&&a.sort(A.compare);let s=[],c=0,l=0,u=i.length;for(let t=0,r=a.length;t<r;t++){let r=a[t];for(;l<u&&i[l].position.isBefore(r);)l++;if(l<u&&i[l].position.equals(r))s[c++]=i[l];else{let t=n.bracketPairs.matchBracket(r,20),i=e._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!t&&this._matchBrackets===`always`&&(t=n.bracketPairs.findEnclosingBrackets(r,20),i=e._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),s[c++]=new qp(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};Rs(Jp.ID,Jp,1),z(Gp),z(Wp),z(Kp),On.appendMenuItem(D.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:x(856,`Go to &&Bracket`)},order:2}),Ra((e,t)=>{let n=e.getColor(Kf);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)}),z(class extends W{constructor(){super({id:`editor.action.transposeLetters`,label:L(863,`Transpose Letters`),precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let n=t.getModel(),r=[],i=t.getSelections();for(let e of i){if(!e.isEmpty())continue;let t=e.startLineNumber,i=e.startColumn,a=n.getLineMaxColumn(t);if(t===1&&(i===1||i===2&&a===2))continue;let o=i===a?e.getPosition():ed.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=ed.leftPosition(n,o),c=ed.leftPosition(n,s),l=n.getValueInRange(C.fromPositions(c,s)),u=n.getValueInRange(C.fromPositions(s,o)),d=C.fromPositions(c,o);r.push(new $c(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Yp=class e{static{this.sep=`.`}static{this.None=new e(`@@none@@`)}static{this.Empty=new e(``)}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(t){return this.equals(t)||this.value===``||t.value.startsWith(this.value+e.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}},Xp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Zp=function(e,t){return function(n,r){t(n,r,e)}},Qp=P.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),$p=class e extends G{static{this.baseId=`editor.widget.inlineProgressWidget`}constructor(e,t,n,r,i){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=M(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=M(`span.icon`);this.domNode.append(t),t.classList.add(...V.asClassNameArray(k.loading),`codicon-modifier-spin`);let n=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};n(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&n()})),this._register(I(this.domNode,Ml.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)}},em=class extends G{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new pc),this._currentWidget=this._register(new pc),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,n,r,i){let a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=qa(()=>{let n=C.fromPositions(e);this._currentDecorations.set([{range:n,options:Qp}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance($p,this.id,this._editor,n,t,r))},i??this._showDelay);try{return await n}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};em=Xp([Zp(2,U)],em);var tm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},nm=function(e,t){return function(n,r){t(n,r,e)}},rm,im=class{static{rm=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new j(`messageVisible`,!1,x(1353,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(rm.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new pc,this._messageListeners=new F,this._mouseOverMessage=!1,this._editor=e,this._visible=rm.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(wo(zr(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),zr(e)){let n=this._messageListeners.add(wl(e,{actionHandler:(e,t)=>{this.closeMessage(),pn(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new om(this._editor,t,n.element)}else this._messageWidget.value=new om(this._editor,t,e);this._messageListeners.add(_u.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&xn(gf(),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(I(this._messageWidget.value.getDomNode(),Ml.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(I(this._messageWidget.value.getDomNode(),Ml.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(n?n.containsPosition(e.target.position)||this.closeMessage():n=new C(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(om.fadeOut(this._messageWidget.value))}};im=rm=tm([nm(1,za),nm(2,en)],im);var am=ad.bindToContribution(im.get);H(new am({id:`leaveEditorMessage`,precondition:im.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var om=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener(`animationend`,t)},n=setTimeout(t,110);return e.getDomNode().addEventListener(`animationend`,t),e.getDomNode().classList.add(`fadeOut`),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement(`div`),this._domNode.classList.add(`monaco-editor-overlaymessage`),this._domNode.style.marginLeft=`-6px`;let i=document.createElement(`div`);i.classList.add(`anchor`,`top`),this._domNode.appendChild(i);let a=document.createElement(`div`);typeof r==`string`?(a.classList.add(`message`),a.textContent=r):(r.classList.add(`message`),a.appendChild(r)),this._domNode.appendChild(a);let o=document.createElement(`div`);o.classList.add(`anchor`,`below`),this._domNode.appendChild(o),this._editor.addContentWidget(this),this._domNode.classList.add(`fadeIn`)}dispose(){this._editor.removeContentWidget(this)}getId(){return`messageoverlay`}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle(`below`,e===2)}};Rs(im.ID,im,4);var sm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},cm=function(e,t){return function(n,r){t(n,r,e)}},lm=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,n,r,i){let a=await this.getEdit(n,i);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,n,r){let i=await this.getEdit(n,r);if(i)return{edits:[{insertText:i.insertText,title:i.title,kind:i.kind,handledMimeType:i.handledMimeType,yieldTo:i.yieldTo}],dispose(){}}}},um=class e extends lm{static{this.id=`text`}constructor(){super(Yp.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[Ao.text],this.pasteMimeTypes=[Ao.text]}async getEdit(e,t){let n=e.get(Ao.text);if(!n||e.has(Ao.uriList))return;let r=await n.asString();return{handledMimeType:Ao.text,title:x(980,`Insert Plain Text`),insertText:r,kind:this.kind}}},dm=class extends lm{constructor(){super(Yp.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[Ao.uriList],this.pasteMimeTypes=[Ao.uriList]}async getEdit(e,t){let n=await mm(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===dl.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?x(981,`Insert Uris`):x(982,`Insert Uri`):n.length>1?x(983,`Insert Paths`):x(984,`Insert Path`),{handledMimeType:Ao.uriList,insertText:i,title:a,kind:this.kind}}},fm=class extends lm{constructor(e){super(Yp.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[Ao.uriList],this.pasteMimeTypes=[Ao.uriList]}async getEdit(e,t){let n=await mm(e);if(!n.length||t.isCancellationRequested)return;let r=vu(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?gn(t.uri,e):void 0}));if(r.length)return{handledMimeType:Ao.uriList,insertText:r.join(` `),title:n.length>1?x(985,`Insert Relative Paths`):x(986,`Insert Relative Path`),kind:this.kind}}};fm=sm([cm(0,wu)],fm);var pm=class{constructor(){this.kind=new Yp(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:Ao.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==_a.PasteAs&&!r.only?.contains(this.kind))return;let a=await n.get(`text/html`)?.asString();if(a&&!i.isCancellationRequested)return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:x(987,`Insert HTML`),kind:this.kind}]}}};async function mm(e){let t=e.get(Ao.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of ql.parse(n))try{r.push({uri:$n.parse(e),originalText:e})}catch{}return r}var hm={scheme:`*`,hasAccessToAllModels:!0},gm=class extends G{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(hm,new um)),this._register(e.documentDropEditProvider.register(hm,new dm)),this._register(e.documentDropEditProvider.register(hm,new fm(t)))}};gm=sm([cm(0,R),cm(1,wu)],gm);var _m=class extends G{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(hm,new um)),this._register(e.documentPasteEditProvider.register(hm,new dm)),this._register(e.documentPasteEditProvider.register(hm,new fm(t))),this._register(e.documentPasteEditProvider.register(hm,new pm))}};_m=sm([cm(0,R),cm(1,wu)],_m);var vm=class e{constructor(){this.value=``,this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let t=this.pos,n=0,r=this.value.charCodeAt(t),i;if(i=e._table[r],typeof i==`number`)return this.pos+=1,{type:i,pos:t,len:1};if(e.isDigitCharacter(r)){i=8;do n+=1,r=this.value.charCodeAt(t+n);while(e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}if(e.isVariableCharacter(r)){i=9;do r=this.value.charCodeAt(t+ ++n);while(e.isVariableCharacter(r)||e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}i=10;do n+=1,r=this.value.charCodeAt(t+n);while(!isNaN(r)&&e._table[r]===void 0&&!e.isDigitCharacter(r)&&!e.isVariableCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}},ym=class{constructor(){this._children=[]}appendChild(e){return e instanceof bm&&this._children[this._children.length-1]instanceof bm?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:n}=e,r=n.children.indexOf(e),i=n.children.slice(0);i.splice(r,1,...t),n._children=i,(function e(t,n){for(let r of t)r.parent=n,e(r.children,r)})(t,n)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof Om)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},bm=class e extends ym{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},xm=class extends ym{},Sm=class e extends xm{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:+(e.index>t.index)}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Cm?this._children[0]:void 0}clone(){let t=new e(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},Cm=class e extends ym{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof bm&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let t=new e;return this.options.forEach(t.appendChild,t),t}},wm=class e extends ym{constructor(){super(...arguments),this.regexp=RegExp(``)}resolve(e){let t=this,n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(e=>e instanceof Tm&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof Tm){let r=e[n.index]||``;r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return``}clone(){let t=new e;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?`i`:``)+(this.regexp.global?`g`:``)),t._children=this.children.map(e=>e.clone()),t}},Tm=class e extends ym{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}resolve(e){return this.shorthandName===`upcase`?e?e.toLocaleUpperCase():``:this.shorthandName===`downcase`?e?e.toLocaleLowerCase():``:this.shorthandName===`capitalize`?e?e[0].toLocaleUpperCase()+e.substr(1):``:this.shorthandName===`pascalcase`?e?this._toPascalCase(e):``:this.shorthandName===`camelcase`?e?this._toCamelCase(e):``:this.shorthandName===`kebabcase`?e?this._toKebabCase(e):``:this.shorthandName===`snakecase`?e?this._toSnakeCase(e):``:e&&typeof this.ifValue==`string`?this.ifValue:!e&&typeof this.elseValue==`string`?this.elseValue:e||``}_toKebabCase(e){if(!e.match(/[\p{L}0-9]+/gu))return e;if(!e.match(/[\p{L}0-9]/u))return e.trim().toLowerCase().replace(/^_+|_+$/g,``).replace(/[\s_]+/g,`-`);let t=e.trim().replace(/^_+|_+$/g,``),n=t.match(/\p{Lu}{2,}(?=\p{Lu}\p{Ll}+[0-9]*|[\s_-]|$)|\p{Lu}?\p{Ll}+[0-9]*|\p{Lu}(?=\p{Lu}\p{Ll})|\p{Lu}(?=[\s_-]|$)|[0-9]+/gu);return n?n.map(e=>e.toLowerCase()).join(`-`):t.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).join(`-`)}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(e=>e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((e,t)=>t===0?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,`$1_$2`).replace(/[\s\-]+/g,`_`).toLowerCase()}clone(){return new e(this.index,this.shorthandName,this.ifValue,this.elseValue)}},Em=class e extends xm{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||``)),t!==void 0&&(this._children=[new bm(t)],!0)}clone(){let t=new e(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}};function Dm(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var Om=class e extends ym{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof Sm&&(e.push(n),t=!t||t.index<n.index?n:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){let{all:e}=this.placeholderInfo;return e}offset(e){let t=0,n=!1;return this.walk(r=>r===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return Dm([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof Sm&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Em&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let t=new e;return t._children=this.children.map(e=>e.clone()),t}walk(e){Dm(this.children,e)}},km=class{constructor(){this._scanner=new vm,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,`\\$&`)}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){let r=new Om;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){let n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let r=new Map,i=[];t.walk(e=>(e instanceof Sm&&(e.isFinalTabstop?r.set(0,void 0):!r.has(e.index)&&e.children.length>0?r.set(e.index,e.children):i.push(e)),!0));let a=(e,n)=>{let i=r.get(e.index);if(!i)return;let o=new Sm(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof Sm&&r.has(t.index)&&!n.has(t.index)&&(n.add(t.index),a(t,n),n.delete(t.index))}t.replace(e,[o])},o=new Set;for(let e of i)a(e,o);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(e=>e.index===0)||e.appendChild(new Sm(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let 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){let t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){let e=this._scanner.next();if(e.type!==0&&e.type!==4&&e.type!==5)return!1}this._token=this._scanner.next()}let n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,`$1`);return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new bm(t)),!0):!1}_parseTabstopOrVariableName(e){let t,n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Sm(Number(t)):new Em(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);let r=new Sm(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new bm("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new Cm;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(t),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseChoiceElement(e){let t=this._token,n=[];for(;this._token.type!==2&&this._token.type!==7;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;n.push(e)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new bm(n.join(``))),!0)}_parseComplexVariable(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);let r=new Em(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new bm("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseTransform(e){let t=new wm,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,n+=e;else if(this._token.type!==14)n+=this._accept(void 0,!0);else return!1}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new bm(e));else if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);)if(this._token.type!==14)r+=this._accept(void 0,!0);else return!1;try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);let r=this._accept(8,!0);if(!r)return this._backTo(t),!1;if(!n||this._accept(4))return e.appendChild(new Tm(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let n=this._accept(9,!0);return!n||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Tm(Number(r),n)),!0)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new Tm(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new Tm(Number(r),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let n=this._until(4);if(n)return e.appendChild(new Tm(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new Tm(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14&&(e.appendChild(new bm(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function Am(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new al(e,{range:t,text:typeof n.insertText==`string`?km.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function jm(e){function t(e,t){return`mimeType`in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}let n=new Map;for(let r of e)for(let i of r.yieldTo??[])for(let a of e)if(a!==r&&t(i,a)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(a)}if(!n.size)return Array.from(e);let r=new Set,i=[];function a(e){if(!e.length)return[];let t=e[0];if(i.includes(t))return console.warn(`Yield to cycle detected`,t),e;if(r.has(t))return a(e.slice(1));let o=[],s=n.get(t);return s&&(i.push(t),o=a(s),i.pop()),r.add(t),[...o,t,...a(e.slice(1))]}return a(Array.from(e))}function Mm(e,t){return t&&(e.stack||e.stacktrace)?x(33,`{0}: {1}`,Pm(e),Nm(e.stack)||Nm(e.stacktrace)):Pm(e)}function Nm(e){return Array.isArray(e)?e.join(`
2
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{A as t,F as n,G as r,H as i,I as a,K as o,L as s,M as c,R as l,S as u,St as d,U as f,V as p,W as m,_ as h,a as g,b as _,c as v,ct as y,dt as b,f as ee,ft as te,g as ne,gt as re,h as ie,ht as ae,i as oe,j as se,k as ce,m as le,n as ue,ot as de,p as fe,pt as pe,q as me,rt as he,st as ge,t as _e,ut as ve,v as ye,vt as be,wt as xe,xt as Se,y as Ce,yt as we}from"./use-editor-shortcut-DI6xbzvo.js";import{F as Te,I as Ee,M as De,N as Oe,T as ke,in as Ae,m as je,rn as Me,t as Ne,v as Pe}from"./XIcon-hd7a6qPG.js";import{a as Fe,t as Ie}from"./button-CWFREsRn.js";import{c as Le,l as Re,n as ze,o as Be,r as Ve,t as He}from"./utils-U6QfaJBO.js";import{a as Ue,l as We,r as Ge,u as Ke}from"./preview-dialog-DXN8c37K.js";import{n as qe,r as Je}from"./TextWrapIcon-BRhMbXe9.js";import{t as Ye}from"./ChevronsDownUpIcon-BNVFd2te.js";import{Wt as Xe}from"./dist-Jliw2AH0.js";import{G as Ze,U as Qe,W as $e,d as et,h as tt,o as nt}from"./dist-TdUDcI9m.js";import{$ as rt,$a as it,$c as at,$d as ot,$i as st,$l as ct,$n as lt,$o as ut,$r as dt,$s as ft,$t as pt,$u as mt,A as ht,Aa as gt,Ac as _t,Ad as x,Ai as vt,Al as yt,An as bt,Ao as xt,Ar as St,As as Ct,At as wt,Au as Tt,B as Et,Ba as Dt,Bc as S,Bd as Ot,Bi as kt,Bl as At,Bn as jt,Bo as Mt,Br as Nt,Bs as Pt,Bt as Ft,Bu as C,C as It,Ca as Lt,Cc as Rt,Cd as zt,Ci as Bt,Cl as Vt,Cn as Ht,Co as Ut,Cr as Wt,Cs as Gt,Ct as Kt,Cu as qt,D as Jt,Da as Yt,Dc as Xt,Dd as Zt,Di as Qt,Dl as $t,Dn as en,Do as tn,Dr as nn,Ds as rn,Dt as an,Du as on,E as sn,Ea as cn,Ec as ln,Ed as un,Ei as dn,El as fn,En as pn,Eo as mn,Er as hn,Es as gn,Et as _n,Eu as vn,F as yn,Fa as bn,Fc as xn,Fd as Sn,Fi as Cn,Fl as wn,Fn as Tn,Fo as En,Fr as Dn,Fs as On,Ft as kn,Fu as An,G as jn,Ga as Mn,Gc as Nn,Gd as Pn,Gi as Fn,Gl as In,Gn as Ln,Go as Rn,Gr as zn,Gs as Bn,Gt as Vn,Gu as Hn,H as Un,Ha as Wn,Hc as Gn,Hd as Kn,Hi as qn,Hl as Jn,Hn as Yn,Ho as Xn,Hr as Zn,Hs as w,Ht as Qn,Hu as $n,Ia as er,Ic as tr,Id as nr,Ii as rr,Il as ir,In as ar,Io as or,Ir as sr,Is as cr,It as lr,Iu as ur,J as dr,Ja as fr,Jc as pr,Jd as mr,Ji as hr,Jl as gr,Jn as _r,Jo as vr,Jr as yr,Js as br,Jt as xr,Ju as T,K as Sr,Ka as Cr,Kc as wr,Kd as Tr,Ki as Er,Kl as Dr,Kn as Or,Ko as kr,Kr as E,Ks as Ar,Kt as jr,Ku as Mr,L as Nr,La as Pr,Lc as Fr,Ld as Ir,Li as Lr,Ll as Rr,Ln as zr,Lo as Br,Lr as Vr,Ls as Hr,Lt as Ur,Lu as Wr,M as Gr,Ma as Kr,Mc as qr,Md as Jr,Mi as Yr,Ml as Xr,Mn as Zr,Mo as Qr,Mr as $r,Ms as ei,Mt as ti,Mu as ni,N as ri,Na as ii,Nc as ai,Nd as oi,Ni as si,Nl as ci,Nn as li,No as ui,Nr as di,Ns as D,Nt as fi,Nu as pi,O as mi,Oa as hi,Oc as gi,Od as _i,Oi as vi,Ol as yi,On as bi,Oo as xi,Or as Si,Os as Ci,Ot as wi,Ou as Ti,P as Ei,Pa as Di,Pc as Oi,Pd as ki,Pi as Ai,Pl as ji,Pn as Mi,Po as Ni,Pr as Pi,Ps as Fi,Pt as Ii,Pu as Li,Q as Ri,Qa as zi,Qc as Bi,Qd as Vi,Qi as Hi,Ql as Ui,Qn as Wi,Qo as Gi,Qr as Ki,Qs as qi,Qt as Ji,Qu as Yi,R as Xi,Ra as O,Rc as Zi,Rd as Qi,Ri as $i,Rl as ea,Rn as ta,Ro as na,Rr as ra,Rs as ia,Rt as aa,Ru as k,S as oa,Sa as sa,Sc as ca,Sd as la,Si as ua,Sl as da,Sn as fa,So as pa,Sr as ma,Ss as ha,St as ga,Su as _a,T as va,Ta as ya,Tc as ba,Td as xa,Ti as Sa,Tl as Ca,Tn as wa,To as Ta,Tr as Ea,Ts as Da,Tt as Oa,Tu as ka,U as Aa,Ua as ja,Uc as Ma,Ud as Na,Ui as Pa,Ul as Fa,Un as Ia,Uo as La,Ur as Ra,Us as za,Ut as Ba,Uu as Va,V as Ha,Va as Ua,Vc as Wa,Vd as Ga,Vi as Ka,Vl as qa,Vn as Ja,Vo as Ya,Vr as Xa,Vs as Za,Vt as Qa,Vu as A,W as $a,Wa as eo,Wc as to,Wd as no,Wi as ro,Wl as io,Wn as ao,Wo as oo,Wr as so,Ws as j,Wt as co,Wu as lo,X as uo,Xa as fo,Xc as po,Xd as mo,Xi as ho,Xl as go,Xn as _o,Xo as vo,Xr as yo,Xs as bo,Xt as xo,Xu as So,Y as Co,Ya as wo,Yc as To,Yd as Eo,Yi as Do,Yl as Oo,Yn as ko,Yo as Ao,Yr as jo,Ys as Mo,Yt as No,Yu as Po,Z as Fo,Za as Io,Zc as Lo,Zd as Ro,Zi as zo,Zl as Bo,Zn as Vo,Zo as Ho,Zr as Uo,Zs as Wo,Zt as Go,Zu as Ko,_ as qo,_a as Jo,_c as Yo,_d as Xo,_f as Zo,_i as Qo,_l as $o,_n as es,_o as ts,_r as ns,_s as rs,_t as is,_u as as,a as os,aa as ss,ac as M,ad as N,af as cs,ai as ls,al as us,an as ds,ao as fs,ar as ps,as as ms,at as hs,au as gs,b as _s,ba as vs,bc as ys,bd as bs,bi as xs,bl as Ss,bn as Cs,bo as ws,br as Ts,bs as Es,bt as Ds,bu as Os,c as ks,ca as As,cc as js,cd as Ms,cf as Ns,ci as Ps,cl as Fs,cn as Is,co as Ls,cr as P,cs as Rs,ct as zs,cu as Bs,d as Vs,da as Hs,dc as Us,dd as F,df as Ws,di as Gs,dl as Ks,dn as qs,do as Js,dr as Ys,ds as Xs,dt as Zs,du as Qs,ea as $s,ec,ef as tc,ei as nc,el as rc,en as ic,eo as ac,er as oc,es as sc,et as cc,eu as lc,f as uc,fa as dc,fc,fd as pc,ff as mc,fi as hc,fl as gc,fn as _c,fo as vc,fr as yc,fs as bc,ft as xc,fu as Sc,g as Cc,ga as wc,gc as Tc,gd as Ec,gf as Dc,gi as Oc,gl as kc,gn as Ac,go as jc,gr as Mc,gs as Nc,gt as Pc,gu as Fc,h as Ic,ha as Lc,hc as I,hd as Rc,hf as zc,hi as Bc,hl as Vc,hn as Hc,ho as Uc,hr as Wc,hs as Gc,ht as Kc,hu as qc,i as Jc,ia as Yc,ic as Xc,id as Zc,if as Qc,ii as $c,il as el,in as tl,io as nl,ir as rl,is as il,it as al,iu as ol,j as sl,ja as cl,jc as ll,jd as L,ji as ul,jl as dl,jn as fl,jo as pl,jr as ml,js as hl,jt as gl,ju as _l,k as vl,ka as yl,kc as bl,kd as xl,ki as Sl,kl as Cl,kn as wl,ko as Tl,kr as El,ks as Dl,kt as Ol,ku as kl,l as Al,la as jl,lc as Ml,ld as Nl,lf as Pl,li as Fl,ll as Il,ln as Ll,lo as R,lr as Rl,ls as zl,lt as Bl,lu as Vl,m as Hl,ma as Ul,mc as Wl,md as Gl,mf as Kl,mi as ql,ml as Jl,mn as Yl,mo as Xl,mr as Zl,ms as Ql,mt as $l,mu as eu,n as tu,na as nu,nc as ru,nd as iu,nf as au,ni as ou,nl as su,nn as cu,no as lu,nr as uu,ns as du,nt as fu,nu as pu,o as mu,oa as hu,oc as gu,od as _u,of as vu,oi as yu,ol as bu,on as xu,oo as Su,or as Cu,os as z,ot as wu,ou as Tu,p as Eu,pa as Du,pc as Ou,pd as ku,pf as Au,pi as ju,pl as B,pn as Mu,po as Nu,pr as Pu,ps as Fu,pt as Iu,pu as Lu,q as Ru,qa as zu,qc as Bu,qd as Vu,qi as Hu,ql as Uu,qn as Wu,qo as Gu,qr as Ku,qs as V,qt as qu,qu as Ju,r as Yu,ra as Xu,rc as Zu,rd as Qu,rf as $u,ri as ed,rl as td,rn as nd,ro as rd,rr as id,rs as ad,rt as od,ru as sd,s as cd,sa as ld,sc as ud,sd as dd,sf as fd,si as pd,sl as md,sn as hd,so as gd,sr as _d,ss as H,st as vd,su as yd,t as bd,ta as xd,tc as U,td as Sd,tf as Cd,ti as wd,tl as Td,tn as Ed,to as Dd,tr as Od,ts as W,tt as kd,tu as Ad,u as jd,ua as Md,uc as Nd,ud as G,uf as Pd,ui as Fd,ul as Id,un as Ld,uo as Rd,ur as zd,us as Bd,ut as Vd,uu as Hd,v as Ud,va as Wd,vc as K,vd as Gd,vf as Kd,vi as qd,vl as Jd,vn as Yd,vo as Xd,vr as Zd,vs as Qd,vt as $d,vu as ef,w as tf,wa as nf,wc as rf,wd as af,wi as of,wl as sf,wn as cf,wo as lf,wr as uf,ws as df,wt as ff,wu as pf,x as mf,xa as hf,xc as gf,xd as _f,xi as vf,xl as yf,xn as bf,xo as xf,xr as Sf,xs as Cf,xt as wf,xu as Tf,y as Ef,ya as Df,yc as Of,yd as kf,yi as Af,yl as jf,yn as Mf,yo as Nf,yr as Pf,ys as Ff,yt as If,yu as Lf,z as Rf,za as zf,zc as Bf,zd as Vf,zi as Hf,zl as Uf,zn as Wf,zo as Gf,zr as Kf,zs as qf,zt as Jf,zu as q}from"./editor.api-Rfucz3mk.js";import{t as J}from"./preload-helper-BLdHbfdN.js";import{i as Yf,t as Xf}from"./langs-DssLtjmH.js";import{t as Zf}from"./engine-oniguruma-BMl9YtsA.js";import{c as Qf,l as $f}from"./tooltip-CKPboHje.js";var ep=[[`path`,{d:`M17.4776 9.01106C17.485 9.01102 17.4925 9.01101 17.5 9.01101C19.9853 9.01101 22 11.0294 22 13.5193C22 15.8398 20.25 17.7508 18 18M17.4776 9.01106C17.4924 8.84606 17.5 8.67896 17.5 8.51009C17.5 5.46695 15.0376 3 12 3C9.12324 3 6.76233 5.21267 6.52042 8.03192M17.4776 9.01106C17.3753 10.1476 16.9286 11.1846 16.2428 12.0165M6.52042 8.03192C3.98398 8.27373 2 10.4139 2 13.0183C2 15.4417 3.71776 17.4632 6 17.9273M6.52042 8.03192C6.67826 8.01687 6.83823 8.00917 7 8.00917C8.12582 8.00917 9.16474 8.38194 10.0005 9.01101`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 21L12 13M12 21C11.2998 21 9.99153 19.0057 9.5 18.5M12 21C12.7002 21 14.0085 19.0057 14.5 18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],tp=[[`path`,{d:`M4 12.0005L4 14.5446C4 17.7896 4 19.4122 4.88607 20.5111C5.06508 20.7331 5.26731 20.9354 5.48933 21.1144C6.58831 22.0005 8.21082 22.0005 11.4558 22.0005C12.1614 22.0005 12.5141 22.0005 12.8372 21.8865C12.9044 21.8627 12.9702 21.8355 13.0345 21.8047C13.3436 21.6569 13.593 21.4075 14.0919 20.9086L18.8284 16.172C19.4065 15.594 19.6955 15.3049 19.8478 14.9374C20 14.5699 20 14.1611 20 13.3436V10.0005C20 6.22922 20 4.34361 18.8284 3.17203C17.7693 2.11287 16.1265 2.01125 13.0345 2.0015M13 21.5005V21.0005C13 18.172 13 16.7578 13.8787 15.8791C14.7574 15.0005 16.1716 15.0005 19 15.0005H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 5.99954H4M8 1.99954V9.99954`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],np=[[`path`,{d:`M13.6656 6.49446H16C18.8284 6.49446 20.2426 6.49446 21.1213 7.37314C22 8.25182 22 9.66603 22 12.4945V14.5C22 17.3284 22 18.7426 21.1213 19.6213C20.2426 20.5 18.8284 20.5 16 20.5H8C5.17157 20.5 3.75736 20.5 2.87868 19.6213C2 18.7426 2 17.3284 2 14.5V8.99183C2 6.65409 2 5.48521 2.61604 4.67881C2.7778 4.46706 2.96706 4.2778 3.17881 4.11604C3.98521 3.5 5.15409 3.5 7.49183 3.5C8.16633 3.5 8.50358 3.5 8.81392 3.60442C8.8976 3.63257 8.97932 3.66623 9.05854 3.70518C9.35239 3.84965 9.59179 4.08719 10.0706 4.56227L10.8483 5.33389C11.4254 5.9066 11.714 6.19295 12.08 6.3437C12.446 6.49446 12.8525 6.49446 13.6656 6.49446Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 10.5H17C18.8692 10.5 19.8038 10.5 20.5 10.9019C20.9561 11.1652 21.3348 11.5439 21.5981 12C22 12.6962 22 13.6308 22 15.5C22 17.3692 22 18.3038 21.5981 19C21.3348 19.4561 20.9561 19.8348 20.5 20.0981C19.8038 20.5 18.8692 20.5 17 20.5H7C5.13077 20.5 4.19615 20.5 3.5 20.0981C3.04394 19.8348 2.66523 19.4561 2.40192 19C2 18.3038 2 17.3692 2 15.5C2 13.6308 2 12.6962 2.40192 12C2.66523 11.5439 3.04394 11.1652 3.5 10.9019C4.19615 10.5 5.13077 10.5 7 10.5Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],rp=[[`path`,{d:`M12 8H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 12H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 20H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12 16H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M3 4V11C3 12.8692 3 13.8038 3.40192 14.5C3.66523 14.9561 4.04394 15.3348 4.5 15.5981C5.19615 16 6.13077 16 8 16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M8 8H7C6.07003 8 5.60504 8 5.22354 7.89778C4.18827 7.62038 3.37962 6.81173 3.10222 5.77646C3 5.39496 3 4.92997 3 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],ip=[[`path`,{d:`M2 11.4C2 10.2417 2.24173 10 3.4 10H20.6C21.7583 10 22 10.2417 22 11.4V12.6C22 13.7583 21.7583 14 20.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2 19.4C2 18.2417 2.24173 18 3.4 18H20.6C21.7583 18 22 18.2417 22 19.4V20.6C22 21.7583 21.7583 22 20.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],ap=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.38886 15.1629C9.89331 15.5 10.5955 15.5 12 15.5C13.4045 15.5 14.1067 15.5 14.6111 15.1629C14.8295 15.017 15.017 14.8295 15.1629 14.6111C15.5 14.1067 15.5 13.4045 15.5 12C15.5 10.5955 15.5 9.89331 15.1629 9.38886C15.017 9.17048 14.8295 8.98298 14.6111 8.83706C14.1067 8.5 13.4045 8.5 12 8.5C10.5955 8.5 9.89331 8.5 9.38886 8.83706C9.17048 8.98298 8.98298 9.17048 8.83706 9.38886C8.5 9.89331 8.5 10.5955 8.5 12C8.5 13.4045 8.5 14.1067 8.83706 14.6111C8.98298 14.8295 9.17048 15.017 9.38886 15.1629Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],op=[[`path`,{d:`M8 2H9.01472C10.241 2 10.8541 2 11.4054 2.22836C11.9567 2.45672 12.3903 2.89027 13.2574 3.75736L21.1262 11.6263C21.6841 12.1867 21.9982 12.9449 22 13.7357L22 13.75L22 13.7643C21.9982 14.5551 21.6841 15.3133 21.1262 15.8737L15.8737 21.1262C15.3133 21.6841 14.5551 21.9982 13.7643 22L13.75 22L13.7357 22C12.9449 21.9982 12.1867 21.6841 11.6263 21.1262L3.75736 13.2574C2.89027 12.3903 2.45672 11.9567 2.22836 11.4054C2 10.8541 2 10.241 2 9.01472V8C2 5.17157 2 3.75736 2.87868 2.87868C3.75736 2 5.17157 2 8 2Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 7.25V7.5M8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],sp=[[`path`,{d:`M3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C8.79275 3 5.97733 4.67765 4.38341 7.20327M3.29339 3.00076L3.46556 5.05452C3.58958 6.53384 3.65159 7.27349 4.13359 7.68914C4.61559 8.10479 5.32673 8.03185 6.74899 7.88595L8.79339 7.67625`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],cp=[[`path`,{d:`M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],Y=e(Re(),1),X=Le();function lp(e){let t=up(e.document,e.view);return t===null?null:(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:t})}function up(e,t){return e===void 0?t===`explorer`?`Open a file from the explorer to start editing.`:`Select a change to see its diff.`:e.status===`large`?`This file is ${dp(e.size)}, too large to open in the editor (limit ${dp(e.limit)}).`:e.status===`binary`?`The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding.`:e.status===`error`?e.message:null}function dp(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function fp(){let e=Oe(e=>e.errors);return e.length===0?null:(0,X.jsxs)(`div`,{role:`alert`,className:`bg-popover text-popover-foreground absolute right-3 bottom-9 z-20 flex w-96 max-w-[calc(100%-1.5rem)] items-start gap-2 rounded-md border p-3 text-[13px] shadow-lg`,children:[(0,X.jsx)(Fe,{icon:xe,className:`text-destructive mt-0.5 size-4 shrink-0`}),(0,X.jsx)(`p`,{className:`min-w-0 flex-1 break-words whitespace-pre-wrap`,children:e.at(-1)}),(0,X.jsx)(`button`,{type:`button`,title:`Dismiss`,"aria-label":`Dismiss`,className:`hover:bg-accent grid size-5 shrink-0 cursor-pointer place-items-center rounded-sm`,onClick:je,children:(0,X.jsx)(Fe,{icon:Ne,className:`size-3.5`})})]})}function pp(e,t){let n=localStorage.getItem(`editorWindow ${e} ${t}`);return n===null?{tabs:[],active:null,expanded:[],settings:{view:`explorer`,sidebar:!0,width:300,tree:!0,sort:`path`,messages:{},graphHeight:240,inline:!1,whitespace:!0,collapse:!1,smartCommit:!0,preview:!1}}:JSON.parse(n)}function mp(e,t,n){localStorage.setItem(`editorWindow ${e} ${t}`,JSON.stringify(n))}function hp(e){let t=(0,Y.useRef)(!1),n=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{let t=e.initial.lastIndexOf(`.`);n.current?.focus(),n.current?.setSelectionRange(0,t>0?t:e.initial.length)},[e.initial]),(0,X.jsx)(`input`,{ref:n,"aria-label":`Name`,defaultValue:e.initial,className:`border-primary bg-background text-foreground h-5 min-w-0 flex-1 border px-1 text-[13px] outline-none`,onKeyDown:n=>{n.key===`Enter`&&(t.current=!0,e.onCommit(n.currentTarget.value)),n.key===`Escape`&&(t.current=!0,e.onCancel())},onBlur:n=>{t.current||(t.current=!0,e.onCommit(n.currentTarget.value))}})}function gp(e){let[n,r]=(0,Y.useState)(null),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(0),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)({path:``,folder:!0}),[f,p]=(0,Y.useState)(null),[m,y]=(0,Y.useState)(null),re=(0,Y.useRef)(null),ae=t();(0,Y.useEffect)(()=>{let t=!0;return Ae(e.machine,`files.entries`,{projectId:e.projectId}).then(e=>{t&&(r(e),a(null))},e=>{t&&a(Ve(e))}),()=>{t=!1}},[e.machine,e.projectId,o]);let ce=(0,Y.useMemo)(()=>_p(n?.files??[],n?.folders??[]),[n]),de=c??e.active,pe=c??(e.active===null?``:vp(e.active));function me(t,n){let r=t===``?[]:t.split(`/`);e.onExpanded([...new Set([...e.expanded,...r.map((e,t)=>r.slice(0,t+1).join(`/`))])]),p({kind:`create`,parent:t,folder:n})}async function he(t){if(f===null)return;p(null);let n=t.trim();if(n!==``)try{if(f.kind===`create`){let t=f.parent===``?n:`${f.parent}/${n}`;await Ae(e.machine,`files.create`,{projectId:e.projectId,path:t,folder:f.folder}),f.folder&&e.onExpanded(e=>[...e,t]),f.folder||e.onOpen(t)}if(f.kind===`rename`&&n!==yp(f.path)){let t=vp(f.path),r=t===``?n:`${t}/${n}`;await Ae(e.machine,`files.rename`,{projectId:e.projectId,path:f.path,to:r}),e.onRenamed(f.path,r)}s(e=>e+1)}catch(e){ke(e)}}async function ge(t){try{await Ae(e.machine,`files.delete`,{projectId:e.projectId,path:t.path}),e.onDeleted(t.path),s(e=>e+1)}catch(e){ke(e)}}function _e(e,t,n){return(0,X.jsxs)(`div`,{className:`flex h-[22px] items-center gap-1.5 pr-2`,style:{paddingLeft:8+e*12},children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),t&&(0,X.jsx)(Fe,{icon:np,className:`text-muted-foreground size-4 shrink-0`}),!t&&(0,X.jsx)(Ke,{path:n}),(0,X.jsx)(hp,{initial:n,onCommit:e=>void he(e),onCancel:()=>p(null)})]},`input`)}function ve(t,n,r,i){return f?.kind===`rename`&&f.path===t?_e(n,r,yp(t)):(0,X.jsxs)(`button`,{type:`button`,"data-path":t,"data-folder":r,className:He(`text-sidebar-foreground hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] w-full cursor-pointer items-center gap-1.5 pr-2 text-left text-[13px] outline-none focus-visible:ring-1 focus-visible:ring-inset`,t===de&&`bg-sidebar-row-active`),style:{paddingLeft:8+n*12},onClick:()=>{r?(l(t),e.onExpanded(i?e.expanded.filter(e=>e!==t):[...e.expanded,t])):(l(null),e.onOpen(t))},children:[Array.from({length:n},(e,t)=>(0,X.jsx)(`span`,{"aria-hidden":!0,className:`border-sidebar-border pointer-events-none absolute inset-y-0 border-l opacity-0 transition-opacity group-hover/tree:opacity-100`,style:{left:16+t*12}},t)),r&&(0,X.jsx)(Fe,{icon:Je,"aria-hidden":!0,className:He(`text-muted-foreground size-4 shrink-0 transition-transform`,i&&`rotate-90`)}),!r&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),r&&(0,X.jsx)(Fe,{icon:i?te:np,className:`text-muted-foreground size-4 shrink-0`}),!r&&(0,X.jsx)(Ke,{path:t}),(0,X.jsx)(`span`,{className:`truncate`,children:yp(t)})]},t)}function be(t,n,r){return[f?.kind===`create`&&f.parent===n&&_e(r,f.folder,``),...[...t.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(t=>{let i=n===``?t[0]:`${n}/${t[0]}`,a=e.expanded.includes(i);return(0,X.jsxs)(`div`,{children:[ve(i,r,!0,a),a&&be(t[1],i,r+1)]},`dir:${i}`)}),...[...t.files].sort((e,t)=>e.localeCompare(t)).map(e=>ve(e,r,!1,!1))]}return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`New File…`,"aria-label":`New File`,onClick:()=>me(pe,!1),children:(0,X.jsx)(Fe,{icon:tp,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`New Folder…`,"aria-label":`New Folder`,onClick:()=>me(pe,!0),children:(0,X.jsx)(Fe,{icon:b,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Refresh Explorer`,"aria-label":`Refresh Explorer`,onClick:()=>s(o+1),children:(0,X.jsx)(Fe,{icon:qe,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Collapse Folders in Explorer`,"aria-label":`Collapse Folders in Explorer`,onClick:()=>e.onExpanded([]),children:(0,X.jsx)(Fe,{icon:Ye,className:`size-4`})})]}),(0,X.jsxs)(ue,{children:[(0,X.jsx)(ee,{asChild:!0,children:(0,X.jsxs)(`div`,{className:`group/tree min-h-0 flex-1 overflow-y-auto pb-6`,onContextMenu:e=>{let t=e.target instanceof Element?e.target.closest(`[data-path]`):null;d(t===null?{path:``,folder:!0}:{path:t.dataset.path??``,folder:t.dataset.folder===`true`})},children:[i!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:i}),i===null&&n===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),i===null&&n!==null&&be(ce,``,0)]})}),(0,X.jsxs)(oe,{className:`min-w-48`,onCloseAutoFocus:e=>{re.current!==null&&(e.preventDefault(),re.current(),re.current=null)},children:[!u.folder&&Xe(u.path)===`markdown`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(g,{onSelect:()=>e.onPreview(u.path),children:`Open Preview`}),(0,X.jsx)(v,{})]}),(0,X.jsx)(g,{onSelect:()=>{re.current=()=>me(u.folder?u.path:vp(u.path),!1)},children:`New File…`}),(0,X.jsx)(g,{onSelect:()=>{re.current=()=>me(u.folder?u.path:vp(u.path),!0)},children:`New Folder…`}),(0,X.jsx)(v,{}),(0,X.jsx)(g,{onSelect:()=>void ae.copy(u.path===``?e.root:`${e.root}/${u.path}`),children:`Copy Path`}),u.path!==``&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(g,{onSelect:()=>void ae.copy(u.path),children:`Copy Relative Path`}),!u.folder&&(0,X.jsx)(g,{onSelect:()=>void se(e.machine,e.projectId,u.path).catch(ke),children:`Download`}),(0,X.jsx)(v,{}),(0,X.jsx)(g,{onSelect:()=>{re.current=()=>p({kind:`rename`,path:u.path,folder:u.folder})},children:`Rename…`}),(0,X.jsx)(g,{variant:`destructive`,onSelect:()=>{re.current=()=>y(u)},children:`Delete`})]})]})]}),(0,X.jsx)(fe,{open:m!==null,onOpenChange:e=>{e||y(null)},children:(0,X.jsxs)(ne,{children:[(0,X.jsxs)(Ce,{children:[(0,X.jsx)(_,{children:`Delete '${m===null?``:yp(m.path)}'?`}),(0,X.jsx)(h,{children:m?.folder===!0?`This folder and everything in it will be permanently deleted.`:`This file will be permanently deleted.`})]}),(0,X.jsxs)(ye,{children:[(0,X.jsx)(ie,{children:`Cancel`}),(0,X.jsx)(le,{variant:`destructive`,onClick:()=>{m!==null&&ge(m)},children:`Delete`})]})]})})]})}function _p(e,t){let n={folders:new Map,files:[]};function r(e){let t=n;for(let n of e){let e=t.folders.get(n)??{folders:new Map,files:[]};t.folders.set(n,e),t=e}return t}for(let e of t)r(e.split(`/`));for(let t of e)r(t.split(`/`).slice(0,-1)).files.push(t);return n}function vp(e){return e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``}function yp(e){return e.slice(e.lastIndexOf(`/`)+1)}function bp(e){return(0,X.jsx)(`div`,{role:`tablist`,className:`flex h-full min-w-0 flex-1 [scrollbar-width:thin] overflow-x-auto`,children:e.tabs.map(t=>{let n=t.id===e.active,r=e.dirty.includes(t.id);return(0,X.jsxs)(`div`,{role:`tab`,tabIndex:0,"aria-selected":n,title:t.path,className:He(`group/tab border-sidebar-border relative flex shrink-0 cursor-pointer items-center gap-1.5 border-r pr-1.5 pl-3 text-[13px] outline-none select-none`,n&&`bg-background text-foreground`,!n&&`text-muted-foreground hover:bg-background/50`),onClick:()=>e.onSelect(t.id),onAuxClick:n=>{n.button===1&&e.onClose(t.id)},onKeyDown:n=>{n.key===`Enter`&&e.onSelect(t.id)},children:[n&&(0,X.jsx)(`span`,{className:`bg-primary absolute inset-x-0 top-0 h-px`}),(0,X.jsx)(Ke,{path:t.path}),(0,X.jsx)(`span`,{className:`max-w-48 truncate`,children:t.label}),e.tabs.some(e=>e!==t&&e.label===t.label)&&(0,X.jsx)(`span`,{className:`text-muted-foreground max-w-40 truncate text-xs`,children:vp(t.path)}),(0,X.jsxs)(`button`,{type:`button`,title:`Close`,"aria-label":`Close ${t.label}`,className:He(`group/close hover:bg-accent flex size-5 cursor-pointer items-center justify-center rounded opacity-0 group-hover/tab:opacity-100 focus-visible:opacity-100`,(n||r)&&`opacity-100`),onClick:n=>{n.stopPropagation(),e.onClose(t.id)},children:[r&&(0,X.jsx)(`span`,{className:`bg-foreground size-2 rounded-full group-hover/close:hidden`}),(0,X.jsx)(Fe,{icon:Ne,className:He(`size-3.5`,r&&`hidden group-hover/close:block`)})]})]},t.id)})})}var xp=class e{_ruleStack;constructor(e){this._ruleStack=e}get ruleStack(){return this._ruleStack}clone(){return new e(this._ruleStack)}equals(t){return!(!t||!(t instanceof e)||t!==this||t._ruleStack!==this._ruleStack)}};function Sp(e){if(Array.isArray(e)&&(e=e[0]),e)return e=(e.charCodeAt(0)===35?e.slice(1):e).toLowerCase(),(e.length===3||e.length===4)&&(e=e.split(``).map(e=>e+e).join(``)),e}var Cp=/[\s,]+/;function wp(e){let t=`rules`in e?e.rules:void 0;if(!t){t=[];let n=e.settings||e.tokenColors;for(let{scope:e,settings:{foreground:r,background:i,fontStyle:a}={}}of n){if(!r&&!i&&!a)continue;let n=Array.isArray(e)?e:e?[e]:[],o=kp(a),s=Sp(r),c=Sp(i);t.push(...n.map(e=>({token:e,foreground:s,background:c,fontStyle:o})))}}let n=Object.fromEntries(Object.entries(e.colors||{}).map(([e,t])=>[e,`#${Sp(t)}`]));return{base:e.type===`light`?`vs`:`vs-dark`,inherit:!1,colors:n,rules:t}}function Tp(e,t,n={}){let r=new Map,i=e.getLoadedThemes();for(let n of i){let i=wp(e.getTheme(n));r.set(n,i),t.editor.defineTheme(n,i)}let a=[],o=new Map,s=t.editor.setTheme.bind(t.editor);t.editor.setTheme=t=>{let n=e.setTheme(t),i=r.get(t);a.length=n.colorMap.length;for(let e=0;e<n.colorMap.length;e++)a[e]=n.colorMap[e];o.clear(),i?.rules.forEach(e=>{let t=Sp(e.foreground);if(!t)return;let n=Ap(t,kp(e.fontStyle));o.has(n)||o.set(n,e.token)}),s(t)};let c=t.editor.create;t.editor.create=(e,n,r)=>(n?.theme&&t.editor.setTheme(n.theme),c(e,n,r)),t.editor.setTheme(i[0]);function l(e,t){let n=Ap(e,Ep(t));return o.get(n)}let{tokenizeMaxLineLength:u=2e4,tokenizeTimeLimit:d=500}=n,f=new Set(t.languages.getLanguages().map(e=>e.id));for(let n of e.getLoadedLanguages())f.has(n)&&t.languages.setTokensProvider(n,{getInitialState(){return new xp(Ze)},tokenize(t,r){if(t.length>=u)return{endState:r,tokens:[{startIndex:0,scopes:``}]};let i=e.getLanguage(n).tokenizeLine2(t,r.ruleStack,d);i.stoppedEarly&&console.warn(`Time limit reached when tokenizing line: ${t.substring(0,100)}`);let o=i.tokens.length/2,s=[];for(let e=0;e<o;e++){let t=i.tokens[2*e],n=i.tokens[2*e+1],r=Qe.getForeground(n),o=Sp(a[r]||``),c=Qe.getFontStyle(n),u=o&&l(o,c)||``;s.push({startIndex:t,scopes:u})}return{endState:new xp(i.ruleStack),tokens:s}}})}function Ep(e){if(e<=$e.None)return``;let t=[];return e&$e.Italic&&t.push(`italic`),e&$e.Bold&&t.push(`bold`),e&$e.Underline&&t.push(`underline`),e&$e.Strikethrough&&t.push(`strikethrough`),t.join(` `)}var Dp=[`italic`,`bold`,`underline`,`strikethrough`],Op={"line-through":`strikethrough`};function kp(e){if(!e)return``;let t=new Set(e.split(Cp).map(e=>e.trim().toLowerCase()).map(e=>Op[e]||e).filter(Boolean));return Dp.filter(e=>t.has(e)).join(` `)}function Ap(e,t){return t?`${e}|${t}`:e}var jp={},Mp={},Np=class e{static getOrCreate(t){return Mp[t]||(Mp[t]=new e(t)),Mp[t]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,jp[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Z(e){let t=e.id;jp[t]=e,Jc.register(e);let n=Np.getOrCreate(t);Jc.registerTokensProviderFactory(t,{create:async()=>(await n.load()).language}),Jc.onLanguageEncountered(t,async()=>{let e=await n.load();Jc.setLanguageConfiguration(t,e.conf)})}Z({id:`abap`,extensions:[`.abap`],aliases:[`abap`,`ABAP`],loader:()=>J(()=>import(`./abap-08VXUWAP.js`),[])}),Z({id:`apex`,extensions:[`.cls`],aliases:[`Apex`,`apex`],mimetypes:[`text/x-apex-source`,`text/x-apex`],loader:()=>J(()=>import(`./apex-BWPQTe0t.js`),[])}),Z({id:`azcli`,extensions:[`.azcli`],aliases:[`Azure CLI`,`azcli`],loader:()=>J(()=>import(`./azcli-Bc_sGQ0U.js`),[])}),Z({id:`bat`,extensions:[`.bat`,`.cmd`],aliases:[`Batch`,`bat`],loader:()=>J(()=>import(`./bat-i0X4ZdIN.js`),[])}),Z({id:`bicep`,extensions:[`.bicep`],aliases:[`Bicep`],loader:()=>J(()=>import(`./bicep-B5-_aFwp.js`),[])}),Z({id:`cameligo`,extensions:[`.mligo`],aliases:[`Cameligo`],loader:()=>J(()=>import(`./cameligo-DMUM7wLl.js`),[])}),Z({id:`clojure`,extensions:[`.clj`,`.cljs`,`.cljc`,`.edn`],aliases:[`clojure`,`Clojure`],loader:()=>J(()=>import(`./clojure-Cm7r79vr.js`),[])}),Z({id:`coffeescript`,extensions:[`.coffee`],aliases:[`CoffeeScript`,`coffeescript`,`coffee`],mimetypes:[`text/x-coffeescript`,`text/coffeescript`],loader:()=>J(()=>import(`./coffee-Ba7i2nA0.js`),[])}),Z({id:`c`,extensions:[`.c`,`.h`],aliases:[`C`,`c`],loader:()=>J(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`cpp`,extensions:[`.cpp`,`.cc`,`.cxx`,`.hpp`,`.hh`,`.hxx`],aliases:[`C++`,`Cpp`,`cpp`],loader:()=>J(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`csharp`,extensions:[`.cs`,`.csx`,`.cake`],aliases:[`C#`,`csharp`],loader:()=>J(()=>import(`./csharp-BKxtCVv1.js`),[])}),Z({id:`csp`,extensions:[`.csp`],aliases:[`CSP`,`csp`],loader:()=>J(()=>import(`./csp-bTuwJoIa.js`),[])}),Z({id:`css`,extensions:[`.css`],aliases:[`CSS`,`css`],mimetypes:[`text/css`],loader:()=>J(()=>import(`./css-DIMkf-bt.js`),[])}),Z({id:`cypher`,extensions:[`.cypher`,`.cyp`],aliases:[`Cypher`,`OpenCypher`],loader:()=>J(()=>import(`./cypher-CVaqCwHa.js`),[])}),Z({id:`dart`,extensions:[`.dart`],aliases:[`Dart`,`dart`],mimetypes:[`text/x-dart-source`,`text/x-dart`],loader:()=>J(()=>import(`./dart-onAF5SnQ.js`),[])}),Z({id:`dockerfile`,extensions:[`.dockerfile`],filenames:[`Dockerfile`],aliases:[`Dockerfile`],loader:()=>J(()=>import(`./dockerfile-DZFCIeNp.js`),[])}),Z({id:`ecl`,extensions:[`.ecl`],aliases:[`ECL`,`Ecl`,`ecl`],loader:()=>J(()=>import(`./ecl-94qehhXe.js`),[])}),Z({id:`elixir`,extensions:[`.ex`,`.exs`],aliases:[`Elixir`,`elixir`,`ex`],loader:()=>J(()=>import(`./elixir-6RTg0lbw.js`),[])}),Z({id:`flow9`,extensions:[`.flow`],aliases:[`Flow9`,`Flow`,`flow9`,`flow`],loader:()=>J(()=>import(`./flow9-C5_-GSwl.js`),[])}),Z({id:`fsharp`,extensions:[`.fs`,`.fsi`,`.ml`,`.mli`,`.fsx`,`.fsscript`],aliases:[`F#`,`FSharp`,`fsharp`],loader:()=>J(()=>import(`./fsharp-C8Ef5oNN.js`),[])}),Z({id:`freemarker2`,extensions:[`.ftl`,`.ftlh`,`.ftlx`],aliases:[`FreeMarker2`,`Apache FreeMarker2`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-dollar`,aliases:[`FreeMarker2 (Angle/Dollar)`,`Apache FreeMarker2 (Angle/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAngleInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-dollar`,aliases:[`FreeMarker2 (Bracket/Dollar)`,`Apache FreeMarker2 (Bracket/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagBracketInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-bracket`,aliases:[`FreeMarker2 (Angle/Bracket)`,`Apache FreeMarker2 (Angle/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAngleInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-bracket`,aliases:[`FreeMarker2 (Bracket/Bracket)`,`Apache FreeMarker2 (Bracket/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagBracketInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-dollar`,aliases:[`FreeMarker2 (Auto/Dollar)`,`Apache FreeMarker2 (Auto/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-bracket`,aliases:[`FreeMarker2 (Auto/Bracket)`,`Apache FreeMarker2 (Auto/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`go`,extensions:[`.go`],aliases:[`Go`],loader:()=>J(()=>import(`./go-C-y9NEjX.js`),[])}),Z({id:`graphql`,extensions:[`.graphql`,`.gql`],aliases:[`GraphQL`,`graphql`,`gql`],mimetypes:[`application/graphql`],loader:()=>J(()=>import(`./graphql-fmXr3nnJ.js`),[])}),Z({id:`handlebars`,extensions:[`.handlebars`,`.hbs`],aliases:[`Handlebars`,`handlebars`,`hbs`],mimetypes:[`text/x-handlebars-template`],loader:()=>J(()=>import(`./handlebars-84NJRWd6.js`),__vite__mapDeps([5,1,2,3,4]))}),Z({id:`hcl`,extensions:[`.tf`,`.tfvars`,`.hcl`],aliases:[`Terraform`,`tf`,`HCL`,`hcl`],loader:()=>J(()=>import(`./hcl-CpzslTdj.js`),[])}),Z({id:`html`,extensions:[`.html`,`.htm`,`.shtml`,`.xhtml`,`.mdoc`,`.jsp`,`.asp`,`.aspx`,`.jshtm`],aliases:[`HTML`,`htm`,`html`,`xhtml`],mimetypes:[`text/html`,`text/x-jshtm`,`text/template`,`text/ng-template`],loader:()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))}),Z({id:`ini`,extensions:[`.ini`,`.properties`,`.gitconfig`],filenames:[`config`,`.gitattributes`,`.gitconfig`,`.editorconfig`],aliases:[`Ini`,`ini`],loader:()=>J(()=>import(`./ini-sBoK_t0W.js`),[])}),Z({id:`java`,extensions:[`.java`,`.jav`],aliases:[`Java`,`java`],mimetypes:[`text/x-java-source`,`text/x-java`],loader:()=>J(()=>import(`./java-BEtHBSE6.js`),[])}),Z({id:`javascript`,extensions:[`.js`,`.es6`,`.jsx`,`.mjs`,`.cjs`],firstLine:`^#!.*\\bnode`,filenames:[`jakefile`],aliases:[`JavaScript`,`javascript`,`js`],mimetypes:[`text/javascript`],loader:()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))}),Z({id:`julia`,extensions:[`.jl`],aliases:[`julia`,`Julia`],loader:()=>J(()=>import(`./julia-Bri6UV-V.js`),[])}),Z({id:`kotlin`,extensions:[`.kt`,`.kts`],aliases:[`Kotlin`,`kotlin`],mimetypes:[`text/x-kotlin-source`,`text/x-kotlin`],loader:()=>J(()=>import(`./kotlin-BOotOW0E.js`),[])}),Z({id:`less`,extensions:[`.less`],aliases:[`Less`,`less`],mimetypes:[`text/x-less`,`text/less`],loader:()=>J(()=>import(`./less-B9JPFI3C.js`),[])}),Z({id:`lexon`,extensions:[`.lex`],aliases:[`Lexon`],loader:()=>J(()=>import(`./lexon-CfSJPG6W.js`),[])}),Z({id:`lua`,extensions:[`.lua`],aliases:[`Lua`,`lua`],loader:()=>J(()=>import(`./lua-CsQS60Ue.js`),[])}),Z({id:`liquid`,extensions:[`.liquid`,`.html.liquid`],aliases:[`Liquid`,`liquid`],mimetypes:[`application/liquid`],loader:()=>J(()=>import(`./liquid-Dcyd1pkL.js`),__vite__mapDeps([9,1,2,3,4]))}),Z({id:`m3`,extensions:[`.m3`,`.i3`,`.mg`,`.ig`],aliases:[`Modula-3`,`Modula3`,`modula3`,`m3`],loader:()=>J(()=>import(`./m3-D-oSqn_W.js`),[])}),Z({id:`markdown`,extensions:[`.md`,`.markdown`,`.mdown`,`.mkdn`,`.mkd`,`.mdwn`,`.mdtxt`,`.mdtext`],aliases:[`Markdown`,`markdown`],loader:()=>J(()=>import(`./markdown-Cimd5fb3.js`),[])}),Z({id:`mdx`,extensions:[`.mdx`],aliases:[`MDX`,`mdx`],loader:()=>J(()=>import(`./mdx-DR7vQeQJ.js`),__vite__mapDeps([10,1,2,3,4]))}),Z({id:`mips`,extensions:[`.s`],aliases:[`MIPS`,`MIPS-V`],mimetypes:[`text/x-mips`,`text/mips`,`text/plaintext`],loader:()=>J(()=>import(`./mips-CIPQ_RoX.js`),[])}),Z({id:`msdax`,extensions:[`.dax`,`.msdax`],aliases:[`DAX`,`MSDAX`],loader:()=>J(()=>import(`./msdax-DauUninz.js`),[])}),Z({id:`mysql`,extensions:[],aliases:[`MySQL`,`mysql`],loader:()=>J(()=>import(`./mysql-SOo6toE5.js`),[])}),Z({id:`objective-c`,extensions:[`.m`],aliases:[`Objective-C`],loader:()=>J(()=>import(`./objective-c-FvmIjYaQ.js`),[])}),Z({id:`pascal`,extensions:[`.pas`,`.p`,`.pp`],aliases:[`Pascal`,`pas`],mimetypes:[`text/x-pascal-source`,`text/x-pascal`],loader:()=>J(()=>import(`./pascal-DrH0SRf2.js`),[])}),Z({id:`pascaligo`,extensions:[`.ligo`],aliases:[`Pascaligo`,`ligo`],loader:()=>J(()=>import(`./pascaligo-D-ptJ9y-.js`),[])}),Z({id:`perl`,extensions:[`.pl`,`.pm`],aliases:[`Perl`,`pl`],loader:()=>J(()=>import(`./perl-oz_6vUea.js`),[])}),Z({id:`pgsql`,extensions:[],aliases:[`PostgreSQL`,`postgres`,`pg`,`postgre`],loader:()=>J(()=>import(`./pgsql-DTj74zXo.js`),[])}),Z({id:`php`,extensions:[`.php`,`.php4`,`.php5`,`.phtml`,`.ctp`],aliases:[`PHP`,`php`],mimetypes:[`application/x-php`],loader:()=>J(()=>import(`./php-nr791fC2.js`),[])}),Z({id:`pla`,extensions:[`.pla`],loader:()=>J(()=>import(`./pla-CopQ2nXW.js`),[])}),Z({id:`postiats`,extensions:[`.dats`,`.sats`,`.hats`],aliases:[`ATS`,`ATS/Postiats`],loader:()=>J(()=>import(`./postiats-43DmfD33.js`),[])}),Z({id:`powerquery`,extensions:[`.pq`,`.pqm`],aliases:[`PQ`,`M`,`Power Query`,`Power Query M`],loader:()=>J(()=>import(`./powerquery-D3hlyOfw.js`),[])}),Z({id:`powershell`,extensions:[`.ps1`,`.psm1`,`.psd1`],aliases:[`PowerShell`,`powershell`,`ps`,`ps1`],loader:()=>J(()=>import(`./powershell-DmHpPYUd.js`),[])}),Z({id:`proto`,extensions:[`.proto`],aliases:[`protobuf`,`Protocol Buffers`],loader:()=>J(()=>import(`./protobuf-C531GsRP.js`),[])}),Z({id:`pug`,extensions:[`.jade`,`.pug`],aliases:[`Pug`,`Jade`,`jade`],loader:()=>J(()=>import(`./pug-Z5eAx3Zn.js`),[])}),Z({id:`python`,extensions:[`.py`,`.rpy`,`.pyw`,`.cpy`,`.gyp`,`.gypi`],aliases:[`Python`,`py`],firstLine:`^#!/.*\\bpython[0-9.-]*\\b`,loader:()=>J(()=>import(`./python-CiSQgsVi.js`),__vite__mapDeps([11,1,2,3,4]))}),Z({id:`qsharp`,extensions:[`.qs`],aliases:[`Q#`,`qsharp`],loader:()=>J(()=>import(`./qsharp-DkqhCAOL.js`),[])}),Z({id:`r`,extensions:[`.r`,`.rhistory`,`.rmd`,`.rprofile`,`.rt`],aliases:[`R`,`r`],loader:()=>J(()=>import(`./r-BwWrilGY.js`),[])}),Z({id:`razor`,extensions:[`.cshtml`],aliases:[`Razor`,`razor`],mimetypes:[`text/x-cshtml`],loader:()=>J(()=>import(`./razor-WdSU-o-W.js`),__vite__mapDeps([12,1,2,3,4]))}),Z({id:`redis`,extensions:[`.redis`],aliases:[`redis`],loader:()=>J(()=>import(`./redis-ClamHrr6.js`),[])}),Z({id:`redshift`,extensions:[],aliases:[`Redshift`,`redshift`],loader:()=>J(()=>import(`./redshift-DT7zqm-g.js`),[])}),Z({id:`restructuredtext`,extensions:[`.rst`],aliases:[`reStructuredText`,`restructuredtext`],loader:()=>J(()=>import(`./restructuredtext-BYgofb2h.js`),[])}),Z({id:`ruby`,extensions:[`.rb`,`.rbx`,`.rjs`,`.gemspec`,`.pp`],filenames:[`rakefile`,`Gemfile`],aliases:[`Ruby`,`rb`],loader:()=>J(()=>import(`./ruby-DezsRK8O.js`),[])}),Z({id:`rust`,extensions:[`.rs`,`.rlib`],aliases:[`Rust`,`rust`],loader:()=>J(()=>import(`./rust-DdL9SqIa.js`),[])}),Z({id:`sb`,extensions:[`.sb`],aliases:[`Small Basic`,`sb`],loader:()=>J(()=>import(`./sb-CcwsVR0C.js`),[])}),Z({id:`scala`,extensions:[`.scala`,`.sc`,`.sbt`],aliases:[`Scala`,`scala`,`SBT`,`Sbt`,`sbt`,`Dotty`,`dotty`],mimetypes:[`text/x-scala-source`,`text/x-scala`,`text/x-sbt`,`text/x-dotty`],loader:()=>J(()=>import(`./scala-DHpiXF5c.js`),[])}),Z({id:`scheme`,extensions:[`.scm`,`.ss`,`.sch`,`.rkt`],aliases:[`scheme`,`Scheme`],loader:()=>J(()=>import(`./scheme-BeGwcela.js`),[])}),Z({id:`scss`,extensions:[`.scss`],aliases:[`Sass`,`sass`,`scss`],mimetypes:[`text/x-scss`,`text/scss`],loader:()=>J(()=>import(`./scss-gp-XZpBa.js`),[])}),Z({id:`shell`,extensions:[`.sh`,`.bash`],aliases:[`Shell`,`sh`],loader:()=>J(()=>import(`./shell-CC2rA5mh.js`),[])}),Z({id:`sol`,extensions:[`.sol`],aliases:[`sol`,`solidity`,`Solidity`],loader:()=>J(()=>import(`./solidity-BEEn4gHE.js`),[])}),Z({id:`aes`,extensions:[`.aes`],aliases:[`aes`,`sophia`,`Sophia`],loader:()=>J(()=>import(`./sophia-CRfGWb83.js`),[])}),Z({id:`sparql`,extensions:[`.rq`],aliases:[`sparql`,`SPARQL`],loader:()=>J(()=>import(`./sparql-D_Lu-MrJ.js`),[])}),Z({id:`sql`,extensions:[`.sql`],aliases:[`SQL`],loader:()=>J(()=>import(`./sql-NEE52Syq.js`),[])}),Z({id:`st`,extensions:[`.st`,`.iecst`,`.iecplc`,`.lc3lib`,`.TcPOU`,`.TcDUT`,`.TcGVL`,`.TcIO`],aliases:[`StructuredText`,`scl`,`stl`],loader:()=>J(()=>import(`./st-DbInun42.js`),[])}),Z({id:`swift`,aliases:[`Swift`,`swift`],extensions:[`.swift`],mimetypes:[`text/swift`],loader:()=>J(()=>import(`./swift-Bxkupp3x.js`),[])}),Z({id:`systemverilog`,extensions:[`.sv`,`.svh`],aliases:[`SV`,`sv`,`SystemVerilog`,`systemverilog`],loader:()=>J(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`verilog`,extensions:[`.v`,`.vh`],aliases:[`V`,`v`,`Verilog`,`verilog`],loader:()=>J(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`tcl`,extensions:[`.tcl`],aliases:[`tcl`,`Tcl`,`tcltk`,`TclTk`,`tcl/tk`,`Tcl/Tk`],loader:()=>J(()=>import(`./tcl-DISqw1ZD.js`),[])}),Z({id:`twig`,extensions:[`.twig`],aliases:[`Twig`,`twig`],mimetypes:[`text/x-twig`],loader:()=>J(()=>import(`./twig-De2hgUGE.js`),[])}),Z({id:`typescript`,extensions:[`.ts`,`.tsx`,`.cts`,`.mts`],aliases:[`TypeScript`,`ts`,`typescript`],mimetypes:[`text/typescript`],loader:()=>J(()=>import(`./typescript-Dy13l_qr.js`),__vite__mapDeps([13,8,1,2,3,4]))}),Z({id:`typespec`,extensions:[`.tsp`],aliases:[`TypeSpec`],loader:()=>J(()=>import(`./typespec-B8J7ngcE.js`),[])}),Z({id:`vb`,extensions:[`.vb`],aliases:[`Visual Basic`,`vb`],loader:()=>J(()=>import(`./vb-DV3o63ZY.js`),[])}),Z({id:`wgsl`,extensions:[`.wgsl`],aliases:[`WebGPU Shading Language`,`WGSL`,`wgsl`],loader:()=>J(()=>import(`./wgsl-DpFanUEy.js`),[])}),Z({id:`xml`,extensions:[`.xml`,`.xsd`,`.dtd`,`.ascx`,`.csproj`,`.config`,`.props`,`.targets`,`.wxi`,`.wxl`,`.wxs`,`.xaml`,`.svg`,`.svgz`,`.opf`,`.xslt`,`.xsl`],firstLine:`(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)`,aliases:[`XML`,`xml`],mimetypes:[`text/xml`,`application/xml`,`application/xaml+xml`,`application/xml-dtd`],loader:()=>J(()=>import(`./xml-AovvXo6A.js`),__vite__mapDeps([14,1,2,3,4]))}),Z({id:`yaml`,extensions:[`.yaml`,`.yml`],aliases:[`YAML`,`yaml`,`YML`,`yml`],mimetypes:[`application/x-yaml`,`text/x-yaml`],loader:()=>J(()=>import(`./yaml-EESuZNdc.js`),__vite__mapDeps([15,1,2,3,4]))});var Pp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Fp=function(e,t){return function(n,r){t(n,r,e)}},Ip,Lp=new j(`selectionAnchorSet`,!1),Rp=class{static{Ip=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(Ip.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Lp.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){let e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(q.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new Mi().appendText(x(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),wo(x(850,`Anchor set at {0}:{1}`,e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){let t=this.editor.getPosition();this.editor.setSelection(q.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){let e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Rp=Ip=Pp([Fp(1,za)],Rp);var zp=class extends W{constructor(){super({id:`editor.action.setSelectionAnchor`,label:L(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:Mr(2089,2080),weight:100}})}async run(e,t){Rp.get(t)?.setSelectionAnchor()}},Bp=class extends W{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:L(852,`Go to Selection Anchor`),precondition:Lp})}async run(e,t){Rp.get(t)?.goToSelectionAnchor()}},Vp=class extends W{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:L(853,`Select from Anchor to Cursor`),precondition:Lp,kbOpts:{kbExpr:E.editorTextFocus,primary:Mr(2089,2089),weight:100}})}async run(e,t){Rp.get(t)?.selectFromAnchorToCursor()}},Hp=class extends W{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:L(854,`Cancel Selection Anchor`),precondition:Lp,kbOpts:{kbExpr:E.editorTextFocus,primary:9,weight:100}})}async run(e,t){Rp.get(t)?.cancelSelectionAnchor()}};Rs(Rp.ID,Rp,4),z(zp),z(Bp),z(Vp),z(Hp);var Up=O(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,x(855,`Overview ruler marker color for matching brackets.`)),Wp=class extends W{constructor(){super({id:`editor.action.jumpToBracket`,label:L(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:3165,weight:100}})}run(e,t){Jp.get(t)?.jumpToBracket()}},Gp=class extends W{constructor(){super({id:`editor.action.selectToBracket`,label:L(858,`Select to Bracket`),precondition:void 0,metadata:{description:L(859,`Select the text inside and including the brackets or curly braces`),args:[{name:`args`,schema:{type:`object`,properties:{selectBrackets:{type:`boolean`,default:!0}}}}]}})}run(e,t,n){let r=!0;n&&n.selectBrackets===!1&&(r=!1),Jp.get(t)?.selectToBracket(r)}},Kp=class extends W{constructor(){super({id:`editor.action.removeBrackets`,label:L(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Jp.get(t)?.removeBrackets(this.id)}},qp=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Jp=class e extends G{static{this.ID=`editor.contrib.bracketMatchingController`}static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Rr(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{this._matchBrackets!==`never`&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;let e=this._editor.getModel(),t=this._editor.getSelections().map(t=>{let n=t.getStartPosition(),r=e.bracketPairs.matchBracket(n),i=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?i=r[1].getStartPosition():r[1].containsPosition(n)&&(i=r[0].getStartPosition());else{let t=e.bracketPairs.findEnclosingBrackets(n);if(t)i=t[1].getStartPosition();else{let t=e.bracketPairs.findNextBracket(n);t&&t.range&&(i=t.range.getStartPosition())}}return i?new q(i.lineNumber,i.column,i.lineNumber,i.column):new q(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{let i=r.getStartPosition(),a=t.bracketPairs.matchBracket(i);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(i),!a)){let e=t.bracketPairs.findNextBracket(i);e&&e.range&&(a=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let o=null,s=null;if(a){a.sort(C.compareRangesUsingStarts);let[t,n]=a;if(o=e?t.getStartPosition():t.getEndPosition(),s=e?n.getEndPosition():n.getStartPosition(),n.containsPosition(i)){let e=o;o=s,s=e}}o&&s&&n.push(new q(o.lineNumber,o.column,s.lineNumber,s.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(n=>{let r=n.getPosition(),i=t.bracketPairs.matchBracket(r);i||=t.bracketPairs.findEnclosingBrackets(r),i&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:i[0],text:``},{range:i[1],text:``}]),this._editor.pushUndoStop())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=P.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:so(Up),position:na.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=P.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`})}_updateBrackets(){if(this._matchBrackets===`never`)return;this._recomputeBrackets();let e=[],t=0;for(let n of this._lastBracketsData){let r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getSelections();if(t.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let n=this._editor.getModel(),r=n.getVersionId(),i=[];this._lastVersionId===r&&(i=this._lastBracketsData);let a=[],o=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];n.isEmpty()&&(a[o++]=n.getStartPosition())}a.length>1&&a.sort(A.compare);let s=[],c=0,l=0,u=i.length;for(let t=0,r=a.length;t<r;t++){let r=a[t];for(;l<u&&i[l].position.isBefore(r);)l++;if(l<u&&i[l].position.equals(r))s[c++]=i[l];else{let t=n.bracketPairs.matchBracket(r,20),i=e._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!t&&this._matchBrackets===`always`&&(t=n.bracketPairs.findEnclosingBrackets(r,20),i=e._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),s[c++]=new qp(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};Rs(Jp.ID,Jp,1),z(Gp),z(Wp),z(Kp),On.appendMenuItem(D.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:x(856,`Go to &&Bracket`)},order:2}),Ra((e,t)=>{let n=e.getColor(Kf);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)}),z(class extends W{constructor(){super({id:`editor.action.transposeLetters`,label:L(863,`Transpose Letters`),precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let n=t.getModel(),r=[],i=t.getSelections();for(let e of i){if(!e.isEmpty())continue;let t=e.startLineNumber,i=e.startColumn,a=n.getLineMaxColumn(t);if(t===1&&(i===1||i===2&&a===2))continue;let o=i===a?e.getPosition():ed.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=ed.leftPosition(n,o),c=ed.leftPosition(n,s),l=n.getValueInRange(C.fromPositions(c,s)),u=n.getValueInRange(C.fromPositions(s,o)),d=C.fromPositions(c,o);r.push(new $c(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Yp=class e{static{this.sep=`.`}static{this.None=new e(`@@none@@`)}static{this.Empty=new e(``)}constructor(e){this.value=e}equals(e){return this.value===e.value}contains(t){return this.equals(t)||this.value===``||t.value.startsWith(this.value+e.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}},Xp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Zp=function(e,t){return function(n,r){t(n,r,e)}},Qp=P.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),$p=class e extends G{static{this.baseId=`editor.widget.inlineProgressWidget`}constructor(e,t,n,r,i){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=M(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=M(`span.icon`);this.domNode.append(t),t.classList.add(...V.asClassNameArray(k.loading),`codicon-modifier-spin`);let n=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};n(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&n()})),this._register(I(this.domNode,Ml.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)}},em=class extends G{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new pc),this._currentWidget=this._register(new pc),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,n,r,i){let a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=qa(()=>{let n=C.fromPositions(e);this._currentDecorations.set([{range:n,options:Qp}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance($p,this.id,this._editor,n,t,r))},i??this._showDelay);try{return await n}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};em=Xp([Zp(2,U)],em);var tm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},nm=function(e,t){return function(n,r){t(n,r,e)}},rm,im=class{static{rm=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new j(`messageVisible`,!1,x(1353,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(rm.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new pc,this._messageListeners=new F,this._mouseOverMessage=!1,this._editor=e,this._visible=rm.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(wo(zr(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),zr(e)){let n=this._messageListeners.add(wl(e,{actionHandler:(e,t)=>{this.closeMessage(),pn(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new om(this._editor,t,n.element)}else this._messageWidget.value=new om(this._editor,t,e);this._messageListeners.add(_u.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&xn(gf(),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(I(this._messageWidget.value.getDomNode(),Ml.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(I(this._messageWidget.value.getDomNode(),Ml.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(n?n.containsPosition(e.target.position)||this.closeMessage():n=new C(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(om.fadeOut(this._messageWidget.value))}};im=rm=tm([nm(1,za),nm(2,en)],im);var am=ad.bindToContribution(im.get);H(new am({id:`leaveEditorMessage`,precondition:im.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var om=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener(`animationend`,t)},n=setTimeout(t,110);return e.getDomNode().addEventListener(`animationend`,t),e.getDomNode().classList.add(`fadeOut`),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement(`div`),this._domNode.classList.add(`monaco-editor-overlaymessage`),this._domNode.style.marginLeft=`-6px`;let i=document.createElement(`div`);i.classList.add(`anchor`,`top`),this._domNode.appendChild(i);let a=document.createElement(`div`);typeof r==`string`?(a.classList.add(`message`),a.textContent=r):(r.classList.add(`message`),a.appendChild(r)),this._domNode.appendChild(a);let o=document.createElement(`div`);o.classList.add(`anchor`,`below`),this._domNode.appendChild(o),this._editor.addContentWidget(this),this._domNode.classList.add(`fadeIn`)}dispose(){this._editor.removeContentWidget(this)}getId(){return`messageoverlay`}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle(`below`,e===2)}};Rs(im.ID,im,4);var sm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},cm=function(e,t){return function(n,r){t(n,r,e)}},lm=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,n,r,i){let a=await this.getEdit(n,i);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,n,r){let i=await this.getEdit(n,r);if(i)return{edits:[{insertText:i.insertText,title:i.title,kind:i.kind,handledMimeType:i.handledMimeType,yieldTo:i.yieldTo}],dispose(){}}}},um=class e extends lm{static{this.id=`text`}constructor(){super(Yp.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[Ao.text],this.pasteMimeTypes=[Ao.text]}async getEdit(e,t){let n=e.get(Ao.text);if(!n||e.has(Ao.uriList))return;let r=await n.asString();return{handledMimeType:Ao.text,title:x(980,`Insert Plain Text`),insertText:r,kind:this.kind}}},dm=class extends lm{constructor(){super(Yp.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[Ao.uriList],this.pasteMimeTypes=[Ao.uriList]}async getEdit(e,t){let n=await mm(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===dl.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?x(981,`Insert Uris`):x(982,`Insert Uri`):n.length>1?x(983,`Insert Paths`):x(984,`Insert Path`),{handledMimeType:Ao.uriList,insertText:i,title:a,kind:this.kind}}},fm=class extends lm{constructor(e){super(Yp.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[Ao.uriList],this.pasteMimeTypes=[Ao.uriList]}async getEdit(e,t){let n=await mm(e);if(!n.length||t.isCancellationRequested)return;let r=vu(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?gn(t.uri,e):void 0}));if(r.length)return{handledMimeType:Ao.uriList,insertText:r.join(` `),title:n.length>1?x(985,`Insert Relative Paths`):x(986,`Insert Relative Path`),kind:this.kind}}};fm=sm([cm(0,wu)],fm);var pm=class{constructor(){this.kind=new Yp(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:Ao.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==_a.PasteAs&&!r.only?.contains(this.kind))return;let a=await n.get(`text/html`)?.asString();if(a&&!i.isCancellationRequested)return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:x(987,`Insert HTML`),kind:this.kind}]}}};async function mm(e){let t=e.get(Ao.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of ql.parse(n))try{r.push({uri:$n.parse(e),originalText:e})}catch{}return r}var hm={scheme:`*`,hasAccessToAllModels:!0},gm=class extends G{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(hm,new um)),this._register(e.documentDropEditProvider.register(hm,new dm)),this._register(e.documentDropEditProvider.register(hm,new fm(t)))}};gm=sm([cm(0,R),cm(1,wu)],gm);var _m=class extends G{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(hm,new um)),this._register(e.documentPasteEditProvider.register(hm,new dm)),this._register(e.documentPasteEditProvider.register(hm,new fm(t))),this._register(e.documentPasteEditProvider.register(hm,new pm))}};_m=sm([cm(0,R),cm(1,wu)],_m);var vm=class e{constructor(){this.value=``,this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let t=this.pos,n=0,r=this.value.charCodeAt(t),i;if(i=e._table[r],typeof i==`number`)return this.pos+=1,{type:i,pos:t,len:1};if(e.isDigitCharacter(r)){i=8;do n+=1,r=this.value.charCodeAt(t+n);while(e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}if(e.isVariableCharacter(r)){i=9;do r=this.value.charCodeAt(t+ ++n);while(e.isVariableCharacter(r)||e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}i=10;do n+=1,r=this.value.charCodeAt(t+n);while(!isNaN(r)&&e._table[r]===void 0&&!e.isDigitCharacter(r)&&!e.isVariableCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}},ym=class{constructor(){this._children=[]}appendChild(e){return e instanceof bm&&this._children[this._children.length-1]instanceof bm?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:n}=e,r=n.children.indexOf(e),i=n.children.slice(0);i.splice(r,1,...t),n._children=i,(function e(t,n){for(let r of t)r.parent=n,e(r.children,r)})(t,n)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof Om)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},bm=class e extends ym{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},xm=class extends ym{},Sm=class e extends xm{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:+(e.index>t.index)}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Cm?this._children[0]:void 0}clone(){let t=new e(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},Cm=class e extends ym{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof bm&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let t=new e;return this.options.forEach(t.appendChild,t),t}},wm=class e extends ym{constructor(){super(...arguments),this.regexp=RegExp(``)}resolve(e){let t=this,n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(e=>e instanceof Tm&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof Tm){let r=e[n.index]||``;r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return``}clone(){let t=new e;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?`i`:``)+(this.regexp.global?`g`:``)),t._children=this.children.map(e=>e.clone()),t}},Tm=class e extends ym{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}resolve(e){return this.shorthandName===`upcase`?e?e.toLocaleUpperCase():``:this.shorthandName===`downcase`?e?e.toLocaleLowerCase():``:this.shorthandName===`capitalize`?e?e[0].toLocaleUpperCase()+e.substr(1):``:this.shorthandName===`pascalcase`?e?this._toPascalCase(e):``:this.shorthandName===`camelcase`?e?this._toCamelCase(e):``:this.shorthandName===`kebabcase`?e?this._toKebabCase(e):``:this.shorthandName===`snakecase`?e?this._toSnakeCase(e):``:e&&typeof this.ifValue==`string`?this.ifValue:!e&&typeof this.elseValue==`string`?this.elseValue:e||``}_toKebabCase(e){if(!e.match(/[\p{L}0-9]+/gu))return e;if(!e.match(/[\p{L}0-9]/u))return e.trim().toLowerCase().replace(/^_+|_+$/g,``).replace(/[\s_]+/g,`-`);let t=e.trim().replace(/^_+|_+$/g,``),n=t.match(/\p{Lu}{2,}(?=\p{Lu}\p{Ll}+[0-9]*|[\s_-]|$)|\p{Lu}?\p{Ll}+[0-9]*|\p{Lu}(?=\p{Lu}\p{Ll})|\p{Lu}(?=[\s_-]|$)|[0-9]+/gu);return n?n.map(e=>e.toLowerCase()).join(`-`):t.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).join(`-`)}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(e=>e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((e,t)=>t===0?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,`$1_$2`).replace(/[\s\-]+/g,`_`).toLowerCase()}clone(){return new e(this.index,this.shorthandName,this.ifValue,this.elseValue)}},Em=class e extends xm{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||``)),t!==void 0&&(this._children=[new bm(t)],!0)}clone(){let t=new e(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}};function Dm(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var Om=class e extends ym{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof Sm&&(e.push(n),t=!t||t.index<n.index?n:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){let{all:e}=this.placeholderInfo;return e}offset(e){let t=0,n=!1;return this.walk(r=>r===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return Dm([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof Sm&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Em&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let t=new e;return t._children=this.children.map(e=>e.clone()),t}walk(e){Dm(this.children,e)}},km=class{constructor(){this._scanner=new vm,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,`\\$&`)}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){let r=new Om;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){let n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let r=new Map,i=[];t.walk(e=>(e instanceof Sm&&(e.isFinalTabstop?r.set(0,void 0):!r.has(e.index)&&e.children.length>0?r.set(e.index,e.children):i.push(e)),!0));let a=(e,n)=>{let i=r.get(e.index);if(!i)return;let o=new Sm(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof Sm&&r.has(t.index)&&!n.has(t.index)&&(n.add(t.index),a(t,n),n.delete(t.index))}t.replace(e,[o])},o=new Set;for(let e of i)a(e,o);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(e=>e.index===0)||e.appendChild(new Sm(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let 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){let t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){let e=this._scanner.next();if(e.type!==0&&e.type!==4&&e.type!==5)return!1}this._token=this._scanner.next()}let n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,`$1`);return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new bm(t)),!0):!1}_parseTabstopOrVariableName(e){let t,n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Sm(Number(t)):new Em(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);let r=new Sm(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new bm("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new Cm;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(t),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseChoiceElement(e){let t=this._token,n=[];for(;this._token.type!==2&&this._token.type!==7;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;n.push(e)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new bm(n.join(``))),!0)}_parseComplexVariable(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);let r=new Em(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new bm("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseTransform(e){let t=new wm,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,n+=e;else if(this._token.type!==14)n+=this._accept(void 0,!0);else return!1}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new bm(e));else if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);)if(this._token.type!==14)r+=this._accept(void 0,!0);else return!1;try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);let r=this._accept(8,!0);if(!r)return this._backTo(t),!1;if(!n||this._accept(4))return e.appendChild(new Tm(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let n=this._accept(9,!0);return!n||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Tm(Number(r),n)),!0)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new Tm(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new Tm(Number(r),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let n=this._until(4);if(n)return e.appendChild(new Tm(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new Tm(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14&&(e.appendChild(new bm(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function Am(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new al(e,{range:t,text:typeof n.insertText==`string`?km.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function jm(e){function t(e,t){return`mimeType`in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}let n=new Map;for(let r of e)for(let i of r.yieldTo??[])for(let a of e)if(a!==r&&t(i,a)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(a)}if(!n.size)return Array.from(e);let r=new Set,i=[];function a(e){if(!e.length)return[];let t=e[0];if(i.includes(t))return console.warn(`Yield to cycle detected`,t),e;if(r.has(t))return a(e.slice(1));let o=[],s=n.get(t);return s&&(i.push(t),o=a(s),i.pop()),r.add(t),[...o,t,...a(e.slice(1))]}return a(Array.from(e))}function Mm(e,t){return t&&(e.stack||e.stacktrace)?x(33,`{0}: {1}`,Pm(e),Nm(e.stack)||Nm(e.stacktrace)):Pm(e)}function Nm(e){return Array.isArray(e)?e.join(`
3
3
  `):e}function Pm(e){return e.code===`ERR_UNC_HOST_NOT_ALLOWED`?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof e.code==`string`&&typeof e.errno==`number`&&typeof e.syscall==`string`?x(34,`A system error occurred ({0})`,e.message):e.message||x(35,`An unknown error occurred. Please consult the log for more details.`)}function Fm(e=null,t=!1){if(!e)return x(36,`An unknown error occurred. Please consult the log for more details.`);if(Array.isArray(e)){let n=vu(e),r=Fm(n[0],t);return n.length>1?x(37,`{0} ({1} errors in total)`,r,n.length):r}if(Kn(e))return e;if(e.detail){let n=e.detail;if(n.error)return Mm(n.error,t);if(n.exception)return Mm(n.exception,t)}return e.stack?Mm(e,t):e.message?e.message:x(38,`An unknown error occurred. Please consult the log for more details.`)}var Im=class extends G{constructor(e){super(),this._onChange=this._register(new N),this.onChange=this._onChange.event,this._checked=!!e.checked,this._title=e.title??e.ariaLabel,this.domNode=M(`button.monaco-switch`),this.domNode.type=`button`,this.domNode.setAttribute(`role`,`switch`),K(this.domNode,M(`.monaco-switch-thumb`)),this._register(pt().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}))),this.setAriaLabel(e.ariaLabel,e.title),this.disabled=!!e.disabled,this._applyState(),this._register(I(this.domNode,Ml.CLICK,e=>{js.stop(e,!0),this.domNode.disabled||(this._checked=!this._checked,this._applyState(),this._onChange.fire(this._checked))}))}get checked(){return this._checked}set checked(e){this._checked!==e&&(this._checked=e,this._applyState())}get disabled(){return this.domNode.disabled}set disabled(e){this.domNode.disabled=e}setAriaLabel(e,t=e){this.domNode.setAttribute(`aria-label`,e),this._title=t}_applyState(){this.domNode.setAttribute(`aria-checked`,String(this._checked)),this.domNode.classList.toggle(`checked`,this._checked)}},Lm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Rm=function(e,t){return function(n,r){t(n,r,e)}},zm=class extends G{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute(`aria-disabled`,`false`),this.el.tabIndex=0,this.el.style.pointerEvents=`auto`,this.el.style.opacity=`1`,this.el.style.cursor=`pointer`,this._enabled=!1):(this.el.setAttribute(`aria-disabled`,`true`),this.el.tabIndex=-1,this.el.style.pointerEvents=`none`,this.el.style.opacity=`0.4`,this.el.style.cursor=`default`,this._enabled=!0),this._enabled=e}constructor(e,t,n={},r,i){super(),this._link=t,this._hoverService=r,this._enabled=!0,this.el=K(e,M(`a.monaco-link`,{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=n.hoverDelegate??ic(`mouse`),this.setTooltip(t.title),this.el.setAttribute(`role`,`button`);let a=this._register(new vf(this.el,`click`)),o=this._register(new vf(this.el,`keydown`)),s=_u.chain(o.event,e=>e.map(e=>new gr(e)).filter(e=>e.keyCode===3||e.keyCode===10)),c=this._register(new vf(this.el,Sa.Tap)).event;this._register(dn.addTarget(this.el));let l=_u.any(a.event,s,c);this._register(l(e=>{this.enabled&&(js.stop(e,!0),n?.opener?n.opener(this._link.href):i.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};zm=Lm([Rm(3,uu),Rm(4,en)],zm);var Bm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Vm=function(e,t){return function(n,r){t(n,r,e)}},Hm,Um=`acceptSelectedCodeAction`,Wm=`previewSelectedCodeAction`,Gm=new Set([Um,Wm,`toggleSectionCodeAction`]),Km=`actionList.remove`,qm=class{get templateId(){return`header`}renderTemplate(e){e.classList.add(`group-header`);let t=document.createElement(`span`);return e.append(t),{container:e,text:t}}renderElement(e,t,n){n.text.textContent=e.group?.title??e.label??``}disposeTemplate(e){}},Jm=class{get templateId(){return`separator`}renderTemplate(e){e.classList.add(`separator`);let t=document.createElement(`span`);return e.append(t),{container:e,text:t}}renderElement(e,t,n){n.container.classList.toggle(`has-label`,!!e.label),n.text.textContent=e.label??``}disposeTemplate(e){}};function Ym(e){return!!e.submenuActions?.length&&!e.hover?.content||!!e.hover?.expandable}function Xm(e){return Ym(e)&&e.hover?.showIndicator!==!1}var Zm=class{get templateId(){return`action`}constructor(e,t,n,r,i,a,o,s,c,l,u,d){this._supportsPreview=e,this._onRemoveItem=t,this._onShowSubmenu=n,this._reservesSubmenuSpace=r,this._groupTitleByIndex=i,this._linkHandler=a,this._hideDefaultKeybindingTooltip=o,this._stopToolbarPointerPropagation=s,this._registerStandaloneToggle=c,this._registerToolbar=l,this._keybindingService=u,this._openerService=d}renderTemplate(e){e.classList.add(this.templateId);let t=document.createElement(`div`);t.className=`icon`,e.append(t);let n=document.createElement(`span`);n.className=`title`,e.append(n);let r=document.createElement(`span`);r.className=`action-item-badge`,r.ariaHidden=`true`,e.append(r);let i=document.createElement(`span`);i.className=`description`,e.append(i);let a=document.createElement(`span`);a.className=`group-title`,e.append(a);let o=document.createElement(`span`);o.className=`detail`,e.append(o);let s=new Rf(e,bs),c=document.createElement(`div`);c.className=`action-list-item-toolbar`,e.append(c);let l=document.createElement(`div`);l.className=`action-list-submenu-indicator`,e.append(l);let u=document.createElement(`div`);return u.className=`action-list-item-inline-toggle`,e.append(u),{container:e,icon:t,text:n,detail:o,badge:r,description:i,groupTitle:a,keybinding:s,toolbar:c,submenuIndicator:l,inlineToggleContainer:u,elementDisposables:new F}}renderElement(e,t,n){if(n.elementDisposables.clear(),e.iconClasses?.length?(n.icon.className=[`icon`,...e.iconClasses].join(` `),n.icon.style.color=``):e.group?.icon?(n.icon.className=V.asClassName(e.group.icon),n.icon.style.color=e.group.icon.color?bn(e.group.icon.color.id):``):(n.icon.className=V.asClassName(k.lightBulb),n.icon.style.color=`var(--vscode-editorLightBulb-foreground)`),!e.item&&!e.standaloneToggle||!e.label)return;if(Nn(!e.hideIcon,n.icon),e.isSectionToggle){let t=e.group?.icon===k.chevronDown;n.container.setAttribute(`aria-expanded`,String(t))}else n.container.removeAttribute(`aria-expanded`);n.previousClassNames?.length&&n.container.classList.remove(...n.previousClassNames);let r=e.className?.split(/\s+/).filter(e=>e.length>0)??[];if(n.container.classList.toggle(`action-list-custom`,r.length>0),r.length&&n.container.classList.add(...r),n.previousClassNames=r,n.text.textContent=rh(e.label),e.badge?(n.badge.textContent=e.badge,n.badge.style.display=``):(n.badge.textContent=``,n.badge.style.display=`none`),e.keybinding)n.description.textContent=e.keybinding.getLabel(),n.description.style.display=`inline`,n.description.style.letterSpacing=`0.5px`;else if(e.description){if(Of(n.description),typeof e.description==`string`)n.description.textContent=rh(e.description);else{let t=wl(e.description,{actionHandler:t=>{let n=$n.parse(t);this._linkHandler?this._linkHandler(n,e):this._openerService.open(n,{allowCommands:!0})}});n.elementDisposables.add(t),n.description.appendChild(t.element)}n.description.style.display=`inline`}else n.description.textContent=``,n.description.style.display=`none`;let i=this._groupTitleByIndex.get(t);i?(n.groupTitle.textContent=i,n.groupTitle.style.display=``):(n.groupTitle.textContent=``,n.groupTitle.style.display=`none`),e.detail?(n.detail.textContent=rh(e.detail),n.detail.style.display=``):(n.detail.textContent=``,n.detail.style.display=`none`),n.container.classList.toggle(`has-detail`,!!e.detail),Of(n.inlineToggleContainer);let a=e.standaloneToggle??e.inlineToggle;if(a){let t=document.createElement(`span`);t.className=`action-list-item-inline-toggle-label`,t.textContent=rh(a.label),e.standaloneToggle||n.inlineToggleContainer.append(t),n.inlineToggleContainer.style.display=``,n.container.classList.toggle(`has-inline-toggle`,!!e.inlineToggle),n.container.classList.toggle(`has-standalone-toggle`,!!e.standaloneToggle);let r=n.elementDisposables.add(new Im({ariaLabel:a.title??a.label,checked:a.checked,disabled:a.disabled}));n.inlineToggleContainer.append(r.domNode),e.standaloneToggle&&n.elementDisposables.add(this._registerStandaloneToggle(e,r)),n.elementDisposables.add(r.onChange(()=>a.onChange(r.checked))),n.elementDisposables.add(I(n.inlineToggleContainer,Ml.CLICK,e=>e.stopPropagation()))}else n.inlineToggleContainer.style.display=`none`,n.container.classList.remove(`has-inline-toggle`),n.container.classList.remove(`has-standalone-toggle`);let o=this._keybindingService.lookupKeybinding(Um)?.getLabel(),s=this._keybindingService.lookupKeybinding(Wm)?.getLabel();n.container.classList.toggle(`option-disabled`,!!e.disabled),e.hover===void 0?e.tooltip?n.container.title=e.tooltip:e.disabled?n.container.title=e.label:e.standaloneToggle||this._hideDefaultKeybindingTooltip?n.container.title=``:o&&s?this._supportsPreview&&e.canPreview?n.container.title=x(1731,`{0} to Apply, {1} to Preview`,o,s):n.container.title=x(1732,`{0} to Apply`,o):n.container.title=``:n.container.title=``,Of(n.toolbar);let c=[...e.toolbarActions??[]];if(e.onRemove&&c.push(Wo({id:Km,label:x(1733,`Remove`),class:V.asClassName(k.close),run:async()=>{await e.onRemove(),this._onRemoveItem?.(e)}})),n.container.classList.toggle(`has-toolbar`,c.length>0),c.length>0){let t=new Ur(n.toolbar);n.elementDisposables.add(t),this._stopToolbarPointerPropagation?(n.elementDisposables.add(Ou(n.toolbar,e=>{e.preventDefault(),e.stopPropagation()})),n.elementDisposables.add(I(n.toolbar,Ml.CLICK,e=>e.stopPropagation())),n.elementDisposables.add(I(n.toolbar,Sa.Tap,e=>e.stopPropagation()))):n.elementDisposables.add(Ou(n.toolbar,e=>e.preventDefault())),t.push(c,{icon:!0,label:!1}),n.elementDisposables.add(this._registerToolbar(e,t))}Xm(e)?(n.submenuIndicator.className=`action-list-submenu-indicator has-submenu `+V.asClassName(k.chevronRight),n.submenuIndicator.style.display=``,n.submenuIndicator.style.visibility=``,n.elementDisposables.add(I(n.submenuIndicator,Ml.CLICK,t=>{t.stopPropagation(),this._onShowSubmenu?.(e)}))):this._reservesSubmenuSpace()?(n.submenuIndicator.className=`action-list-submenu-indicator`,n.submenuIndicator.style.display=``,n.submenuIndicator.style.visibility=`hidden`):(n.submenuIndicator.className=`action-list-submenu-indicator`,n.submenuIndicator.style.display=`none`),Ym(e)?(n.container.setAttribute(`aria-haspopup`,e.hover?.expandable?`dialog`:`menu`),n.container.setAttribute(`aria-expanded`,`false`)):(n.container.removeAttribute(`aria-haspopup`),e.isSectionToggle||n.container.removeAttribute(`aria-expanded`))}disposeTemplate(e){e.keybinding.dispose(),e.elementDisposables.dispose()}};Zm=Bm([Vm(10,Ea),Vm(11,en)],Zm);var Qm=class extends UIEvent{constructor(){super(`acceptSelectedAction`)}},$m=class extends UIEvent{constructor(){super(`previewSelectedAction`)}};function eh(e){if(e.kind===`action`)return e.label}var th=Hm=class extends G{constructor(e,t,n,r,i,a,o,s,c){if(super(),this._supportsPreview=t,this._delegate=r,this._options=a,this._keybindingService=o,this._openerService=s,this._instantiationService=c,this._headerLineHeight=24,this._separatorLineHeight=8,this.cts=this._register(new Po),this._submenuDisposables=this._register(new F),this._submenuHoverActionElements=[],this._itemMoveAnimation=this._register(new pc),this._collapsedSections=new Set,this._filterText=``,this._imeSessionInProgress=!1,this._isMeasuringWidth=!1,this._suppressHover=!1,this._hoverEnabled=!0,this._ignoreInitialHover=!0,this._hasLaidOut=!1,this._filterCts=this._register(new pc),this._groupTitleByIndex=new Map,this._standaloneToggles=new Map,this._itemToolbars=new Map,this._onDidRequestLayout=this._register(new N),this.onDidRequestLayout=this._onDidRequestLayout.event,this._visibleMenuItems=n,this._initialFocusItemId=this._options?.initialFocusItemId,this._filterText=this._options?.showFilter?this._options.initialFilterValue??``:``,this.domNode=document.createElement(`div`),this.domNode.classList.add(`actionList`),this._options?.inlineDescription&&this.domNode.classList.add(`inline-description`),this._options?.className){let e=this._options.className.split(/\s+/).filter(e=>e.length>0);e.length>0&&this.domNode.classList.add(...e)}if(this._actionLineHeight=24,this._submenuContainer=document.createElement(`div`),this._submenuContainer.className=`action-list-submenu-panel action-widget`,this._submenuContainer.style.display=`none`,this._options?.persistentHover&&(this._submenuContainer.style.boxSizing=`border-box`),this._submenuContainer.tabIndex=-1,this.domNode.append(this._submenuContainer),this._register(I(this._submenuContainer,`keydown`,e=>{if((e.key===`Enter`||e.key===` `)&&this._currentSubmenuElement?.hover?.tabThroughPanel){let t=Zi(e.target)?e.target:void 0;if(t&&this._currentSubmenuElement.hover.getTabbableElements?.().includes(t)){e.stopPropagation();return}}if(e.key!==`ArrowLeft`&&e.key!==`Escape`)return;js.stop(e,!0);let t=e.key===`Escape`&&this._currentSubmenuWidget!==void 0;this._hideSubmenu(),t?this.hide():(this._setKeyboardNavigation(!0),this._list.domFocus())})),this._register(I(this._submenuContainer,`mouseenter`,()=>{this._cancelSubmenuHide(),this._usesSubmenuPointerIntent()&&(this._cancelSubmenuShow(),this._resetSubmenuPointer())})),this._register(I(this._submenuContainer,`mouseleave`,()=>{this._scheduleSubmenuHide()})),this._register(I(this.domNode,Ml.MOUSE_LEAVE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer()})),this._usesSubmenuPointerIntent()&&this._register(I(this.domNode,Ml.MOUSE_MOVE,e=>{Zi(e.target)&&this._expandedTrigger?.contains(e.target)&&this._updateSubmenuPointer(e)})),this._register(Xo(()=>{this._cancelSubmenuHide(),this._cancelSubmenuShow()})),this._options?.collapsedByDefault)for(let e of this._options.collapsedByDefault)this._collapsedSections.add(e);let l={getHeight:e=>this._getItemHeight(e),getTemplateId:e=>e.kind},u=()=>{let e=this._options?.reserveSubmenuSpace??!0;return e===`always`||e&&this._allMenuItems.some(Xm)};this._list=this._register(new Go(e,this.domNode,l,[new Zm(this._supportsPreview,e=>this._removeItem(e),e=>this._showSubmenuForItem(e),u,this._groupTitleByIndex,this._options?.linkHandler,this._options?.hideDefaultKeybindingTooltip??!1,this._options?.stopToolbarPointerPropagation??!1,(e,t)=>(this._standaloneToggles.set(e,t),Xo(()=>{this._standaloneToggles.get(e)===t&&this._standaloneToggles.delete(e)})),(e,t)=>(this._itemToolbars.set(e,t),this._updateToolbarFocusability(),Xo(()=>{this._itemToolbars.get(e)===t&&this._itemToolbars.delete(e)})),this._keybindingService,this._openerService),new qm,new Jm],{keyboardSupport:!1,typeNavigationEnabled:!this._options?.showFilter&&!this._options?.onType,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:eh},accessibilityProvider:{getAriaLabel:e=>{if(e.kind===`action`){let t=e.label?rh(e?.label):``;if(e.badge&&(t=t+`, `+rh(e.badge)),e.detail&&(t=t+`, `+rh(e.detail)),e.ariaDescription)t=t+`, `+rh(e.ariaDescription);else if(e.description){let n=typeof e.description==`string`?e.description:e.description.value;t=t+`, `+rh(n)}if(e.hover?.content&&!e.ariaDescription&&!e.description){let n=e.hover.content,r=typeof n==`string`?n:zr(n)?n.value:Zi(n)?n.textContent??void 0:void 0;r&&(!e.detail||rh(e.detail)!==rh(r))&&(t=t+`, `+rh(r))}e.group?.title&&(t=t+`, `+e.group.title);let n=e.standaloneToggle??e.inlineToggle;return n&&(t=e.standaloneToggle?n.checked?x(1734,`{0}, on`,n.label):x(1735,`{0}, off`,n.label):t+`, `+(n.checked?x(1736,`{0}, on`,n.label):x(1737,`{0}, off`,n.label))),e.disabled&&(t=x(1738,`{0}, Disabled Reason: {1}`,t,e.disabled)),e.submenuActions?.length&&(t=x(1739,`{0}, use right arrow to access options`,t)),t}return null},getWidgetAriaLabel:()=>x(1740,`Action Widget`),getSetSize:()=>this._visibleMenuItems.filter(e=>e.kind===`action`).length,getPosInSet:(e,t)=>Math.max(this._visibleMenuItems.slice(0,t+1).filter(e=>e.kind===`action`).length,1),getRole:e=>{switch(e.kind){case`action`:return`option`;case`separator`:return`separator`;default:return`separator`}},getWidgetRole:()=>`listbox`,...i}})),this._list.style(jr),this._register(this._list.onKeyDown(()=>this._setKeyboardNavigation(!0))),this._register(I(this._list.getHTMLElement(),Ml.MOUSE_MOVE,e=>{(e.movementX!==0||e.movementY!==0)&&this._setKeyboardNavigation(!1)})),this._register(this._list.onMouseClick(e=>this.onListClick(e))),this._register(this._list.onMouseOver(e=>{this._ignoreInitialHover||this.onListHover(e)}));let d=this._register(new pc);if(d.value=this._list.onMouseMove(e=>{(e.browserEvent.movementX!==0||e.browserEvent.movementY!==0)&&(d.clear(),this._ignoreInitialHover=!1,this.onListHover(e))}),this._register(this._list.onMouseDown(()=>{d.clear(),this._ignoreInitialHover=!1,this._setKeyboardNavigation(!1)})),this._register(this._list.onDidChangeFocus(()=>{this._updateToolbarFocusability(),this.onFocus()})),this._register(this._list.onDidChangeSelection(e=>this.onListSelection(e))),this._register(this._list.onDidScroll(()=>{this._isMeasuringWidth||this._layoutSubmenu?.()})),this._allMenuItems=[...n],this._options?.showFilter||this._options?.secondaryHeading){this._filterContainer=document.createElement(`div`),this._filterContainer.className=`action-list-filter`;let e=K(this._filterContainer,M(`.action-list-filter-row`));if(this._options?.showFilter){if(this._filterInput=document.createElement(`input`),this._filterInput.type=`text`,this._filterInput.className=`action-list-filter-input`,this._filterInput.placeholder=this._options?.filterPlaceholder??x(1741,`Search...`),this._filterInput.value=this._filterText,this._filterInput.setAttribute(`aria-label`,x(1742,`Filter items`)),e.appendChild(this._filterInput),this._register(I(this._filterInput,Ml.KEY_DOWN,e=>{if(this._setKeyboardNavigation(!0),e.isComposing||!this._filterInput?.closest(`.action-list-submenu-panel`))return;let t=this._keybindingService.softDispatch(new gr(e),this._filterInput);(t.kind===2&&t.commandId!==null&&Gm.has(t.commandId)||e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey)&&e.stopPropagation()})),this._register(I(this._filterInput,Ml.MOUSE_DOWN,()=>this._setKeyboardNavigation(!1))),this._options.tabThroughItemActions&&this._register(I(this._filterInput,`keydown`,e=>this._handleTabThroughPanelKeyDown(e),!0)),this._options.filterAsCombobox){let e=this._list.getHTMLElement();e.id=this._list.domId,this._filterInput.setAttribute(`role`,`combobox`),this._filterInput.setAttribute(`aria-label`,this._filterInput.placeholder),this._filterInput.setAttribute(`aria-autocomplete`,`list`),this._filterInput.setAttribute(`aria-expanded`,`true`),this._filterInput.setAttribute(`aria-controls`,e.id),this._register(this._list.onDidChangeFocus(()=>this._updateFilterActiveDescendant())),this._register(I(this._filterInput,`focus`,()=>this._updateFilterActiveDescendant())),this._register(I(this._filterInput,`blur`,()=>this._updateFilterActiveDescendant())),this._register(Yo(this._filterInput,`keydown`,e=>{if(this._imeSessionInProgress||e.browserEvent.isComposing||e.keyCode===114||e.keyCode===15||e.keyCode===17||e.keyCode===14||e.keyCode===13){e.stopPropagation();return}let t=e.keyCode===16||e.keyCode===18;(t||e.keyCode===3)&&(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey?t&&e.stopPropagation():(js.stop(e,!0),e.keyCode===16?this.focusPrevious():e.keyCode===18?this.focusNext():this.acceptSelected()))}))}let t=this._options?.filterActions??[];if(t.length>0){let n=K(e,M(`.action-list-filter-actions`));this._register(new Ur(n)).push(t,{icon:!0,label:!1})}let n=()=>{let e=this._filterInput.value;this._imeSessionInProgress||e===this._filterText&&!this._filterCts.value?.token.isCancellationRequested||(this._filterText=e,this._applyOrUpdateFilter())};this._register(I(this._filterInput,`compositionstart`,()=>{this._imeSessionInProgress=!0,this._filterCts.value?.cancel()})),this._register(I(this._filterInput,`compositionend`,()=>{this._imeSessionInProgress=!1,n()})),this._register(I(this._filterInput,`input`,n))}if(this._options?.secondaryHeading){let t=K(e,M(`.action-list-filter-label`));t.textContent=this._options.secondaryHeading}}if(this._options?.footerText&&(this._footerContainer=document.createElement(`div`),this._footerContainer.className=`action-list-footer`,this._footerContainer.textContent=this._options.footerText),this._options?.headerText){if(this._headerContainer=document.createElement(`div`),this._headerContainer.className=`action-list-header`,this._options.headerIcon){let e=K(this._headerContainer,M(`span.action-list-header-icon`));e.classList.add(...V.asClassNameArray(this._options.headerIcon)),e.setAttribute(`aria-hidden`,`true`)}let e=K(this._headerContainer,M(`span.action-list-header-text`));if(e.textContent=this._options.headerText,this._register(I(this._headerContainer,Ml.MOUSE_ENTER,()=>{this._options?.persistentHover?(this._cancelSubmenuShow(),this._resetSubmenuPointer()):this._hideSubmenu()})),this._options.headerLink){let{label:t,uri:n}=this._options.headerLink;e.textContent+=` `,this._register(this._instantiationService.createInstance(zm,e,{label:t,href:n.toString(!0)},{}))}if(this._options.headerDismiss){let e=this._options.headerDismiss,t=K(this._headerContainer,M(`span.action-list-header-dismiss`));t.appendChild(M(V.asCSSSelector(k.close))),t.tabIndex=0,t.setAttribute(`role`,`button`),t.setAttribute(`aria-label`,x(1743,`Dismiss`));let n=()=>{e(),this.focus(),this._headerContainer?.remove(),this._headerContainer=void 0,this._onDidRequestLayout.fire()};this._register(Wl(t,()=>n())),this._register(I(t,Ml.KEY_DOWN,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())}))}}this._applyFilter(),this._list.length&&this._focusCheckedOrFirst(),this._register(I(this.domNode,`keydown`,e=>{if(e.key===`ArrowRight`&&!e.isComposing){let t=this._list.getFocus();if(t.length>0){let n=this._list.element(t[0]);if(n?.submenuActions?.length||n?.hover?.expandable){js.stop(e,!0);let r=this._getRowElement(t[0]);r&&(this._showSubmenuForElement(n,r),n.hover?.tabThroughPanel?this._focusFirstTabThroughPanelControl(n,r):this._currentSubmenuWidget?this._currentSubmenuWidget.focus():this._submenuContainer.focus())}}}})),this._register(I(this.domNode,`keydown`,e=>this._handleTabThroughPanelKeyDown(e),!0)),(this._filterInput||this._options?.onType)&&this._register(I(this.domNode,`keydown`,e=>{let t=e.target;(this._options?.onType||this._options?.filterAsCombobox)&&Zi(t)&&(Fr(t)||t.closest(`button, a, [contenteditable="true"], .action-list-submenu-panel`))||this._filterInput&&Oi(this._filterInput)||e.isComposing||e.key.length!==1||e.key===` `||e.ctrlKey||e.metaKey||e.altKey||(e.preventDefault(),e.stopPropagation(),this._filterInput?(this._filterInput.focus(),this._filterInput.value=e.key,this._filterText=e.key,this._applyOrUpdateFilter()):this._options?.onType?.(e.key))}))}_toggleSection(e){let t=this._collapsedSections.has(e);if(t)this._collapsedSections.delete(e);else{this._collapsedSections.add(e);let t=this.getFocusedElement();if(t?.section===e&&!t.isSectionToggle){let t=this._visibleMenuItems.findIndex(t=>t.section===e&&t.isSectionToggle);t>=0&&this._list.setFocus([t])}}this._options?.onDidToggleSection?.(e,this._collapsedSections.has(e)),this._applyFilter(),t&&this._revealFirstItemOfSection(e)}_revealFirstItemOfSection(e){for(let t=0;t<this._list.length;t++){let n=this._list.element(t);if(n.section===e&&!n.isSectionToggle){this._list.reveal(t);return}}}_applyOrUpdateFilter(){if(!this._delegate.onFilter){this._applyFilter();return}let e=this._filterText;this._filterCts.value?.cancel();let t=new Po;this._filterCts.value=t,this._delegate.onFilter(e,t.token).then(e=>{t.token.isCancellationRequested||(this._allMenuItems=[...e],this._applyFilter(!0))}).catch(()=>{}).finally(()=>{this._filterCts.value===t&&!t.token.isCancellationRequested&&this._filterCts.clear()})}_applyFilter(e=!1,t=!0,n){this._itemMoveAnimation.clear();let r=e?``:this._filterText.toLowerCase(),i=!e&&r.length>0,a=[],o=this._list.getFocus(),s;if(o.length>0&&(s=this._list.element(o[0])),i){let e,t=[],n=!1,i=()=>{e&&n&&a.push(e),a.push(...t),e=void 0,t=[],n=!1},o=e=>{let t=(e.label??``).toLowerCase(),n=typeof e.description==`string`?e.description:e.description?.value??``;return t.includes(r)||n.toLowerCase().includes(r)};for(let r of this._allMenuItems)if(r.kind!==`header`){if(r.kind===`separator`)i(),e=r.label?r:void 0;else if(r.showAlways)t.push(r);else if(!r.isSectionToggle){if(r.filterItems){let e=o(r)?r.filterItems:r.filterItems.filter(o);e.length>0&&(n=!0,t.push(...e))}else o(r)&&(n=!0,t.push(r))}}i()}else for(let e of this._allMenuItems)if(e.kind===`header`)a.push(e);else if(e.kind===`separator`){if(e.section&&this._collapsedSections.has(e.section))continue;a.push(e)}else if(e.isSectionToggle&&e.section){let t=this._collapsedSections.has(e.section);a.push({...e,group:{...e.group,icon:t?k.chevronRight:k.chevronDown}})}else e.section&&this._collapsedSections.has(e.section)||a.push(e);let c=[],l=!1;for(let e=0;e<a.length;e++)c[e]=l,a[e].kind===`action`&&(l=!0);let u=[],d=!1;for(let e=a.length-1;e>=0;e--)a[e].kind===`action`?d=!0:a[e].kind===`separator`&&(u[e]=d,d=!1);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.kind!==`separator`)continue;let n=u[e],r=!t.label&&!c[e];(!n||r)&&a.splice(e,1)}this._options?.showGroupTitleOnFirstItem&&this._recomputeGroupTitles(a);let f=this._filterInput&&Oi(this._filterInput),p=tr(this._list.getHTMLElement());if(this._visibleMenuItems=a,this._list.splice(0,this._list.length,a),t&&this._onDidRequestLayout.fire(),f)this._filterInput?.focus(),this._focusCheckedOrFirst();else if(this._hasLaidOut&&(s||n)){let e=n??s?.item?.id;if(e){for(let t=0;t<this._list.length;t++)if(this._list.element(t).item?.id===e){this._list.setFocus([t]),this._list.reveal(t);break}p&&(this._focusCheckedOrFirst(),this._list.domFocus())}}}get filterContainer(){return this._filterContainer}get footerContainer(){return this._footerContainer}get headerContainer(){return this._headerContainer}get filterInput(){return this._filterInput}get closeAnimation(){return this._options?.closeAnimation}focusCondition(e){return!e.disabled&&e.kind===`action`}_setKeyboardNavigation(e){if(this._keyboardNavigation===e)return;this._keyboardNavigation=e;let t=this._list.getHTMLElement();t.classList.toggle(`keyboard-navigation`,e===!0),t.classList.toggle(`mouse-navigation`,e===!1)}_updateFilterActiveDescendant(){if(!this._filterInput)return;let[e]=this._list.getFocus();Oi(this._filterInput)&&e!==void 0?this._filterInput.setAttribute(`aria-activedescendant`,this._list.getElementID(e)):this._filterInput.removeAttribute(`aria-activedescendant`)}focus(){this._setKeyboardNavigation(void 0),this._filterInput&&this._options?.focusFilterOnOpen?(this._filterInput.focus(),this._focusCheckedOrFirst()):(this._list.domFocus(),this._focusCheckedOrFirst(),this._showTabThroughPanelForFocusedItem())}clearFocus(){this._list.setFocus([])}getFocusedElement(){let e=this._list.getFocus();if(e.length>0)return this._list.element(e[0])}_updateToolbarFocusability(){if(!this._options?.tabThroughItemActions)return;let[e]=this._list.getFocus(),t=e!==void 0&&e<this._list.length?this._list.element(e):void 0;for(let[e,n]of this._itemToolbars)n.setFocusable(e===t)}_focusCheckedOrFirst(){let e=this._suppressHover;this._suppressHover=!0;try{let e=this._initialFocusItemId;if(this._initialFocusItemId=void 0,e)for(let t=0;t<this._list.length;t++){let n=this._list.element(t);if(this.focusCondition(n)&&n.item?.id===e){this._list.setFocus([t]),this._list.reveal(t);return}}let[t]=this._list.getFocus();if(t!==void 0){let e=this._list.element(t);if(e&&this.focusCondition(e)){this._list.reveal(t);return}}for(let e=0;e<this._list.length;e++){let t=this._list.element(e);if(this.focusCondition(t)&&t.item?.checked){this._list.setFocus([e]),this._list.reveal(e);return}}this._list.focusFirst(void 0,this.focusCondition);let n=this._list.getFocus();n.length>0&&this._list.reveal(n[0])}finally{this._suppressHover=e,this._options?.filterAsCombobox&&this._updateFilterActiveDescendant()}}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._filterCts.value?.cancel(),this._filterCts.clear(),this._hideSubmenu()}clearFilter(){return this._filterInput&&this._filterText?(this._filterInput.value=``,this._filterText=``,this._applyOrUpdateFilter(),!0):!1}get hasDynamicHeight(){return this._options?.showFilter?!0:this._allMenuItems.some(e=>e.isSectionToggle)}get lineHeight(){return this._actionLineHeight}_getItemHeight(e){return this._itemHeightWith(e,this._options)}_itemHeightWith(e,t){switch(e.kind){case`header`:return this._headerLineHeight;case`separator`:return e.label?this._actionLineHeight:this._separatorLineHeight;default:return e.inlineToggle?t?.inlineToggleItemHeight??70:e.detail?t?.detailItemHeight??48:this._actionLineHeight}}computeFullHeight(){return this.computeHeightForItems(this._allMenuItems,void 0,this._options)}computeHeightForItems(e,t,n){let r=0;for(let i of e)t&&i.section&&!i.isSectionToggle&&t.has(i.section)||(r+=this._itemHeightWith(i,n));return r}computeListHeight(){let e=this._list.length,t=0;for(let n=0;n<e;n++){let e=this._list.element(n);t+=this._getItemHeight(e)}return t}layout(e,t){this._hasLaidOut=!0,this._list.layout(e,t),this.domNode.style.height=`${e}px`;let n=this.domNode.parentElement;n&&this._filterContainer?.parentElement===n&&n.insertBefore(this._filterContainer,this.domNode),this._layoutSubmenu?.()}computeMaxWidth(e){let t=this._list.length,n=Math.max(e,this._options?.minWidth??0),r=this._options?.maxWidth??1/0,i=Math.max(r,n),a=e=>Math.min(Math.max(e,n),i),o=this._allMenuItems.length;if(o>=50)return a(380);if(o>t){let e=[];for(let n=0;n<t;n++)e.push(this._list.element(n));let n=this._list.renderHeight,r=this._list.scrollTop,i=this._list.getFocus(),o=this._isMeasuringWidth;this._isMeasuringWidth=!0;try{let e=[...this._allMenuItems];this._list.splice(0,t,e);let n=0;for(let t of e)n+=this._getItemHeight(t);this._list.layout(n);let r=this._measureItemWidths(e);return a(Math.max(...r))}finally{try{this._list.splice(0,this._list.length,e),this._list.layout(n),this._list.scrollTop=r;let t=this._suppressHover;this._suppressHover=!0;try{this._list.setFocus(i)}finally{this._suppressHover=t}}finally{this._isMeasuringWidth=o}}}let s=[];for(let e=0;e<t;e++)s.push(this._list.element(e));let c=this._measureItemWidths(s);return a(Math.max(...c))}focusPrevious(){if(this._setKeyboardNavigation(!0),this._focusFilterResult(`previous`))return;if(this._filterInput&&Oi(this._filterInput)){this._list.domFocus();let e=this._list.getFocus();if(e.length>0){this._list.focusPrevious(1,!1,void 0,this.focusCondition);let t=this._list.getFocus();t.length>0&&t[0]>=e[0]?this._filterInput.focus():t.length>0&&this._list.reveal(t[0])}else{this._list.focusLast(void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}return}let e=this._list.getFocus();this._list.focusPrevious(1,!0,void 0,this.focusCondition);let t=this._list.getFocus();if(t.length>0){if(this._filterInput&&e.length>0&&t[0]>e[0]){this._list.setFocus([]),this._filterInput.focus();return}this._list.reveal(t[0])}}focusNext(){if(this._setKeyboardNavigation(!0),this._focusFilterResult(`next`))return;if(this._filterInput&&Oi(this._filterInput)){if(this._list.domFocus(),this._list.getFocus().length>0){this._list.focusNext(1,!1,void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}else{this._list.focusFirst(void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}return}let e=this._list.getFocus();this._list.focusNext(1,!0,void 0,this.focusCondition);let t=this._list.getFocus();if(t.length>0){if(this._filterInput&&e.length>0&&t[0]<e[0]){this._list.setFocus([]),this._filterInput.focus();return}this._list.reveal(t[0])}}_focusFilterResult(e){if(!this._options?.filterAsCombobox||!this._filterInput||!Oi(this._filterInput))return!1;e===`previous`?this._list.focusPrevious(1,!0,void 0,this.focusCondition):this._list.focusNext(1,!0,void 0,this.focusCondition);let[t]=this._list.getFocus();return t!==void 0&&this._list.reveal(t),!0}collapseFocusedSection(){let e=this._getFocusedSection();e&&!this._collapsedSections.has(e)&&this._toggleSection(e)}expandFocusedSection(){let e=this._getFocusedSection();e&&this._collapsedSections.has(e)&&this._toggleSection(e)}toggleFocusedSection(){let e=this._list.getFocus();if(e.length===0)return!1;let t=this._list.element(e[0]);return t.isSectionToggle&&t.section?(this._toggleSection(t.section),!0):!1}_getFocusedSection(){let e=this._list.getFocus();if(e.length===0)return;let t=this._list.element(e[0]);return t.isSectionToggle&&t.section,t.section}acceptSelected(e){let t=this._list.getFocus();if(t.length===0)return;let n=t[0],r=this._list.element(n);if(!this.focusCondition(r))return;let i=e?new $m:new Qm;this._list.setSelection([n],i)}onListSelection(e){if(!e.elements.length)return;let t=e.elements[0];if(t.standaloneToggle){this._list.setSelection([]);let e=this._standaloneToggles.get(t);e&&!e.disabled&&(e.checked=!e.checked,t.standaloneToggle.onChange(e.checked));return}if(t.isSectionToggle&&t.section){this._list.setSelection([]);let e=t.section;queueMicrotask(()=>{this._toggleSection(e)});return}let n=Bf(e.browserEvent)||e.browserEvent?.type===Sa.Tap;if(n){let t=e.browserEvent.target;if(Zi(t)&&(t.closest(`.action-list-item-toolbar`)||t.closest(`.action-list-submenu-indicator`)||t.closest(`.action-list-item-inline-toggle`))){this._list.setSelection([]);return}}if(t.openSubmenuOnClick&&t.submenuActions?.length&&(n||e.browserEvent instanceof Qm))this._list.setSelection([]),this._showSubmenuForItem(t),n||this._currentSubmenuWidget?.focus();else if(t.item&&this.focusCondition(t)){let n=e.browserEvent instanceof $m;this._delegate.onSelect(t.item,n&&this._supportsPreview)}else this._list.setSelection([])}onFocus(){let e=this._list.getFocus();if(e.length===0)return;let t=e[0],n=this._list.element(t);this._delegate.onFocus?.(n.item),this._suppressHover||(this._options?.persistentHover&&(this._cancelSubmenuShow(),this._resetSubmenuPointer(),this._list.reveal(t)),this._showHoverForElement(n,t))}_removeItem(e){let t=this._allMenuItems.indexOf(e);t>=0&&(this._allMenuItems.splice(t,1),this._applyFilter())}_recomputeGroupTitles(e){this._groupTitleByIndex.clear();let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];r.kind===`action`&&r.group?.title&&!t.has(r.group.title)&&(t.add(r.group.title),this._groupTitleByIndex.set(n,r.group.title))}}_measureItemWidths(e){let t=[];for(let n=0;n<e.length;n++){let r=this._getRowElement(n);r&&(r.style.width=`auto`,t.push({element:r,item:e[n]}))}try{return t.map(({element:e,item:t})=>e.getBoundingClientRect().width+(t.detail?0:this._computeToolbarWidth(t)))}finally{for(let{element:e}of t)e.style.width=``}}_computeToolbarWidth(e){let t=e.toolbarActions?.length??0;return e.onRemove&&t++,t===0?0:t*22+6+10}_getRowElement(e){return e<0?null:this.domNode.ownerDocument.getElementById(this._list.getElementID(e))}_showTabThroughPanelForFocusedItem(){let e=this._list.getFocus();if(e.length===0)return;let t=e[0],n=this._list.element(t);if(!n.hover?.tabThroughPanel)return;let r=this._getRowElement(t);r&&this._showSubmenuForElement(n,r)}_getTabThroughPanelControls(e,t){return e.hover?.tabThroughPanel&&this._currentSubmenuElement!==e&&this._showSubmenuForElement(e,t),{toolbar:this._itemToolbars.get(e),panelControls:[...e.hover?.getTabbableElements?.()??[],...this._submenuHoverActionElements]}}_focusFirstTabThroughPanelControl(e,t){let n=this._getTabThroughPanelControls(e,t);n.toolbar?.length()?n.toolbar.focus(0):(n.panelControls[0]??this._list.getHTMLElement()).focus()}_handleTabThroughPanelKeyDown(e){if(e.isComposing)return;let t=this._list.getFocus();if(t.length===0)return;let n=t[0],r=this._list.element(n);if(!r.hover?.tabThroughPanel&&!this._options?.tabThroughItemActions)return;let i=this._getRowElement(n),a=gf();if(!i||!Zi(a))return;let o=this._getTabThroughPanelControls(r,i),s=o.toolbar?.isFocused()??!1,c=this._submenuContainer.contains(a);if((e.key===`ArrowUp`||e.key===`ArrowDown`)&&(s||c)){js.stop(e,!0),this._list.domFocus(),e.key===`ArrowUp`?this.focusPrevious():this.focusNext();return}if(e.key!==`Tab`||e.ctrlKey||e.metaKey||e.altKey)return;let l;if(e.shiftKey){if(c){let t=o.panelControls.indexOf(a);if(t>0)l=o.panelControls[t-1];else if(o.toolbar?.length()){js.stop(e,!0),o.toolbar.focus(o.toolbar.length()-1);return}else l=this._list.getHTMLElement()}else if(o.toolbar?.isFocused()){let t=o.toolbar.viewItems.findIndex((e,t)=>o.toolbar?.isFocused(t));if(t>0){js.stop(e,!0),o.toolbar.focus(t-1);return}l=this._options?.filterAsCombobox?this._filterInput:this._list.getHTMLElement()}}else if(a===this._list.getHTMLElement()||a===this._filterInput){if(o.toolbar?.length()){js.stop(e,!0),o.toolbar.focus(0);return}l=o.panelControls[0]}else if(o.toolbar?.isFocused()){let t=o.toolbar.viewItems.findIndex((e,t)=>o.toolbar?.isFocused(t));if(t+1<o.toolbar.length()){js.stop(e,!0),o.toolbar.focus(t+1);return}l=o.panelControls[0]}else{let e=o.panelControls.indexOf(a);e>=0&&(l=o.panelControls[e+1]??this._list.getHTMLElement())}l&&(js.stop(e,!0),l.focus())}_showHoverForElement(e,t){if(this._currentSubmenuElement===e)return;let n=!!e.hover?.content,r=!!e.submenuActions?.length;if(n||r){let n=this._getRowElement(t);n&&this._showSubmenuForElement(e,n)}else this._options?.persistentHover||this._hideSubmenu()}_showSubmenuForItem(e){let t=this._list.indexOf(e);if(t>=0){let n=this._getRowElement(t);n&&this._showSubmenuForElement(e,n)}}_showSubmenuForElement(e,t){if(!this._hoverEnabled||this._currentSubmenuElement===e)return;this._currentSubmenuElement=e,this._clearSubmenuContainer(),t.setAttribute(`aria-expanded`,`true`),this._expandedTrigger=t,this._submenuPanelClassName=e.hover?.panelClassName,this._submenuPanelClassName&&this._submenuContainer.classList.add(this._submenuPanelClassName);let n=e.hover?.preserveVerticalPosition,r=!!e.submenuActions?.length,i=n?M(`.action-list-submenu-content`):this._submenuContainer,a=n?M(`.action-list-submenu-viewport`,void 0,i):void 0,o=a&&!r?this._submenuDisposables.add(new ua(a,{horizontal:2,vertical:1,consumeMouseWheelIfScrollbarIsNeeded:!0,useShadows:!1})):void 0;o&&a?(this._submenuContainer.appendChild(o.getDomNode()),this._submenuDisposables.add(I(a,Ml.SCROLL,()=>o.scanDomNode())),this._submenuDisposables.add(I(this._submenuContainer,Ml.KEY_DOWN,e=>{let t=new gr(e);(t.equals(12)||t.equals(11))&&(js.stop(e,!0),o.setScrollPosition({scrollTop:o.getScrollPosition().scrollTop+(t.equals(12)?1:-1)*a.clientHeight}))}))):a&&this._submenuContainer.appendChild(a);let s,c=typeof e.hover?.content==`function`?e.hover.content():e.hover?.content;if(c){if(Zi(c))s=c,e.hover?.disposable&&this._register(e.hover.disposable);else{let t=typeof c==`string`?new Mi(c):c,n=this._options?.linkHandler,r=wl(t,{actionHandler:t=>{let r=$n.parse(t);n?n(r,e):this._openerService.open(r,{allowCommands:!0})}});this._submenuDisposables.add(r),s=r.element}s.classList.add(`action-list-submenu-hover-header`),s.classList.toggle(`content-owns-padding`,e.hover?.contentOwnsPadding===!0),e.submenuActions?.length&&s.classList.add(`has-submenu`),i.appendChild(s)}if(e.hover?.actions?.length){let t=M(`.hover-row.status-bar`),n=K(t,M(`.actions`));for(let t of e.hover.actions){let e=this._keybindingService.lookupKeybinding(t.commandId),r=this._submenuDisposables.add(_o.render(n,{label:t.label,commandId:t.commandId,run:e=>t.run(e),iconClass:t.iconClass},e?.getLabel()??null));this._submenuHoverActionElements.push(r.actionContainer)}this._submenuContainer.appendChild(t)}this._submenuContainer.style.display=``,this._submenuContainer.style.position=`absolute`,e.hover?.expandable?(this._submenuContainer.setAttribute(`role`,`dialog`),e.label&&this._submenuContainer.setAttribute(`aria-label`,e.label)):this._submenuContainer.removeAttribute(`role`);let l=ll(this.domNode),u=0,d=s?s.offsetWidth:0,f;if(r){let t=this._createSubmenuItems(e.submenuActions),n=this._submenuDisposables.add(this._instantiationService.createInstance(Hm,`submenu`,!1,t,{onHide:()=>{},onSelect:e=>{e.run();let t=this._currentSubmenuElement?.item;this._hideSubmenu(),t&&this._delegate.onSelect(t),this.hide()}},void 0,e.submenuOptions));f=n,n.headerContainer&&i.appendChild(n.headerContainer),n.filterContainer&&i.appendChild(n.filterContainer),i.appendChild(n.domNode),n.footerContainer&&i.appendChild(n.footerContainer),this._currentSubmenuWidget=n,n.clearFocus(),u=n.computeListHeight(),n.layout(u);let r=n.computeMaxWidth(0);d=Math.max(d,r,n.footerContainer?.offsetWidth??0),n.layout(u,d),n.domNode.style.width=`${d}px`,e.submenuOptions&&(this._submenuContainer.style.boxSizing=`border-box`,this._submenuContainer.style.width=`${d+10}px`),this._submenuDisposables.add(n.onDidRequestLayout(()=>{u=n.computeListHeight(),n.layout(u,d),this._layoutSubmenu?.()})),this._submenuDisposables.add(I(i,`keydown`,e=>{e.key===`Escape`?(js.stop(e,!0),this._hideSubmenu(),this.hide()):e.key===`ArrowLeft`?(js.stop(e,!0),this._hideSubmenu(),this._setKeyboardNavigation(!0),this._list.domFocus()):e.key===`Enter`||e.key===` `?(js.stop(e,!0),n.acceptSelected()):e.key===`ArrowDown`?(js.stop(e,!0),n.focusNext()):e.key===`ArrowUp`&&(js.stop(e,!0),n.focusPrevious())}))}let p,m,h=()=>{let e=this._currentSubmenuElement;if(!e||this._layoutSubmenu!==h)return;let t=this._list.indexOf(e),r=t>=0?this._getRowElement(t):null,s=this._options?.persistentHover;if(!r&&(!s||!this._allMenuItems.includes(e))){this._hideSubmenu();return}this._expandedTrigger!==r&&(this._expandedTrigger?.hasAttribute(`aria-expanded`)&&this._expandedTrigger.setAttribute(`aria-expanded`,`false`),this._expandedTrigger=r??void 0),r?.setAttribute(`aria-expanded`,`true`);let c=this.domNode.getBoundingClientRect(),g=s||e.hover?.alignToParent,_=g?this.domNode.parentElement?.closest(`.action-widget`)?.getBoundingClientRect()??c:c,v=r?.getBoundingClientRect()??_,y=g||n?ln(this.domNode):1;s&&(this._submenuContainer.style.width=`${_.width/y}px`);let b=this._submenuContainer.getBoundingClientRect(),ee=g?b.width:d+10,te=l.innerWidth-(g?_.right:v.right),ne=_.left,re=g?0:4;if(!g){let e=l.innerWidth-8;ee>e&&(ee=Math.max(e,0)),this._submenuContainer.style.boxSizing=`border-box`,this._submenuContainer.style.width=`${ee}px`}let ie=te>=ee||te>=ne;s&&this._submenuSide&&(this._submenuSide===`right`?te:ne)>=ee&&(ie=this._submenuSide===`right`),s&&(this._submenuSide=ie?`right`:`left`);let ae=ie?_.right-c.left+re:_.left-c.left-ee-re,oe=c.left+ae;oe<4?ae+=4-oe:oe+ee>l.innerWidth-4&&(ae-=oe+ee-(l.innerWidth-4)),this._submenuContainer.style.left=`${ae/y}px`;let se=b.height;n&&(p??=se/y);let ce=p===void 0?se:p*y,le=m===void 0?r&&e.hover?.alignToAnchorTop?v.top-c.top:r?v.top-c.top+(v.height-ce)/2:b.top-c.top:m*y;if(n&&e.hover?.alignToAnchorTop&&a&&f){let e=b.height-a.getBoundingClientRect().height+((f.headerContainer?.offsetHeight??0)+(f.filterContainer?.offsetHeight??0)+(f.footerContainer?.offsetHeight??0)+u)*y;le=Math.min(le,l.innerHeight-c.top-e-8)}let ue=c.top+le+ce;if(ue>l.innerHeight&&!(n&&e.hover?.alignToAnchorTop)&&(le-=ue-l.innerHeight+8),c.top+le<0&&(le=-c.top),n&&(m??=le/y),a&&o){let e=(b.height-o.getDomNode().getBoundingClientRect().height)/y,t=Math.max(0,(l.innerHeight-c.top-le-8)/y-e);a.style.height=`${Math.min(i.getBoundingClientRect().height/y,t)}px`,o.scanDomNode()}else if(a&&f){let e=(b.height-a.getBoundingClientRect().height)/y,t=Math.max(0,(l.innerHeight-c.top-le-8)/y-e),n=(f.headerContainer?.offsetHeight??0)+(f.filterContainer?.offsetHeight??0)+(f.footerContainer?.offsetHeight??0),r=u===0?0:Math.max(this._actionLineHeight,Math.min(u,t-n));f.layout(r,d),a.style.height=`${n+r}px`}this._submenuContainer.style.top=`${le/y}px`};if(this._layoutSubmenu=h,h(),(this._options?.persistentHover||e.hover?.alignToParent||e.hover?.tabThroughPanel||n)&&this._currentSubmenuElement===e){if(!f){let e=this._submenuDisposables.add(new pc),t=this._submenuDisposables.add(new ud(`ActionListWidget.hoverPanel`,()=>{e.value||=to(l,()=>{e.clear(),h()})},l));this._submenuDisposables.add(t.observe(n?i:this._submenuContainer,{box:`border-box`}))}(this._options?.persistentHover||n)&&this._submenuDisposables.add(I(l,Ml.RESIZE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer(),h()}))}}_createSubmenuItems(e){let t=[],n=e.filter(e=>e instanceof bo).filter(e=>e.actions.length>0);for(let e=0;e<n.length;e++){let r=n[e];r.label&&t.push({kind:`header`,group:{title:r.label},label:r.label});for(let e of r.actions){let n=e,r=n.icon??V.fromId(e.checked?k.check.id:k.blank.id),i=n.hoverContent,a=i?new Mi().appendText(`${e.label}\n`).appendMarkdown(i):void 0;t.push({item:e,kind:`action`,label:e.label,description:e.tooltip&&e.tooltip!==e.label?e.tooltip:void 0,group:{title:``,icon:r},hideIcon:!1,hover:a?{content:a}:void 0,tooltip:e.tooltip||e.label,onRemove:n.onRemove,submenuActions:e instanceof bo?[new bo(e.id,``,e.actions)]:void 0})}e<n.length-1&&t.push({kind:`separator`,label:``})}for(let n of e)if(!(n instanceof bo)){let e=n,r=e.icon??V.fromId(n.checked?k.check.id:k.blank.id),i=e.hoverContent,a=i?new Mi().appendText(`${n.label}\n`).appendMarkdown(i):void 0;t.push({item:n,kind:`action`,label:n.label,description:n.tooltip&&n.tooltip!==n.label?n.tooltip:void 0,group:{title:``,icon:r},hideIcon:!1,hover:a?{content:a}:void 0,tooltip:n.tooltip||n.label,onRemove:e.onRemove})}return t}_hideSubmenu(){this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._currentSubmenuElement=void 0,this._submenuSide=void 0,this._clearSubmenuContainer(),this._submenuContainer.style.display=`none`}_clearSubmenuContainer(){this._layoutSubmenu=void 0,this._resetSubmenuPointer(),this._submenuContainer.contains(gf())&&this._list.domFocus(),this._submenuDisposables.clear(),this._currentSubmenuWidget=void 0,this._submenuHoverActionElements=[],this._submenuPanelClassName&&=(this._submenuContainer.classList.remove(this._submenuPanelClassName),void 0),this._submenuContainer.removeAttribute(`role`),this._submenuContainer.removeAttribute(`aria-label`),this._expandedTrigger?.hasAttribute(`aria-expanded`)&&this._expandedTrigger.setAttribute(`aria-expanded`,`false`),this._expandedTrigger=void 0,Of(this._submenuContainer),this._submenuContainer.style.width=``,this._submenuContainer.style.boxSizing=this._options?.persistentHover?`border-box`:``}_scheduleSubmenuHide(){this._cancelSubmenuHide(),this._options?.persistentHover||(this._submenuHideTimeout=setTimeout(()=>{this._hideSubmenu()},300))}_cancelSubmenuHide(){this._submenuHideTimeout!==void 0&&(clearTimeout(this._submenuHideTimeout),this._submenuHideTimeout=void 0)}_scheduleSubmenuShow(e,t){this._cancelSubmenuShow();let n=this._options?.submenuHoverDelay??500;if(this._usesSubmenuPointerIntent()){n=0;let e=this._submenuPointerOrigin;if(e&&t.clientX!==e.x&&this._currentSubmenuElement&&new Us(e.x,e.y,this._submenuContainer).contains(t.clientX,t.clientY)){let e=Date.now();this._submenuPointerGraceDeadline??=e+200,n=Math.max(0,this._submenuPointerGraceDeadline-e)}}let r=()=>{this._submenuShowTimeout=void 0;let n=this._list.indexOf(e),r=n>=0?this._getRowElement(n):null;r&&(this._showSubmenuForElement(e,r),this._usesSubmenuPointerIntent()&&this._updateSubmenuPointer(t))};n===0?r():this._submenuShowTimeout=setTimeout(r,n)}_updateSubmenuPointer(e){this._submenuPointerOrigin={x:e.clientX,y:e.clientY},this._submenuPointerGraceDeadline=void 0}_resetSubmenuPointer(){this._submenuPointerOrigin=void 0,this._submenuPointerGraceDeadline=void 0}_usesSubmenuPointerIntent(){return this._options?.persistentHover===!0||this._options?.submenuPointerIntent===!0}_cancelSubmenuShow(){this._submenuShowTimeout!==void 0&&(clearTimeout(this._submenuShowTimeout),this._submenuShowTimeout=void 0)}async onListHover(e){this._setKeyboardNavigation(!1);let t=e.element;if(t&&t.item&&this.focusCondition(t)){let n=typeof e.index==`number`?[e.index]:[],r=gf();if(this._options?.tabThroughItemActions&&this._list.getFocus()[0]!==e.index&&Zi(r)&&this.domNode.contains(r)&&r.closest(`.action-list-item-toolbar`)&&this._list.domFocus(),Zi(e.browserEvent.target)&&e.browserEvent.target.closest(`.action-list-item-toolbar`)!==null){t.submenuActions?.length||this._cancelSubmenuShow(),this._list.setFocus(this._options?.tabThroughItemActions?n:[]);return}let i=!!(t.submenuActions?.length||t.hover?.content),a=this._suppressHover;(i||this._usesSubmenuPointerIntent())&&(this._suppressHover=!0);try{this._list.setFocus(n)}finally{this._suppressHover=a}if(i){this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._usesSubmenuPointerIntent()&&this._updateSubmenuPointer(e.browserEvent)):(this._usesSubmenuPointerIntent()||this._hideSubmenu(),this._scheduleSubmenuShow(t,e.browserEvent));return}if(this._currentSubmenuElement===t?this._cancelSubmenuHide():(this._cancelSubmenuShow(),this._options?.submenuPointerIntent?this._scheduleSubmenuHide():this._options?.persistentHover||this._hideSubmenu()),this._delegate.onHover&&!t.disabled&&t.kind===`action`&&this._currentSubmenuElement!==t){let n=await this._delegate.onHover(t.item,this.cts.token),r=n?n.canPreview:void 0;r!==t.canPreview&&(t.canPreview=r,typeof e.index==`number`&&(this._list.splice(e.index,1,[t]),this._list.setFocus([e.index])))}}else t&&t.hover?.content&&typeof e.index==`number`&&(this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow()):(this._options?.persistentHover||this._hideSubmenu(),this._scheduleSubmenuShow(t,e.browserEvent)))}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};th=Hm=Bm([Vm(6,Ea),Vm(7,en),Vm(8,U)],th);var nh=class extends G{get domNode(){return this._widget.domNode}get filterContainer(){return this._widget.filterContainer}get footerContainer(){return this._widget.footerContainer}get headerContainer(){return this._widget.headerContainer}get filterInput(){return this._widget.filterInput}get closeAnimation(){return this._widget.closeAnimation}get widgetClassName(){return this._widgetClassName}get anchorPosition(){if(this._preferredAnchorPosition!==void 0)return this._preferredAnchorPosition;if(this._showAbove!==void 0)return+!!this._showAbove}constructor(e,t,n,r,i,a,o,s,c,l){super(),this._contextViewService=s,this._layoutService=c,this._lastMinWidth=0,this._hasLaidOut=!1,this._anchor=o,this._preferredAnchorPosition=a?.anchorPosition,this._useFullHeight=a?.useFullHeight??!1,this._widgetClassName=a?.widgetClassName,this._widget=this._register(l.createInstance(th,e,t,n,r,i,a)),this._register(this._widget.onDidRequestLayout(()=>{this._hasLaidOut&&(this.layout(this._lastMinWidth),this._contextViewService.layout())}))}focus(){this._widget.focus()}hide(e,t=!0){this._widget.hide(e),t&&this._contextViewService.hideContextView()}clearFilter(){return this._widget.clearFilter()}focusPrevious(){this._widget.focusPrevious()}focusNext(){this._widget.focusNext()}collapseFocusedSection(){this._widget.collapseFocusedSection()}expandFocusedSection(){this._widget.expandFocusedSection()}toggleFocusedSection(){return this._widget.toggleFocusedSection()}acceptSelected(e){this._widget.acceptSelected(e)}hasDynamicHeight(){return this._widget.hasDynamicHeight}computeActionWidgetVerticalChromeHeight(){let e=this.domNode.parentElement?.closest(`.action-widget`);if(!e)return 0;let t=ll(e).getComputedStyle(e),n=e=>Number.parseFloat(e)||0;return n(t.paddingTop)+n(t.paddingBottom)+n(t.borderTopWidth)+n(t.borderBottomWidth)}computeHeight(){let e=this._fixedContentHeight??this._widget.computeListHeight(),t=this._widget.filterContainer?36:0,n=this._widget.footerContainer?32:0,r=this._widget.headerContainer&&!this._widget.headerContainer.hidden?this._widget.headerContainer.offsetHeight||36:0,i=t+n+r,a=ll(this.domNode),o;if(this.hasDynamicHeight()||this._preferredAnchorPosition!==void 0){let e=a.innerHeight,t=cf(this._anchor),n=t.top-a.pageYOffset,r=e-n-t.height-30,s=n;if(this._showAbove===void 0){let e=this._fixedContentHeight??this._widget.computeFullHeight();this._showAbove=this._preferredAnchorPosition===void 0?i+e>r&&s>r:this._preferredAnchorPosition===1}o=Math.max(0,(this._showAbove?s:r)-this.computeActionWidgetVerticalChromeHeight())}else{let e=this._layoutService.getContainer(a).clientHeight,t=this.domNode.getBoundingClientRect().top;o=t>0?e-t-10:e*.7}let s=this._useFullHeight?a.innerHeight:Math.floor(a.innerHeight*.6),c=this._widget.lineHeight;if(this._preferredAnchorPosition!==void 0){let t=Math.min(o,s),n=Math.min(e+i,Math.max(0,t));return Math.max(0,n-i)}let l=Math.min(Math.max(o,c*3+i),s);return Math.min(e+i,l)-i}layout(e,t){this._hasLaidOut=!0,this._lastMinWidth=e,t!==void 0&&(this._fixedContentHeight=t);let n=this.computeHeight();this._widget.layout(n);let r=this._widget.computeMaxWidth(e);return this._cachedMaxWidth=r,this._widget.layout(n,this._cachedMaxWidth),this._cachedMaxWidth}};nh=Bm([Vm(7,Od),Vm(8,Ht),Vm(9,U)],nh);function rh(e){return e.replace(/\r\n|\r|\n/g,` `)}var ih=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ah=function(e,t){return function(n,r){t(n,r,e)}};O(`actionBar.toggledBackground`,$i,x(1744,`Background color for toggled action items in action bar.`));var oh=`--action-widget-close-start-opacity`,sh=`--action-widget-close-start-transform`,ch={Visible:new j(`codeActionMenuVisible`,!1,x(1745,`Whether the action widget list is visible`)),FilterFocused:new j(`codeActionMenuFilterFocused`,!1,x(1746,`Whether the action widget filter input is focused`))},lh=ru(`actionWidgetService`),uh=class extends G{get isVisible(){return ch.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new pc),this._closeAnimation=this._register(new pc)}show(e,t,n,r,i,a,o,s,c){let l=ch.Visible.bindTo(this._contextKeyService),u=this._instantiationService.createInstance(nh,e,t,n,r,s,c,i);this._contextViewService.showContextView({getAnchor:()=>i,render:e=>(l.set(!0),this._renderWidget(e,u,o??[],c)),onHide:e=>{l.reset(),this._onWidgetClosed(e)},get anchorPosition(){return u.anchorPosition},focus:()=>u.focus()},a,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}collapseSection(){this._list?.value?.collapseFocusedSection()}expandSection(){this._list?.value?.expandFocusedSection()}toggleSection(){return this._list?.value?.toggleFocusedSection()??!1}clearFilter(){return this._list?.value?.clearFilter()??!1}hide(e){let t=this._list.value,n=this._widgetElement;if(!t||this._closingList===t)return;let r=t.closeAnimation;if(!n||!r||r.duration<=0||!this._hasRequiredAncestorClasses(n,r.requiredAncestorClasses)){this._closingList=t,t.hide(e);return}this._closingList=t;let i=ll(n).getComputedStyle(n);n.style.setProperty(oh,i.opacity),n.style.setProperty(sh,i.transform),n.classList.add(r.className),t.hide(e,!1),this._closeAnimation.value=qa(()=>{this._list.value===t&&this._contextViewService.hideContextView(e)},r.duration)}clear(){this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement?.style.removeProperty(oh),this._widgetElement?.style.removeProperty(sh),this._widgetElement=void 0,this._list.clear()}_renderWidget(e,t,n,r){let i=document.createElement(`div`);i.classList.add(`action-widget`);let a=t.widgetClassName?.split(/\s+/).filter(Boolean);if(a?.length&&i.classList.add(...a),e.appendChild(i),this._widgetElement=i,this._list.value=t,this._list.value)this._list.value.headerContainer&&i.appendChild(this._list.value.headerContainer),this._list.value.filterContainer&&i.appendChild(this._list.value.filterContainer),i.appendChild(this._list.value.domNode),this._list.value.footerContainer&&i.appendChild(this._list.value.footerContainer);else throw Error(`List has no value`);let o=new F;r?.filterAsCombobox&&o.add(Yo(i,`keydown`,e=>{e.keyCode===9&&!e.browserEvent.isComposing&&(js.stop(e,!0),this.hide(!0))}));let s=this._list.value.headerContainer;s&&o.add(Ou(s,e=>e.preventDefault()));let c=0;o.add(Ou(i,()=>{c=Date.now()+1e3}));let l=document.createElement(`div`),u=e.appendChild(l);u.classList.add(`context-view-block`),o.add(Ou(u,e=>e.stopPropagation()));let d=0;if(n.length){let e=this._createActionBar(`.action-widget-action-bar`,n);e&&(i.appendChild(e.getContainer().parentElement),o.add(e),d=e.getContainer().offsetWidth)}let f=this._list.value?.layout(d);i.style.width=`${f}px`;let p=ch.FilterFocused.bindTo(this._contextKeyService);if(o.add({dispose:()=>p.reset()}),this._list.value?.filterInput){let e=this._list.value.filterInput;o.add(I(e,`focus`,()=>p.set(!0))),o.add(I(e,`blur`,()=>p.set(!1)))}let m=o.add(pr(e)),h=o.add(new pc);return o.add(m.onDidFocus(()=>h.clear())),o.add(m.onDidBlur(()=>{let t=()=>{let n=c-Date.now();if(n>0){h.value=qa(t,n);return}let r=gf();r&&(e.contains(r)||r.closest(`.action-widget-hover`)||r.closest(`.action-list-submenu-panel`))||this.hide(!0)};h.value=qa(t,75)})),o}_createActionBar(e,t){if(!t.length)return;let n=M(e),r=new Ur(n);return r.push(t,{icon:!1,label:!0}),r}_hasRequiredAncestorClasses(e,t){if(!t?.length)return!0;for(let n=e;n;n=n.parentElement)if(t.every(e=>n.classList.contains(e)))return!0;return!1}_onWidgetClosed(e){this._closingList===this._list.value?this.clear():(this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement=void 0,this._list.value?.hide(e))}};uh=ih([ah(0,Od),ah(1,za),ah(2,U)],uh),vo(lh,uh,1);var dh=1100;ia(class extends hl{constructor(){super({id:`hideCodeActionWidget`,title:L(1747,`Hide action widget`),precondition:ch.Visible,keybinding:{weight:dh,primary:9,secondary:[1033]}})}run(e){e.get(lh).hide(!0)}}),ia(class extends hl{constructor(){super({id:`clearFilterCodeActionWidget`,title:L(1748,`Clear action widget filter`),precondition:w.and(ch.Visible,ch.FilterFocused),keybinding:{weight:1101,primary:9}})}run(e){let t=e.get(lh);t instanceof uh&&(t.clearFilter()||t.hide(!0))}}),ia(class extends hl{constructor(){super({id:`selectPrevCodeAction`,title:L(1749,`Select previous action`),precondition:ch.Visible,keybinding:{weight:dh,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){let t=e.get(lh);t instanceof uh&&t.focusPrevious()}}),ia(class extends hl{constructor(){super({id:`selectNextCodeAction`,title:L(1750,`Select next action`),precondition:ch.Visible,keybinding:{weight:dh,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){let t=e.get(lh);t instanceof uh&&t.focusNext()}}),ia(class extends hl{constructor(){super({id:`collapseSectionCodeAction`,title:L(1751,`Collapse section`),precondition:w.and(ch.Visible,ch.FilterFocused.negate()),keybinding:{weight:dh,primary:15}})}run(e){let t=e.get(lh);t instanceof uh&&t.collapseSection()}}),ia(class extends hl{constructor(){super({id:`expandSectionCodeAction`,title:L(1752,`Expand section`),precondition:w.and(ch.Visible,ch.FilterFocused.negate()),keybinding:{weight:dh,primary:17}})}run(e){let t=e.get(lh);t instanceof uh&&t.expandSection()}}),ia(class extends hl{constructor(){super({id:`toggleSectionCodeAction`,title:L(1753,`Toggle section`),precondition:w.and(ch.Visible,ch.FilterFocused.negate()),keybinding:{weight:dh,primary:10}})}run(e){let t=e.get(lh);t instanceof uh&&(t.toggleSection()||t.acceptSelected())}}),ia(class extends hl{constructor(){super({id:Um,title:L(1754,`Accept selected action`),precondition:ch.Visible,keybinding:{weight:dh,primary:3,secondary:[2137]}})}run(e){let t=e.get(lh);t instanceof uh&&t.acceptSelected()}}),ia(class extends hl{constructor(){super({id:Wm,title:L(1755,`Preview selected action`),precondition:ch.Visible,keybinding:{weight:dh,primary:2051}})}run(e){let t=e.get(lh);t instanceof uh&&t.acceptSelected(!0)}});var fh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ph=function(e,t){return function(n,r){t(n,r,e)}},mh,hh=class extends G{static{mh=this}static{this.baseId=`editor.widget.postEditWidget`}constructor(e,t,n,r,i,a,o,s,c,l,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=i,this.edits=a,this.onSelectNewEdit=o,this.additionalActions=s,this._keybindingService=l,this._actionWidgetService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(Xo(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Xo((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(e=>{this.dispose()})),this._register(_u.runAndSubscribe(l.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){this.button.element.title=this._keybindingService.appendKeybinding(this.showCommand.label,this.showCommand.id)}create(){this.domNode=M(`.post-edit-widget`),this.button=this._register(new $a(this.domNode,{supportIcons:!0})),this.button.label=`$(insert)`,this._register(I(this.domNode,Ml.CLICK,()=>this.showSelector()))}getId(){return mh.baseId+`.`+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){let e=ba(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:V.fromId(t===this.edits.activeEditIndex?k.check.id:k.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:e=>{this._actionWidgetService.hide(!1);let t=this.edits.allEdits.findIndex(t=>t===e);if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}};hh=mh=fh([ph(8,za),ph(9,Ea),ph(10,lh)],hh);var gh=class extends G{constructor(e,t,n,r,i,a,o,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._getAdditionalActions=i,this._instantiationService=a,this._bulkEditService=o,this._notificationService=s,this._currentWidget=this._register(new pc),this._register(_u.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,n,r,i){if(!e.length||!this._editor.hasModel())return;let a=this._editor.getModel(),o=t.allEdits.at(t.activeEditIndex);if(!o)return;let s=async a=>{let o=this._editor.getModel();o&&(await o.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:a,allEdits:t.allEdits},n,r,i))},c=(r,i)=>{Vi(r)||(this._notificationService.error(i),n&&this.show(e[0],t,s))},l=new jd(this._editor,3,void 0,i),u;try{u=await io(r(o,l.token),l.token)}catch(e){return c(e,x(991,`Error resolving edit '{0}':
4
4
  {1}`,o.title,Fm(e)))}finally{l.dispose()}if(i.isCancellationRequested)return;let d=Am(a.uri,e,u),f=e[0],p=a.deltaDecorations([],[{range:f,options:{description:`paste-line-suffix`,stickiness:0}}]);this._editor.focus();let m,h;try{m=await this._bulkEditService.apply(d,{editor:this._editor,token:i}),h=a.getDecorationRange(p[0])}catch(e){return c(e,x(992,`Error applying edit '{0}':
5
5
  {1}`,o.title,Fm(e)))}finally{a.deltaDecorations(p,[])}i.isCancellationRequested||n&&m.isApplied&&t.allEdits.length>1&&this.show(h??f,t,s)}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(hh,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};gh=fh([ph(5,U),ph(6,od),ph(7,St)],gh);var _h=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},vh=function(e,t){return function(n,r){t(n,r,e)}},yh,bh=`editor.changePasteType`,xh=`editor.pasteAs.preferences`,Sh=new j(`pasteWidgetVisible`,!1,x(971,`Whether the paste widget is showing`)),Ch=`application/vnd.code.copymetadata`,wh=class extends G{static{yh=this}static{this.ID=`editor.contrib.copyPasteActionController`}static get(e){return e.getContribution(yh.ID)}constructor(e,t,n,r,i,a,o,s,c,l){super(),this._logService=n,this._bulkEditService=r,this._clipboardService=i,this._commandService=a,this._configService=o,this._languageFeaturesService=s,this._quickInputService=c,this._progressService=l,this._editor=e,this._register(e.onWillCopy(e=>this.handleCopy(e))),this._register(e.onWillCut(e=>this.handleCopy(e))),this._register(e.onWillPaste(e=>this.handlePaste(e))),this._pasteProgressManager=this._register(new em(`pasteIntoEditor`,e,t)),this._postPasteWidgetManager=this._register(t.createInstance(gh,`pasteIntoEditor`,e,Sh,{id:bh,label:x(972,`Show paste options...`)},()=>yh._configureDefaultAction?[yh._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace(`CopyPasteController.pasteAs`),this._editor.focus();try{this._logService.trace(`Before calling editor.action.clipboardPasteAction`),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand(`editor.action.clipboardPasteAction`)}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){if(this._logService.trace(`CopyPasteController#handleCopy`),!this._editor.hasTextFocus()||(this._clipboardService.clearInternalState?.(),!this.isPasteAsEnabled()))return;let t=this._editor.getModel(),n=this._editor._getViewModel(),r=this._editor.getSelections();if(!t||!n||!r?.length)return;let i={multicursorText:e.dataToCopy.multicursorText??null,pasteOnNewLine:e.dataToCopy.isFromEmptySelection,mode:null},a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(e=>!!e.prepareDocumentPaste);if(!a.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:i});return}let o=new Bc,s=a.flatMap(e=>e.copyMimeTypes??[]),c=Af();this.setCopyMetadata(e.clipboardData,{id:c,providerCopyMimeTypes:s,defaultPastePayload:i});let l=a.map(n=>({providerMimeTypes:n.copyMimeTypes,operation:At(r=>n.prepareDocumentPaste(t,e.dataToCopy.sourceRanges,o,r).catch(e=>{console.error(e)}))}));yh._currentCopyOperation?.operations.forEach(e=>e.operation.cancel()),yh._currentCopyOperation={handle:c,operations:l}}async handlePaste(e){if(this._logService.trace(`CopyPasteController#handlePaste for id : `,e.metadata?.id),!this._editor.hasTextFocus())return;let t=e.toExternalVSDataTransfer();if(!t)return;t.delete(Ch),im.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;let n=this._editor.getModel(),r=this._editor.getSelections();if(!r?.length||!n||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;let i=this.fetchCopyMetadata(e);this._logService.trace(`CopyPasteController#handlePaste with metadata : `,i?.id,` and text.length : `,e.clipboardData.getData(`text/plain`).length);let a=Array.from(e.clipboardData.files).map(e=>e.type),o=[...e.clipboardData.types,...a,...i?.providerCopyMimeTypes??[],Ao.uriList],s=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(e=>{let t=this._pasteAsActionContext?.preferred;return t&&!this.providerMatchesPreference(e,t)?!1:e.pasteMimeTypes?.some(e=>Qo(e,o))});s.length?(e.setHandled(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,s,r,t,i):this.doPasteInline(s,r,t,i,e.browserEvent)):this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(r,this._pasteAsActionContext.preferred),e.setHandled())}showPasteAsNoEditMessage(e,t){let n=`only`in t?t.only.value:`preferences`in t?t.preferences.length?t.preferences.map(e=>e.value).join(`, `):x(973,`empty`):t.providerId;im.get(this._editor)?.showMessage(x(974,`No paste edits for '{0}' found`,n),e[0].getStartPosition())}doPasteInline(e,t,n,r,i){this._logService.trace(`CopyPasteController#doPasteInline`);let a=this._editor;if(!a.hasModel())return;let o=new jd(a,3,void 0),s=At(async a=>{let c=this._editor;if(!c.hasModel())return;let l=c.getModel(),u=new F,d=u.add(new Po(a));u.add(o.token.onCancellationRequested(()=>d.cancel()));let f=d.token;try{if(await this.mergeInDataFromCopy(e,n,r,f),f.isCancellationRequested)return;let a=e.filter(e=>this.isSupportedPasteProvider(e,n));if(!a.length||a.length===1&&a[0]instanceof um)return this.applyDefaultPasteHandler(n,r,f,i);let o={triggerKind:_a.Automatic},s=await this.getPasteEdits(a,n,l,t,o,f);if(u.add(s),f.isCancellationRequested)return;if(s.edits.length===1&&s.edits[0].provider instanceof um)return this.applyDefaultPasteHandler(n,r,f,i);if(s.edits.length){let e=c.getOption(97).showPasteSelector===`afterPaste`;return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(l,s.edits),allEdits:s.edits},e,async(e,n)=>{if(!e.provider.resolveDocumentPasteEdit)return e;let r=e.provider.resolveDocumentPasteEdit(e,n),i=new wn,a=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),x(975,`Resolving paste edit for '{0}'. Click to cancel`,e.title),Fa(Promise.race([i.p,r]),n),{cancel:()=>i.cancel()},0);return a&&(e.insertText=a.insertText,e.additionalEdit=a.additionalEdit),e},f)}await this.applyDefaultPasteHandler(n,r,f,i)}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),x(976,`Running paste handlers. Click to cancel and do basic paste`),s,{cancel:async()=>{s.cancel(),o.token.isCancellationRequested||await this.applyDefaultPasteHandler(n,r,o.token,i)}}).finally(()=>{o.dispose()}),this._currentPasteOperation=s}showPasteAsPick(e,t,n,r,i){this._logService.trace(`CopyPasteController#showPasteAsPick`);let a=At(async o=>{let s=this._editor;if(!s.hasModel())return;let c=s.getModel(),l=new F,u=l.add(new jd(s,3,void 0,o));try{if(await this.mergeInDataFromCopy(t,r,i,u.token),u.token.isCancellationRequested)return;let a=t.filter(t=>this.isSupportedPasteProvider(t,r,e));e&&(a=a.filter(t=>this.providerMatchesPreference(t,e)));let o={triggerKind:_a.PasteAs,only:e&&`only`in e?e.only:void 0},s=l.add(await this.getPasteEdits(a,r,c,n,o,u.token));if(u.token.isCancellationRequested)return;if(e&&(s={edits:s.edits.filter(t=>`only`in e?e.only.contains(t.kind):`preferences`in e?e.preferences.some(e=>e.contains(t.kind)):e.providerId===t.provider.id),dispose:s.dispose}),!s.edits.length){e&&this.showPasteAsNoEditMessage(n,e);return}let d;if(e)d=s.edits.at(0);else{let e={id:`editor.pasteAs.default`,label:x(977,`Configure default paste action`),edit:void 0},t=await this._quickInputService.pick([...s.edits.map(e=>({label:e.title,description:e.kind?.value,edit:e})),...yh._configureDefaultAction?[no({type:`separator`}),{label:yh._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:x(978,`Select Paste Action`)});if(t===e){yh._configureDefaultAction?.run();return}d=t?.edit}if(!d)return;let f=Am(c.uri,n,d);await this._bulkEditService.apply(f,{editor:this._editor})}finally{l.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:x(979,`Running paste handlers`)},()=>a)}setCopyMetadata(e,t){this._logService.trace(`CopyPasteController#setCopyMetadata new id : `,t.id),e.setData(Ch,JSON.stringify(t))}fetchCopyMetadata(e){this._logService.trace(`CopyPasteController#fetchCopyMetadata`);let t=e.clipboardData.getData(Ch);if(t)try{return JSON.parse(t)}catch{return}if(e.metadata)return{defaultPastePayload:{mode:e.metadata.mode,multicursorText:e.metadata.multicursorText??null,pasteOnNewLine:!!e.metadata.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,n,r){if(this._logService.trace(`CopyPasteController#mergeInDataFromCopy with metadata : `,n?.id),n?.id&&yh._currentCopyOperation?.handle===n.id){let n=yh._currentCopyOperation.operations.filter(t=>e.some(e=>e.pasteMimeTypes.some(e=>Qo(e,t.providerMimeTypes)))).map(e=>e.operation),i=await Promise.all(n);if(r.isCancellationRequested)return;for(let e of i.reverse())if(e)for(let[n,r]of e)t.replace(n,r)}if(!t.has(Ao.uriList)){let e=await this._clipboardService.readResources();if(r.isCancellationRequested)return;e.length&&t.append(Ao.uriList,Oc(ql.create(e)))}}async getPasteEdits(e,t,n,r,i,a){let o=new F,s=await Fa(Promise.all(e.map(async e=>{try{let s=await e.provideDocumentPasteEdits?.(n,r,t,i,a);return s&&o.add(s),s?.edits?.map(t=>({...t,provider:e}))}catch(e){Vi(e)||console.error(e);return}})),a);return{edits:jm(vu(s??[]).flat().filter(e=>!i.only||i.only.contains(e.kind))),dispose:()=>o.dispose()}}async applyDefaultPasteHandler(e,t,n,r){let i=await(e.get(Ao.text)??e.get(`text`))?.asString()??``;if(n.isCancellationRequested)return;let a={clipboardEvent:r,text:i,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._logService.trace(`CopyPasteController#applyDefaultPasteHandler for id : `,t?.id),this._editor.trigger(`keyboard`,`paste`,a)}isSupportedPasteProvider(e,t,n){return e.pasteMimeTypes?.some(e=>t.matches(e))?!n||this.providerMatchesPreference(e,n):!1}providerMatchesPreference(e,t){return`only`in t?e.providedPasteEditKinds.some(e=>t.only.contains(e)):`preferences`in t?e.providedPasteEditKinds.some(e=>t.preferences.some(t=>t.contains(e))):e.id===t.providerId}getInitialActiveEditIndex(e,t){let n=this._configService.getValue(xh,{resource:e.uri});for(let e of Array.isArray(n)?n:[]){let n=new Yp(e),r=t.findIndex(e=>n.contains(e.kind));if(r>=0)return r}return 0}};wh=yh=_h([vh(1,U),vh(2,Fu),vh(3,od),vh(4,ds),vh(5,Ar),vh(6,Gi),vh(7,R),vh(8,Yd),vh(9,Iu)],wh);var Th=`9_cutcopypaste`,Eh=xa||document.queryCommandSupported&&document.queryCommandSupported(`cut`),Dh=xa||document.queryCommandSupported&&document.queryCommandSupported(`copy`),Oh=navigator.clipboard===void 0||Oo?document.queryCommandSupported&&document.queryCommandSupported(`paste`):!0;function kh(e){return e.register(),e}var Ah=Eh?kh(new il({id:`editor.action.clipboardCutAction`,precondition:void 0,kbOpts:xa?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:D.MenubarEditMenu,group:`2_ccp`,title:x(864,`Cu&&t`),order:1},{menuId:D.EditorContext,group:Th,title:x(865,`Cut`),when:E.writable,order:1},{menuId:D.CommandPalette,group:``,title:x(866,`Cut`),order:1},{menuId:D.SimpleEditorContext,group:Th,title:x(867,`Cut`),when:E.writable,order:1}]})):void 0,jh=Dh?kh(new il({id:`editor.action.clipboardCopyAction`,precondition:void 0,kbOpts:xa?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:D.MenubarEditMenu,group:`2_ccp`,title:x(868,`&&Copy`),order:2},{menuId:D.EditorContext,group:Th,title:x(869,`Copy`),order:2},{menuId:D.CommandPalette,group:``,title:x(870,`Copy`),order:1},{menuId:D.SimpleEditorContext,group:Th,title:x(871,`Copy`),order:2}]})):void 0;On.appendMenuItem(D.MenubarEditMenu,{submenu:D.MenubarCopy,title:L(876,`Copy As`),group:`2_ccp`,order:3}),On.appendMenuItem(D.EditorContext,{submenu:D.EditorContextCopy,title:L(877,`Copy As`),group:Th,order:3}),On.appendMenuItem(D.EditorContext,{submenu:D.EditorContextShare,title:L(878,`Share`),group:`11_share`,order:-1,when:w.and(w.notEquals(`resourceScheme`,`output`),E.editorTextFocus)}),On.appendMenuItem(D.ExplorerContext,{submenu:D.ExplorerContextShare,title:L(879,`Share`),group:`11_share`,order:-1});var Mh=Oh?kh(new il({id:`editor.action.clipboardPasteAction`,precondition:void 0,kbOpts:xa?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:D.MenubarEditMenu,group:`2_ccp`,title:x(872,`&&Paste`),order:4},{menuId:D.EditorContext,group:Th,title:x(873,`Paste`),when:E.writable,order:4},{menuId:D.CommandPalette,group:``,title:x(874,`Paste`),order:1},{menuId:D.SimpleEditorContext,group:Th,title:x(875,`Paste`),when:E.writable,order:4}]})):void 0,Nh=class extends W{constructor(){super({id:`editor.action.clipboardCopyWithSyntaxHighlightingAction`,label:L(880,`Copy with Syntax Highlighting`),precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,weight:100}})}run(e,t){let n=e.get(Fu),r=e.get(ds);n.trace(`ExecCommandCopyWithSyntaxHighlightingAction#run`),t.hasModel()&&(t.getOption(45)||!t.getSelection().isEmpty())&&(Fl.forceCopyWithSyntaxHighlighting=!0,t.focus(),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)`),Ph(t,r),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)`),Fl.forceCopyWithSyntaxHighlighting=!1)}};function Ph(e,t){if(Fl.electronBugWorkaroundCopyEventHasFired=!1,e.getContainerDomNode().ownerDocument.execCommand(`copy`),xa&&Fl.electronBugWorkaroundCopyEventHasFired===!1){let{dataToCopy:n}=Gs(e._getViewModel(),void 0,Oo);t.writeText(n.text)}}function Fh(e,t){e&&(e.addImplementation(1e4,`code-editor`,(e,n)=>{let r=e.get(Fu),i=e.get(ds);r.trace(`registerExecCommandImpl (addImplementation code-editor for : `,t,`)`);let a=e.get(ec).getFocusedCodeEditor();if(a&&a.hasTextFocus()&&a.hasModel()){let e=a.getOption(45),n=a.getSelection();return n&&n.isEmpty()&&!e||(a.getOption(171)&&t===`cut`?(Ih(a),r.trace(`registerExecCommandImpl (before execCommand copy)`),Ph(a,i),a.trigger(void 0,`cut`,void 0),r.trace(`registerExecCommandImpl (after execCommand copy)`)):(Ih(a),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),t===`copy`?Ph(a,i):a.getContainerDomNode().ownerDocument.execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`))),!0}return!1}),e.addImplementation(0,`generic-dom`,(e,n)=>{let r=e.get(Fu);return r.trace(`registerExecCommandImpl (addImplementation generic-dom for : `,t,`)`),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),ys().execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`),!0}))}function Ih(e){if(e.getOption(171)){let t=uf.get(e.getId());t&&t.handleWillCopy()}}Fh(Ah,`cut`),Fh(jh,`copy`),Mh&&(Mh.addImplementation(1e4,`code-editor`,(e,t)=>{let n=e.get(Fu);n.trace(`registerExecCommandImpl (addImplementation code-editor for : paste)`);let r=e.get(ec),i=e.get(ds),a=r.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(171)){let e=uf.get(a.getId());e&&e.handleWillPaste()}n.trace(`registerExecCommandImpl (before triggerPaste)`);let e=i.triggerPaste(ca().vscodeWindowId);return e?(n.trace(`registerExecCommandImpl (triggerPaste defined)`),e.then(async()=>(n.trace(`registerExecCommandImpl (after triggerPaste)`),wh.get(a)?.finishedPaste()??Promise.resolve()))):(n.trace(`registerExecCommandImpl (triggerPaste undefined)`),!un||(n.trace(`registerExecCommandImpl (Paste handling on web)`),(async()=>{let e=await i.readText();if(e!==``){let t=Fd.INSTANCE.get(e),r=!1,i=null,o=null;t&&(r=a.getOption(45)&&!!t.isFromEmptySelection,i=t.multicursorText===void 0?null:t.multicursorText,o=t.mode),n.trace(`registerExecCommandImpl (clipboardText.length : `,e.length,` id : `,t?.id,`)`),a.trigger(`keyboard`,`paste`,{text:e,pasteOnNewLine:r,multicursorText:i,mode:o})}})()))}return!1}),Mh.addImplementation(0,`generic-dom`,(e,t)=>(e.get(Fu).trace(`registerExecCommandImpl (addImplementation generic-dom for : paste)`),e.get(ds).triggerPaste(ca().vscodeWindowId)??!1))),Dh&&z(Nh);var Lh=new class{constructor(){this.QuickFix=new Yp(`quickfix`),this.Refactor=new Yp(`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 Yp(`notebook`),this.Source=new Yp(`source`),this.SourceOrganizeImports=this.Source.append(`organizeImports`),this.SourceFixAll=this.Source.append(`fixAll`),this.SurroundWith=this.Refactor.append(`surround`)}},Rh;(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`})(Rh||={});function zh(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some(n=>Vh(t,n,e.include))||!e.includeSourceActions&&Lh.Source.contains(t))}function Bh(e,t){let n=t.kind?new Yp(t.kind):void 0;return!(e.include&&(!n||!e.include.contains(n))||e.excludes&&n&&e.excludes.some(t=>Vh(n,t,e.include))||!e.includeSourceActions&&n&&Lh.Source.contains(n)||e.onlyIncludePreferredActions&&!t.isPreferred)}function Vh(e,t,n){return!(!t.contains(e)||n&&t.contains(n))}var Hh=class e{static fromUser(t,n){return!t||typeof t!=`object`?new e(n.kind,n.apply,!1):new e(e.getKindFromUser(t,n.kind),e.getApplyFromUser(t,n.apply),e.getPreferredUser(t))}static getApplyFromUser(e,t){switch(typeof e.apply==`string`?e.apply.toLowerCase():``){case`first`:return`first`;case`never`:return`never`;case`ifsingle`:return`ifSingle`;default:return t}}static getKindFromUser(e,t){return typeof e.kind==`string`?new Yp(e.kind):t}static getPreferredUser(e){return typeof e.preferred==`boolean`&&e.preferred}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}},Uh=class{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(e){tc(e)}t&&(this.action.edit=t.edit)}return this}},Wh=`editor.action.codeAction`,Gh=`editor.action.quickFix`,Kh=`editor.action.autoFix`,qh=`editor.action.refactor`,Jh=`editor.action.sourceAction`,Yh=`editor.action.organizeImports`,Xh=`editor.action.fixAll`,Zh=1e3,Qh=class e extends G{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:t},{action:n}){return t.isAI&&!n.isAI?1:!t.isAI&&n.isAI?-1:Au(t.diagnostics)?Au(n.diagnostics)?e.codeActionsPreferredComparator(t,n):-1:Au(n.diagnostics)?1:e.codeActionsPreferredComparator(t,n)}constructor(t,n,r){super(),this.documentation=n,this._register(r),this.allActions=[...t].sort(e.codeActionsComparator),this.validActions=this.allActions.filter(({action:e})=>!e.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Lh.QuickFix.contains(new Yp(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},$h={actions:[],documentation:void 0};async function eg(e,t,n,r,i,a){let o=r.filter||{},s={...o,excludes:[...o.excludes||[],Lh.Notebook]},c={only:o.include?.value,trigger:r.type},l=new Vs(t,a),u=tg(e,t,r.type===2?s:o),d=new F,f=u.map(async e=>{let r=setTimeout(()=>i.report(e),1250);try{let r=await e.provideCodeActions(t,n,c,l.token);if(l.token.isCancellationRequested)return r?.dispose(),$h;r&&d.add(r);let i=(r?.actions||[]).filter(e=>e&&Bh(o,e)),a=rg(e,i,o.include);return{actions:i.map(t=>new Uh(t,e)),documentation:a}}catch(e){if(Vi(e))throw e;return tc(e),$h}finally{clearTimeout(r)}}),p=e.onDidChange(()=>{let n=e.all(t);Pd(n,u)||l.cancel()});try{let n=await Promise.all(f),i=n.map(e=>e.actions).flat(),a=new Qh(i,[...vu(n.map(e=>e.documentation)),...ng(e,t,r,i)],d);return d.add(a),a}catch(e){throw d.dispose(),e}finally{p.dispose(),l.dispose()}}function tg(e,t,n){return e.all(t).filter(e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some(e=>zh(n,new Yp(e))))}function*ng(e,t,n,r){if(t&&r.length)for(let i of e.all(t))i._getAdditionalMenuItems&&(yield*i._getAdditionalMenuItems?.({trigger:n.type,only:n.filter?.include?.value},r.map(e=>e.action)))}function rg(e,t,n){if(!e.documentation)return;let r=e.documentation.map(e=>({kind:new Yp(e.kind),command:e.command}));if(n){let e;for(let t of r)t.kind.contains(n)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return e?.command}for(let e of t)if(e.kind){for(let t of r)if(t.kind.contains(new Yp(e.kind)))return t.command}}var ig;(function(e){e.OnSave=`onSave`,e.FromProblemsView=`fromProblemsView`,e.FromCodeActions=`fromCodeActions`,e.FromAILightbulb=`fromAILightbulb`,e.FromProblemsHover=`fromProblemsHover`})(ig||={});async function ag(e,t,n,r,i=T.None){let a=e.get(od),o=e.get(Ar),s=e.get(Ct),c=e.get(St),l=e.get(hd);if(s.publicLog2(`codeAction.applyCodeAction`,{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:n}),l.playSignal(xu.codeActionTriggered),await t.resolve(i),!i.isCancellationRequested&&(!t.action.edit?.edits.length||(await a.apply(t.action.edit,{editor:r?.editor,label:t.action.title,quotableLabel:t.action.title,code:`undoredo.codeAction`,respectAutoSaveConfig:n!==ig.OnSave,showPreview:r?.preview,reason:Ts.codeAction({kind:t.action.kind,providerId:_l.fromExtensionId(t.provider?.extensionId)})})).isApplied)){if(t.action.command)try{await o.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(e){let t=og(e);c.error(typeof t==`string`?t:x(881,`An unknown error occurred while applying the code action`))}setTimeout(()=>l.playSignal(xu.codeActionApplied),Zh)}}function og(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}Bn.registerCommand(`_executeCodeActionProvider`,async function(e,t,n,r,i){if(!(t instanceof $n))throw Ro();let{codeActionProvider:a}=e.get(R),o=e.get(ft).getModel(t);if(!o)throw Ro();let s=q.isISelection(n)?q.liftSelection(n):C.isIRange(n)?o.validateRange(n):void 0;if(!s)throw Ro();let c=typeof r==`string`?new Yp(r):void 0,l=await eg(a,o,s,{type:1,triggerAction:Rh.Default,filter:{includeSourceActions:!0,include:c}},$l.None,T.None),u=[],d=Math.min(l.validActions.length,typeof i==`number`?i:0);for(let e=0;e<d;e++)u.push(l.validActions[e].resolve(T.None));try{return await Promise.all(u),l.validActions.map(e=>e.action)}finally{setTimeout(()=>l.dispose(),100)}});var sg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},cg=function(e,t){return function(n,r){t(n,r,e)}},lg,ug=class{static{lg=this}static{this.codeActionCommands=[qh,Wh,Jh,Yh,Xh]}constructor(e){this.keybindingService=e}getResolver(){let e=new Fc(()=>this.keybindingService.getKeybindings().filter(e=>lg.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return e.command===`editor.action.organizeImports`?t={kind:Lh.SourceOrganizeImports.value}:e.command===`editor.action.fixAll`&&(t={kind:Lh.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...Hh.fromUser(t,{kind:Yp.None,apply:`never`})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;let n=new Yp(e.kind);return t.filter(e=>e.kind.contains(n)).filter(t=>!t.preferred||e.isPreferred).reduceRight((e,t)=>e?e.kind.contains(t.kind)?t:e:t,void 0)}};ug=lg=sg([cg(0,Ea)],ug),O(`symbolIcon.arrayForeground`,ii,x(1569,`The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.booleanForeground`,ii,x(1570,`The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.classForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},x(1571,`The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.colorForeground`,ii,x(1572,`The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.constantForeground`,ii,x(1573,`The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.constructorForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},x(1574,`The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.enumeratorForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},x(1575,`The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.enumeratorMemberForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},x(1576,`The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.eventForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},x(1577,`The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.fieldForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},x(1578,`The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.fileForeground`,ii,x(1579,`The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.folderForeground`,ii,x(1580,`The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.functionForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},x(1581,`The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.interfaceForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},x(1582,`The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.keyForeground`,ii,x(1583,`The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.keywordForeground`,ii,x(1584,`The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.methodForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},x(1585,`The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.moduleForeground`,ii,x(1586,`The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.namespaceForeground`,ii,x(1587,`The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.nullForeground`,ii,x(1588,`The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.numberForeground`,ii,x(1589,`The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.objectForeground`,ii,x(1590,`The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.operatorForeground`,ii,x(1591,`The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.packageForeground`,ii,x(1592,`The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.propertyForeground`,ii,x(1593,`The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.referenceForeground`,ii,x(1594,`The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.snippetForeground`,ii,x(1595,`The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.stringForeground`,ii,x(1596,`The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.structForeground`,ii,x(1597,`The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.textForeground`,ii,x(1598,`The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.typeParameterForeground`,ii,x(1599,`The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.unitForeground`,ii,x(1600,`The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.variableForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},x(1601,`The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`));var dg=Object.freeze({kind:Yp.Empty,title:x(917,`More Actions...`)}),fg=Object.freeze([{kind:Lh.QuickFix,title:x(918,`Quick Fix`)},{kind:Lh.RefactorExtract,title:x(919,`Extract`),icon:k.wrench},{kind:Lh.RefactorInline,title:x(920,`Inline`),icon:k.wrench},{kind:Lh.RefactorRewrite,title:x(921,`Rewrite`),icon:k.wrench},{kind:Lh.RefactorMove,title:x(922,`Move`),icon:k.wrench},{kind:Lh.SurroundWith,title:x(923,`Surround With`),icon:k.surroundWith},{kind:Lh.Source,title:x(924,`Source Action`),icon:k.symbolFile},dg]);function pg(e,t,n){if(!t)return e.map(e=>({kind:`action`,item:e,group:dg,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!e.action.edit?.edits.length}));let r=fg.map(e=>({group:e,actions:[]}));for(let t of e){let e=t.action.kind?new Yp(t.action.kind):Yp.None;for(let n of r)if(n.group.kind.contains(e)){n.actions.push(t);break}}let i=[];for(let e of r)if(e.actions.length){i.push({kind:`header`,group:e.group});for(let t of e.actions){let r=e.group;i.push({kind:`action`,item:t,group:t.action.isAI?{title:r.title,kind:r.kind,icon:k.sparkle}:r,label:t.action.title,disabled:!!t.action.disabled,keybinding:n(t.action)})}}return i}var mg=new j(`supportedCodeAction`,``),hg=class extends G{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new ea),this.ignoreLightbulbOff=!1,this._register(this._markerService.onMarkerChanged(e=>this._onMarkerChanges(e))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){let t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){let t=this._editor.getModel();t&&e.some(e=>Gt(e,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Rh.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;let t=this._editor.getSelection();if(e.type===1)return t;let n=this._editor.getOption(73).enabled;if(n!==mt.Off||this.ignoreLightbulbOff){if(n===mt.Off||n===mt.On)return t;if(n===mt.OnCode){if(!t.isEmpty())return t;let e=this._editor.getModel(),{lineNumber:n,column:r}=t.getPosition(),i=e.getLineContent(n);if(i.length===0)return;if(r===1){if(/\s/.test(i[0]))return}else if(r===e.getLineMaxColumn(n)){if(/\s/.test(i[i.length-1]))return}else if(/\s/.test(i[r-2])&&/\s/.test(i[r-1]))return}return t}}},gg;(function(e){e.Empty={type:0};class t{constructor(e,t,n){this.trigger=e,this.position=t,this._cancellablePromise=n,this.type=1,this.actions=n.catch(e=>{if(Vi(e))return _g;throw e})}cancel(){this._cancellablePromise.cancel()}}e.Triggered=t})(gg||={});var _g=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),vg=class extends G{constructor(e,t,n,r,i,a){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=i,this._configurationService=a,this._codeActionOracle=this._register(new pc),this._state=gg.Empty,this._onDidChangeState=this._register(new N),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new pc),this._disposed=!1,this._ignoreLightbulbOff=!1,this._supportedCodeActions=mg.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(gg.Empty,!0))}_settingEnabledNearbyQuickfixes(){let e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue(`editor.codeActionWidget.includeNearbyQuickFixes`,{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(gg.Empty),this.codeActionsDisposable.clear();let e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){let t=this._registry.all(e).flatMap(e=>e.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(` `));let n=new hg(this._editor,this._markerService,t=>{if(!t){this.setState(gg.Empty);return}let n=t.selection.getStartPosition(),r=At(async n=>{if(this._settingEnabledNearbyQuickfixes()&&t.trigger.type===1&&(t.trigger.triggerAction===Rh.QuickFix||t.trigger.filter?.include?.contains(Lh.QuickFix))){let r=new F,i=!1;try{let a=r.add(await eg(this._registry,e,t.selection,t.trigger,$l.None,n)),o=[...a.allActions];if(n.isCancellationRequested)return _g;let s=a.validActions?.some(e=>e.action.kind&&Lh.QuickFix.contains(new Yp(e.action.kind))&&!e.action.isAI),c=this._markerService.read({resource:e.uri});if(s){for(let e of a.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...c.filter(e=>e.relatedInformation)]);let e=this._setCodeActions({validActions:a.validActions,allActions:o,documentation:a.documentation,hasAutoFix:a.hasAutoFix,hasAIFix:a.hasAIFix,allAIFixes:a.allAIFixes,dispose:()=>r.dispose()});return i=!0,e}if(!s&&c.length>0){let s=t.selection.getPosition(),l=s,u=Number.MAX_VALUE,d=[...a.validActions];for(let i of c){let f=i.endColumn,p=i.endLineNumber,m=i.startLineNumber;if(p===s.lineNumber||m===s.lineNumber){l=new A(p,f);let i={type:t.trigger.type,triggerAction:t.trigger.triggerAction,filter:{include:t.trigger.filter?.include?t.trigger.filter?.include:Lh.QuickFix},autoApply:t.trigger.autoApply,context:{notAvailableMessage:t.trigger.context?.notAvailableMessage||``,position:l}},m=new q(l.lineNumber,l.column,l.lineNumber,l.column),h=r.add(await eg(this._registry,e,m,i,$l.None,n));if(n.isCancellationRequested)return _g;if(h.validActions.length!==0){for(let e of h.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...c.filter(e=>e.relatedInformation)]);a.allActions.length===0&&o.push(...h.allActions),Math.abs(s.column-f)<u?d.unshift(...h.validActions):d.push(...h.validActions)}u=Math.abs(s.column-f)}}let f=d.filter((e,t,n)=>n.findIndex(t=>t.action.title===e.action.title)===t);f.sort((e,t)=>e.action.isPreferred&&!t.action.isPreferred?-1:!e.action.isPreferred&&t.action.isPreferred||e.action.isAI&&!t.action.isAI?1:!e.action.isAI&&t.action.isAI?-1:0);let p=this._setCodeActions({validActions:f,allActions:o,documentation:a.documentation,hasAutoFix:a.hasAutoFix,hasAIFix:a.hasAIFix,allAIFixes:a.allAIFixes,dispose:()=>r.dispose()});return i=!0,p}}finally{i||r.dispose()}}if(t.trigger.type===1){let r=await eg(this._registry,e,t.selection,t.trigger,$l.None,n);return n.isCancellationRequested?(r.dispose(),_g):this._setCodeActions(r)}let r=await eg(this._registry,e,t.selection,t.trigger,$l.None,n);return n.isCancellationRequested?(r.dispose(),_g):this._setCodeActions(r)});t.trigger.type===1&&this._progressService?.showWhile(r,250);let i=new gg.Triggered(t.trigger,n,r),a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&i.type===1&&i.trigger.type===2&&this._state.position!==i.position),a?setTimeout(()=>{this.setState(i)},500):this.setState(i)},void 0);n.ignoreLightbulbOff=this._ignoreLightbulbOff,this._codeActionOracle.value=n,this._codeActionOracle.value.trigger({type:2,triggerAction:Rh.Default})}else this._supportedCodeActions.reset()}_setCodeActions(e){return this.codeActionsDisposable.value=e,e}takeCodeActions(e){if(this.codeActionsDisposable.value===e)return this.codeActionsDisposable.clearAndLeak(),e}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.clear()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}},yg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},bg=function(e,t){return function(n,r){t(n,r,e)}},xg,Sg=Nr(`gutter-lightbulb`,k.lightBulb,x(925,`Icon which spawns code actions menu from the gutter when there is no space in the editor.`)),Cg=Nr(`gutter-lightbulb-auto-fix`,k.lightbulbAutofix,x(926,`Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.`)),wg=Nr(`gutter-lightbulb-sparkle`,k.lightbulbSparkle,x(927,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.`)),Tg=Nr(`gutter-lightbulb-aifix-auto-fix`,k.lightbulbSparkleAutofix,x(928,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.`)),Eg=Nr(`gutter-lightbulb-sparkle-filled`,k.sparkleFilled,x(929,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.`)),Dg;(function(e){e.Hidden={type:0};class t{constructor(e,t,n,r){this.actions=e,this.trigger=t,this.editorPosition=n,this.widgetPosition=r,this.type=1}}e.Showing=t})(Dg||={});function Og(e,t,n,r,i=!1){if(e.validActions.length<=0)return;let a,o=!1;e.allAIFixes?(a=i?Eg:k.sparkleFilled,e.validActions.length===1&&(o=!0)):a=e.hasAutoFix?e.hasAIFix?i?Tg:k.lightbulbSparkleAutofix:i?Cg:k.lightbulbAutofix:e.hasAIFix?i?wg:k.lightbulbSparkle:i?Sg:k.lightBulb;let s;return s=o?x(930,`Run: {0}`,e.validActions[0].action.title):e.hasAutoFix&&n?x(931,`Show Code Actions. Preferred Quick Fix Available ({0})`,n):!e.hasAutoFix&&r?x(932,`Show Code Actions ({0})`,r):x(933,`Show Code Actions`),{actions:e,trigger:t,icon:a,autoRun:o,title:s,isGutter:i}}var kg=class extends G{static{xg=this}static{this.GUTTER_DECORATION=P.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:V.asClassName(k.lightBulb),glyphMargin:{position:or.Left},stickiness:1})}static{this.ID=`editor.contrib.lightbulbWidget`}static{this._posPref=[0]}static _computeLightBulbInfo(e,t,n,r){if(e.type===1)return Og(e.actions,e.trigger,n,r,t)}constructor(e,t){super(),this._editor=e,this._keybindingService=t,this.onlyWithEmptySelection=!1,this._onClick=this._register(new N),this.onClick=this._onClick.event,this._state=us(this,Dg.Hidden),this._gutterState=us(this,Dg.Hidden),this._combinedInfo=B(this,e=>{let t=this._gutterState.read(e);if(t.type===1)return xg._computeLightBulbInfo(t,!0,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e));let n=this._state.read(e);if(n.type===1)return xg._computeLightBulbInfo(n,!1,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e))}),this._iconClasses=[],this.lightbulbClasses=[`codicon-`+Sg.id,`codicon-`+Tg.id,`codicon-`+Cg.id,`codicon-`+wg.id,`codicon-`+Eg.id],this._preferredKbLabel=us(this,void 0),this._quickFixKbLabel=us(this,void 0),this.gutterDecoration=xg.GUTTER_DECORATION,this._domNode=M(`div.lightBulbWidget`),this._domNode.role=`listbox`,this._register(dn.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(e=>{let t=this._editor.getModel(),n=this._state.get();(n.type!==1||!t||n.editorPosition.lineNumber>=t.getLineCount())&&this.hide();let r=this._gutterState.get();(r.type!==1||!t||r.editorPosition.lineNumber>=t.getLineCount())&&this.gutterHide()})),this._register(Tc(this._domNode,e=>{let t=this._state.get();if(t.type!==1)return;this._editor.focus(),e.preventDefault();let{top:n,height:r}=ba(this._domNode),i=this._editor.getOption(75),a=Math.floor(i/3);t.widgetPosition.position!==null&&t.widgetPosition.position.lineNumber<t.editorPosition.lineNumber&&(a+=i),this._onClick.fire({x:e.posx,y:n+r+a,actions:t.actions,trigger:t.trigger})})),this._register(I(this._domNode,`mouseenter`,e=>{(e.buttons&1)==1&&this.hide()})),this._register(_u.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.autoFix`)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.quickFix`)?.getLabel()??void 0,void 0)})),this._register(Il(e=>{let t=this._combinedInfo.read(e);this._updateLightBulbTitleAndIcon(t),this._updateGutterDecorationOptions(t)})),this._register(this._editor.onMouseDown(async e=>{if(!e.target.element||!this.lightbulbClasses.some(t=>e.target.element&&e.target.element.classList.contains(t)))return;let t=this._gutterState.get();if(t.type!==1)return;this._editor.focus();let{top:n,height:r}=ba(e.target.element),i=this._editor.getOption(75),a=Math.floor(i/3);t.widgetPosition.position!==null&&t.widgetPosition.position.lineNumber<t.editorPosition.lineNumber&&(a+=i),this._onClick.fire({x:e.event.posx,y:n+r+a,actions:t.actions,trigger:t.trigger})}))}dispose(){super.dispose(),this._editor.removeContentWidget(this),this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID)}getId(){return`LightBulbWidget`}getDomNode(){return this._domNode}getPosition(){let e=this._state.get();return e.type===1?e.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0||this.onlyWithEmptySelection&&!this._editor.getSelection()?.isEmpty()||!this._editor.hasTextFocus()||this._editor.getOptions().get(73).enabled===mt.Off)return this.gutterHide(),this.hide();let r=this._editor.getModel();if(!r)return this.gutterHide(),this.hide();let{lineNumber:i,column:a}=r.validatePosition(n),o=r.getOptions().tabSize,s=this._editor.getOptions().get(59),c=r.getLineContent(i),l=ra(c,o),u=s.spaceWidth*l>22,d=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1),f=this._editor.getLineDecorations(i),p=!1;if(f)for(let e of f){let t=e.options.glyphMarginClassName;if(t&&!this.lightbulbClasses.some(e=>t.includes(e))){p=!0;break}}let m=i,h=1;if(!u){let o=e=>{let t=r.getLineContent(e);return/^\s*$|^\s+/.test(t)||t.length<=h};if(i>1&&!d(i-1)){let a=i===r.getLineCount(),s=i>1&&o(i-1),c=!a&&o(i+1),l=o(i),u=!c&&!s;if(!c&&!s&&!p)return this._gutterState.set(new Dg.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:xg._posPref}),void 0),this.renderGutterLightbub(),this.hide();s||a||s&&!l?--m:(c||u&&l)&&(m+=1)}else if(i===1&&(i===r.getLineCount()||!o(i+1)&&!o(i))){if(this._gutterState.set(new Dg.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:xg._posPref}),void 0),p)this.gutterHide();else return this.renderGutterLightbub(),this.hide()}else if(i<r.getLineCount()&&!d(i+1))m+=1;else if(a*s.spaceWidth<22)return this.hide();h=/^\S\s*$/.test(r.getLineContent(m))?2:1}this._state.set(new Dg.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:xg._posPref}),void 0),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());let g=e.validActions;e.validActions[0].action.kind,g.length,this._editor.layoutContentWidget(this)}hide(){this._state.get()!==Dg.Hidden&&(this._state.set(Dg.Hidden,void 0),this._editor.layoutContentWidget(this))}gutterHide(){this._gutterState.get()!==Dg.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this._gutterState.set(Dg.Hidden,void 0))}_updateLightBulbTitleAndIcon(e){this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],e&&!e.isGutter&&(this._domNode.title=e.title,this._iconClasses=V.asClassNameArray(e.icon),this._domNode.classList.add(...this._iconClasses))}_updateGutterDecorationOptions(e){e&&e.isGutter&&(this.gutterDecoration=P.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:V.asClassName(e.icon),glyphMargin:{position:or.Left},stickiness:1}))}renderGutterLightbub(){let e=this._editor.getSelection();e&&(this._gutterDecorationID===void 0?this._addGutterDecoration(e.startLineNumber):this._updateGutterDecoration(this._gutterDecorationID,e.startLineNumber))}_addGutterDecoration(e){this._editor.changeDecorations(t=>{this._gutterDecorationID=t.addDecoration(new C(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(n=>{n.changeDecoration(e,new C(t,0,t,0)),n.changeDecorationOptions(e,this.gutterDecoration)})}};kg=xg=yg([bg(1,Ea)],kg);var Ag=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},jg=function(e,t){return function(n,r){t(n,r,e)}},Mg,Ng=`quickfix-edit-highlight`,Pg=class extends G{static{Mg=this}static{this.ID=`editor.contrib.codeActionController`}static get(e){return e.getContribution(Mg.ID)}constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(),this._commandService=o,this._configurationService=s,this._actionWidgetService=c,this._instantiationService=l,this._progressService=u,this._keybindingService=d,this._activeCodeActions=this._register(new pc),this._showDisabled=!1,this._disposed=!1,this._onlyLightBulbWithEmptySelection=!1,this._lightBulbInfoObs=us(this,void 0),this._preferredKbLabel=us(this,void 0),this._quickFixKbLabel=us(this,void 0),this._editor=e,this._model=this._register(new vg(this._editor,i.codeActionProvider,t,n,a,s)),this._register(this._model.onDidChangeState(e=>this.update(e))),this._register(_u.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.autoFix`)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.quickFix`)?.getLabel()??void 0,void 0)})),this._lightBulbWidget=new Fc(()=>{let e=this._editor.getContribution(kg.ID);return e&&(this._register(e.onClick(e=>this.showCodeActionsFromLightbulb(e.actions,e))),e.onlyWithEmptySelection=this._onlyLightBulbWithEmptySelection),e}),this._resolver=r.createInstance(ug),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){let t=e.validActions[0],n=t.action.command;n&&n.id===`inlineChat.start`&&n.arguments&&n.arguments.length>=1&&n.arguments[0]&&(n.arguments[0]={...n.arguments[0],autoSend:!1}),await this.applyCodeAction(t,!1,!1,ig.FromAILightbulb)}else await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,r){if(!this._editor.hasModel())return;im.get(this._editor)?.closeMessage();let i=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:r,context:{notAvailableMessage:e,position:i}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,n,r){let i=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(ag,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Rh.QuickFix,filter:{}}),i.done()}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==1){this.hideLightBulbWidget(),this._lightBulbInfoObs.set(void 0,void 0);return}let t;try{t=this._model.takeCodeActions(await e.actions)}catch(e){ot(e);return}if(t){if(this._disposed)t.dispose();else if(this._editor.getSelection()?.startLineNumber!==e.position.lineNumber)t.dispose();else if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),this._lightBulbInfoObs.set(Og(t,e.trigger,this._preferredKbLabel.get(),this._quickFixKbLabel.get()),void 0),e.trigger.type===1){if(e.trigger.filter?.include){let n=this.tryGetValidActionToApply(e.trigger,t);if(n){try{this.hideLightBulbWidget(),await this.applyCodeAction(n,!1,!1,ig.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){let n=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(n&&n.action.disabled){im.get(this._editor)?.showMessage(n.action.disabled,e.trigger.context.position),t.dispose();return}}}let n=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!n&&!t.validActions.length)){im.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:n,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply===`first`&&t.validActions.length===0||e.autoApply===`ifSingle`&&t.allActions.length===1))return t.allActions.find(({action:e})=>e.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply===`first`&&t.validActions.length>0||e.autoApply===`ifSingle`&&t.validActions.length===1))return t.validActions[0]}static{this.DECORATION=P.register({description:`quickfix-highlight`,className:Ng})}async showCodeActionList(e,t,n){let r=this._editor.createDecorationsCollection(),i=this._editor.getDomNode();if(!i)return;let a=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!a.length)return;let o=A.isIPosition(t)?this.toCoords(t):t;this._actionWidgetService.show(`codeActionWidget`,!0,pg(a,this._shouldShowHeaders(),this._resolver.getResolver()),{onSelect:async(e,t)=>{this.applyCodeAction(e,!0,!!t,n.fromLightbulb?ig.FromAILightbulb:ig.FromCodeActions),this._actionWidgetService.hide(!1),r.clear()},onHide:e=>{this._editor?.focus(),r.clear()},onHover:async(e,t)=>{if(t.isCancellationRequested)return;let n=!1,r=e.action.kind;if(r){let e=new Yp(r);n=[Lh.RefactorExtract,Lh.RefactorInline,Lh.RefactorRewrite,Lh.RefactorMove,Lh.Source].some(t=>t.contains(e))}return{canPreview:n||!!e.action.edit?.edits.length}},onFocus:e=>{if(e&&e.action){let t=e.action.ranges,n=e.action.diagnostics;if(r.clear(),t&&t.length>0){let e=n&&n?.length>1?n.map(e=>({range:e,options:Mg.DECORATION})):t.map(e=>({range:e,options:Mg.DECORATION}));r.set(e)}else if(n&&n.length>0){let e=n.map(e=>({range:e,options:Mg.DECORATION}));r.set(e);let t=n[0];if(t.startLineNumber&&t.startColumn){let e=this._editor.getModel()?.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn})?.word;fo(x(914,`Context: {0} at line {1} and column {2}.`,e,t.startLineNumber,t.startColumn))}}}else r.clear()}},o,i,this._getActionBarActions(e,t,n))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();let t=this._editor.getScrolledVisiblePosition(e),n=ba(this._editor.getDomNode());return{x:n.left+t.left,y:n.top+t.top+t.height}}_shouldShowHeaders(){let e=this._editor?.getModel();return this._configurationService.getValue(`editor.codeActionWidget.showHeaders`,{resource:e?.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];let r=e.documentation.map(e=>({id:e.id,label:e.title,tooltip:e.tooltip??``,class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(e.id,...e.arguments??[])}));return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:`hideMoreActions`,label:x(915,`Hide Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:`showMoreActions`,label:x(916,`Show Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};Pg=Mg=Ag([jg(1,Pc),jg(2,za),jg(3,U),jg(4,R),jg(5,xc),jg(6,Ar),jg(7,Gi),jg(8,lh),jg(9,U),jg(10,xc),jg(11,Ea)],Pg),Ra((e,t)=>{((e,n)=>{n&&t.addRule(`.monaco-editor ${e} { background-color: ${n}; }`)})(`.quickfix-edit-highlight`,e.getColor(Xu));let n=e.getColor(Yc);n&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${vt(e.type)?`dotted`:`solid`} ${n}; box-sizing: border-box; }`)});function Fg(e){return w.regex(mg.keys()[0],RegExp(`(\\s|^)`+sd(e.value)+`\\b`))}var Ig={type:`object`,defaultSnippets:[{body:{kind:``}}],properties:{kind:{type:`string`,description:x(882,`Kind of the code action to run.`)},apply:{type:`string`,description:x(883,`Controls when the returned actions are applied.`),default:`ifSingle`,enum:[`first`,`ifSingle`,`never`],enumDescriptions:[x(884,`Always apply the first returned code action.`),x(885,`Apply the first returned code action if it is the only one.`),x(886,`Do not apply the returned code actions.`)]},preferred:{type:`boolean`,default:!1,description:x(887,`Controls if only preferred code actions should be returned.`)}}};function Lg(e,t,n,r,i=Rh.Default){e.hasModel()&&Pg.get(e)?.manualTriggerAtCurrentPosition(t,i,n,r)}var Rg=class extends du{constructor(){super({id:Gh,title:L(904,`Quick Fix...`),precondition:w.and(E.writable,E.hasCodeActionsProvider),icon:k.lightBulb,f1:!0,keybinding:{when:E.textInputFocus,primary:2137,weight:100},menu:{id:D.InlineChatEditorAffordance,group:`1_quickfix`,order:0,when:w.and(E.writable,E.hasCodeActionsProvider)}})}runEditorCommand(e,t){return Lg(t,x(888,`No code actions available`),void 0,void 0,Rh.QuickFix)}},zg=class extends ad{constructor(){super({id:Wh,precondition:w.and(E.writable,E.hasCodeActionsProvider),metadata:{description:`Trigger a code action`,args:[{name:`args`,schema:Ig}]}})}runEditorCommand(e,t,n){let r=Hh.fromUser(n,{kind:Yp.Empty,apply:`ifSingle`});return Lg(t,typeof n?.kind==`string`?r.preferred?x(889,`No preferred code actions for '{0}' available`,n.kind):x(890,`No code actions for '{0}' available`,n.kind):r.preferred?x(891,`No preferred code actions available`):x(892,`No code actions available`),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}},Bg=class extends W{constructor(){super({id:qh,label:L(905,`Refactor...`),precondition:w.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:`1_modification`,order:2,when:w.and(E.writable,Fg(Lh.Refactor))},metadata:{description:`Refactor...`,args:[{name:`args`,schema:Ig}]}})}run(e,t,n){let r=Hh.fromUser(n,{kind:Lh.Refactor,apply:`never`});return Lg(t,typeof n?.kind==`string`?r.preferred?x(893,`No preferred refactorings for '{0}' available`,n.kind):x(894,`No refactorings for '{0}' available`,n.kind):r.preferred?x(895,`No preferred refactorings available`):x(896,`No refactorings available`),{include:Lh.Refactor.contains(r.kind)?r.kind:Yp.None,onlyIncludePreferredActions:r.preferred},r.apply,Rh.Refactor)}},Vg=class extends W{constructor(){super({id:Jh,label:L(906,`Source Action...`),precondition:w.and(E.writable,E.hasCodeActionsProvider),contextMenuOpts:{group:`1_modification`,order:2.1,when:w.and(E.writable,Fg(Lh.Source))},metadata:{description:`Source Action...`,args:[{name:`args`,schema:Ig}]}})}run(e,t,n){let r=Hh.fromUser(n,{kind:Lh.Source,apply:`never`});return Lg(t,typeof n?.kind==`string`?r.preferred?x(897,`No preferred source actions for '{0}' available`,n.kind):x(898,`No source actions for '{0}' available`,n.kind):r.preferred?x(899,`No preferred source actions available`):x(900,`No source actions available`),{include:Lh.Source.contains(r.kind)?r.kind:Yp.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Rh.SourceAction)}},Hg=class extends W{constructor(){super({id:Yh,label:L(907,`Organize Imports`),precondition:w.and(E.writable,Fg(Lh.SourceOrganizeImports)),kbOpts:{kbExpr:E.textInputFocus,primary:1581,weight:100},metadata:{description:L(908,`Organize imports in the current file. Also called 'Optimize Imports' by some tools`)}})}run(e,t){return Lg(t,x(901,`No organize imports action available`),{include:Lh.SourceOrganizeImports,includeSourceActions:!0},`ifSingle`,Rh.OrganizeImports)}},Ug=class extends W{constructor(){super({id:Xh,label:L(909,`Fix All`),precondition:w.and(E.writable,Fg(Lh.SourceFixAll))})}run(e,t){return Lg(t,x(902,`No fix all action available`),{include:Lh.SourceFixAll,includeSourceActions:!0},`ifSingle`,Rh.FixAll)}},Wg=class extends W{constructor(){super({id:Kh,label:L(910,`Auto Fix...`),precondition:w.and(E.writable,Fg(Lh.QuickFix)),kbOpts:{kbExpr:E.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Lg(t,x(903,`No auto fixes available`),{include:Lh.QuickFix,onlyIncludePreferredActions:!0},`ifSingle`,Rh.AutoFix)}};Rs(Pg.ID,Pg,3),Rs(kg.ID,kg,4),ia(Rg),z(Bg),z(Vg),z(Hg),z(Wg),z(Ug),H(new zg),Pt.as(Gu.Configuration).registerConfiguration({...kd,properties:{"editor.codeActionWidget.showHeaders":{type:`boolean`,scope:6,description:x(911,`Enable/disable showing group headers in the Code Action menu.`),default:!0}}}),Pt.as(Gu.Configuration).registerConfiguration({...kd,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:`boolean`,scope:6,description:x(912,`Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.`),default:!0}}}),Pt.as(Gu.Configuration).registerConfiguration({...kd,properties:{"editor.codeActions.triggerOnFocusChange":{type:`boolean`,scope:6,markdownDescription:x(913,`Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.`,"`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});var Gg=class e{constructor(){this.lenses=[]}static{this.Empty=new e}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){Ec(e)&&(this._store??=new F,this._store.add(e));for(let n of e.lenses)this.lenses.push({symbol:n,provider:t})}};async function Kg(e,t,n){let r=e.ordered(t),i=new Map,a=new Gg,o=r.map(async(e,r)=>{i.set(e,r);try{let r=await Promise.resolve(e.provideCodeLenses(t,n));r&&a.add(r,e)}catch(e){tc(e)}});return await Promise.all(o),n.isCancellationRequested?(a.dispose(),Gg.Empty):(a.lenses=a.lenses.sort((e,t)=>e.symbol.range.startLineNumber<t.symbol.range.startLineNumber?-1:e.symbol.range.startLineNumber>t.symbol.range.startLineNumber?1:i.get(e.provider)<i.get(t.provider)?-1:i.get(e.provider)>i.get(t.provider)?1:e.symbol.range.startColumn<t.symbol.range.startColumn?-1:+(e.symbol.range.startColumn>t.symbol.range.startColumn)),a)}Bn.registerCommand(`_executeCodeLensProvider`,function(e,...t){let[n,r]=t;nr($n.isUri(n)),nr(typeof r==`number`||!r);let{codeLensProvider:i}=e.get(R),a=e.get(ft).getModel(n);if(!a)throw Ro();let o=[],s=new F;return Kg(i,a,T.None).then(e=>{s.add(e);let t=[];for(let n of e.lenses)r==null||n.symbol.command?o.push(n.symbol):r-->0&&n.provider.resolveCodeLens&&t.push(Promise.resolve(n.provider.resolveCodeLens(a,n.symbol,T.None)).then(e=>o.push(e||n.symbol)));return Promise.all(t)}).then(()=>o).finally(()=>{setTimeout(()=>s.dispose(),100)})});var qg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Jg=function(e,t){return function(n,r){t(n,r,e)}},Yg=ru(`ICodeLensCache`),Xg=class{constructor(e,t){this.lineCount=e,this.data=t}},Zg=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw Error(`not supported`)}},this._cache=new Ci(20,.75),Ma(ef,()=>e.remove(`codelens/cache`,1));let t=`codelens/cache2`,n=e.get(t,1,`{}`);this._deserialize(n);let r=_u.filter(e.onWillSaveState,e=>e.reason===es.SHUTDOWN);_u.once(r)(n=>{e.store(t,this._serialize(),1,1)})}put(e,t){let n=t.lenses.map(e=>({range:e.symbol.range,command:e.symbol.command&&{id:``,title:e.symbol.command?.title}})),r=new Gg;r.add({lenses:n},this._fakeProvider);let i=new Xg(e.getLineCount(),r);this._cache.set(e.uri.toString(),i)}get(e){let t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){let e=Object.create(null);for(let[t,n]of this._cache){let r=new Set;for(let e of n.data.lenses)r.add(e.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{let t=JSON.parse(e);for(let e in t){let n=t[e],r=[];for(let e of n.lines)r.push({range:new C(e,1,e,11)});let i=new Gg;i.add({lenses:r},this._fakeProvider),this._cache.set(e,new Xg(n.lineCount,i))}}catch{}}};Zg=qg([Jg(0,Ac)],Zg),vo(Yg,Zg,1);var Qg=class{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement(`div`)}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute(`monaco-visible-view-zone`)}},$g=class e{static{this._idPool=0}constructor(t,n){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=t,this._id=`codelens.widget-${e._idPool++}`,this.updatePosition(n),this._domNode=document.createElement(`span`),this._domNode.className=`codelens-decoration`}withCommands(t,n){this._commands.clear();let r=[],i=!1;for(let n=0;n<t.length;n++){let a=t[n];if(a&&(i=!0,a.command)){let i=fl(a.command.title.trim());if(a.command.id){let t=`c${e._idPool++}`;r.push(M(`a`,{id:t,title:a.command.tooltip,role:`button`},...i)),this._commands.set(t,a.command)}else r.push(M(`span`,{title:a.command.tooltip},...i));n+1<t.length&&r.push(M(`span`,void 0,`\xA0|\xA0`))}}i?(Wa(this._domNode,...r),this._isEmpty&&n&&this._domNode.classList.add(`fadein`),this._isEmpty=!1):Wa(this._domNode,M(`span`,void 0,`no commands`))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){let t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}},e_=class{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){let t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let e=0,n=t.length;e<n;e++)this._addDecorationsCallbacks[e](t[e])}},t_=P.register({collapseOnReplaceEdit:!0,description:`codelens`}),n_=class{constructor(e,t,n,r,i,a){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let o,s=[];this._data.forEach((e,t)=>{e.symbol.command&&s.push(e.symbol),n.addDecoration({range:e.symbol.range,options:t_},e=>this._decorationIds[t]=e),o=o?C.plusRange(o,e.symbol.range):C.lift(e.symbol.range)}),this._viewZone=new Qg(o.startLineNumber-1,i,a),this._viewZoneId=r.addZone(this._viewZone),s.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(s,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new $g(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&=(this._editor.removeContentWidget(this._contentWidget),void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{let n=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(n&&C.isEmpty(r.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((e,n)=>{t.addDecoration({range:e.symbol.range,options:t_},e=>this._decorationIds[n]=e)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){let n=e.getDecorationRange(this._decorationIds[t]);n&&(this._data[t].symbol.range=n)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){let n=e[t];if(n){let{symbol:e}=this._data[t];e.command=n.command||e.command}}}getCommand(e){return this._contentWidget?.getCommand(e)}getLineNumber(){let e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){let t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}},r_=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},i_=function(e,t){return function(n,r){t(n,r,e)}},a_=class{static{this.ID=`css.editor.codeLens`}constructor(e,t,n,r,i,a){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=i,this._codeLensCache=a,this._disposables=new F,this._localToDispose=new F,this._lenses=[],this._oldCodeLensModels=new F,this._provideCodeLensDebounce=n.for(t.codeLensProvider,`CodeLensProvide`,{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,`CodeLensResolve`,{min:250,salt:`resolve`}),this._resolveCodeLensesScheduler=new Rr(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(e=>{(e.hasChanged(59)||e.hasChanged(25)||e.hasChanged(24))&&this._updateLensStyle(),e.hasChanged(23)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._resolveCodeLensesScheduler.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){let e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61)),t=this._editor.getOption(25);return(!t||t<5)&&(t=this._editor.getOption(61)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){let{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(24),r=this._editor.getOption(59),{style:i}=this._editor.getContainerDomNode();i.setProperty(`--vscode-editorCodeLens-lineHeight`,`${e}px`),i.setProperty(`--vscode-editorCodeLens-fontSize`,`${t}px`),i.setProperty(`--vscode-editorCodeLens-fontFeatureSettings`,r.fontFeatureSettings),n&&(i.setProperty(`--vscode-editorCodeLens-fontFamily`,n),i.setProperty(`--vscode-editorCodeLens-fontFamilyDefault`,Qu.fontFamily)),this._editor.changeViewZones(t=>{for(let n of this._lenses)n.updateHeight(e,t)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();let e=this._editor.getModel();if(!e||!this._editor.getOption(23)||e.isTooLargeForTokenization())return;let t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&qa(()=>{let n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},3e4,this._localToDispose);return}for(let t of this._languageFeaturesService.codeLensProvider.all(e))if(typeof t.onDidChange==`function`){let e=t.onDidChange(()=>n.schedule());this._localToDispose.add(e)}let n=new Rr(()=>{let t=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=At(t=>Kg(this._languageFeaturesService.codeLensProvider,e,t)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);let i=this._provideCodeLensDebounce.update(e,Date.now()-t);n.delay=i,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},ot)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(Xo(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let n=[],r=-1;this._lenses.forEach(e=>{!e.isValid()||r===e.getLineNumber()?n.push(e):(e.update(t),r=e.getLineNumber())});let i=new e_;n.forEach(e=>{e.dispose(i,t),this._lenses.splice(this._lenses.indexOf(e),1)}),i.commit(e)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Xo(()=>{if(this._editor.getModel()){let e=ht.capture(this._editor);this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{this._disposeAllLenses(e,t)})}),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(e=>{if(e.target.type!==9)return;let t=e.target.element;if(t?.tagName===`SPAN`&&(t=t.parentElement),t?.tagName===`A`)for(let e of this._lenses){let n=e.getCommand(t);if(n){this._commandService.executeCommand(n.id,...n.arguments||[]).catch(e=>this._notificationService.error(e));break}}})),n.schedule()}_disposeAllLenses(e,t){let n=new e_;for(let e of this._lenses)e.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t=this._editor.getModel().getLineCount(),n=[],r;for(let i of e.lenses){let e=i.symbol.range.startLineNumber;e<1||e>t||(r&&r[r.length-1].symbol.range.startLineNumber===e?r.push(i):(r=[i],n.push(r)))}if(!n.length&&!this._lenses.length)return;let i=ht.capture(this._editor),a=this._getLayoutInfo();this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let r=new e_,i=0,o=0;for(;o<n.length&&i<this._lenses.length;){let e=n[o][0].symbol.range.startLineNumber,s=this._lenses[i].getLineNumber();s<e?(this._lenses[i].dispose(r,t),this._lenses.splice(i,1)):s===e?(this._lenses[i].updateCodeLensSymbols(n[o],r),o++,i++):(this._lenses.splice(i,0,new n_(n[o],this._editor,r,t,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),i++,o++)}for(;i<this._lenses.length;)this._lenses[i].dispose(r,t),this._lenses.splice(i,1);for(;o<n.length;)this._lenses.push(new n_(n[o],this._editor,r,t,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),o++;r.commit(e)})}),i.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;let e=this._editor.getModel();if(!e)return;let t=[],n=[];if(this._lenses.forEach(r=>{let i=r.computeIfNecessary(e);i&&(t.push(i),n.push(r))}),t.length===0){this._oldCodeLensModels.clear();return}let r=Date.now(),i=At(r=>{let i=t.map((t,i)=>{let a=Array(t.length),o=t.map((t,n)=>!t.symbol.command&&typeof t.provider.resolveCodeLens==`function`?Promise.resolve(t.provider.resolveCodeLens(e,t.symbol,r)).then(e=>{a[n]=e},tc):(a[n]=t.symbol,Promise.resolve(void 0)));return Promise.all(o).then(()=>{!r.isCancellationRequested&&!n[i].isDisposed()&&n[i].updateCommands(a)})});return Promise.all(i)});this._resolveCodeLensesPromise=i,this._resolveCodeLensesPromise.then(()=>{let t=this._resolveCodeLensesDebounce.update(e,Date.now()-r);this._resolveCodeLensesScheduler.delay=t,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},e=>{ot(e),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}};a_=r_([i_(1,R),i_(2,qs),i_(3,Ar),i_(4,St),i_(5,Yg)],a_),Rs(a_.ID,a_,1),z(class extends W{constructor(){super({id:`codelens.showLensesInCurrentLine`,precondition:E.hasCodeLensProvider,label:L(935,`Show CodeLens Commands for Current Line`)})}async run(e,t){if(!t.hasModel())return;let n=e.get(Yd),r=e.get(Ar),i=e.get(St),a=t.getSelection().positionLineNumber,o=t.getContribution(a_.ID);if(!o)return;let s=await o.getModel();if(!s)return;let c=[];for(let e of s.lenses)e.symbol.command&&e.symbol.range.startLineNumber===a&&c.push({label:e.symbol.command.title,command:e.symbol.command});if(c.length===0)return;let l=await n.pick(c,{canPickMany:!1,placeHolder:x(934,`Select a command`)});if(!l)return;let u=l.command;if(s.isDisposed){let e=(await o.getModel())?.lenses.find(e=>e.symbol.range.startLineNumber===a&&e.symbol.command?.title===u.title);if(!e||!e.symbol.command)return;u=e.symbol.command}try{await r.executeCommand(u.id,...u.arguments||[])}catch(e){i.error(e)}}});var o_=class{constructor(e,t,n,r){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=r,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}},s_=class{constructor(e,t,n,r,i,a){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=i,this.supportsMarkerHover=a,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}},c_=class{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(let e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}},l_=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}},u_=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},d_=function(e,t){return function(n,r){t(n,r,e)}},f_=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){let r=t.range,i=t.color,a=new Js(new Nu(Math.round(255*i.red),Math.round(255*i.green),Math.round(255*i.blue),i.alpha)),o=Js.Format.CSS.formatRGB(a),s=Js.Format.CSS.formatHSL(a),c=Js.Format.CSS.formatHexA(a,!0),l=[];return l.push({label:o,textEdit:{range:r,text:o}}),l.push({label:s,textEdit:{range:r,text:s}}),l.push({label:c,textEdit:{range:r,text:c}}),l}};f_=u_([d_(0,fr)],f_);var p_=class extends G{constructor(e,t){super(),this._register(e.colorProvider.register(`*`,new f_(t)))}};p_=u_([d_(0,R),d_(1,fr)],p_);async function m_(e,t,n,r=`auto`){return y_(new g_,e,t,n,r)}function h_(e,t,n,r){return Promise.resolve(n.provideColorPresentations(e,t,r))}var g_=class{constructor(){}async compute(e,t,n,r){let i=await e.provideDocumentColors(t,n);if(Array.isArray(i))for(let t of i)r.push({colorInfo:t,provider:e});return Array.isArray(i)}},__=class{constructor(){}async compute(e,t,n,r){let i=await e.provideDocumentColors(t,n);if(Array.isArray(i))for(let e of i)r.push({range:e.range,color:[e.color.red,e.color.green,e.color.blue,e.color.alpha]});return Array.isArray(i)}},v_=class{constructor(e){this.colorInfo=e}async compute(e,t,n,r){let i=await e.provideColorPresentations(t,this.colorInfo,T.None);return Array.isArray(i)&&r.push(...i),Array.isArray(i)}};async function y_(e,t,n,r,i){let a=!1,o,s=[],c=t.ordered(n);for(let t=c.length-1;t>=0;t--){let l=c[t];if(i!==`always`&&l instanceof f_)o=l;else try{await e.compute(l,n,r,s)&&(a=!0)}catch(e){tc(e)}}return a?s:o&&i!==`never`?(await e.compute(o,n,r,s),s):[]}function b_(e,t){let{colorProvider:n}=e.get(R),r=e.get(ft).getModel(t);if(!r)throw Ro();return{model:r,colorProviderRegistry:n,defaultColorDecoratorsEnablement:e.get(Gi).getValue(`editor.defaultColorDecorators`,{resource:t})}}var x_=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},S_=function(e,t){return function(n,r){t(n,r,e)}},C_,w_=Object.create({}),T_=class extends G{static{C_=this}static{this.ID=`editor.contrib.colorDetector`}static{this.RECOMPUTE_TIME=1e3}static{this.colorDecoratorInnerWidthInEm=.8}static{this.colorDecoratorMarginInEm=.2}constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new F),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new E_),this._colorDecorationClassRefs=this._register(new F),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new ul(this._editor));let i=this._editor.getContainerDomNode();i.style.setProperty(`--vscode-colorPicker-colorDecoratorWidth`,`${C_.colorDecoratorInnerWidthInEm}em`),i.style.setProperty(`--vscode-colorPicker-colorDecoratorMargin`,`${C_.colorDecoratorMarginInEm}em`),this._register(Xo(()=>{i.style.removeProperty(`--vscode-colorPicker-colorDecoratorWidth`),i.style.removeProperty(`--vscode-colorPicker-colorDecoratorMargin`)})),this._debounceInformation=r.for(n.colorProvider,`Document Colors`,{min:C_.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(e=>{let t=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(168);let n=t!==this._isColorDecoratorsEnabled||e.hasChanged(27),r=e.hasChanged(168);(n||r)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(168),this.updateColors()}isEnabled(){let e=this._editor.getModel();if(!e)return!1;let t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n==`object`){let e=n.colorDecorators;if(e&&e.enable!==void 0&&!e.enable)return e.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled){this.removeAllDecorations();return}let e=this._editor.getModel();e&&this._languageFeaturesService.colorProvider.has(e)&&(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new ea,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=At(async e=>{let t=this._editor.getModel();if(!t)return[];let n=new Ms(!1),r=await m_(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,n.elapsed()),r});try{let e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){ot(e)}}stop(){this._timeoutTimer&&=(this._timeoutTimer.cancel(),null),this._computePromise&&=(this._computePromise.cancel(),null),this._localToDispose.clear()}updateDecorations(e){let t=e.map(e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:P.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((t,n)=>this._colorDatas.set(t,e[n]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();let t=[],n=C_.colorDecoratorInnerWidthInEm+2*C_.colorDecoratorMarginInEm,r=this._editor.getOption(27);for(let i=0;i<e.length&&t.length<r;i++){let{red:r,green:a,blue:o,alpha:s}=e[i].colorInfo.color,c=new Nu(Math.round(r*255),Math.round(a*255),Math.round(o*255),s),l=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,u=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:l}));t.push({range:{startLineNumber:e[i].colorInfo.range.startLineNumber,startColumn:e[i].colorInfo.range.startColumn,endLineNumber:e[i].colorInfo.range.endLineNumber,endColumn:e[i].colorInfo.range.endColumn},options:{description:`colorDetector`,before:{content:`\xA0`,inlineClassName:`${u.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:w_,widthInEm:n}}})}let i=r<e.length&&r;this._decoratorLimitReporter.update(e.length,i),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){let t=this._editor.getModel();if(!t)return null;let n=t.getDecorationsInRange(C.fromPositions(e,e)).filter(e=>this._colorDatas.has(e.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};T_=C_=x_([S_(1,Gi),S_(2,R),S_(3,qs)],T_);var E_=class extends G{constructor(){super(...arguments),this._onDidChange=this._register(new N),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}},D_=`editor.action.showHover`,O_=`editor.action.showDefinitionPreviewHover`,k_=`editor.action.hideHover`,A_=`editor.action.scrollUpHover`,j_=`editor.action.scrollDownHover`,M_=`editor.action.scrollLeftHover`,N_=`editor.action.scrollRightHover`,P_=`editor.action.pageUpHover`,F_=`editor.action.pageDownHover`,I_=`editor.action.goToTopHover`,L_=`editor.action.goToBottomHover`,R_=`editor.action.increaseHoverVerbosityLevel`,z_=x(1160,`Increase Hover Verbosity Level`),B_=`editor.action.decreaseHoverVerbosityLevel`,V_=x(1161,`Decrease Hover Verbosity Level`),H_=`editor.action.hideLongLineWarningHover`,U_=`editor.action.inlineSuggest.commit`,W_=`editor.action.inlineSuggest.commitAlternativeAction`,G_=`editor.action.inlineSuggest.showPrevious`,K_=`editor.action.inlineSuggest.showNext`,q_=`editor.action.inlineSuggest.jump`,J_=`editor.action.inlineSuggest.hide`,Y_=`editor.action.inlineSuggest.toggleShowCollapsed`,X_=`editor.action.inlineSuggest.renameSymbol`,Z_=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Q_=function(e,t){return function(n,r){t(n,r,e)}},$_,ev=class extends G{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=su(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar===`always`),this.sessionPosition=void 0,this.position=B(this,e=>{let t=this.model.read(e)?.primaryGhostText.read(e);if(!this.alwaysShowToolbar.read(e)||!t||t.parts.length===0)return this.sessionPosition=void 0,null;let n=t.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==t.lineNumber&&(this.sessionPosition=void 0);let r=new A(t.lineNumber,Math.min(n,this.sessionPosition?.column??2**53-1));return this.sessionPosition=r,r}),this._register(Ks((t,n)=>{let r=this.model.read(t);if(!r||!this.alwaysShowToolbar.read(t))return;let i=B(t=>{let n=t.store.add(this.instantiationService.createInstance(rv.hot.read(t),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(n),t.store.add(Xo(()=>e.removeContentWidget(n))),t.store.add(Il(e=>{this.position.read(e)&&r.lastTriggerKind.read(e)!==Ti.Explicit&&r.triggerExplicitly()})),n}),a=Lo(this,(e,t)=>!!this.position.read(e)||!!t);n.add(Il(e=>{a.read(e)&&i.read(e)}))}))}};ev=Z_([Q_(2,U)],ev);var tv=Nr(`inline-suggestion-hints-next`,k.chevronRight,x(1270,`Icon for show next parameter hint.`)),nv=Nr(`inline-suggestion-hints-previous`,k.chevronLeft,x(1271,`Icon for show previous parameter hint.`)),rv=class extends G{static{$_=this}static{this.hot=ri(this)}static{this._dropDownVisible=!1}static get dropDownVisible(){return this._dropDownVisible}static{this.id=0}createCommandAction(e,t,n){let r=new br(e,t,n,!0,()=>this._commandService.executeCommand(e));return r.tooltip=this.keybindingService.appendKeybinding(t,e,this._contextKeyService),r}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=i,this._extraCommands=a,this._warning=o,this._relayout=s,this._commandService=c,this.keybindingService=u,this._contextKeyService=d,this._menuService=f,this.id=`InlineSuggestionHintsContentWidget${$_.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=B(e=>{let t=this._warning.read(e);if(t)return typeof t.message==`string`?t.message:e.store.add(wl(t.message)).element}),this._warningMessageNode=S.div({class:`warningMessage`,style:{maxWidth:400,margin:4,marginBottom:4,display:B(e=>this._warning.read(e)?`block`:`none`)}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=qr(`div.inlineSuggestionsHints`,{className:this.withBorder?`monaco-hover monaco-hover-content`:``},[this._warningMessageNode.element,qr(`div@toolBar`)]),this.previousAction=this._register(this.createCommandAction(G_,x(1272,`Previous`),V.asClassName(nv))),this.availableSuggestionCountAction=this._register(new br(`inlineSuggestionHints.availableSuggestionCount`,``,void 0,!1)),this.nextAction=this._register(this.createCommandAction(K_,x(1273,`Next`),V.asClassName(tv))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(D.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Rr(()=>{this.availableSuggestionCountAction.label=``},100)),this.disableButtonsDebounced=this._register(new Rr(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(Il(e=>{this._warningMessageContentNode.read(e),this._warningMessageNode.readEffect(e),this._relayout()})),this.toolBar=this._register(l.createInstance(ov,this.nodes.toolBar,D.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith(`primary`)},actionViewItemProvider:(e,t)=>{if(e instanceof Fi)return l.createInstance(av,e,void 0);if(e===this.availableSuggestionCountAction){let t=new iv(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=>{$_._dropDownVisible=e})),this._register(Il(e=>{this._position.read(e),this.editor.layoutContentWidget(this)})),this._register(Il(e=>{let t=this._suggestionCount.read(e),n=this._currentSuggestionIdx.read(e);t===void 0?this.clearAvailableSuggestionCountLabelDebounced.schedule():(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${n+1}/${t}`),t!==void 0&&t>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Il(e=>{let t=this._extraCommands.read(e).map(e=>({class:void 0,id:e.command.id,enabled:!0,tooltip:e.command.tooltip||``,label:e.command.title,run:()=>this._commandService.executeCommand(e.command.id,...e.command.arguments??[])}));for(let[e,n]of this.inlineCompletionsActionsMenus.getActions())for(let e of n)e instanceof Fi&&t.push(e);t.length>0&&t.unshift(new Mo),this.toolBar.setAdditionalSecondaryActions(t)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};rv=$_=Z_([Q_(8,Ar),Q_(9,U),Q_(10,Ea),Q_(11,za),Q_(12,ei)],rv);var iv=class extends xo{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(){}},av=class extends aa{updateLabel(){let e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){let t=qr(`div.keybinding`).root;this._register(new Rf(t,bs,{disableTitle:!0,...Et})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add(`inlineSuggestionStatusBarItemLabel`)}}updateTooltip(){}},ov=class extends Ef{constructor(e,t,n,r,i,a,o,s,c){super(e,{resetMenu:t,...n},r,i,a,o,s,c),this.menuId=t,this.options2=n,this.menuService=r,this.contextKeyService=i,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){let{primary:e,secondary:t}=Qa(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){Pd(this.prependedPrimaryActions,e,(e,t)=>e===t)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Pd(this.additionalActions,e,(e,t)=>e===t)||(this.additionalActions=e,this.updateToolbar())}};ov=Z_([Q_(3,ei),Q_(4,za),Q_(5,oc),Q_(6,Ea),Q_(7,Ar),Q_(8,Ct)],ov);function sv(e,t,n){let r=ba(e);return!(t<r.left+3||t>r.left+r.width-3||n<r.top+3||n>r.top+r.height-3)}function cv(e,t,n){return e===`on`||e!==`off`&&lv(t,n.event)}function lv(e,t){return e===`altKey`?t.ctrlKey||t.metaKey:t.altKey}var uv=class{constructor(e,t,n,r){this.value=e,this.isComplete=t,this.hasLoadingMessage=n,this.options=r}},dv=class extends G{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new N),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new fv(e=>this._triggerAsyncComputation(e),0)),this._syncComputationScheduler=this._register(new fv(e=>this._triggerSyncComputation(e),0)),this._loadingMessageScheduler=this._register(new fv(e=>this._triggerLoadingMessage(e),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&=(this._asyncIterable.cancel(),null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=Uf(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(let t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0,e)}catch(e){ot(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){this._state===3&&this._setState(4,e)}_fireResult(e){if(this._state===1||this._state===2)return;let t=this._state===0,n=this._state===4;this._onResult.fire(new uv(this._result.slice(0),t,n,e))}start(e,t){if(e===0)this._state===0&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t)}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&=(this._asyncIterable.cancel(),null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}},fv=class extends G{constructor(e,t){super(),this._scheduler=this._register(new Rr(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}},pv=class{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new N,this._onDidResize=new N,this._sashListener=new F,this._size=new gu(0,0),this._minSize=new gu(0,0),this._maxSize=new gu(2**53-1,2**53-1),this.domNode=document.createElement(`div`),this._eastSash=new fi(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new fi(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new fi(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:ti.North}),this._southSash=new fi(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:ti.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,n=0;this._sashListener.add(_u.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(_u.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(n=r.currentX-r.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(n=-(r.currentX-r.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(_u.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(_u.any(this._northSash.onDidReset,this._southSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,n,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){let{height:n,width:r}=this._minSize,{height:i,width:a}=this._maxSize;e=Math.max(n,Math.min(i,e)),t=Math.max(r,Math.min(a,t));let o=new gu(t,e);gu.equals(o,this._size)||(this.domNode.style.height=e+`px`,this.domNode.style.width=t+`px`,this._size=o,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}},mv=30,hv=24,gv=class extends G{constructor(e,t=new gu(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new pv),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position=`absolute`,this._resizableNode.minSize=gu.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 gu(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?A.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(t&&n)return ba(t).top+n.top-mv}_availableVerticalSpaceBelow(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;let r=ba(t),i=Rt(t.ownerDocument.body),a=r.top+n.top+n.height;return i.height-a-hv}_findPositionPreference(e,t){let n=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),r=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),i=Math.min(e,Math.min(Math.max(r,n),e)),a;return a=this._editor.getOption(69).above?i<=r?1:2:i<=n?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}},_v=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},vv=function(e,t){return function(n,r){t(n,r,e)}},yv,bv=30,xv=class extends gv{static{yv=this}static{this.ID=`editor.contrib.resizableContentHoverWidget`}static{this._lastDimensions=new gu(0,0)}get isVisibleFromKeyboard(){return this._renderedHover?.source===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,n,r,i){let a=e.getOption(75)+8,o=new gu(150,a);super(e,o),this._configurationService=n,this._accessibilityService=r,this._keybindingService=i,this._hover=this._register(new Vo(!0)),this._onDidResize=this._register(new N),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new N),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new N),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=o,this._hoverVisibleKey=E.hoverVisible.bindTo(t),this._hoverFocusedKey=E.hoverFocused.bindTo(t),K(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex=`50`,this._resizableNode.domNode.className=`monaco-resizable-hover`,this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(59)&&this._updateFont()}));let s=this._register(pr(this._resizableNode.domNode));this._register(s.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(s.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 yv.ID}static _applyDimensions(e,t,n){let r=typeof t==`number`?`${t}px`:t,i=typeof n==`number`?`${n}px`:n;e.style.width=r,e.style.height=i}_setContentsDomNodeDimensions(e,t){let n=this._hover.contentsDomNode;return yv._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){let n=this._hover.containerDomNode;return yv._applyDimensions(n,e,t)}_setScrollableElementDimensions(e,t){let n=this._hover.scrollbar.getDomNode();return yv._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){let r=typeof t==`number`?`${t}px`:t,i=typeof n==`number`?`${n}px`:n;e.style.maxWidth=r,e.style.maxHeight=i}_setHoverWidgetMaxDimensions(e,t){yv._applyMaxDimensions(this._hover.contentsDomNode,e,t),yv._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),yv._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty(`--vscode-hover-maxWidth`,typeof e==`number`?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions(`none`,`none`),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){let e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new gu(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){yv._lastDimensions=new gu(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){let e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){let e=this._findAvailableSpaceVertically();if(!e)return;let t=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(e=>{t+=e.clientHeight}),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty(`--vscode-hover-whiteSpace`,`nowrap`),this._hover.containerDomNode.style.setProperty(`--vscode-hover-sourceWhiteSpace`,`nowrap`);let e=Array.from(this._hover.contentsDomNode.children).some(e=>e.scrollWidth>e.clientWidth);return this._hover.containerDomNode.style.removeProperty(`--vscode-hover-whiteSpace`),this._hover.containerDomNode.style.removeProperty(`--vscode-hover-sourceWhiteSpace`),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;let e=this._isHoverTextOverflowing(),t=this._contentWidth===void 0?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidth<t?Rt(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth}isMouseGettingCloser(e,t){if(!this._renderedHover)return!1;if(this._renderedHover.initialMousePosX===void 0||this._renderedHover.initialMousePosY===void 0)return this._renderedHover.initialMousePosX=e,this._renderedHover.initialMousePosY=t,!1;let n=ba(this.getDomNode());this._renderedHover.closestMouseDistance===void 0&&(this._renderedHover.closestMouseDistance=Sv(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,n.left,n.top,n.width,n.height));let r=Sv(e,t,n.left,n.top,n.width,n.height);return r>this._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,r),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle(`hidden`,!e)}_updateFont(){let{fontSize:e,lineHeight:t}=this._editor.getOption(59),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName(`code`)).forEach(e=>this._editor.applyFontInfo(e))}_updateContent(e){let t=this._hover.contentsDomNode;t.style.paddingBottom=``,t.textContent=``,t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){let e=Math.max(this._editor.getLayoutInfo().height/4,250,yv._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,yv._lastDimensions.width);this._resizableNode.maxSize=new gu(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);let t=bl(this._hover.containerDomNode),n=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,n)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();let r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&lt(this._configurationService.getValue(`accessibility.verbosity.hover`)===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding(`editor.action.accessibleView`)?.getAriaLabel()??``);r&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+`, `+r)}hide(){if(!this._renderedHover)return;let e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new gu(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){let e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions(`auto`,`auto`),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new gu(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){let e=this._contentWidth===void 0?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new gu(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();let e=this._hover.contentsDomNode,t=bl(e),n=_t(e)+2;if(this._resizableNode.layout(t,n),this._setHoverWidgetDimensions(n,t),t=bl(e),n=_t(e),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(t,n),this._renderedHover?.showAtPosition){let e=bl(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(e,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-bv})}scrollRight(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+bv})}pageUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};xv=yv=_v([vv(1,za),vv(2,Gi),vv(3,Mn),vv(4,Ea)],xv);function Sv(e,t,n,r,i,a){let o=n+i/2,s=r+a/2,c=Math.max(Math.abs(e-o)-i/2,0),l=Math.max(Math.abs(t-s)-a/2,0);return Math.sqrt(c*c+l*l)}var Cv=class e{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];let n=e.getModel(),r=t.range.startLineNumber;if(r>n.getLineCount())return[];let i=n.getLineMaxColumn(r);return e.getLineDecorations(r).filter(e=>{if(e.options.isWholeLine)return!0;let n=e.range.startLineNumber===r?e.range.startColumn:1,a=e.range.endLineNumber===r?e.range.endColumn:i;if(e.options.showIfCollapsed){if(n>t.range.startColumn+1||t.range.endColumn-1>a)return!1}else if(n>t.range.startColumn||t.range.endColumn>a)return!1;return!0})}computeAsync(t,n){let r=t.anchor;if(!this._editor.hasModel()||!r)return ji.EMPTY;let i=e._getLineDecorations(this._editor,r);return ji.merge(this._participants.map(e=>e.computeAsync?e.computeAsync(r,i,t.source,n):ji.EMPTY))}computeSync(t){if(!this._editor.hasModel())return[];let n=t.anchor,r=e._getLineDecorations(this._editor,n),i=[];for(let e of this._participants)i=i.concat(e.computeSync(n,r,t.source));return vu(i)}},wv=class{constructor(e,t,n){this.hoverParts=e,this.isComplete=t,this.options=n}filter(e){let t=this.hoverParts.filter(t=>t.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new Tv(this,t,this.isComplete,this.options)}},Tv=class extends wv{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}},Ev=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Dv=function(e,t){return function(n,r){t(n,r,e)}},Ov=M,kv=class extends G{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=Ov(`div.hover-row.status-bar`),this.hoverElement.tabIndex=0,this.actionsElement=K(this.hoverElement,Ov(`div.actions`))}addAction(e){let t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;this._hasContent=!0;let r=this._register(_o.render(this.actionsElement,e,n));return this._register(this._hoverService.setupManagedHover(ic(`element`),r.actionContainer,r.actionRenderedLabel)),this.actions.push(r),r}append(e){let t=K(this.actionsElement,e);return this._hasContent=!0,t}};kv=Ev([Dv(0,Ea),Dv(1,uu)],kv);var Av=class e{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){let e=this._findScopeDecorationIds.map(e=>this._editor.getModel().getDecorationRange(e)).filter(e=>!!e);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){let t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){let t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(t){let n=this._editor.getModel().getDecorationsInRange(t);for(let t of n){let n=t.options;if(n===e._FIND_MATCH_DECORATION||n===e._FIND_MATCH_NO_OVERVIEW_DECORATION||n===e._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(t.id)}return 0}setCurrentFindMatch(t){let n=null,r=0;if(t)for(let e=0,i=this._decorations.length;e<i;e++){let i=this._editor.getModel().getDecorationRange(this._decorations[e]);if(t.equalsRange(i)){n=this._decorations[e],r=e+1;break}}return(this._highlightedDecorationId!==null||n!==null)&&this._editor.changeDecorations(t=>{if(this._highlightedDecorationId!==null&&(t.changeDecorationOptions(this._highlightedDecorationId,e._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),n!==null&&(this._highlightedDecorationId=n,t.changeDecorationOptions(this._highlightedDecorationId,e._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(t.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),n!==null){let r=this._editor.getModel().getDecorationRange(n);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){let e=r.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);r=new C(r.startLineNumber,r.startColumn,e,t)}this._rangeHighlightDecorationId=t.addDecoration(r,e._RANGE_HIGHLIGHT_DECORATION)}}),r}set(t,n){this._editor.changeDecorations(r=>{let i=e._FIND_MATCH_DECORATION,a=[];if(t.length>1e3){i=e._FIND_MATCH_NO_OVERVIEW_DECORATION;let n=this._editor.getModel().getLineCount(),r=this._editor.getLayoutInfo().height/n,o=Math.max(2,Math.ceil(3/r)),s=t[0].range.startLineNumber,c=t[0].range.endLineNumber;for(let n=1,r=t.length;n<r;n++){let r=t[n].range;c+o>=r.startLineNumber?r.endLineNumber>c&&(c=r.endLineNumber):(a.push({range:new C(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),s=r.startLineNumber,c=r.endLineNumber)}a.push({range:new C(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let o=Array(t.length);for(let e=0,n=t.length;e<n;e++)o[e]={range:t[e].range,options:i};this._decorations=r.deltaDecorations(this._decorations,o),this._overviewRulerApproximateDecorations=r.deltaDecorations(this._overviewRulerApproximateDecorations,a),this._rangeHighlightDecorationId&&=(r.removeDecoration(this._rangeHighlightDecorationId),null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(e=>r.removeDecoration(e)),this._findScopeDecorationIds=[]),n?.length&&(this._findScopeDecorationIds=n.map(t=>r.addDecoration(t,e._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){let n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.endLineNumber>e.lineNumber)&&(r.endLineNumber<e.lineNumber||!(r.endColumn>e.column)))return r}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;t<n;t++){let n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.startLineNumber<e.lineNumber)&&(r.startLineNumber>e.lineNumber||!(r.startColumn<e.column)))return r}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}static{this._CURRENT_FIND_MATCH_DECORATION=P.register({description:`current-find-match`,stickiness:1,zIndex:13,className:`currentFindMatch`,inlineClassName:`currentFindMatchInline`,showIfCollapsed:!0,overviewRuler:{color:so(ya),position:na.Center},minimap:{color:so(Hu),position:1}})}static{this._FIND_MATCH_DECORATION=P.register({description:`find-match`,stickiness:1,zIndex:10,className:`findMatch`,inlineClassName:`findMatchInline`,showIfCollapsed:!0,overviewRuler:{color:so(ya),position:na.Center},minimap:{color:so(Hu),position:1}})}static{this._FIND_MATCH_NO_OVERVIEW_DECORATION=P.register({description:`find-match-no-overview`,stickiness:1,className:`findMatch`,showIfCollapsed:!0})}static{this._FIND_MATCH_ONLY_OVERVIEW_DECORATION=P.register({description:`find-match-only-overview`,stickiness:1,overviewRuler:{color:so(ya),position:na.Center}})}static{this._RANGE_HIGHLIGHT_DECORATION=P.register({description:`find-range-highlight`,stickiness:1,className:`rangeHighlight`,isWholeLine:!0})}static{this._FIND_SCOPE_DECORATION=P.register({description:`find-scope`,className:`findScope`,isWholeLine:!0})}},jv=class{constructor(e,t,n){this._editorSelection=e,this._ranges=t,this._replaceStrings=n,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){let e=[];for(let t=0;t<this._ranges.length;t++)e.push({range:this._ranges[t],text:this._replaceStrings[t]});e.sort((e,t)=>C.compareRangesUsingStarts(e.range,t.range));let n=[],r=e[0];for(let t=1;t<e.length;t++)r.range.endLineNumber===e[t].range.startLineNumber&&r.range.endColumn===e[t].range.startColumn?(r.range=r.range.plusRange(e[t].range),r.text+=e[t].text):(n.push(r),r=e[t]);n.push(r);for(let e of n)t.addEditOperation(e.range,e.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}};function Mv(e,t){if(e&&e[0]!==``){let n=Nv(e,t,`-`),r=Nv(e,t,`_`);return n&&!r?Pv(e,t,`-`):!n&&r?Pv(e,t,`_`):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():pu(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 Nv(e,t,n){return e[0].indexOf(n)!==-1&&t.indexOf(n)!==-1&&e[0].split(n).length===t.split(n).length}function Pv(e,t,n){let r=t.split(n),i=e[0].split(n),a=``;return r.forEach((e,t)=>{a+=Mv([i[t]],e)+n}),a.slice(0,-1)}var Fv=class{constructor(e){this.staticValue=e,this.kind=0}},Iv=class{constructor(e){this.pieces=e,this.kind=1}},Lv=class e{static fromStaticValue(t){return new e([Rv.staticValue(t)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){this._state=!e||e.length===0?new Fv(``):e.length===1&&e[0].staticValue!==null?new Fv(e[0].staticValue):new Iv(e)}buildReplaceString(t,n){if(this._state.kind===0)return n?Mv(t,this._state.staticValue):this._state.staticValue;let r=``;for(let n=0,i=this._state.pieces.length;n<i;n++){let i=this._state.pieces[n];if(i.staticValue!==null){r+=i.staticValue;continue}let a=e._substitute(i.matchIndex,t);if(i.caseOps!==null&&i.caseOps.length>0){let e=[],t=i.caseOps.length,n=0;for(let r=0,o=a.length;r<o;r++){if(n>=t){e.push(a.slice(r));break}switch(i.caseOps[n]){case`U`:e.push(a[r].toUpperCase());break;case`u`:e.push(a[r].toUpperCase()),n++;break;case`L`:e.push(a[r].toLowerCase());break;case`l`:e.push(a[r].toLowerCase()),n++;break;default:e.push(a[r])}}a=e.join(``)}r+=a}return r}static _substitute(e,t){if(t===null)return``;if(e===0)return t[0];let n=``;for(;e>0;){if(e<t.length)return(t[e]||``)+n;n=String(e%10)+n,e=Math.floor(e/10)}return`$`+n}},Rv=class e{static staticValue(t){return new e(t,-1,null)}static caseOps(t,n){return new e(null,t,n)}constructor(e,t,n){this.staticValue=e,this.matchIndex=t,this.caseOps=!n||n.length===0?null:n.slice(0)}},zv=class{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=``}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,n){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Rv.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),this._result[this._resultLen++]=Rv.caseOps(e,n),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Rv.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),new Lv(this._result)}};function Bv(e){if(!e||e.length===0)return new Lv(null);let t=[],n=new zv(e);for(let r=0,i=e.length;r<i;r++){let a=e.charCodeAt(r);if(a===92){if(r++,r>=i)break;let a=e.charCodeAt(r);switch(a){case 92:n.emitUnchanged(r-1),n.emitStatic(`\\`,r+1);break;case 110:n.emitUnchanged(r-1),n.emitStatic(`
@@ -49,4 +49,4 @@ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{A as t,B as n,F as r,G
49
49
  `);return new e(t,n,i,l,a,o,u)}constructor(e,t,n,r,i,a,o){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=r,this.wholeWord=i,this.matchCase=a,this.currentMatch=o}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;let e=this._getNextMatch();return e?new jz(this._editor.getSelections().concat(e),e,0):null}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;let e=this._getNextMatch();if(!e)return null;let t=this._editor.getSelections();return new jz(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){let e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();let e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return n?new q(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;let e=this._getPreviousMatch();return e?new jz(this._editor.getSelections().concat(e),e,0):null}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;let e=this._getPreviousMatch();if(!e)return null;let t=this._editor.getSelections();return new jz(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){let e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();let e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return n?new q(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();let 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)}},Nz=class e extends G{static{this.ID=`editor.contrib.multiCursorController`}static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._sessionDispose=this._register(new F),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){let t=Mz.create(this._editor,e);if(!t)return;this._session=t;let n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!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;let n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new q(t.startLineNumber,n.startColumn,t.startLineNumber,n.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){let t=this._editor.getSelections();if(t.length>1){let n=e.getState().matchCase;if(!Uz(this._editor.getModel(),t,n)){let e=this._editor.getModel(),n=[];for(let r=0,i=t.length;r<i;r++)n[r]=this._expandEmptyToWord(e,t[r]);this._editor.setSelections(n);return}}}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,n=e.getState();if(n.isRevealed&&n.searchString.length>0&&n.isRegex){let e=this._editor.getModel();t=n.searchScope?e.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(148):null,!1,1073741824):e.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){let e=this._editor.getSelection();for(let n=0,r=t.length;n<r;n++){let r=t[n];if(r.range.intersectRanges(e)){t[n]=t[0],t[0]=r;break}}this._setSelections(t.map(e=>new q(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)))}}},Pz=class extends W{run(e,t){let n=Nz.get(t);if(!n)return;let r=t._getViewModel();if(r){let i=r.getCursorStates(),a=kw.get(t);if(a)this._run(n,a);else{let r=e.get(U).createInstance(kw,t);this._run(n,r),r.dispose()}Tz(i,r.getCursorStates())}}},Fz=class extends Pz{constructor(){super({id:`editor.action.addSelectionToNextFindMatch`,label:L(1369,`Add Selection to Next Find Match`),precondition:void 0,kbOpts:{kbExpr:E.focus,primary:2082,weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:`3_multi`,title:x(1359,`Add &&Next Occurrence`),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}},Iz=class extends Pz{constructor(){super({id:`editor.action.addSelectionToPreviousFindMatch`,label:L(1370,`Add Selection to Previous Find Match`),precondition:void 0,menuOpts:{menuId:D.MenubarSelectionMenu,group:`3_multi`,title:x(1360,`Add P&&revious Occurrence`),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}},Lz=class extends Pz{constructor(){super({id:`editor.action.moveSelectionToNextFindMatch`,label:L(1371,`Move Last Selection to Next Find Match`),precondition:void 0,kbOpts:{kbExpr:E.focus,primary:Mr(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}},Rz=class extends Pz{constructor(){super({id:`editor.action.moveSelectionToPreviousFindMatch`,label:L(1372,`Move Last Selection to Previous Find Match`),precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}},zz=class extends Pz{constructor(){super({id:`editor.action.selectHighlights`,label:L(1373,`Select All Occurrences of Find Match`),precondition:void 0,kbOpts:{kbExpr:E.focus,primary:3114,weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:`3_multi`,title:x(1361,`Select All &&Occurrences`),order:7}})}_run(e,t){e.selectAll(t)}},Bz=class extends Pz{constructor(){super({id:`editor.action.changeAll`,label:L(1374,`Change All Occurrences`),precondition:w.and(E.writable,E.editorTextFocus),kbOpts:{kbExpr:E.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:`1_modification`,order:1.2}})}_run(e,t){e.selectAll(t)}},Vz=class{constructor(e,t,n,r,i){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=r,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),i&&this._model===i._model&&this._searchText===i._searchText&&this._matchCase===i._matchCase&&this._wordSeparators===i._wordSeparators&&this._modelVersionId===i._modelVersionId&&(this._cachedFindMatches=i._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(C.compareRangesUsingStarts)),this._cachedFindMatches}},Hz=class extends G{static{wz=this}static{this.ID=`editor.contrib.selectionHighlighter`}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 Rr(()=>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()?e.reason===3?(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()}));let n=kw.get(e);n&&this._register(n.getState().onFindReplaceStateChange(e=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(wz._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(e,t,n,r,i){if(!t||!i.hasModel())return null;if(!n){let e=i.getSelection();if(e.startLineNumber!==e.endLineNumber)return null}let a=Nz.get(i);if(!a)return null;let o=kw.get(i);if(!o)return null;let s=a.getSession(o);if(!s){let e=i.getSelections();if(e.length>1){let t=o.getState().matchCase;if(!Uz(i.getModel(),e,t))return null}s=Mz.create(i,o)}if(!s||s.currentMatch||/^[ \t]+$/.test(s.searchText)||r>0&&s.searchText.length>r)return null;let c=o.getState(),l=c.matchCase;if(c.isRevealed){let e=c.searchString;l||(e=e.toLowerCase());let t=s.searchText;if(l||(t=t.toLowerCase()),e===t&&s.matchCase===c.matchCase&&s.wholeWord===c.wholeWord&&!c.isRegex)return null}return new Vz(i.getModel(),s.searchText,s.matchCase,s.wholeWord?i.getOption(148):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;let t=this.editor.getModel();if(t.isTooLargeForTokenization())return;let n=this.state.findMatches(),r=this.editor.getSelections();r.sort(C.compareRangesUsingStarts);let i=[];for(let e=0,t=0,a=n.length,o=r.length;e<a;){let a=n[e];if(t>=o)i.push(a),e++;else{let n=C.compareRangesUsingStarts(a,r[t]);n<0?((r[t].isEmpty()||!C.areIntersecting(a,r[t]))&&i.push(a),e++):(n>0||e++,t++)}}let a=this.editor.getOption(90)!==`off`,o=this._languageFeaturesService.documentHighlightProvider.has(t)&&a,s=i.map(e=>({range:e,options:xz(o)}));this._decorations.set(s)}dispose(){this._setState(null),super.dispose()}};Hz=wz=Sz([Cz(1,R)],Hz);function Uz(e,t,n){let r=Wz(e,t[0],!n);for(let i=1,a=t.length;i<a;i++){let a=t[i];if(a.isEmpty()||r!==Wz(e,a,!n))return!1}return!0}function Wz(e,t,n){let r=e.getValueInRange(t);return n?r.toLowerCase():r}var Gz=class extends W{constructor(){super({id:`editor.action.focusNextCursor`,label:L(1375,`Focus Next Cursor`),metadata:{description:x(1362,`Focuses the next cursor`),args:[]},precondition:void 0})}run(e,t,n){if(!t.hasModel())return;let r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();let i=Array.from(r.getCursorStates()),a=i.shift();a&&(i.push(a),r.setCursorStates(n.source,3,i),r.revealPrimaryCursor(n.source,!0),Tz(i,r.getCursorStates()))}},Kz=class extends W{constructor(){super({id:`editor.action.focusPreviousCursor`,label:L(1376,`Focus Previous Cursor`),metadata:{description:x(1363,`Focuses the previous cursor`),args:[]},precondition:void 0})}run(e,t,n){if(!t.hasModel())return;let r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();let i=Array.from(r.getCursorStates()),a=i.pop();a&&(i.unshift(a),r.setCursorStates(n.source,3,i),r.revealPrimaryCursor(n.source,!0),Tz(i,r.getCursorStates()))}};Rs(Nz.ID,Nz,4),Rs(Hz.ID,Hz,1),z(Ez),z(Dz),z(Oz),z(Fz),z(Iz),z(Lz),z(Rz),z(zz),z(Bz),z(kz),z(Az),z(Gz),z(Kz);var qz={Visible:new j(`parameterHintsVisible`,!1),MultipleSignatures:new j(`parameterHintsMultipleSignatures`,!1)};async function Jz(e,t,n,r,i){let a=e.ordered(t);for(let e of a)try{let a=await e.provideSignatureHelp(t,n,i,r);if(a)return a}catch(e){tc(e)}}Bn.registerCommand(`_executeSignatureHelpProvider`,async(e,...t)=>{let[n,r,i]=t;nr($n.isUri(n)),nr(A.isIPosition(r)),nr(typeof i==`string`||!i);let a=e.get(R),o=await e.get(qi).createModelReference(n);try{let e=await Jz(a.signatureHelpProvider,o.object.textEditorModel,A.lift(r),{triggerKind:pi.Invoke,isRetrigger:!1,triggerCharacter:i},T.None);return e?(setTimeout(()=>e.dispose(),0),e.value):void 0}finally{o.dispose()}});var Yz;(function(e){e.Default={type:0};class t{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}}e.Pending=t;class n{constructor(e){this.hints=e,this.type=1}}e.Active=n})(Yz||={});var Xz=class e extends G{static{this.DEFAULT_DELAY=120}constructor(t,n,r=e.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new N),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Yz.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new pc),this.triggerChars=new Xn,this.retriggerChars=new Xn,this.triggerId=0,this.editor=t,this.providers=n,this.throttledDelayer=this._register(new ir(r)),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){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Yz.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){let n=this.editor.getModel();if(!n||!this.providers.has(n))return;let r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(ot)}next(){if(this.state.type!==1)return;let e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,r=this.editor.getOption(98).cycle;(e<2||n)&&!r?this.cancel():this.updateActiveSignature(n&&r?0:t+1)}previous(){if(this.state.type!==1)return;let e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,r=this.editor.getOption(98).cycle;(e<2||n)&&!r?this.cancel():this.updateActiveSignature(n&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Yz.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){let t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;let r=this._pendingTriggers.reduce(Zz);this._pendingTriggers=[];let i={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;let a=this.editor.getModel(),o=this.editor.getPosition();this.state=new Yz.Pending(At(e=>Jz(this.providers,a,o,i,e)),n);try{let t=await this.state.request;return e===this.triggerId?!t||!t.value.signatures||t.value.signatures.length===0?(t?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Yz.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(t?.dispose(),!1)}catch(t){return e===this.triggerId&&(this.state=Yz.Default),ot(t),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();let e=this.editor.getModel();if(e)for(let t of this.providers.ordered(e)){for(let e of t.signatureHelpTriggerCharacters||[])if(e.length){let t=e.charCodeAt(0);this.triggerChars.add(t),this.retriggerChars.add(t)}for(let e of t.signatureHelpRetriggerCharacters||[])e.length&&this.retriggerChars.add(e.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;let t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:pi.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source===`mouse`?this.cancel():this.isTriggered&&this.trigger({triggerKind:pi.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:pi.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};function Zz(e,t){switch(t.triggerKind){case pi.Invoke:return t;case pi.ContentChange:return e;case pi.TriggerCharacter:default:return t}}var Qz=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},$z=function(e,t){return function(n,r){t(n,r,e)}},eB,tB=M,nB=Nr(`parameter-hints-next`,k.chevronDown,x(1378,`Icon for show next parameter hint.`)),rB=Nr(`parameter-hints-previous`,k.chevronUp,x(1379,`Icon for show previous parameter hint.`)),iB=class extends G{static{eB=this}static{this.ID=`editor.widget.parameterHintsWidget`}constructor(e,t,n,r){super(),this.editor=e,this.model=t,this.markdownRendererService=r,this.renderDisposeables=this._register(new F),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.keyVisible=qz.Visible.bindTo(n),this.keyMultipleSignatures=qz.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){let e=tB(`.editor-widget.parameter-hints-widget`),t=K(e,tB(`.phwrapper`));t.tabIndex=-1;let n=K(t,tB(`.controls`)),r=K(n,tB(`.button`+V.asCSSSelector(rB))),i=K(n,tB(`.overloads`)),a=K(n,tB(`.button`+V.asCSSSelector(nB)));this._register(I(r,`click`,e=>{js.stop(e),this.previous()})),this._register(I(a,`click`,e=>{js.stop(e),this.next()}));let o=tB(`.body`),s=new ua(o,{alwaysConsumeMouseWheel:!0});this._register(s),t.appendChild(s.getDomNode());let c=K(o,tB(`.signature`)),l=K(o,tB(`.docs`));e.style.userSelect=`text`,this.domNodes={element:e,signature:c,overloads:i,docs:l,scrollbar:s},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(e=>{this.visible&&this.editor.layoutContentWidget(this)}));let u=()=>{if(!this.domNodes)return;let 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`,Qu.fontFamily)};u(),this._register(_u.chain(this.editor.onDidChangeConfiguration.bind(this.editor),e=>e.filter(e=>e.hasChanged(59)))(u)),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;let t=e.signatures.length>1;this.domNodes.element.classList.toggle(`multiple`,t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText=``,this.domNodes.docs.innerText=``;let n=e.signatures[e.activeSignature];if(!n)return;let r=K(this.domNodes.signature,tB(`.code`)),i=n.parameters.length>0,a=n.activeParameter??e.activeParameter;if(i)this.renderParameters(r,n,a);else{let e=K(r,tB(`span`));e.textContent=n.label}let o=n.parameters[a];if(o?.documentation){let e=tB(`span.documentation`);if(typeof o.documentation==`string`)e.textContent=o.documentation;else{let t=this.renderMarkdownDocs(o.documentation);e.appendChild(t.element)}K(this.domNodes.docs,tB(`p`,{},e))}if(n.documentation!==void 0){if(typeof n.documentation==`string`)K(this.domNodes.docs,tB(`p`,{},n.documentation));else{let e=this.renderMarkdownDocs(n.documentation);K(this.domNodes.docs,e.element)}}let s=this.hasDocs(n,o);if(this.domNodes.signature.classList.toggle(`has-docs`,s),this.domNodes.docs.classList.toggle(`empty`,!s),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,`0`)+`/`+e.signatures.length,o){let e=``,t=n.parameters[a];e=Array.isArray(t.label)?n.label.substring(t.label[0],t.label[1]):t.label,t.documentation&&(e+=typeof t.documentation==`string`?`, ${t.documentation}`:`, ${t.documentation.value}`),n.documentation&&(e+=typeof n.documentation==`string`?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==e&&(wo(x(1380,`{0}, hint`,e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){let 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&&typeof t.documentation==`string`&&Sn(t.documentation).length>0||t&&typeof t.documentation==`object`&&Sn(t.documentation).value.length>0||e.documentation&&typeof e.documentation==`string`&&Sn(e.documentation).length>0||e.documentation&&typeof e.documentation==`object`&&Sn(e.documentation.value).length>0)}renderParameters(e,t,n){let[r,i]=this.getParameterLabelOffsets(t,n),a=document.createElement(`span`);a.textContent=t.label.substring(0,r);let o=document.createElement(`span`);o.textContent=t.label.substring(r,i),o.className=`parameter active`;let s=document.createElement(`span`);s.textContent=t.label.substring(i),K(e,a,o,s)}getParameterLabelOffsets(e,t){let n=e.parameters[t];if(!n)return[0,0];if(Array.isArray(n.label))return n.label;if(n.label.length){let t=RegExp(`(\\W|^)${sd(n.label)}(?=\\W|$)`,`g`);t.test(e.label);let r=t.lastIndex-n.label.length;return r>=0?[r,t.lastIndex]:[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 eB.ID}updateMaxHeight(){if(!this.domNodes)return;let e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;let t=this.domNodes.element.getElementsByClassName(`phwrapper`);t.length&&(t[0].style.maxHeight=e)}};iB=eB=Qz([$z(2,za),$z(3,wa)],iB),O(`editorHoverWidget.highlightForeground`,Er,x(1381,`Foreground color of the active item in the parameter hint.`));var aB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},oB=function(e,t){return function(n,r){t(n,r,e)}},sB,cB=class extends G{static{sB=this}static{this.ID=`editor.controller.parameterHints`}static get(e){return e.getContribution(sB.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new Xz(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(e=>{e?(this.widget.value.show(),this.widget.value.render(e)):this.widget.rawValue?.hide()})),this.widget=new Fc(()=>this._register(t.createInstance(iB,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)}};cB=sB=aB([oB(1,U),oB(2,R)],cB);var lB=class extends W{constructor(){super({id:`editor.action.triggerParameterHints`,label:L(1377,`Trigger Parameter Hints`),precondition:E.hasSignatureHelpProvider,kbOpts:{kbExpr:E.editorTextFocus,primary:3082,weight:100}})}run(e,t){cB.get(t)?.trigger({triggerKind:pi.Invoke})}};Rs(cB.ID,cB,2),z(lB);var uB=175,dB=ad.bindToContribution(cB.get);H(new dB({id:`closeParameterHints`,precondition:qz.Visible,handler:e=>e.cancel(),kbOpts:{weight:uB,kbExpr:E.focus,primary:9,secondary:[1033]}})),H(new dB({id:`showPrevParameterHint`,precondition:w.and(qz.Visible,qz.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:uB,kbExpr:E.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),H(new dB({id:`showNextParameterHint`,precondition:w.and(qz.Visible,qz.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:uB,kbExpr:E.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var fB=class extends G{static{this.ID=`editor.contrib.placeholderText`}constructor(e){super(),this._editor=e,this._editorObs=_s(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=kc({owner:this,equalsFn:Ca},e=>{let t=this._placeholderText.read(e);if(t&&this._editorObs.valueIsEmpty.read(e))return{placeholder:t}}),this._shouldViewBeAlive=pB(this,e=>this._state.read(e)?.placeholder!==void 0),this._view=B(e=>{if(!this._shouldViewBeAlive.read(e))return;let t=qr(`div.editorPlaceholder`);e.store.add(Il(e=>{let n=this._state.read(e),r=n?.placeholder!==void 0;t.root.style.display=r?`block`:`none`,t.root.innerText=n?.placeholder??``})),e.store.add(Il(e=>{let n=this._editorObs.layoutInfo.read(e);t.root.style.left=`${n.contentLeft}px`,t.root.style.width=n.contentWidth-n.verticalScrollbarWidth+`px`,t.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),e.store.add(Il(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:Ji(0),position:Ji(null),domNode:t.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};function pB(e,t){return Lo(e,(e,n)=>n===!0||t(e))}var mB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},hB=function(e,t){return function(n,r){t(n,r,e)}},gB=class{constructor(e){this.instantiationService=e}init(...e){}};function _B(e){return e()}var vB=class extends gB{constructor(e,t){super(t),this.init(e)}};vB=mB([hB(1,U)],vB),Rs(fB.ID,_B(()=>fB),0),O(`editor.placeholder.foreground`,Nt,x(1400,`Foreground color of the placeholder text in the editor.`));function yB(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return t}var bB=class e{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){let n=this.computeEmbedding(e),r=new Map,i=[];for(let[e,a]of this.documents){if(t.isCancellationRequested)return[];for(let t of a.chunks){let a=this.computeSimilarityScore(t,n,r);a>0&&i.push({key:e,score:a})}}return i}static termFrequencies(t){return yB(e.splitTerms(t))}static*splitTerms(e){let t=e=>e.toLowerCase();for(let[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);let e=n.replace(/([a-z])([A-Z])/g,`$1 $2`).split(/\s+/g);if(e.length>1)for(let n of e)n.length>2&&/\p{Letter}{3,}/gu.test(n)&&(yield t(n))}}updateDocuments(t){for(let{key:e}of t)this.deleteDocument(e);for(let n of t){let t=[];for(let r of n.textChunks){let n=e.termFrequencies(r);for(let e of n.keys())this.chunkOccurrences.set(e,(this.chunkOccurrences.get(e)??0)+1);t.push({text:r,tf:n})}this.chunkCount+=t.length,this.documents.set(n.key,{chunks:t})}return this}deleteDocument(e){let t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(let e of t.chunks)for(let t of e.tf.keys()){let e=this.chunkOccurrences.get(t);if(typeof e==`number`){let n=e-1;n<=0?this.chunkOccurrences.delete(t):this.chunkOccurrences.set(t,n)}}}}computeSimilarityScore(e,t,n){let r=0;for(let[i,a]of Object.entries(t)){let t=e.tf.get(i);if(!t)continue;let o=n.get(i);typeof o!=`number`&&(o=this.computeIdf(i),n.set(i,o));let s=t*o;r+=s*a}return r}computeEmbedding(t){let n=e.termFrequencies(t);return this.computeTfidf(n)}computeIdf(e){let t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){let t=Object.create(null);for(let[n,r]of e){let e=this.computeIdf(n);e>0&&(t[n]=r*e)}return t}};function xB(e){let t=e.slice(0);t.sort((e,t)=>t.score-e.score);let n=t[0]?.score??0;if(n>0)for(let e of t)e.score/=n;return t}var SB;(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`})(SB||={});function CB(e){let t=e;return Array.isArray(t.items)}function wB(e){let t=e;return!!t.picks&&t.additionalPicks instanceof Promise}var TB=class extends G{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){let r=new F;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let i,a=r.add(new pc),o=async()=>{i?.dispose(!0),e.busy=!1;let r=a.value=new F;i=r.add(new Po(t));let o=i.token,s=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(s=s.trim());let c=this._getPicks(s,r,o,n),l=(t,n)=>{let r,i;if(CB(t)?(r=t.items,i=t.active):r=t,r.length===0){if(n)return!1;(s.length>0||e.hideInput)&&this.options?.noResultsPick&&(r=Vf(this.options.noResultsPick)?[this.options.noResultsPick(s)]:[this.options.noResultsPick])}return e.items=r,i&&(e.activeItems=[i]),!0},u=async t=>{let n=!1,r=!1;await Promise.all([(async()=>{typeof t.mergeDelay==`number`&&(await Dr(t.mergeDelay),o.isCancellationRequested)||r||(n=l(t.picks,!0))})(),(async()=>{e.busy=!0;try{let r=await t.additionalPicks;if(o.isCancellationRequested)return;let i,a;CB(t.picks)?(i=t.picks.items,a=t.picks.active):i=t.picks;let s,c;if(CB(r)?(s=r.items,c=r.active):s=r,s.length>0||!n){let t;if(!a&&!c){let n=e.activeItems[0];n&&i.indexOf(n)!==-1&&(t=n)}l({items:[...i,...s],active:a||c||t})}}finally{o.isCancellationRequested||(e.busy=!1),r=!0}})()])};if(c!==null){if(wB(c))await u(c);else if(!(c instanceof Promise))l(c);else{e.busy=!0;try{let e=await c;if(o.isCancellationRequested)return;wB(e)?await u(e):l(e)}finally{o.isCancellationRequested||(e.busy=!1)}}}};r.add(e.onDidChangeValue(()=>o())),o(),r.add(e.onDidAccept(t=>{if(n?.handleAccept){t.inBackground||e.hide(),n.handleAccept?.(e.activeItems[0],t.inBackground);return}let[r]=e.selectedItems;if(typeof r?.accept==`function`){if(bf(e.keyMods)&&r.attach){r.attach(e.keyMods,t);return}t.inBackground||e.hide(),r.accept(e.keyMods,t)}}));let s=async(n,r)=>{if(typeof r.trigger!=`function`)return;let i=r.buttons?.indexOf(n)??-1;if(i>=0){let n=r.trigger(i,e.keyMods),a=typeof n==`number`?n:await n;if(t.isCancellationRequested)return;switch(a){case SB.NO_ACTION:break;case SB.CLOSE_PICKER:e.hide();break;case SB.REFRESH_PICKER:o();break;case SB.REMOVE_ITEM:{let t=e.items.indexOf(r);if(t!==-1){let n=e.items.slice(),r=n.splice(t,1),i=e.activeItems.filter(e=>e!==r[0]),a=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=n,i&&(e.activeItems=i),e.keepScrollPosition=a}break}}}};return r.add(e.onDidTriggerItemButton(({button:e,item:t})=>s(e,t))),r.add(e.onDidTriggerSeparatorButton(({button:e,separator:t})=>s(e,t))),r}},EB=Object.freeze({View:L(1718,`View`),Help:L(1719,`Help`),Test:L(1720,`Test`),File:L(1721,`File`),Preferences:L(1722,`Preferences`),Developer:L(1723,`Developer`)}),DB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},OB=function(e,t){return function(n,r){t(n,r,e)}},kB,AB,jB=class extends TB{static{kB=this}static{this.PREFIX=`>`}static{this.TFIDF_THRESHOLD=.5}static{this.TFIDF_MAX_RESULTS=5}static{this.WORD_FILTER=_r(Ln,Wu)}constructor(e,t,n,r,i,a){super(kB.PREFIX,e),this.keybindingService=n,this.commandService=r,this.telemetryService=i,this.dialogService=a,this.commandsHistory=this._register(t.createInstance(MB)),this.options=e}async _getPicks(e,t,n,r){let i=await this.getCommandPicks(n);if(n.isCancellationRequested)return[];let a=kf(()=>{let t=new bB;return t.updateDocuments(i.map(e=>({key:e.commandId,textChunks:[this.getTfIdfChunk(e)]}))),xB(t.calculateScores(e,n)).filter(e=>e.score>kB.TFIDF_THRESHOLD).slice(0,kB.TFIDF_MAX_RESULTS)}),o=[];for(let t of i){let r=kB.WORD_FILTER(e,t.label)??void 0,i;if(t.commandAlias&&(i=kB.WORD_FILTER(e,t.commandAlias)??void 0),r||i)t.highlights={label:r,detail:this.options.showAlias?i:void 0},o.push(t);else if(e===t.commandId)o.push(t);else if(e.length>=3){let e=a();if(n.isCancellationRequested)return[];let r=e.find(e=>e.key===t.commandId);r&&(t.tfIdfScore=r.score,o.push(t))}}let s=new Map;for(let e of o){let t=s.get(e.label);t?(e.description=e.commandId,t.description=t.commandId):s.set(e.label,e)}o.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;let n=this.commandsHistory.peek(e.commandId),r=this.commandsHistory.peek(t.commandId);if(n&&r)return n>r?-1:1;if(n)return-1;if(r)return 1;if(this.options.suggestedCommandIds){let n=this.options.suggestedCommandIds.has(e.commandId),r=this.options.suggestedCommandIds.has(t.commandId);if(n&&r)return 0;if(n)return-1;if(r)return 1}let i=e.commandCategory===EB.Developer.value,a=t.commandCategory===EB.Developer.value;return i&&!a?1:!i&&a?-1:e.label.localeCompare(t.label)});let c=[],l=!1,u=!0,d=!!this.options.suggestedCommandIds;for(let e=0;e<o.length;e++){let t=o[e],n=!!this.commandsHistory.peek(t.commandId);e===0&&n&&(c.push({type:`separator`,label:x(1836,`recently used`)}),l=!0),u&&t.tfIdfScore!==void 0&&(c.push({type:`separator`,label:x(1837,`similar commands`)}),u=!1),d&&t.tfIdfScore===void 0&&!n&&this.options.suggestedCommandIds?.has(t.commandId)&&(c.push({type:`separator`,label:x(1838,`commonly used`)}),l=!0,d=!1),l&&t.tfIdfScore===void 0&&!n&&!this.options.suggestedCommandIds?.has(t.commandId)&&(c.push({type:`separator`,label:x(1839,`other commands`)}),l=!1),c.push(this.toCommandPick(t,r,n))}return this.hasAdditionalCommandPicks(e,n)?{picks:c,additionalPicks:(async()=>{let t=await this.getAdditionalCommandPicks(i,o,e,n);if(n.isCancellationRequested)return[];let a=t.map(e=>this.toCommandPick(e,r));return u&&a[0]?.type!==`separator`&&a.unshift({type:`separator`,label:x(1840,`similar commands`)}),a})()}:c}toCommandPick(e,t,n=!1){if(e.type===`separator`)return e;let r=e.tooltip??e.commandDescription?.value,i=this.keybindingService.lookupKeybinding(e.commandId),a=i?x(1841,`{0}, {1}`,e.label,i.getAriaLabel()):e.label,o=e.buttons||[],s=n?[...o,{iconClass:V.asClassName(k.close),tooltip:x(1842,`Remove from Recently Used`)}]:e.buttons;return{...e,id:e.commandId,tooltip:r,ariaLabel:a,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,buttons:s,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(t){Vi(t)||this.dialogService.error(x(1843,`Command '{0}' resulted in an error`,e.label),Fm(t))}},trigger:n?(t,n)=>t===o.length?(this.commandsHistory.remove(e.commandId),SB.REMOVE_ITEM):e.trigger?e.trigger(t,n):SB.NO_ACTION:e.trigger}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:n}){let r=e;return t&&t!==e&&(r+=` - ${t}`),n&&n.value!==e&&(r+=` - ${n.value===n.original?n.value:`${n.value} (${n.original})`}`),r}};jB=kB=DB([OB(1,U),OB(2,Ea),OB(3,Ar),OB(4,Ct),OB(5,fa)],jB);var MB=class extends G{static{AB=this}static{this.DEFAULT_COMMANDS_HISTORY_LENGTH=50}static{this.PREF_KEY_CACHE=`commandPalette.mru.cache`}static{this.PREF_KEY_COUNTER=`commandPalette.mru.counter`}static{this.counter=1}static{this.hasChanges=!1}constructor(e,t,n){super(),this.storageService=e,this.configurationService=t,this.logService=n,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===es.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){(!e||e.affectsConfiguration(`workbench.commandPalette.history`))&&(this.configuredCommandsHistoryLength=AB.getConfiguredCommandHistoryLength(this.configurationService),AB.cache&&AB.cache.limit!==this.configuredCommandsHistoryLength&&(AB.cache.limit=this.configuredCommandsHistoryLength,AB.hasChanges=!0))}load(){let e=this.storageService.get(AB.PREF_KEY_CACHE,0),t;if(e)try{t=JSON.parse(e)}catch(e){this.logService.error(`[CommandsHistory] invalid data: ${e}`)}let n=AB.cache=new Ci(this.configuredCommandsHistoryLength,1);if(t){let e;e=t.usesLRU?t.entries:t.entries.sort((e,t)=>e.value-t.value),e.forEach(e=>n.set(e.key,e.value))}AB.counter=this.storageService.getNumber(AB.PREF_KEY_COUNTER,0,AB.counter)}push(e){AB.cache&&(AB.cache.set(e,AB.counter++),AB.hasChanges=!0)}peek(e){return AB.cache?.peek(e)}remove(e){AB.cache&&(AB.cache.delete(e),AB.hasChanges=!0)}saveState(){if(!AB.cache||!AB.hasChanges)return;let e={usesLRU:!0,entries:[]};AB.cache.forEach((t,n)=>e.entries.push({key:n,value:t})),this.storageService.store(AB.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(AB.PREF_KEY_COUNTER,AB.counter,0,0),AB.hasChanges=!1}static getConfiguredCommandHistoryLength(e){let t=e.getValue().workbench?.commandPalette?.history;return typeof t==`number`?t:AB.DEFAULT_COMMANDS_HISTORY_LENGTH}};MB=AB=DB([OB(0,Ac),OB(1,Gi),OB(2,Fu)],MB);var NB=class extends jB{constructor(e,t,n,r,i,a){super(e,t,n,r,i,a)}getCodeEditorCommandPicks(){let e=this.activeTextEditorControl;if(!e)return[];let t=[];for(let n of e.getSupportedActions()){let e;n.metadata?.description&&(e=No(n.metadata.description)?n.metadata.description:{original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:e,label:ta(n.label)||n.id})}return t}},PB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},FB=function(e,t){return function(n,r){t(n,r,e)}},IB=class extends NB{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,n,r,i,a){super({showAlias:!1},e,n,r,i,a),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};IB=PB([FB(0,U),FB(1,ec),FB(2,Ea),FB(3,Ar),FB(4,Ct),FB(5,fa)],IB);var LB=class e extends W{static{this.ID=`editor.action.quickCommand`}constructor(){super({id:e.ID,label:Co.quickCommandActionLabel,alias:`Command Palette`,precondition:void 0,kbOpts:{kbExpr:E.focus,primary:59,weight:100},contextMenuOpts:{group:`z_commands`,order:1}})}run(e){e.get(Yd).quickAccess.show(IB.PREFIX)}};z(LB),Pt.as(jn.Quickaccess).registerQuickAccessProvider({ctor:IB,prefix:IB.PREFIX,helpEntries:[{description:Co.quickCommandHelp,commandId:LB.ID}]});var RB=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},zB=function(e,t){return function(n,r){t(n,r,e)}},BB,VB=class{static{BB=this}static{this.PREFIX=`?`}constructor(e,t,n){this.quickInputService=e,this.keybindingService=t,this.contextKeyService=n,this.registry=Pt.as(jn.Quickaccess)}provide(e){let t=new F;return t.add(e.onDidAccept(()=>{let[t]=e.selectedItems;t&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(e=>{let t=this.registry.getQuickAccessProvider(e.substr(BB.PREFIX.length),this.contextKeyService);t?.prefix&&t.prefix!==BB.PREFIX&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(e=>e.prefix!==BB.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders(this.contextKeyService).sort((e,t)=>e.prefix.localeCompare(t.prefix)).flatMap(e=>this.createPicks(e))}createPicks(e){return e.helpEntries.map(t=>{let n=t.prefix||e.prefix,r=n||`…`;return{prefix:n,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:x(1844,`{0}, {1}`,r,t.description),description:t.description}})}};VB=BB=RB([zB(0,Yd),zB(1,Ea),zB(2,za)],VB),Pt.as(jn.Quickaccess).registerQuickAccessProvider({ctor:VB,prefix:``,helpEntries:[{description:uo.helpQuickAccessActionLabel}]});var HB=[void 0,[]];function UB(e,t,n=0,r=0){let i=t;return i.values&&i.values.length>1?WB(e,i.values,n,r):GB(e,t,n,r)}function WB(e,t,n,r){let i=0,a=[];for(let o of t){let[t,s]=GB(e,o,n,r);if(typeof t!=`number`)return HB;i+=t,a.push(...s)}return[i,KB(a)]}function GB(e,t,n,r){let i=Ia(t.normalized,t.normalizedLowercase,n,e,e.toLowerCase(),r,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?[i[0],Yn(i)]:HB}new yi(`allowNonContiguousMatches`),new yi(`description`),new yi(`label`),new yi(`values`),new yi(`expectContiguousMatch`),new yi(`value`);function KB(e){let t=e.sort((e,t)=>e.start-t.start),n=[],r;for(let e of t)!r||!qB(r,e)?(r=e,n.push(e)):(r.start=Math.min(r.start,e.start),r.end=Math.max(r.end,e.end));return n}function qB(e,t){return!(e.end<t.start||t.end<e.start)}function JB(e){return e.startsWith(`"`)&&e.endsWith(`"`)}var YB=` `;function XB(e){typeof e!=`string`&&(e=``);let t=e.toLowerCase(),{pathNormalized:n,normalized:r,normalizedLowercase:i}=ZB(e),a=n.indexOf(Hn)>=0,o=JB(e),s,c=e.split(YB);if(c.length>1)for(let e of c){let t=JB(e),{pathNormalized:n,normalized:r,normalizedLowercase:i}=ZB(e);r&&(s||=[],s.push({original:e,originalLowercase:e.toLowerCase(),pathNormalized:n,normalized:r,normalizedLowercase:i,expectContiguousMatch:t}))}return{original:e,originalLowercase:t,pathNormalized:n,normalized:r,normalizedLowercase:i,values:s,containsPathSeparator:a,expectContiguousMatch:o}}function ZB(e){let t;t=Zt?e.replace(/\//g,Hn):e.replace(/\\/g,Hn);let n=t.replace(/[\*\u2026\s"]/g,``).replace(/(?<=.)#$/,``);return{pathNormalized:t,normalized:n,normalizedLowercase:n.toLowerCase()}}function QB(e){return XB(Array.isArray(e)?e.map(e=>e.original).join(YB):e.original)}var $B=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},eV=function(e,t){return function(n,r){t(n,r,e)}},tV,nV=class extends QE{static{tV=this}static{this.PREFIX=`@`}static{this.SCOPE_PREFIX=`:`}static{this.PREFIX_BY_CATEGORY=`${this.PREFIX}${this.SCOPE_PREFIX}`}constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,x(1414,`To go to a symbol, first open a text editor with symbol information.`)),G.None}provideWithTextEditor(e,t,n,r){let i=e.editor,a=this.getModel(i);return a?this._languageFeaturesService.documentSymbolProvider.has(a)?this.doProvideWithEditorSymbols(e,a,t,n,r):this.doProvideWithoutEditorSymbols(e,a,t,n):G.None}doProvideWithoutEditorSymbols(e,t,n,r){let i=new F;return this.provideLabelPick(n,x(1415,`The active text editor does not provide symbol information.`)),(async()=>{await this.waitForLanguageSymbolRegistry(t,i)&&!r.isCancellationRequested&&i.add(this.doProvideWithEditorSymbols(e,t,n,r))})(),i}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;let n=new wn,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),n.complete(!0))}));return t.add(Xo(()=>n.complete(!1))),n.p}doProvideWithEditorSymbols(e,t,n,r,i){let a=e.editor,o=new F;o.add(n.onDidAccept(t=>{let[r]=n.selectedItems;if(r&&r.range){if(n.keyMods.shift&&r.attach){r.attach(n.keyMods,t);return}this.gotoLocation(e,{range:r.range.selection,keyMods:n.keyMods,preserveFocus:t.inBackground}),i?.handleAccept?.(r,t.inBackground),t.inBackground||n.hide()}})),o.add(n.onDidTriggerItemButton(({item:t})=>{t&&t.range&&(this.gotoLocation(e,{range:t.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));let s=this.getDocumentSymbols(t,r),c=o.add(new pc),l=async e=>{c?.value?.cancel(),n.busy=!1,c.value=new Po,n.busy=!0;try{let i=XB(n.value.substr(tV.PREFIX.length).trim()),a=await this.doGetSymbolPicks(s,i,void 0,c.value.token,t);if(r.isCancellationRequested)return;if(a.length>0){if(n.items=a,e&&i.original.length===0){let t=xt(a,t=>!!(t.type!==`separator`&&t.range&&C.containsPosition(t.range.decoration,e)));t&&(n.activeItems=[t])}}else i.original.length>0?this.provideLabelPick(n,x(1416,`No matching editor symbols`)):this.provideLabelPick(n,x(1417,`No editor symbols`))}finally{r.isCancellationRequested||(n.busy=!1)}};return o.add(n.onDidChangeValue(()=>l(void 0))),l(a.getSelection()?.getPosition()),o.add(n.onDidChangeActive(()=>{let[e]=n.activeItems;e&&e.range&&(a.revealRangeInCenter(e.range.selection,0),this.addDecorations(a,e.range.decoration))})),o}async doGetSymbolPicks(e,t,n,r,i){let a=await e;if(r.isCancellationRequested)return[];let o=t.original.indexOf(tV.SCOPE_PREFIX)===0,s=+!!o,c,l;t.values&&t.values.length>1?(c=QB(t.values[0]),l=QB(t.values.slice(1))):c=t;let u,d=this.options?.openSideBySideDirection?.();d&&(u=[{iconClass:d===`right`?V.asClassName(k.splitHorizontal):V.asClassName(k.splitVertical),tooltip:d===`right`?x(1418,`Open to the Side`):x(1419,`Open to the Bottom`)}]);let f=[];for(let e=0;e<a.length;e++){let r=a[e],o=qc(r.name),d=`$(${Li.toIcon(r.kind).id}) ${o}`,p=d.length-o.length,m=r.containerName;n?.extraContainerLabel&&(m=m?`${n.extraContainerLabel} • ${m}`:n.extraContainerLabel);let h,g,_,v;if(t.original.length>s){let e=!1;if(c!==t&&([h,g]=UB(d,{...t,values:void 0},s,p),typeof h==`number`&&(e=!0)),typeof h!=`number`&&([h,g]=UB(d,c,s,p),typeof h!=`number`))continue;if(!e&&l){if(m&&l.original.length>0&&([_,v]=UB(m,l)),typeof _!=`number`)continue;typeof h==`number`&&(h+=_)}}let y=r.tags&&r.tags.indexOf(1)>=0;f.push({index:e,kind:r.kind,score:h,label:d,ariaLabel:ur(r.name,r.kind),description:m,highlights:y?void 0:{label:g,description:v},range:{selection:C.collapseToStart(r.selectionRange),decoration:r.range},uri:i.uri,symbolName:o,strikethrough:y,buttons:u})}let p=f.sort((e,t)=>o?this.compareByKindAndScore(e,t):this.compareByScore(e,t)),m=[];if(o){let e,t,n=0;function r(){t&&typeof e==`number`&&n>0&&(t.label=gs(iV[e]||rV,n))}for(let i of p)e===i.kind?n++:(r(),e=i.kind,n=1,t={type:`separator`},m.push(t)),m.push(i);r()}else p.length>0&&(m=[{label:x(1420,`symbols ({0})`,f.length),type:`separator`},...p]);return m}compareByScore(e,t){if(typeof e.score!=`number`&&typeof t.score==`number`)return 1;if(typeof e.score==`number`&&typeof t.score!=`number`)return-1;if(typeof e.score==`number`&&typeof t.score==`number`){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:+(e.index>t.index)}compareByKindAndScore(e,t){let n=iV[e.kind]||rV,r=iV[t.kind]||rV,i=n.localeCompare(r);return i===0?this.compareByScore(e,t):i}async getDocumentSymbols(e,t){let n=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()}};nV=tV=$B([eV(0,R),eV(1,YC)],nV);var rV=x(1421,`properties ({0})`),iV={5:x(1422,`methods ({0})`),11:x(1423,`functions ({0})`),8:x(1424,`constructors ({0})`),12:x(1425,`variables ({0})`),4:x(1426,`classes ({0})`),22:x(1427,`structs ({0})`),23:x(1428,`events ({0})`),24:x(1429,`operators ({0})`),10:x(1430,`interfaces ({0})`),2:x(1431,`namespaces ({0})`),3:x(1432,`packages ({0})`),25:x(1433,`type parameters ({0})`),1:x(1434,`modules ({0})`),6:x(1435,`properties ({0})`),9:x(1436,`enumerations ({0})`),21:x(1437,`enumeration members ({0})`),14:x(1438,`strings ({0})`),0:x(1439,`files ({0})`),17:x(1440,`arrays ({0})`),15:x(1441,`numbers ({0})`),16:x(1442,`booleans ({0})`),18:x(1443,`objects ({0})`),19:x(1444,`keys ({0})`),7:x(1445,`fields ({0})`),13:x(1446,`constants ({0})`)},aV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},oV=function(e,t){return function(n,r){t(n,r,e)}},sV=class extends nV{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=_u.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};sV=aV([oV(0,ec),oV(1,R),oV(2,YC)],sV);var cV=class e extends W{static{this.ID=`editor.action.quickOutline`}constructor(){super({id:e.ID,label:Fo.quickOutlineActionLabel,alias:`Go to Symbol...`,precondition:E.hasDocumentSymbolProvider,kbOpts:{kbExpr:E.focus,primary:3117,weight:100},contextMenuOpts:{group:`navigation`,order:3}})}run(e){e.get(Yd).quickAccess.show(nV.PREFIX,{itemActivation:Mf.NONE})}};z(cV),Pt.as(jn.Quickaccess).registerQuickAccessProvider({ctor:sV,prefix:nV.PREFIX,helpEntries:[{description:Fo.quickOutlineActionLabel,prefix:nV.PREFIX,commandId:cV.ID},{description:Fo.quickOutlineByCategoryActionLabel,prefix:nV.PREFIX_BY_CATEGORY}]});var lV=class extends G{static{this.ID=`editor.contrib.readOnlyMessageController`}constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){let e=im.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||=this.editor.isSimpleWidget?new Mi(x(1447,`Cannot edit in read-only input`)):new Mi(x(1448,`Cannot edit in read-only editor`)),e.showMessage(t,this.editor.getPosition())}}};Rs(lV.ID,lV,2);var uV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},dV=function(e,t){return function(n,r){t(n,r,e)}},fV=class extends Gx{constructor(e,t,n,r,i,a,o){super(!0,e,t,n,r,i,a,o)}};fV=uV([dV(1,za),dV(2,ec),dV(3,St),dV(4,U),dV(5,Ac),dV(6,Gi)],fV),Rs(Gx.ID,fV,4);var pV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},mV=function(e,t){return function(n,r){t(n,r,e)}},hV=class extends G{static{this.ID=`editor.sectionHeaderDetector`}constructor(e,t,n){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=n,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=>{let n=this.editor.getModel()?.getLanguageId();n&&t.affects(n)&&(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 Rr(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;let t=this.editor.getModel().getLanguageId();if(!t)return;let n=this.languageConfigurationService.getLanguageConfiguration(t).comments,r=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(n||r?.markers)return{foldingRules:r,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;let e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;let t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(n=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(n)})}updateDecorations(e){let t=this.editor.getModel();t&&(e=e.filter(e=>{if(!e.shouldBeInComments)return!0;let n=t.validateRange(e.range),r=t.tokenization.getLineTokens(n.startLineNumber),i=r.findTokenIndexAtOffset(n.startColumn-1),a=r.getStandardTokenType(i),o=t.getLanguageIdAtPosition(n.startLineNumber,n.startColumn);return r.getLanguageId(i)===o&&a===1}));let n=Object.values(this.currentOccurrences).map(e=>e.decorationId),r=e.map(e=>gV(e));this.editor.changeDecorations(t=>{let i=t.deltaDecorations(n,r);this.currentOccurrences={};for(let t=0,n=i.length;t<n;t++){let n={sectionHeader:e[t],decorationId:i[t]};this.currentOccurrences[n.decorationId]=n}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&=(this.computePromise.cancel(),null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}};hV=pV([mV(1,Rn),mV(2,fr)],hV);function gV(e){return{range:e.range,options:P.createDynamic({description:`section-header`,stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:e.hasSeparatorLine?2:1,sectionHeaderText:e.text}})}}Rs(hV.ID,hV,1);function _V(e){for(let t=0,n=e.length;t<n;t+=4){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];e[t+0]=a,e[t+1]=i,e[t+2]=r,e[t+3]=n}}function vV(e){let t=new Uint8Array(e.buffer,e.byteOffset,e.length*4);return zt()||_V(t),yt.wrap(t)}function yV(e){let t=new Uint32Array(bV(e)),n=0;if(t[n++]=e.id,e.type===`full`)t[n++]=1,t[n++]=e.data.length,t.set(e.data,n),n+=e.data.length;else{t[n++]=2,t[n++]=e.deltas.length;for(let r of e.deltas)t[n++]=r.start,t[n++]=r.deleteCount,r.data?(t[n++]=r.data.length,t.set(r.data,n),n+=r.data.length):t[n++]=0}return vV(t)}function bV(e){let t=0;if(t+=2,e.type===`full`)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(let n of e.deltas)n.data&&(t+=n.data.length)}return t}function xV(e){return e&&!!e.data}function SV(e){return e&&Array.isArray(e.edits)}var CV=class{constructor(e,t,n){this.provider=e,this.tokens=t,this.error=n}};function wV(e,t){return e.has(t)}function TV(e,t){let n=e.orderedGroups(t);return n.length>0?n[0]:[]}async function EV(e,t,n,r,i){let a=TV(e,t),o=await Promise.all(a.map(async e=>{let a,o=null;try{a=await e.provideDocumentSemanticTokens(t,e===n?r:null,i)}catch(e){o=e,a=null}return a&&(xV(a)||SV(a))||(a=null),new CV(e,a,o)}));for(let e of o){if(e.error)throw e.error;if(e.tokens)return e}return o.length>0?o[0]:null}function DV(e,t){let n=e.orderedGroups(t);return n.length>0?n[0]:null}var OV=class{constructor(e,t){this.provider=e,this.tokens=t}};function kV(e,t){return e.has(t)}function AV(e,t){let n=e.orderedGroups(t);return n.length>0?n[0]:[]}async function jV(e,t,n,r){let i=AV(e,t),a=await Promise.all(i.map(async e=>{let i;try{i=await e.provideDocumentRangeSemanticTokens(t,n,r)}catch(e){tc(e),i=null}return i&&xV(i)||(i=null),new OV(e,i)}));for(let e of a)if(e.tokens)return e;return a.length>0?a[0]:null}Bn.registerCommand(`_provideDocumentSemanticTokensLegend`,async(e,...t)=>{let[n]=t;nr(n instanceof $n);let r=e.get(ft).getModel(n);if(!r)return;let{documentSemanticTokensProvider:i}=e.get(R),a=DV(i,r);return a?a[0].getLegend():e.get(Ar).executeCommand(`_provideDocumentRangeSemanticTokensLegend`,n)}),Bn.registerCommand(`_provideDocumentSemanticTokens`,async(e,...t)=>{let[n]=t;nr(n instanceof $n);let r=e.get(ft).getModel(n);if(!r)return;let{documentSemanticTokensProvider:i}=e.get(R);if(!wV(i,r))return e.get(Ar).executeCommand(`_provideDocumentRangeSemanticTokens`,n,r.getFullModelRange());let a=await EV(i,r,null,null,T.None);if(!a)return;let{provider:o,tokens:s}=a;if(!s||!xV(s))return;let c=yV({id:0,type:`full`,data:s.data});return s.resultId&&o.releaseDocumentSemanticTokens(s.resultId),c}),Bn.registerCommand(`_provideDocumentRangeSemanticTokensLegend`,async(e,...t)=>{let[n,r]=t;nr(n instanceof $n);let i=e.get(ft).getModel(n);if(!i)return;let{documentRangeSemanticTokensProvider:a}=e.get(R),o=AV(a,i);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!r||!C.isIRange(r))return console.warn(`provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in`),o[0].getLegend();let s=await jV(a,i,C.lift(r),T.None);if(s)return s.provider.getLegend()}),Bn.registerCommand(`_provideDocumentRangeSemanticTokens`,async(e,...t)=>{let[n,r]=t;nr(n instanceof $n),nr(C.isIRange(r));let i=e.get(ft).getModel(n);if(!i)return;let{documentRangeSemanticTokensProvider:a}=e.get(R),o=await jV(a,i,C.lift(r),T.None);if(o&&o.tokens)return yV({id:0,type:`full`,data:o.tokens.data})});var MV=`editor.semanticHighlighting`;function NV(e,t,n){let r=n.getValue(MV,{overrideIdentifier:e.getLanguageId(),resource:e.uri})?.enabled;return typeof r==`boolean`?r:t.getColorTheme().semanticHighlighting}var PV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},FV=function(e,t){return function(n,r){t(n,r,e)}},IV=class extends G{static{this.ID=`editor.contrib.viewportSemanticTokens`}constructor(e,t,n,r,i,a){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=r,this._editor=e,this._provider=a.documentRangeSemanticTokensProvider,this._debounceInformation=i.for(this._provider,`DocumentRangeSemanticTokens`,{min:100,max:500}),this._tokenizeViewport=this._register(new Rr(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];let o=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},s=()=>{if(this._cleanupProviderListeners(),this._editor.hasModel()){let e=this._editor.getModel();for(let t of this._provider.all(e)){let e=t.onDidChange?.(()=>{this._cancelAll(),o()});e&&this._rangeProvidersChangeListeners.push(e)}}};this._register(this._editor.onDidScrollChange(()=>{o()})),this._register(this._editor.onDidChangeModel(()=>{s(),this._cancelAll(),o()})),this._register(this._editor.onDidChangeModelLanguage(()=>{s(),this._cancelAll(),o()})),this._register(this._editor.onDidChangeModelContent(e=>{this._cancelAll(),o()})),s(),this._register(this._provider.onDidChange(()=>{s(),this._cancelAll(),o()})),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(`editor.semanticHighlighting`)&&(this._cancelAll(),o())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),o()})),o()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){Rc(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(let e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,n=this._outstandingRequests.length;t<n;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;let e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!NV(e,this._themeService,this._configurationService)||!kV(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}let t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(t=>this._requestRange(e,t)))}_requestRange(e,t){let n=e.getVersionId(),r=At(n=>Promise.resolve(jV(this._provider,e,t,n))),i=new Ms(!1);return r.then(r=>{if(this._debounceInformation.update(e,i.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==n)return;let{provider:a,tokens:o}=r,s=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,Ll(o,s,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};IV=PV([FV(1,Is),FV(2,Zn),FV(3,Gi),FV(4,qs),FV(5,R)],IV),Rs(IV.ID,IV,1);var LV=class{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){let n=[];for(let r of t){let t=[];n.push(t),this.selectSubwords&&this._addInWordRanges(t,e,r),this._addWordRanges(t,e,r),this._addWhitespaceLine(t,e,r),t.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){let r=t.getWordAtPosition(n);if(!r)return;let{word:i,startColumn:a}=r,o=n.column-a,s=o,c=o,l=0;for(;s>=0;s--){let e=i.charCodeAt(s);if(s!==o&&(e===95||e===45)||Qs(e)&&Sc(l))break;l=e}for(s+=1;c<i.length;c++){let e=i.charCodeAt(c);if(Sc(e)&&Qs(l)||e===95||e===45)break;l=e}s<c&&e.push({range:new C(n.lineNumber,a+s,n.lineNumber,a+c)})}_addWordRanges(e,t,n){let r=t.getWordAtPosition(n);r&&e.push({range:new C(n.lineNumber,r.startColumn,n.lineNumber,r.endColumn)})}_addWhitespaceLine(e,t,n){t.getLineLength(n.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new C(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}},RV=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},zV=function(e,t){return function(n,r){t(n,r,e)}},BV,VV=class e{constructor(e,t){this.index=e,this.ranges=t}mov(t){let n=this.index+(t?1:-1);if(n<0||n>=this.ranges.length)return this;let r=new e(n,this.ranges);return r.ranges[n].equalsRange(this.ranges[this.index])?r.mov(t):r}},HV=class{static{BV=this}static{this.ID=`editor.contrib.smartSelectController`}static get(e){return e.getContribution(BV.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;let t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||await KV(this._languageFeaturesService.selectionRangeProvider,n,t.map(e=>e.getPosition()),this._editor.getOption(129),T.None).then(e=>{if(Au(e)&&e.length===t.length&&this._editor.hasModel()&&Pd(this._editor.getSelections(),t,(e,t)=>e.equalsSelection(t))){for(let n=0;n<e.length;n++)e[n]=e[n].filter(e=>e.containsPosition(t[n].getStartPosition())&&e.containsPosition(t[n].getEndPosition())),e[n].unshift(t[n]);this._state=e.map(e=>new VV(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));let r=this._state.map(e=>q.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}};HV=BV=RV([zV(1,R)],HV);var UV=class extends W{constructor(e,t){super(t),this._forward=e}async run(e,t){let n=HV.get(t);n&&await n.run(this._forward)}},WV=class extends UV{constructor(){super(!0,{id:`editor.action.smartSelect.expand`,label:L(1469,`Expand Selection`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:`1_basic`,title:x(1467,`&&Expand Selection`),order:2}})}};Bn.registerCommandAlias(`editor.action.smartSelect.grow`,`editor.action.smartSelect.expand`);var GV=class extends UV{constructor(){super(!1,{id:`editor.action.smartSelect.shrink`,label:L(1470,`Shrink Selection`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:`1_basic`,title:x(1468,`&&Shrink Selection`),order:3}})}};Rs(HV.ID,HV,4),z(WV),z(GV);async function KV(e,t,n,r,i){let a=e.all(t).concat(new LV(r.selectSubwords));a.length===1&&a.unshift(new eN);let o=[],s=[];for(let e of a)o.push(Promise.resolve(e.provideSelectionRanges(t,n,i)).then(e=>{if(Au(e)&&e.length===n.length)for(let t=0;t<n.length;t++){s[t]||(s[t]=[]);for(let r of e[t])C.isIRange(r.range)&&C.containsPosition(r.range,n[t])&&s[t].push(C.lift(r.range))}},tc));return await Promise.all(o),s.map(e=>{if(e.length===0)return[];e.sort((e,t)=>A.isBefore(e.getStartPosition(),t.getStartPosition())?1:A.isBefore(t.getStartPosition(),e.getStartPosition())||A.isBefore(e.getEndPosition(),t.getEndPosition())?-1:+!!A.isBefore(t.getEndPosition(),e.getEndPosition()));let n=[],i;for(let t of e)(!i||C.containsRange(t,i)&&!C.equalsRange(t,i))&&(n.push(t),i=t);if(!r.selectLeadingAndTrailingWhitespace)return n;let a=[n[0]];for(let e=1;e<n.length;e++){let r=n[e-1],i=n[e];if(i.startLineNumber!==r.startLineNumber||i.endLineNumber!==r.endLineNumber){let e=new C(r.startLineNumber,t.getLineFirstNonWhitespaceColumn(r.startLineNumber),r.endLineNumber,t.getLineLastNonWhitespaceColumn(r.endLineNumber));e.containsRange(r)&&!e.equalsRange(r)&&i.containsRange(e)&&!i.equalsRange(e)&&a.push(e);let n=new C(r.startLineNumber,1,r.endLineNumber,t.getLineMaxColumn(r.endLineNumber));n.containsRange(r)&&!n.equalsRange(e)&&i.containsRange(n)&&!i.equalsRange(n)&&a.push(n)}a.push(i)}return a})}Bn.registerCommand(`_executeSelectionRangeProvider`,async function(e,...t){let[n,r]=t;nr($n.isUri(n)),nr(Ir(r,e=>A.isIPosition(e)));let i=e.get(R).selectionRangeProvider,a=await e.get(qi).createModelReference(n);try{return KV(i,a.object.textEditorModel,r.map(A.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},T.None)}finally{a.dispose()}});var qV=class extends du{constructor(){super({id:`editor.action.toggleStickyScroll`,title:{...L(1518,`Toggle Editor Sticky Scroll`),mnemonicTitle:x(1514,`&&Toggle Editor Sticky Scroll`)},metadata:{description:L(1519,`Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport`)},category:EB.View,toggled:{condition:w.equals(`config.editor.stickyScroll.enabled`,!0),title:x(1515,`Sticky Scroll`),mnemonicTitle:x(1516,`&&Sticky Scroll`)},menu:[{id:D.CommandPalette},{id:D.MenubarAppearanceMenu,group:`4_editor`,order:3},{id:D.StickyScrollContext}]})}async runEditorCommand(e,t){let n=e.get(Gi),r=!n.getValue(`editor.stickyScroll.enabled`),i=KP.get(t)?.isFocused();n.updateValue(`editor.stickyScroll.enabled`,r),i&&t.focus()}},JV=100,YV=class extends du{constructor(){super({id:`editor.action.focusStickyScroll`,title:{...L(1520,`Focus Editor Sticky Scroll`),mnemonicTitle:x(1517,`&&Focus Editor Sticky Scroll`)},precondition:w.and(w.has(`config.editor.stickyScroll.enabled`),E.stickyScrollVisible),menu:[{id:D.CommandPalette}]})}runEditorCommand(e,t){KP.get(t)?.focus()}},XV=class extends du{constructor(){super({id:`editor.action.selectNextStickyScrollLine`,title:L(1521,`Select the next editor sticky scroll line`),precondition:E.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JV,primary:18}})}runEditorCommand(e,t){KP.get(t)?.focusNext()}},ZV=class extends du{constructor(){super({id:`editor.action.selectPreviousStickyScrollLine`,title:L(1522,`Select the previous sticky scroll line`),precondition:E.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JV,primary:16}})}runEditorCommand(e,t){KP.get(t)?.focusPrevious()}},QV=class extends du{constructor(){super({id:`editor.action.goToFocusedStickyScrollLine`,title:L(1523,`Go to the focused sticky scroll line`),precondition:E.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JV,primary:3}})}runEditorCommand(e,t){KP.get(t)?.goToFocused()}},$V=class extends du{constructor(){super({id:`editor.action.selectEditor`,title:L(1524,`Select Editor`),precondition:E.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JV,primary:9}})}runEditorCommand(e,t){KP.get(t)?.selectEditor()}};Rs(KP.ID,KP,1),ia(qV),ia(YV),ia(ZV),ia(XV),ia(QV),ia($V);var eH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},tH=function(e,t){return function(n,r){t(n,r,e)}},nH=class{constructor(e,t,n,r,i,a,o){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=r,this.command=i,this.gutterMenuLinkAction=a,this.completion=o,this.doNotLog=!0}},rH=class extends ku{constructor(e,t,n,r,i,a){super(i.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=r,this._suggestMemoryService=a}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn<n.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){let e=[],{items:t}=this.completionModel,n=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),r=Gd.slice(t,n),i=Gd.slice(t,0,n),a=5;for(let t of Gd.concat(r,i)){if(t.score===Wf.Default)continue;let n=new C(t.editStart.lineNumber,t.editStart.column,t.editInsertEnd.lineNumber,t.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),r=t.completion.insertTextRules&&t.completion.insertTextRules&4?{snippet:t.completion.insertText}:t.completion.insertText;e.push(new nH(n,r,t.filterTextLow??t.labelLow,t.completion.additionalTextEdits,t.completion.command,t.completion.action,t)),a-->=0&&t.resolve(T.None)}return e}};rH=eH([tH(5,HM)],rH);var iH=class extends G{constructor(e,t,n,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=n,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register(`*`,this))}async provideInlineCompletions(e,t,n,r){if(n.selectedSuggestionInfo)return;let i;for(let t of this._editorService.listCodeEditors())if(t.getModel()===e){i=t;break}if(!i)return;let a=i.getOption(102);if(KO.isAllOff(a))return;e.tokenization.tokenizeIfCheap(t.lineNumber);let o=e.tokenization.getLineTokens(t.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(KO.valueFor(a,s)!==`inline`)return;let c=e.getWordAtPosition(t),l;if(c?.word||(l=this._getTriggerCharacterInfo(e,t)),!c?.word&&!l||(c||=e.getWordUntilPosition(t),c.endColumn!==t.column))return;let u,d=e.getValueInRange(new C(t.lineNumber,1,t.lineNumber,t.column));if(!l&&this._lastResult?.canBeReused(e,t.lineNumber,c)){let e=new QM(d,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=e,this._lastResult.acquire(),u=this._lastResult}else{let n=await zO(this._languageFeatureService.completionProvider,e,t,new LO(void 0,cN.createSuggestFilter(i).itemKind,l?.providers),l&&{triggerKind:1,triggerCharacter:l.ch},r),a;n.needsClipboard&&(a=await this._clipboardService.readText());let o=new $M(n.items,t.column,new QM(d,0),tN.None,i.getOption(134),i.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},a);u=new rH(e,t.lineNumber,c,o,n,this._suggestMemoryService)}return this._lastResult=u,u}handleItemDidShow(e,t){t.completion.resolve(T.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){let n=e.getValueInRange(C.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(let t of this._languageFeatureService.completionProvider.all(e))t.triggerCharacters?.includes(n)&&r.add(t);if(r.size!==0)return{providers:r,ch:n}}};iH=eH([tH(0,R),tH(1,ds),tH(2,HM),tH(3,ec)],iH),rt(iH),z(class extends W{constructor(){super({id:`editor.action.toggleHighContrast`,label:Ri.toggleHighContrast,alias:`Toggle High Contrast Theme`,precondition:void 0}),this._originalThemeName=null}run(e,t){let n=e.get(Sr),r=n.getColorTheme();vt(r.type)?(n.setTheme(this._originalThemeName||(Sl(r.type)?`vs-dark`:`vs`)),this._originalThemeName=null):(n.setTheme(Sl(r.type)?Ei:yn),this._originalThemeName=r.themeName)}});var aH=class e extends hl{static{this.ID=`editor.action.toggleTabFocusMode`}constructor(){super({id:e.ID,title:L(1604,`Toggle Tab Key Moves Focus`),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:L(1605,`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(){let e=!Cr.getTabFocusMode();Cr.setTabFocusMode(e),wo(e?x(1602,`Pressing Tab will now move focus to the next focusable element`):x(1603,`Pressing Tab will now insert the tab character`))}};ia(aH),z(class extends W{constructor(){super({id:`editor.action.forceRetokenize`,label:L(1606,`Developer: Force Retokenize`),precondition:void 0})}run(e,t){if(!t.hasModel())return;let n=t.getModel();n.tokenization.resetTokenization();let r=new Ms;n.tokenization.forceTokenization(n.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}});var oH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},sH=function(e,t){return function(n,r){t(n,r,e)}},cH=26,lH=class extends G{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(uH))}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,cH)}};lH=oH([sH(1,U)],lH);var uH=class extends G{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=M(`div.editor-banner`),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message==`string`)return e.message}getBannerMessage(e){if(typeof e==`string`){let t=M(`span`);return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){Of(this.element)}show(e){Of(this.element);let t=this.getAriaLabel(e);t&&this.element.setAttribute(`aria-label`,t);let n=K(this.element,M(`div.icon-container`));n.setAttribute(`aria-hidden`,`true`),e.icon&&n.appendChild(M(`div${V.asCSSSelector(e.icon)}`));let r=K(this.element,M(`div.message-container`));if(r.setAttribute(`aria-hidden`,`true`),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=K(this.element,M(`div.message-actions-container`)),e.actions)for(let t of e.actions)this._register(this.instantiationService.createInstance(zm,this.messageActionsContainer,{...t,tabIndex:-1},{}));let i=K(this.element,M(`div.action-container`));this.actionBar=this._register(new Ur(i)),this.actionBar.push(this._register(new br(`banner.close`,x(1607,`Close Banner`),V.asClassName(Xi),!0,()=>{typeof e.onClose==`function`&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};uH=oH([sH(0,U),sH(1,wa)],uH);var dH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},fH=function(e,t){return function(n,r){t(n,r,e)}},pH=Nr(`extensions-warning-message`,k.warning,x(1608,`Icon shown with a warning message in the extensions editor.`)),mH=class extends G{static{this.ID=`editor.contrib.unicodeHighlighter`}constructor(e,t,n,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=e=>{if(e&&e.hasMore){if(this._bannerClosed)return;let t=Math.max(e.ambiguousCharacterCount,e.nonBasicAsciiCharacterCount,e.invisibleCharacterCount),n;if(e.nonBasicAsciiCharacterCount>=t)n={message:x(1609,`This document contains many non-basic ASCII unicode characters`),command:new kH};else if(e.ambiguousCharacterCount>=t)n={message:x(1610,`This document contains many ambiguous unicode characters`),command:new DH};else if(e.invisibleCharacterCount>=t)n={message:x(1611,`This document contains many invisible unicode characters`),command:new OH};else throw Error(`Unreachable`);this._bannerController.show({id:`unicodeHighlightBanner`,message:n.message,icon:pH,actions:[{label:n.command.shortLabel,href:`command:${n.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(lH,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(n.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(),null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&=(this._highlighter.dispose(),null),!this._editor.hasModel())return;let e=hH(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(e=>e===!1))return;let 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=>e===`_os`?Ya.NumberFormat().value.resolvedOptions().locale:e===`_vscode`?_i:e)};this._highlighter=this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?new gH(this._editor,t,this._updateState,this._editorWorkerService):new _H(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};mH=dH([fH(1,fr),fH(2,hs),fH(3,U)],mH);function hH(e,t){return{nonBasicASCII:t.nonBasicASCII===`inUntrustedWorkspace`?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments===`inUntrustedWorkspace`?!e:t.includeComments,includeStrings:t.includeStrings===`inUntrustedWorkspace`?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}var gH=class extends G{constructor(e,t,n,r){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Rr(()=>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()){this._decorations.clear();return}let e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);let n=[];if(!t.hasMore)for(let e of t.ranges)n.push({range:e,options:wH.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;let t=this._editor.getModel();return Vr(t,e)?{reason:CH(t.getValueInRange(e.range),this._options),inComment:Dn(t,e),inString:sr(t,e)}:null}};gH=dH([fH(3,fr)],gH);var _H=class extends G{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Rr(()=>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()){this._decorations.clear();return}let e=this._editor.getVisibleRanges(),t=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(let t of e){let e=Ni.computeUnicodeHighlights(this._model,this._options,t);for(let t of e.ranges)n.ranges.push(t);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||e.hasMore}if(!n.hasMore)for(let e of n.ranges)t.push({range:e,options:wH.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;let t=this._editor.getModel(),n=t.getValueInRange(e.range);return Vr(t,e)?{reason:CH(n,this._options),inComment:Dn(t,e),inString:sr(t,e)}:null}},vH=x(1612,`Configure Unicode Highlight Options`),yH=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];let n=this._editor.getModel(),r=this._editor.getContribution(mH.ID);if(!r)return[];let i=[],a=new Set,o=300;for(let e of t){let t=r.getDecorationInfo(e);if(!t)continue;let s=n.getValueInRange(e.range).codePointAt(0),c=xH(s),l;switch(t.reason.kind){case 0:l=yd(t.reason.confusableWith)?x(1613,`The character {0} could be confused with the ASCII character {1}, which is more common in source code.`,c,xH(t.reason.confusableWith.codePointAt(0))):x(1614,`The character {0} could be confused with the character {1}, which is more common in source code.`,c,xH(t.reason.confusableWith.codePointAt(0)));break;case 1:l=x(1615,`The character {0} is invisible.`,c);break;case 2:l=x(1616,`The character {0} is not a basic ASCII character.`,c)}if(a.has(l))continue;a.add(l);let u={codePoint:s,reason:t.reason,inComment:t.inComment,inString:t.inString},d=x(1617,`Adjust settings`),f=Tn(AH.ID,u),p=new Mi(``,!0).appendMarkdown(l).appendText(` `).appendLink(f,d,vH);i.push(new sb(this,e.range,[p],!1,o++))}return i}renderHoverParts(e,t){return fb(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(e=>e.value).join(`
50
50
  `)}};yH=dH([fH(1,wa)],yH);function bH(e){return`U+${e.toString(16).padStart(4,`0`)}`}function xH(e){let t=`\`${bH(e)}\``;return go.isInvisibleCharacter(e)||(t+=` "${`${SH(e)}`}"`),t}function SH(e){return e===96?"`` ` ``":"`"+String.fromCodePoint(e)+"`"}function CH(e,t){return Ni.computeUnicodeHighlightReason(e,t)}var wH=class e{constructor(){this.map=new Map}static{this.instance=new e}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){let n=`${e}${t}`,r=this.map.get(n);return r||(r=P.createDynamic({description:`unicode-highlight`,stickiness:1,className:`unicode-highlight`,showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,r)),r}},TH=class extends W{constructor(){super({id:DH.ID,label:L(1626,`Disable highlighting of characters in comments`),precondition:void 0}),this.shortLabel=x(1618,`Disable Highlight In Comments`)}async run(e,t){let n=e.get(Gi);n&&this.runAction(n)}async runAction(e){await e.updateValue(Sd.includeComments,!1,2)}},EH=class extends W{constructor(){super({id:DH.ID,label:L(1627,`Disable highlighting of characters in strings`),precondition:void 0}),this.shortLabel=x(1619,`Disable Highlight In Strings`)}async run(e,t){let n=e.get(Gi);n&&this.runAction(n)}async runAction(e){await e.updateValue(Sd.includeStrings,!1,2)}},DH=class e extends hl{static{this.ID=`editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters`}constructor(){super({id:e.ID,title:L(1628,`Disable highlighting of ambiguous characters`),precondition:void 0,f1:!1}),this.shortLabel=x(1620,`Disable Ambiguous Highlight`)}async run(e,t){let n=e.get(Gi);n&&this.runAction(n)}async runAction(e){await e.updateValue(Sd.ambiguousCharacters,!1,2)}},OH=class e extends hl{static{this.ID=`editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters`}constructor(){super({id:e.ID,title:L(1629,`Disable highlighting of invisible characters`),precondition:void 0,f1:!1}),this.shortLabel=x(1621,`Disable Invisible Highlight`)}async run(e,t){let n=e.get(Gi);n&&this.runAction(n)}async runAction(e){await e.updateValue(Sd.invisibleCharacters,!1,2)}},kH=class e extends hl{static{this.ID=`editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters`}constructor(){super({id:e.ID,title:L(1630,`Disable highlighting of non basic ASCII characters`),precondition:void 0,f1:!1}),this.shortLabel=x(1622,`Disable Non ASCII Highlight`)}async run(e,t){let n=e.get(Gi);n&&this.runAction(n)}async runAction(e){await e.updateValue(Sd.nonBasicASCII,!1,2)}},AH=class e extends hl{static{this.ID=`editor.action.unicodeHighlight.showExcludeOptions`}constructor(){super({id:e.ID,title:L(1631,`Show Exclude Options`),precondition:void 0,f1:!1})}async run(e,t){let{codePoint:n,reason:r,inString:i,inComment:a}=t,o=String.fromCodePoint(n),s=e.get(Yd),c=e.get(Gi);function l(e){return go.isInvisibleCharacter(e)?x(1623,`Exclude {0} (invisible character) from being highlighted`,bH(e)):x(1624,`Exclude {0} from being highlighted`,`${bH(e)} "${o}"`)}let u=[];if(r.kind===0)for(let e of r.notAmbiguousInLocales)u.push({label:x(1625,`Allow unicode characters that are more common in the language "{0}".`,e),run:async()=>{MH(c,[e])}});if(u.push({label:l(n),run:()=>jH(c,[n])}),a){let e=new TH;u.push({label:e.label,run:async()=>e.runAction(c)})}else if(i){let e=new EH;u.push({label:e.label,run:async()=>e.runAction(c)})}function d(e){return typeof e.desc.title==`string`?e.desc.title:e.desc.title.value}if(r.kind===0){let e=new DH;u.push({label:d(e),run:async()=>e.runAction(c)})}else if(r.kind===1){let e=new OH;u.push({label:d(e),run:async()=>e.runAction(c)})}else if(r.kind===2){let e=new kH;u.push({label:d(e),run:async()=>e.runAction(c)})}else NH(r);let f=await s.pick(u,{title:vH});f&&await f.run()}};async function jH(e,t){let n=e.getValue(Sd.allowedCharacters),r;r=typeof n==`object`&&n?n:{};for(let e of t)r[String.fromCodePoint(e)]=!0;await e.updateValue(Sd.allowedCharacters,r,2)}async function MH(e,t){let n=e.inspect(Sd.allowedLocales).user?.value,r;r=typeof n==`object`&&n?Object.assign({},n):{};for(let e of t)r[e]=!0;await e.updateValue(Sd.allowedLocales,r,2)}function NH(e){throw Error(`Unexpected value: ${e}`)}ia(DH),ia(OH),ia(kH),ia(AH),Rs(mH.ID,mH,1),l_.register(yH);var PH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},FH=function(e,t){return function(n,r){t(n,r,e)}},IH=`ignoreUnusualLineTerminators`;function LH(e,t,n){e.setModelProperty(t.uri,IH,n)}function RH(e,t){return e.getModelProperty(t.uri,IH)}var zH=class extends G{static{this.ID=`editor.contrib.unusualLineTerminatorsDetector`}constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,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(this._config===`off`||!this._editor.hasModel())return;let e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||RH(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config===`auto`){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let t;try{this._isPresentingDialog=!0,t=await this._dialogService.confirm({title:x(1632,`Unusual Line Terminators`),message:x(1633,`Detected unusual line terminators`),detail:x(1634,`The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).
51
51
 
52
- It is recommended to remove them from the file. This can be configured via \`editor.unusualLineTerminators\`.`,Qd(e.uri)),primaryButton:x(1635,`&&Remove Unusual Line Terminators`),cancelButton:x(1636,`Ignore`)})}finally{this._isPresentingDialog=!1}t.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):LH(this._codeEditorService,e,!0)}};zH=PH([FH(1,fa),FH(2,ec)],zH),Rs(zH.ID,zH,1);var BH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},VH=function(e,t){return function(n,r){t(n,r,e)}},HH=class{constructor(){this.selector={language:`*`}}provideDocumentHighlights(e,t,n){if(e.isDisposed())return;let r=[],i=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return i?e.findMatches(i.word,!0,!1,!0,iu,!1).map(e=>({range:e.range,kind:Tf.Text})):Promise.resolve(r)}provideMultiDocumentHighlights(e,t,n,r){if(e.isDisposed())return;let i=new Dl,a=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!a)return Promise.resolve(i);for(let t of[e,...n]){if(t.isDisposed())continue;let e=t.findMatches(a.word,!0,!1,!0,iu,!1).map(e=>({range:e.range,kind:Tf.Text}));e&&i.set(t.uri,e)}return i}},UH=class extends G{constructor(e){super(),this._register(e.documentHighlightProvider.register(`*`,new HH)),this._register(e.multiDocumentHighlightProvider.register(`*`,new HH))}};UH=BH([VH(0,R)],UH);var WH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},GH=function(e,t){return function(n,r){t(n,r,e)}},KH,qH,JH=new j(`hasWordHighlights`,!1);function YH(e,t,n,r){let i=e.ordered(t);return Jn(i.map(e=>()=>Promise.resolve(e.provideDocumentHighlights(t,n,r)).then(void 0,tc)),e=>e!=null).then(e=>{if(e){let n=new Dl;return n.set(t.uri,e),n}return new Dl})}function XH(e,t,n,r,i){let a=e.ordered(t);return Jn(a.map(e=>()=>{let a=i.filter(e=>Gf(e)).filter(t=>Ld(e.selector,t.uri,t.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(e.provideMultiDocumentHighlights(t,n,a,r)).then(void 0,tc)}),e=>e!=null)}var ZH=class{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||=At(e=>this._compute(this._model,this._selection,this._wordSeparators,e)),this._result}_getCurrentWordRange(e,t){let n=e.getWordAtPosition(t.getPosition());return n?new C(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}cancel(){this.result.cancel()}},QH=class extends ZH{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return YH(this._providers,e,t.getPosition(),r).then(e=>e||new Dl)}},$H=class extends ZH{constructor(e,t,n,r,i){super(e,t,n),this._providers=r,this._otherModels=i}_compute(e,t,n,r){return XH(this._providers,e,t.getPosition(),r,this._otherModels).then(e=>e||new Dl)}};function eU(e,t,n,r){return new QH(t,n,r,e)}function tU(e,t,n,r,i){return new $H(t,n,r,e,i)}Bd(`_executeDocumentHighlights`,async(e,t,n)=>(await YH(e.get(R).documentHighlightProvider,t,n,T.None))?.get(t.uri));var nU=class{static{KH=this}static{this.storedDecorationIDs=new Dl}static{this.query=null}constructor(e,t,n,r,i,a,o,s){this.toUnhook=new F,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Dl,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new ir(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=a,this.textModelService=i,this.configurationService=o,this.logService=s,this._hasWordHighlights=JH.bindTo(r),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||this.occurrencesHighlightEnablement!==`off`&&this.runDelayer.trigger(()=>{this._onPositionChanged(e)}).catch(ot)})),this.toUnhook.add(e.onDidFocusEditorText(e=>{this.occurrencesHighlightEnablement!==`off`&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}).catch(ot))})),this.toUnhook.add(e.onDidChangeModelContent(e=>{Xr(this.model.uri,`output`)||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(e=>{!e.newModelUrl&&e.oldModelUrl?this._stopSingular():KH.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(e=>{let t=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==t)switch(this.occurrencesHighlightEnablement=t,t){case`off`:this._stopAll();break;case`singleFile`:this._stopAll(KH.query?.modelInfo?.modelURI);break;case`multiFile`:KH.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`)){let e=o.getValue(`editor.occurrencesHighlightDelay`);this.occurrencesHighlightDelay!==e&&(this.occurrencesHighlightDelay=e)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{let e=this.codeEditorService.getFocusedCodeEditor();e?e.getModel()?.uri.scheme===dl.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==dl.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,KH.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!==`off`&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}).catch(ot))}stop(){this.occurrencesHighlightEnablement!==`off`&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(C.compareRangesUsingStarts)}moveNext(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);wo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);wo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;let e=KH.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),KH.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){let t=this.codeEditorService.listCodeEditors(),n=[];for(let r of t){if(!r.hasModel()||Gt(r.getModel().uri,e))continue;let t=KH.storedDecorationIDs.get(r.getModel().uri);if(!t)continue;r.removeDecorations(t),n.push(r.getModel().uri);let i=rU.get(r);i?.wordHighlighter&&i.wordHighlighter.decorations.length>0&&(i.wordHighlighter.decorations.clear(),i.wordHighlighter.workerRequest=null,i.wordHighlighter._hasWordHighlights.set(!1))}for(let e of n)KH.storedDecorationIDs.delete(e)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==dl.vscodeNotebookCell&&KH.query?.modelInfo?.modelURI.scheme!==dl.vscodeNotebookCell?(KH.query=null,this._run()):KH.query?.modelInfo&&(KH.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||=(this.workerRequestTokenId++,!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||=(this.workerRequestTokenId++,!0)}_onPositionChanged(e){this.occurrencesHighlightEnablement===`off`||e.source!==`api`&&e.reason!==3?this._stopAll():this._run()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===dl.vscodeNotebookCell){let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){let n=r.getModel();n&&n!==e&&n.uri.scheme===dl.vscodeNotebookCell&&t.push(n)}return t}let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){if(!Hl(r))continue;let n=r.getModel();n&&e===n.modified&&t.push(n.modified)}if(t.length)return t;if(this.occurrencesHighlightEnablement===`singleFile`)return[];for(let r of n){let n=r.getModel();n&&n!==e&&t.push(n)}return t}async _run(e,t){if(this.editor.hasTextFocus()){let e=this.editor.getSelection();if(!e||e.startLineNumber!==e.endLineNumber){KH.query=null,this._stopAll();return}let t=e.startColumn,n=e.endColumn,r=this._getWord();if(!r||r.startColumn>t||r.endColumn<n){KH.query=null,this._stopAll();return}KH.query={modelInfo:{modelURI:this.model.uri,selection:e}}}else if(!KH.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),Gt(this.editor.getModel().uri,KH.query.modelInfo?.modelURI)){if(!e){let e=this.decorations.getRanges();for(let t of e)if(t.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);let n=++this.workerRequestTokenId;this.workerRequestCompleted=!1;let r=this.getOtherModelsToHighlight(this.editor.getModel());if(!KH.query||!KH.query.modelInfo)return;let i=await this.textModelService.createModelReference(KH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(i.object.textEditorModel,KH.query.modelInfo.selection,r),this.workerRequest?.result.then(e=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=e||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},ot)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{i.dispose()}}else if(this.model.uri.scheme===dl.vscodeNotebookCell){let e=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!KH.query||!KH.query.modelInfo)return;let n=await this.textModelService.createModelReference(KH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(n.object.textEditorModel,KH.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(n=>{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=n||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},ot)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{n.dispose()}}}computeWithModel(e,t,n){return n.length?tU(this.multiDocumentProviders,e,t,this.editor.getOption(148),n):eU(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){let t=new Date().getTime(),n=this.lastCursorPositionChangeTime+e;t>=n?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},n-t)}renderDecorations(){this.renderDecorationsTimer=void 0;let e=this.codeEditorService.listCodeEditors();for(let t of e){let e=rU.get(t);if(!e)continue;let n=[],r=t.getModel()?.uri;if(r&&this.workerRequestValue.has(r)){let i=KH.storedDecorationIDs.get(r),a=this.workerRequestValue.get(r);if(a)for(let e of a)e.range&&n.push({range:e.range,options:bz(e.kind)});let o=[];t.changeDecorations(e=>{o=e.deltaDecorations(i??[],n)}),KH.storedDecorationIDs=KH.storedDecorationIDs.set(r,o),n.length>0&&(e.wordHighlighter?.decorations.set(n),e.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}};nU=KH=WH([GH(4,qi),GH(5,ec),GH(6,Gi),GH(7,Fu)],nU);var rU=class extends G{static{qH=this}static{this.ID=`editor.contrib.wordHighlighter`}static get(e){return e.getContribution(qH.ID)}constructor(e,t,n,r,i,a,o){super(),this._wordHighlighter=null;let s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==dl.accessibleView&&(this._wordHighlighter=new nU(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,i,r,a,o))};this._register(e.onDidChangeModel(e=>{this._wordHighlighter&&=(!e.newModelUrl&&e.oldModelUrl?.scheme!==dl.vscodeNotebookCell&&this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),null),s()})),s()}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(),null),super.dispose()}};rU=qH=WH([GH(1,za),GH(2,R),GH(3,ec),GH(4,qi),GH(5,Gi),GH(6,Fu)],rU);var iU=class extends W{constructor(e,t){super(t),this._isNext=e}run(e,t){let n=rU.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}},aU=class extends iU{constructor(){super(!0,{id:`editor.action.wordHighlight.next`,label:L(1646,`Go to Next Symbol Highlight`),precondition:JH,kbOpts:{kbExpr:E.editorTextFocus,primary:65,weight:100}})}},oU=class extends iU{constructor(){super(!1,{id:`editor.action.wordHighlight.prev`,label:L(1647,`Go to Previous Symbol Highlight`),precondition:JH,kbOpts:{kbExpr:E.editorTextFocus,primary:1089,weight:100}})}},sU=class extends W{constructor(){super({id:`editor.action.wordHighlight.trigger`,label:L(1648,`Trigger Symbol Highlight`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:0,weight:100}})}run(e,t){let n=rU.get(t);n&&n.restoreViewState(!0)}};Rs(rU.ID,rU,0),z(aU),z(oU),z(sU),rt(UH);var cU=class extends ad{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;let r=Mt(t.getOption(148),t.getOption(147)),i=t.getModel(),a=t.getSelections(),o=a.length>1,s=a.map(e=>{let t=new A(e.positionLineNumber,e.positionColumn),n=this._move(r,i,t,this._wordNavigationType,o);return this._moveTo(e,n,this._inSelectionMode)});if(i.pushStackElement(),t._getViewModel().setCursorStates(`moveWordCommand`,3,s.map(e=>pd.fromModelSelection(e))),s.length===1){let e=new A(s[0].positionLineNumber,s[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,n){return n?new q(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new q(t.lineNumber,t.column,t.lineNumber,t.column)}},lU=class extends cU{_move(e,t,n,r,i){return wd.moveWordLeft(e,t,n,r,i)}},uU=class extends cU{_move(e,t,n,r,i){return wd.moveWordRight(e,t,n,r)}},dU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartLeft`,precondition:void 0})}},fU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndLeft`,precondition:void 0})}},pU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:`cursorWordLeft`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(eo,nd)?.negate()),primary:2063,mac:{primary:527},weight:100}})}},mU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartLeftSelect`,precondition:void 0})}},hU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndLeftSelect`,precondition:void 0})}},gU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:`cursorWordLeftSelect`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(eo,nd)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}},_U=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityLeft`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Mt(Yi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},vU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityLeftSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Mt(Yi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},yU=class extends uU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartRight`,precondition:void 0})}},bU=class extends uU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndRight`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(eo,nd)?.negate()),primary:2065,mac:{primary:529},weight:100}})}},xU=class extends uU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordRight`,precondition:void 0})}},SU=class extends uU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartRightSelect`,precondition:void 0})}},CU=class extends uU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndRightSelect`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(eo,nd)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}},wU=class extends uU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordRightSelect`,precondition:void 0})}},TU=class extends uU{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityRight`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Mt(Yi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},EU=class extends uU{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityRightSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Mt(Yi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},DU=class extends ad{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){let r=e?.get(Rn);if(!t.hasModel()||!r)return;let i=Mt(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections(),s=t.getOption(10),c=t.getOption(15),l=r.getLanguageConfiguration(a.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),d=o.map(e=>{let n=this._delete({wordSeparators:i,model:a,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:s,autoClosingQuotes:c,autoClosingPairs:l,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new $c(n,``)});t.pushUndoStop(),t.executeCommands(this.id,d),t.pushUndoStop()}},OU=class extends DU{_delete(e,t){return wd.deleteWordLeft(e,t)||new C(1,1,1,1)}},kU=class extends DU{_delete(e,t){let n=wd.deleteWordRight(e,t);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new C(r,i,r,i)}},AU=class extends OU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartLeft`,precondition:E.writable})}},jU=class extends OU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndLeft`,precondition:E.writable})}},MU=class extends OU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordLeft`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}},NU=class extends kU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartRight`,precondition:E.writable})}},PU=class extends kU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndRight`,precondition:E.writable})}},FU=class extends kU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordRight`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}},IU=class extends W{constructor(){super({id:`deleteInsideWord`,precondition:E.writable,label:L(1650,`Delete Word`),metadata:{description:L(1651,`Delete the word at the cursor`),args:[{name:`args`,schema:{type:`object`,properties:{onlyWord:{type:`boolean`,default:!1,description:x(1649,`Delete only the word and leave surrounding whitespace`)}}}}]}})}run(e,t,n){if(!t.hasModel())return;let r=!!(n&&typeof n==`object`&&n.onlyWord),i=Mt(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections().map(e=>{let t=wd.deleteInsideWord(i,a,e,r);return new $c(t,``)});t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}};H(new dU),H(new fU),H(new pU),H(new mU),H(new hU),H(new gU),H(new yU),H(new bU),H(new xU),H(new SU),H(new CU),H(new wU),H(new _U),H(new vU),H(new TU),H(new EU),H(new AU),H(new jU),H(new MU),H(new NU),H(new PU),H(new FU),z(IU);var LU=class extends DU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordPartLeft`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){return ou.deleteWordPartLeft(e)||new C(1,1,1,1)}},RU=class extends DU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordPartRight`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let n=ou.deleteWordPartRight(e);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new C(r,i,r,i)}},zU=class extends cU{_move(e,t,n,r,i){return ou.moveWordPartLeft(e,t,n,i)}},BU=class extends zU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordPartLeft`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:783},weight:100}})}};Bn.registerCommandAlias(`cursorWordPartStartLeft`,`cursorWordPartLeft`);var VU=class extends zU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordPartLeftSelect`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}};Bn.registerCommandAlias(`cursorWordPartStartLeftSelect`,`cursorWordPartLeftSelect`);var HU=class extends cU{_move(e,t,n,r,i){return ou.moveWordPartRight(e,t,n)}},UU=class extends HU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordPartRight`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:785},weight:100}})}},WU=class extends HU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordPartRightSelect`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}};H(new LU),H(new RU),H(new BU),H(new VU),H(new UU),H(new WU);var GU=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>J(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-BscAjiQZ.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-C6YyR8OD.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-CYlAq2b0.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-b97czJOk.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DFPxpIYQ.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}],KU=Object.fromEntries(GU.map(e=>[e.id,e.import])),qU=nt({langs:Xf,themes:KU,engine:()=>(0,Zf.createOnigurumaEngine)(J(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:JU,codeToHast:YU,codeToTokens:XU,codeToTokensBase:ZU,codeToTokensWithThemes:QU,getSingletonHighlighter:$U,getLastGrammarState:eW}=et(qU,{guessEmbeddedLanguages:tt});self.MonacoEnvironment={async getWorker(){return new(await(J(()=>import(`./editor.worker-CGG2Yh4v.js`),[]))).default}};function tW(e,t){let n=tu.registerCommand(`offsite.block`,(e,n)=>t(n)),r=e===`stage`?`Stage`:`Unstage`,i={id:e===`stage`?`add`:`remove`},a=[On.appendMenuItem(D.DiffEditorHunkToolbar,{command:{id:`offsite.block`,title:`${r} Block`,icon:i},group:`primary`,order:10}),On.appendMenuItem(D.DiffEditorSelectionToolbar,{command:{id:`offsite.block`,title:`${r} Selection`,icon:i},group:`primary`,order:10})];return()=>{n.dispose();for(let e of a)e.dispose()}}function nW(e,t,n){let r=t.getValue();for(let i of n.innerChanges.slice().reverse()){let n=i.modifiedRange;r=r.slice(0,t.getOffsetAt({lineNumber:n.startLineNumber,column:n.startColumn}))+e.getValueInRange(i.originalRange)+r.slice(t.getOffsetAt({lineNumber:n.endLineNumber,column:n.endColumn}))}return r}var rW=qU({themes:[],langs:[]}),iW=new Map([[`tsx`,()=>J(()=>import(`./typescript-Dy13l_qr.js`),__vite__mapDeps([13,8,1,2,3,4]))],[`jsx`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`json`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`jsonc`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`shellscript`,()=>J(()=>import(`./shell-CC2rA5mh.js`),[])],[`docker`,()=>J(()=>import(`./dockerfile-DZFCIeNp.js`),[])],[`c`,()=>J(()=>import(`./cpp-C7h46wYY.js`),[])],[`objective-cpp`,()=>J(()=>import(`./cpp-C7h46wYY.js`),[])],[`vue`,()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))],[`svelte`,()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))]]);async function aW(e){let t=Xe(e),n=Yf.find(e=>e.id===t||e.aliases?.includes(t)===!0);if(n===void 0)return{id:`plaintext`,name:`Plain Text`};let r=await rW;if(!r.getLoadedLanguages().includes(n.id)){if(await r.loadLanguage(n.import),!Jc.getLanguages().some(e=>e.id===n.id)){Jc.register({id:n.id});let e=iW.get(n.id);e!==void 0&&Jc.setLanguageConfiguration(n.id,(await e()).conf)}await oW()}return{id:n.id,name:n.name}}async function oW(){let e=we(),t=GU.find(t=>t.id===e.codeTheme);if(t===void 0)throw Error(`unknown code theme ${e.codeTheme}`);let n=(await t.import()).default,r=await rW;await r.loadTheme({...n,colors:{...n.colors,"editor.background":e.background}}),Tp(r,Yu),tu.setTheme(e.codeTheme)}function sW(e){return{fontFamily:e.font.family,fontSize:e.font.size,lineHeight:e.font.lineHeight,fontLigatures:e.font.ligatures?e.font.features===``||e.font.features:!1,cursorStyle:e.cursor.style===`bar`?`line`:e.cursor.style,cursorBlinking:e.cursor.blink?`expand`:`solid`,tabSize:e.tabSize,insertSpaces:!0,detectIndentation:!1,trimAutoWhitespace:!1,wordWrap:e.wordWrap?`on`:`off`,wrappingStrategy:`advanced`,minimap:{enabled:!1},stickyScroll:{enabled:!1},overviewRulerBorder:!1,padding:{top:3,bottom:48},cursorSurroundingLines:2,copyWithSyntaxHighlighting:!1,accessibilitySupport:`off`,guides:{bracketPairs:!0,bracketPairsHorizontal:!1,highlightActiveBracketPair:!0,highlightActiveIndentation:!0},dragAndDrop:!1,glyphMargin:!1,useTabStops:!1,selectionHighlight:!1,emptySelectionClipboard:!1,renderWhitespace:`selection`,smartSelect:{selectLeadingAndTrailingWhitespace:!1},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},scrollBeyondLastLine:!1,smoothScrolling:!0,hover:{above:!1},find:{cursorMoveOnType:!1},acceptSuggestionOnCommitCharacter:!1,suggestSelection:`first`,suggest:{localityBonus:!0,insertMode:`replace`,snippetsPreventQuickSuggestions:!1},quickSuggestions:{comments:`on`,strings:`on`,other:`on`},quickSuggestionsDelay:0}}async function cW(e){await document.fonts.load(`${e.font.size}px ${e.font.family}`),tu.remeasureFonts()}function lW(e){let t=e.model,n=e.editor,r=e.machine,i=e.projectId,a=e.path,o=(0,Y.useRef)(null),s=(0,Y.useCallback)(e=>{let n=t.onDidChangeContent(e);return()=>n.dispose()},[t]),c=(0,Y.useDeferredValue)((0,Y.useSyncExternalStore)(s,()=>t.getValue())),u=(0,Y.useMemo)(()=>({img(e){return(0,X.jsx)(uW,{machine:r,projectId:i,file:a,src:e.src,alt:e.alt,width:e.width,height:e.height})}}),[r,i,a]);return(0,Y.useEffect)(()=>{if(n===null)return;let e=n.onDidScrollChange(e=>{let t=o.current;t!==null&&e.scrollTopChanged&&!t.matches(`:hover`)&&(t.scrollTop=e.scrollTop/(n.getScrollHeight()-n.getLayoutInfo().height)*(t.scrollHeight-t.clientHeight))});return()=>e.dispose()},[n]),(0,X.jsx)(`div`,{ref:o,className:He(`border-sidebar-border bg-background min-w-0 flex-1 overflow-y-auto p-6`,n!==null&&`border-l`),onScroll:e=>{let t=e.currentTarget;n!==null&&t.matches(`:hover`)&&n.setScrollTop(t.scrollTop/(t.scrollHeight-t.clientHeight)*(n.getScrollHeight()-n.getLayoutInfo().height),tu.ScrollType.Immediate)},onClickCapture:t=>{let n=(t.target instanceof Element?t.target.closest(`a`):null)?.getAttribute(`href`)??null;n===null||dW(n)||(t.preventDefault(),t.stopPropagation(),n.startsWith(`#`)?pW(t.currentTarget,n.slice(1))?.scrollIntoView():e.onOpen(fW(a,n)))},children:(0,X.jsx)(l,{text:c.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,``),components:u})})}function uW(e){let t=e.src??``,n=dW(t),[r,i]=(0,Y.useState)(void 0);return(0,Y.useEffect)(()=>{if(n)return;let r=!0;async function a(){try{let n=await se(e.machine,e.projectId,fW(e.file,t));r&&i(n)}catch{r&&i(void 0)}}return a(),()=>{r=!1}},[n,e.machine,e.projectId,e.file,t]),(0,X.jsx)(`img`,{src:n?t:r,alt:e.alt,width:e.width,height:e.height,className:`max-w-full`})}function dW(e){return/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}function fW(e,t){let n=e.split(`/`).map(encodeURIComponent).join(`/`),r=new URL(t,`file:///${n}`).pathname.slice(1);try{return decodeURIComponent(r)}catch{return r}}function pW(e,t){return[...e.querySelectorAll(`h1, h2, h3, h4, h5, h6`)].find(e=>mW(e.textContent)===t.toLowerCase())}function mW(e){return e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu,``).replaceAll(/\s/g,`-`)}function hW(e){return(0,X.jsx)(te,{open:e.path!==null,onOpenChange:t=>{t||e.onCancel()},children:(0,X.jsxs)(ie,{children:[(0,X.jsxs)(be,{children:[(0,X.jsx)(Se,{children:`${yp(e.path??``)} changed on disk`}),(0,X.jsx)(ne,{children:`Something else changed this file after you opened it. Overwriting replaces that version with yours.`})]}),(0,X.jsxs)(h,{children:[(0,X.jsx)(ue,{children:`Cancel`}),(0,X.jsx)(pe,{onClick:e.onOverwrite,children:`Overwrite`})]})]})})}function gW(e){return(0,X.jsx)(te,{open:e.open,onOpenChange:t=>{t||e.onCancel()},children:(0,X.jsxs)(ie,{children:[(0,X.jsxs)(be,{children:[(0,X.jsx)(Se,{children:e.paths.length===1?`Do you want to save the changes you made to ${yp(e.paths[0])}?`:`Do you want to save the changes to the following ${e.paths.length} files?`}),(0,X.jsxs)(ne,{children:[e.paths.length>1&&`${e.paths.map(yp).join(`, `)}. `,`Your changes will be lost if you don't save them.`]})]}),(0,X.jsxs)(h,{children:[(0,X.jsx)(ue,{children:`Cancel`}),(0,X.jsx)(pe,{variant:`outline`,onClick:()=>e.onFinish(!1),children:`Don't Save`}),(0,X.jsx)(pe,{onClick:()=>e.onFinish(!0),children:e.paths.length===1?`Save`:`Save All`})]})]})})}function _W(e){let[t,n]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{let t=e.editor;if(t===null)return;n(vW(t));let r=[t.onDidChangeCursorSelection(()=>n(vW(t))),t.onDidChangeModel(()=>n(vW(t))),t.onDidChangeModelOptions(()=>n(vW(t)))];return()=>{for(let e of r)e.dispose()}},[e.editor]),(0,X.jsxs)(`div`,{className:`bg-sidebar border-sidebar-border text-muted-foreground flex h-[22px] shrink-0 items-center justify-end gap-4 border-t px-3 text-xs whitespace-nowrap`,children:[e.children,e.language!==null&&t!==null&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{children:[`Ln `,t.line,`, Col `,t.column,t.selected>0&&` (${t.selected} selected)`]}),(0,X.jsxs)(`span`,{children:[t.spaces?`Spaces`:`Tab Size`,`: `,t.tabSize]}),(0,X.jsx)(`span`,{children:`UTF-8`}),(0,X.jsx)(`span`,{children:t.eol}),(0,X.jsx)(`span`,{children:e.language})]})]})}function vW(e){let t=e.getModel(),n=e.getSelection();if(t===null||n===null)return null;let r=t.getOptions();return{line:n.positionLineNumber,column:n.positionColumn,selected:t.getValueLengthInRange(n),tabSize:r.tabSize,spaces:r.insertSpaces,eol:t.getEndOfLineSequence()===tu.EndOfLineSequence.LF?`LF`:`CRLF`}}function yW(e){let t=bW(e.spec),n=t?.kind??null,r=(0,Y.useEffectEvent)(n=>{let r=e.spec,i=e.original,a=e.modified;if(r===void 0||t===null||i===null||a===null)throw Error(`This diff has no blocks to stage`);e.onPerform(()=>je(e.machine,`git.run`,{projectId:e.projectId,repo:r.repo,action:{kind:`stageContent`,path:t.path,content:t.kind===`stage`?n.originalWithModifiedChanges:nW(i,a,n.mapping)}}))});(0,Y.useEffect)(()=>{if(n!==null)return tW(n,r)},[n])}function bW(e){return e?.left?.kind===`git`&&e.left.ref===``&&e.right.kind===`worktree`?{kind:`stage`,path:e.left.path}:e?.left?.kind===`git`&&e.right.kind===`git`&&e.right.ref===``?{kind:`unstage`,path:e.right.path}:null}function xW(){let[e,t]=(0,Y.useState)(null),[n,r]=(0,Y.useState)(null);return{editor:e,diff:n,codeHost:(0,Y.useCallback)(e=>{if(e===null)return;let n=tu.create(e,{automaticLayout:!0,model:null});return t(n),()=>n.dispose()},[]),diffHost:(0,Y.useCallback)(e=>{if(e===null)return;let t=tu.createDiffEditor(e,{automaticLayout:!0,originalEditable:!1,experimental:{showMoves:!0},useInlineViewWhenSpaceIsLimited:!0});return r(t),()=>t.dispose()},[])}}var SW={M:`Modified`,T:`Type Changed`,A:`Added`,D:`Deleted`,R:`Renamed`,C:`Copied`,U:`Untracked`,"!":`Conflict`},CW={M:`text-warning`,T:`text-warning`,A:`text-success`,D:`text-destructive`,R:`text-success`,C:`text-success`,U:`text-success`,"!":`text-destructive`};function wW(e,t){return e===``?t:`${e}/${t}`}function TW(e){return e.slice(0,7)}function EW(e,t,n){let r=wW(e,n.path),i={kind:`git`,ref:``,path:n.path};function a(t,n,i){return{id:`${t}:${r}`,repo:e,path:r,label:`${yp(r)} (${t})`,left:n,right:i}}return t===`merge`?a(`Working Tree`,null,{kind:`worktree`}):t===`staged`&&n.status===`A`?a(`Index`,null,i):t===`staged`&&n.status===`D`?a(`Deleted`,null,{kind:`git`,ref:`HEAD`,path:n.path}):t===`staged`?a(`Index`,{kind:`git`,ref:`HEAD`,path:n.from??n.path},i):n.status===`U`?a(`Untracked`,null,{kind:`worktree`}):n.status===`A`?a(`Intent to Add`,null,{kind:`worktree`}):n.status===`D`?a(`Deleted`,null,i):a(`Working Tree`,i,{kind:`worktree`})}function DW(e,t){return{id:`File:${t}`,repo:e,path:t,label:yp(t),left:null,right:{kind:`worktree`}}}function OW(e,t){return{...DW(e,t),id:`Preview:${t}`,label:`${yp(t)} (Preview)`,preview:!0}}function kW(e,t){let n=wW(e,t.path);return{id:`HEAD:${n}`,repo:e,path:n,label:`${yp(n)} (HEAD)`,left:null,right:{kind:`git`,ref:`HEAD`,path:t.from??t.path}}}function AW(e,t,n){let r=wW(e,n.path),i=t.parents.at(0)??null;return{id:`${t.hash}:${r}`,repo:e,path:r,label:`${yp(r)} (${i===null?`empty`:TW(i)} ↔ ${TW(t.hash)})`,left:i===null||n.status===`A`?{kind:`empty`}:{kind:`git`,ref:i,path:n.from??n.path},right:n.status===`D`?{kind:`empty`}:{kind:`git`,ref:t.hash,path:n.path}}}function jW(e,t){return[...e].sort((e,n)=>t===`name`?yp(e.path).localeCompare(yp(n.path))||e.path.localeCompare(n.path):t===`status`&&e.status.localeCompare(n.status)||e.path.localeCompare(n.path))}function MW(e,t){let n={folders:new Map,files:[]};for(let t of e){let e=n,r=vp(t.path);for(let t of r===``?[]:r.split(`/`)){let n=e.folders.get(t)??{folders:new Map,files:[]};e.folders.set(t,n),e=n}e.files.push(t)}return NW(n,``,t)}function NW(e,t,n){return[...[...e.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(e=>{let r=e[0],i=e[1];for(;i.files.length===0&&i.folders.size===1;){let e=[...i.folders][0];r=`${r}/${e[0]}`,i=e[1]}let a=t===``?r:`${t}/${r}`,o=NW(i,a,n);return{kind:`folder`,path:a,label:r,children:o,resources:o.flatMap(e=>e.kind===`file`?[e.resource]:e.resources)}}),...jW(e.files,n).map(e=>({kind:`file`,resource:e}))]}var PW=new WeakSet;function FW(e){let[t,n]=(0,Y.useState)(()=>({tabs:e.saved.tabs.map(e=>({spec:e.spec,document:{status:`loading`}})),active:e.saved.active})),r=(0,Y.useRef)(t),i=(0,Y.useRef)(!0),a=(0,Y.useRef)(new Set),o=(0,Y.useRef)(Promise.resolve()),s=t.tabs,c=t.active,[l,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(null),p=s.filter(e=>e.document.status===`text`&&e.document.dirty),m=l?.kind===`tab`?s.filter(e=>e.spec.id===l.id):p,h=p.length>0;(0,Y.useEffect)(()=>{if(!h)return;function e(e){e.preventDefault()}return addEventListener(`beforeunload`,e),()=>removeEventListener(`beforeunload`,e)},[h]),(0,Y.useEffect)(()=>(i.current=!0,()=>{i.current=!1,queueMicrotask(()=>{if(i.current)return;let e=new Set([...a.current,...r.current.tabs.flatMap(e=>IW(e.document))]);for(let t of e)t.dispose()})}),[]);function g(e){r.current={...r.current,...e},n(r.current)}function _(e){g({active:e})}function v(){let e=new Set(s.flatMap(e=>IW(e.document)));for(let t of a.current)e.has(t)||t.dispose();a.current=e}async function y(t,n){if(n.kind===`empty`)return``;if(n.kind===`git`)return je(e.machine,`git.show`,{projectId:e.projectId,repo:t.repo,ref:n.ref,path:n.path});let r=await je(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return r.kind===`text`?r.content:null}function b(e){return Promise.all([e.left===null?``:y(e,e.left),y(e,e.right)])}function ee(e,t){g({tabs:r.current.tabs.map(n=>n.spec.id===e?{...n,document:t}:n)})}async function te(t){try{if(t.left===null&&t.right.kind===`worktree`){let n=await je(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return n.kind===`image`?{status:`image`,src:`data:${n.mediaType};base64,${n.data}`}:n.kind===`large`?{status:`large`,size:n.size,limit:n.limit}:n.kind===`binary`?{status:`binary`}:await ne(t,``,n.content)}let n=await b(t);return n[0]===null||n[1]===null?{status:`binary`}:await ne(t,n[0],n[1])}catch(e){return{status:`error`,message:Ve(e)}}}async function ne(e,t,n){let i=await aW(e.path),a=e.left===null?null:tu.createModel(t,i.id),o=tu.createModel(n,i.id);return o.onDidChangeContent(()=>{if(PW.has(o))return;let e=r.current.tabs,t=e.find(e=>e.document.status===`text`&&e.document.modified===o);if(t===void 0||t.document.status!==`text`)return;let n=o.getAlternativeVersionId()!==t.document.saved;t.document.dirty!==n&&g({tabs:e.map(e=>e===t?{...t,document:{...t.document,dirty:n}}:e)})}),{status:`text`,original:a,modified:o,language:i.name,saved:o.getAlternativeVersionId(),dirty:!1,base:n}}async function re(e){let t=r.current.tabs.find(t=>t.spec.id===e);if(t?.document.status!==`text`||t.document.dirty)return;let n=t.document,i=n.modified.getAlternativeVersionId();try{let a=await b(t.spec);if(n.modified.isDisposed()||n.modified.getAlternativeVersionId()!==i)return;let o=a[1];if(a[0]===null||o===null){ee(e,{status:`binary`});return}n.original!==null&&LW(n.original,a[0]),PW.add(n.modified),LW(n.modified,o),PW.delete(n.modified);let s=n.modified.getAlternativeVersionId();(s!==i||o!==n.base)&&g({tabs:r.current.tabs.map(e=>e.document.status===`text`&&e.document.modified===n.modified?{...e,document:{...e.document,saved:s,base:o}}:e)})}catch(t){ee(e,{status:`error`,message:Ve(t)})}}async function ie(e){g({active:e.id}),r.current.tabs.some(t=>t.spec.id===e.id)||(g({tabs:[...r.current.tabs,{spec:e,document:{status:`loading`}}]}),await ae(e))}async function ae(e){let t=await te(e),n=r.current.tabs.some(t=>t.spec.id===e.id&&t.document.status===`loading`);if(!i.current||!n)for(let e of IW(t))e.dispose();else ee(e.id,t)}function oe(e,t){let n=o.current.then(()=>se(e,t));return o.current=n,n}async function se(t,n){let i=r.current.tabs.find(e=>e.spec.id===t);if(i?.document.status!==`text`||!i.document.dirty||i.document.modified.isDisposed()||i.spec.right.kind!==`worktree`||i.spec.preview===!0)return!0;let a=i.document.modified,o=a.getAlternativeVersionId(),s=a.getValue();try{if(!await je(e.machine,`files.write`,{projectId:e.projectId,path:i.spec.path,content:s,base:n?null:i.document.base}))return f(i.spec),!1}catch(e){return ke(e),!1}return g({tabs:r.current.tabs.map(e=>e.document.status===`text`&&e.document.modified===a?{...e,document:{...e.document,saved:o,dirty:a.getAlternativeVersionId()!==o,base:s}}:e)}),e.onSaved(),!0}function ce(e){let t=r.current,n=t.tabs.filter(t=>!e(t.spec)),i=t.tabs.findIndex(e=>e.spec.id===t.active);g({tabs:n,active:i!==-1&&e(t.tabs[i].spec)?n.at(Math.min(i,n.length-1))?.spec.id??null:t.active})}function le(e,t){function n(n){return n===e?t:n.startsWith(`${e}/`)?`${t}${n.slice(e.length)}`:n}let i=r.current,a=i.tabs.map(e=>e.spec.id===DW(e.spec.repo,e.spec.path).id?{...e,spec:DW(e.spec.repo,n(e.spec.path))}:e.spec.id===OW(e.spec.repo,e.spec.path).id?{...e,spec:OW(e.spec.repo,n(e.spec.path))}:e),o=i.tabs.findIndex(e=>e.spec.id===i.active);g({tabs:a,active:o===-1?i.active:a[o].spec.id})}function ue(e){ce(t=>t.right.kind===`worktree`&&(t.path===e||t.path.startsWith(`${e}/`)))}function de(e){p.some(t=>t.spec.id===e)?u({kind:`tab`,id:e}):ce(t=>t.id===e)}function fe(){p.length>0?u({kind:`dialog`}):e.onClose()}async function pe(t){l!==null&&(u(null),t&&(await Promise.all(m.map(e=>oe(e.spec.id,!1)))).includes(!1)||(l.kind===`tab`&&ce(e=>e.id===l.id),l.kind===`dialog`&&e.onClose()))}function me(){d!==null&&oe(d.id,!0),f(null)}De(l?.kind!==`dialog`,fe);let he=(0,Y.useEffectEvent)(()=>{for(let t of e.saved.tabs)ae(t.spec)});return(0,Y.useEffect)(()=>he(),[]),{tabs:s,active:c,setActive:_,dirty:p,closing:l,setClosing:u,closingTabs:m,conflict:{path:d?.path??null,onCancel:()=>f(null),onOverwrite:me},open:ie,reload:re,save:oe,close:de,renamed:le,deleted:ue,requestClose:fe,finish:pe,releaseModels:v}}function IW(e){return e.status===`text`?e.original===null?[e.modified]:[e.original,e.modified]:[]}function LW(e,t){let n=e.getValue(),r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r++;let i=0;for(;i<n.length-r&&i<t.length-r&&n[n.length-1-i]===t[t.length-1-i];)i++;(r!==n.length||r!==t.length)&&e.applyEdits([{range:bd.fromPositions(e.getPositionAt(r),e.getPositionAt(n.length-i)),text:t.slice(r,t.length-i)}])}function RW(e){return(0,X.jsxs)(u,{children:[(0,X.jsxs)(s,{className:`hover:bg-accent data-[state=open]:bg-accent mr-auto ml-1 flex h-6 min-w-0 cursor-pointer items-center gap-1 rounded-sm px-1 text-[11px] font-bold tracking-wide uppercase outline-none`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.view===`explorer`?`Explorer`:`Source Control`}),(0,X.jsx)(Fe,{icon:v,className:`size-3.5 shrink-0`})]}),(0,X.jsx)(o,{align:`start`,className:`bg-popover! w-44`,children:(0,X.jsxs)(n,{value:e.view,onValueChange:t=>{(t===`explorer`||t===`scm`)&&e.onView(t)},children:[(0,X.jsx)(p,{value:`explorer`,children:`Explorer`}),(0,X.jsx)(p,{value:`scm`,children:`Source Control`})]})})]})}function zW(e){return(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 pl-1.5`,children:[(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Open File`,"aria-label":`Open File`,onClick:e.onOpenFile,children:(0,X.jsx)(Fe,{icon:ee,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Previous Change`,"aria-label":`Previous Change`,onClick:e.onPrevious,children:(0,X.jsx)(Fe,{icon:g,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Next Change`,"aria-label":`Next Change`,onClick:e.onNext,children:(0,X.jsx)(Fe,{icon:Ce,className:`size-4`})}),(0,X.jsxs)(u,{children:[(0,X.jsx)(s,{asChild:!0,children:(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,children:(0,X.jsx)(Fe,{icon:fe,className:`size-4`})})}),(0,X.jsxs)(o,{align:`end`,className:`bg-popover! w-80`,children:[(0,X.jsx)(r,{checked:e.settings.inline,onCheckedChange:t=>e.onSettings({inline:t}),children:`Inline View`}),(0,X.jsx)(r,{checked:e.settings.whitespace,onCheckedChange:t=>e.onSettings({whitespace:t}),children:`Show Leading/Trailing Whitespace Differences`}),(0,X.jsx)(r,{checked:e.settings.collapse,onCheckedChange:t=>e.onSettings({collapse:t}),children:`Collapse Unchanged Regions`})]})]})]})}function BW(e){let t=e.repo;return(0,X.jsxs)(`div`,{className:`mr-auto -ml-1.5 flex h-full items-center`,children:[(0,X.jsxs)(`button`,{type:`button`,title:`${t.branch??`HEAD`} (Git) - Checkout Branch/Tag...`,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onCheckout,children:[(0,X.jsx)(Fe,{icon:y,className:`size-3.5`}),t.branch??(t.head===null?`HEAD`:TW(t.head)),t.changes.length>0&&`*`,t.staged.length>0&&`+`,t.merge.length>0&&`!`]}),t.upstream!==null&&(0,X.jsxs)(`button`,{type:`button`,title:`Synchronize Changes`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onSync,children:[(0,X.jsx)(Fe,{icon:oe,className:He(`size-3.5`,e.busy&&`animate-spin`)}),(t.behind>0||t.ahead>0)&&`${t.behind}↓ ${t.ahead}↑`]}),t.upstream===null&&t.branch!==null&&t.remote&&(0,X.jsx)(`button`,{type:`button`,title:`Publish Branch`,"aria-label":`Publish Branch`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onPublish,children:(0,X.jsx)(Fe,{icon:me,className:`size-3.5`})})]})}var VW={all:null,amend:!1,then:null};function HW(e){let t=e.repo,n=t.merge.length+t.staged.length+t.changes.length>0,r=!n&&t.branch!==null&&t.upstream===null&&t.remote,i=!n&&t.upstream!==null&&(t.ahead>0||t.behind>0);return(0,X.jsxs)(`div`,{className:He(`grid gap-1.5 pt-1.5 pr-2 pb-1.5`,e.nested?`pl-4`:`pl-2`),children:[(0,X.jsxs)(`div`,{className:`bg-input/40 border-input focus-within:border-primary relative rounded-sm border`,children:[(0,X.jsx)(`textarea`,{rows:7,"aria-label":`Source Control Input`,value:e.message,placeholder:`Message (${Be===`⌘`?`⌘Enter`:`Ctrl+Enter`} to commit on "${t.branch??(t.head===null?`HEAD`:TW(t.head))}")`,className:`placeholder:text-muted-foreground block w-full resize-none bg-transparent py-1 pr-7 pl-2 text-[13px] leading-[18px] outline-none`,onChange:t=>e.onMessage(t.target.value),onKeyDown:t=>{(t.metaKey||t.ctrlKey)&&t.key===`Enter`&&(t.preventDefault(),e.onCommit({...VW,then:`push`}))}}),(0,X.jsx)(`button`,{type:`button`,title:e.generating?`Cancel`:`Generate Commit Message`,"aria-label":e.generating?`Cancel`:`Generate Commit Message`,className:`text-muted-foreground hover:text-foreground hover:bg-accent absolute top-[3px] right-[3px] grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:e.generating?e.onCancel:e.onGenerate,children:(0,X.jsx)(Fe,{icon:e.generating?ap:ve,className:`size-3.5`})})]}),r&&(0,X.jsxs)(Ie,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.push`),children:[(0,X.jsx)(Fe,{icon:me}),`Publish Branch`]}),i&&(0,X.jsxs)(Ie,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.sync`),children:[(0,X.jsx)(Fe,{icon:oe}),`Sync Changes`,t.behind>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[t.behind,(0,X.jsx)(Fe,{icon:Ce,className:`size-3`})]}),t.ahead>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[t.ahead,(0,X.jsx)(Fe,{icon:g,className:`size-3`})]})]}),!r&&!i&&(0,X.jsxs)(`div`,{className:`flex`,children:[(0,X.jsxs)(Ie,{size:`xs`,className:`flex-1 rounded-sm rounded-r-none [&:active:not([aria-haspopup])]:scale-100`,disabled:!n||e.busy,onClick:()=>e.onCommit({...VW,then:`push`}),children:[(0,X.jsx)(Fe,{icon:re}),`Commit & Push`]}),(0,X.jsxs)(u,{children:[(0,X.jsx)(s,{asChild:!0,children:(0,X.jsx)(Ie,{size:`xs`,className:`rounded-sm rounded-l-none px-1 before:absolute before:inset-y-1 before:-left-px before:w-px before:bg-white/10`,disabled:!n||e.busy,title:`More Actions...`,"aria-label":`More Commit Actions`,children:(0,X.jsx)(Fe,{icon:v})})}),(0,X.jsxs)(o,{align:`end`,className:`bg-popover! w-48`,children:[(0,X.jsx)(c,{onSelect:()=>e.onCommit(VW),children:`Commit`}),(0,X.jsx)(c,{onSelect:()=>e.onCommit({...VW,amend:!0}),children:`Commit (Amend)`}),(0,X.jsx)(c,{onSelect:()=>e.onCommit({...VW,then:`push`}),children:`Commit & Push`}),(0,X.jsx)(c,{onSelect:()=>e.onCommit({...VW,then:`sync`}),children:`Commit & Sync`})]})]})]})]})}var UW=[{id:`merge`,title:`Merge Changes`},{id:`staged`,title:`Staged Changes`},{id:`changes`,title:`Changes`}];function WW(e){let[t,n]=(0,Y.useState)([]),[r,i]=(0,Y.useState)(null),a=ce(),o=e.repo;function s(e){n(t.includes(e)?t.filter(t=>t!==e):[...t,e])}function c(t,n,r){let i=r===`group`?`All Changes`:`Changes`;return(0,X.jsxs)(X.Fragment,{children:[r===`file`&&n[0].status!==`D`&&(0,X.jsx)(KW,{title:`Open File`,icon:ee,onClick:()=>e.onOpen(DW(o.path,wW(o.path,n[0].path)))}),t===`changes`&&(0,X.jsx)(KW,{title:`Discard ${i}`,icon:sp,onClick:()=>e.onDiscard(n)}),t===`staged`&&(0,X.jsx)(KW,{title:`Unstage ${i}`,icon:$f,onClick:()=>e.onUnstage(n)}),t!==`staged`&&(0,X.jsx)(KW,{title:t===`merge`&&r===`group`?`Stage All Merge Changes`:`Stage ${i}`,icon:Qf,onClick:()=>e.onStage(n)})]})}function l(t,n,r){let a=EW(o.path,t,n),s=wW(o.path,n.path);return(0,X.jsxs)(`div`,{"data-resource":!0,role:`button`,tabIndex:0,title:`${e.root}/${s} • ${SW[n.status]}`,className:He(`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,a.id===e.active&&`bg-sidebar-row-active`),style:{paddingLeft:20+r*8},onClick:()=>e.onOpen(a),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(a)},onContextMenu:()=>i({group:t,resource:n}),children:[(0,X.jsx)(Ke,{path:n.path}),(0,X.jsx)(`span`,{className:He(`min-w-0 shrink-0 truncate`,CW[n.status],n.status===`D`&&`line-through`),children:yp(n.path)}),!e.tree&&(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:vp(n.path)}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:c(t,[n],`file`)}),(0,X.jsx)(`span`,{className:He(`w-3.5 text-center text-xs`,CW[n.status]),children:n.status})]})]},`${t}:${n.path}`)}function u(e,n,r){return n.map(n=>{if(n.kind===`file`)return l(e,n.resource,r);let i=`${o.path}:${e}:${n.path}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:n.path,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+r*8},onClick:()=>s(i),onKeyDown:e=>{e.key===`Enter`&&s(i)},children:[(0,X.jsx)(GW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.label}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:c(e,n.resources,`folder`)})]}),a&&u(e,n.children,r+1)]},i)})}return(0,X.jsxs)(_e,{children:[(0,X.jsx)(b,{asChild:!0,children:(0,X.jsx)(`div`,{onContextMenu:e=>{e.target instanceof Element&&e.target.closest(`[data-resource]`)!==null||e.preventDefault()},children:UW.map(n=>{let r=o[n.id];if(r.length===0)return null;let i=`${o.path}:${n.id}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+e.depth*8},onClick:()=>s(i),onKeyDown:e=>{e.key===`Enter`&&s(i)},children:[(0,X.jsx)(GW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.title}),(0,X.jsx)(`span`,{className:`hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:c(n.id,r,`group`)}),(0,X.jsx)(`span`,{className:`bg-muted text-foreground grid h-4.5 min-w-4.5 shrink-0 place-items-center rounded-full px-1 text-[11px] tabular-nums`,children:r.length})]}),a&&(e.tree?u(n.id,MW(r,e.sort),e.depth+1):jW(r,e.sort).map(t=>l(n.id,t,e.depth+1)))]},n.id)})})}),r!==null&&(0,X.jsxs)(he,{className:`min-w-52`,children:[(0,X.jsx)(ae,{onSelect:()=>e.onOpen(EW(o.path,r.group,r.resource)),children:`Open Changes`}),r.resource.status!==`D`&&(0,X.jsx)(ae,{onSelect:()=>e.onOpen(DW(o.path,wW(o.path,r.resource.path))),children:`Open File`}),r.resource.status!==`U`&&r.resource.status!==`A`&&(0,X.jsx)(ae,{onSelect:()=>e.onOpen(kW(o.path,r.resource)),children:`Open File (HEAD)`}),(0,X.jsx)(ge,{}),r.group===`staged`&&(0,X.jsx)(ae,{onSelect:()=>e.onUnstage([r.resource]),children:`Unstage Changes`}),r.group!==`staged`&&(0,X.jsx)(ae,{onSelect:()=>e.onStage([r.resource]),children:`Stage Changes`}),r.group===`changes`&&(0,X.jsx)(ae,{onSelect:()=>e.onDiscard([r.resource]),children:`Discard Changes`}),r.resource.status===`U`&&(0,X.jsx)(ae,{onSelect:()=>e.onIgnore([r.resource]),children:`Add to .gitignore`}),(0,X.jsx)(ge,{}),(0,X.jsx)(ae,{onSelect:()=>void a.copy(`${e.root}/${wW(o.path,r.resource.path)}`),children:`Copy Path`}),(0,X.jsx)(ae,{onSelect:()=>void a.copy(wW(o.path,r.resource.path)),children:`Copy Relative Path`})]})]})}function GW(e){return(0,X.jsx)(Fe,{icon:Je,"aria-hidden":!0,className:He(`text-muted-foreground size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)})}function KW(e){return(0,X.jsx)(`button`,{type:`button`,title:e.title,"aria-label":e.title,className:`text-foreground hover:bg-accent grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:t=>{t.stopPropagation(),e.onClick()},children:(0,X.jsx)(Fe,{icon:e.icon,className:`size-4`})})}var qW=50,JW=11,YW=22,XW=[`#59A4F9`,`#FFB000`,`#DC267F`,`#994F00`,`#40B0A6`,`#B66DFF`];function ZW(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(qW),[l,u]=(0,Y.useState)(0),[d,f]=(0,Y.useState)([]),[p,m]=(0,Y.useState)({}),h=e.repos.find(e=>e.path===t)??e.repos.at(0),g=h?.path??null,_=h?.head??null,v=h?.upstream??null,y=h?.behind??0;(0,Y.useEffect)(()=>{if(g===null||_===null){i([]);return}let t=!0;return je(e.machine,`git.history`,{projectId:e.projectId,repo:g,limit:s}).then(e=>{t&&(i(e),o(null))},e=>{t&&o(Ve(e))}),()=>{t=!1}},[e.machine,e.projectId,g,_,v,y,s,l]);async function b(t){if(d.includes(t.hash))f(d.filter(e=>e!==t.hash));else if(f([...d,t.hash]),h!==void 0&&p[t.hash]===void 0)try{let n=await je(e.machine,`git.commitFiles`,{projectId:e.projectId,repo:h.path,hash:t.hash,parent:t.parents.at(0)??null});m(e=>({...e,[t.hash]:n}))}catch(e){ke(e)}}let ee=nG(r??[]);return(0,X.jsxs)(`div`,{className:He(`border-sidebar-border relative flex shrink-0 flex-col border-t`,e.open&&`min-h-20`),style:e.open?{height:e.height}:void 0,children:[e.open&&(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,className:`hover:bg-primary absolute inset-x-0 -top-0.5 z-10 h-1 cursor-row-resize touch-none transition-colors delay-100`,onPointerDown:t=>{let n=t.currentTarget.parentElement?.parentElement;if(n==null)return;let r=n.getBoundingClientRect();ze(t,t=>e.onHeight(Math.min(Math.max(r.bottom-t.clientY,80),r.height-120)))}}),(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row text-sidebar-foreground flex h-[22px] shrink-0 cursor-pointer items-center gap-0.5 pr-2 pl-0.5 outline-none select-none`,onClick:e.onToggle,onKeyDown:t=>{t.key===`Enter`&&e.onToggle()},children:[(0,X.jsx)(Fe,{icon:Je,"aria-hidden":!0,className:He(`size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-bold tracking-wide uppercase`,children:`Graph`}),e.repos.length>1&&(0,X.jsx)(`select`,{"aria-label":`Repository`,value:h?.path??``,className:`bg-sidebar text-muted-foreground max-w-28 cursor-pointer truncate text-xs outline-none`,onClick:e=>e.stopPropagation(),onChange:e=>{n(e.target.value),f([]),c(qW)},children:e.repos.map(e=>(0,X.jsx)(`option`,{value:e.path,children:e.path===``?`.`:e.path},e.path))}),e.open&&h!==void 0&&(0,X.jsxs)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex`,children:[(0,X.jsx)(KW,{title:`Fetch From All Remotes`,icon:ep,onClick:()=>e.onFetch(h)}),(0,X.jsx)(KW,{title:`Refresh`,icon:qe,onClick:()=>u(l+1)})]})]}),e.open&&(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[a!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:a}),a===null&&ee.length===0&&r!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:`No commits yet.`}),a===null&&h!==void 0&&ee.map(t=>{let n=t.commit,r=d.includes(n.hash);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${n.author}, ${new Date(n.date).toLocaleString()}\n\n${n.subject}\n\n${TW(n.hash)}`,className:`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,onClick:()=>void b(n),onKeyDown:e=>{e.key===`Enter`&&b(n)},children:[(0,X.jsx)(QW,{row:t,child:!1}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.subject}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 shrink-[2] truncate text-xs`,children:n.author}),(0,X.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:n.refs.map(e=>$W(e,h))})]}),r&&(p[n.hash]??[]).map(r=>{let i=AW(h.path,n,r);return(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${r.path} • ${SW[r.status]}`,className:He(`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,i.id===e.active&&`bg-sidebar-row-active`),onClick:()=>e.onOpen(i),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(i)},children:[(0,X.jsx)(QW,{row:t,child:!0}),(0,X.jsx)(Ke,{path:r.path}),(0,X.jsx)(`span`,{className:He(`min-w-0 shrink-0 truncate`,CW[r.status],r.status===`D`&&`line-through`),children:yp(r.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:vp(r.path)}),(0,X.jsx)(`span`,{className:He(`ml-auto w-3.5 shrink-0 text-center text-xs`,CW[r.status]),children:r.status})]},r.path)})]},n.hash)}),r!==null&&r.length===s&&(0,X.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground w-full cursor-pointer px-4 py-1 text-left text-xs`,onClick:()=>c(s+qW),children:`Load More…`})]})]})}function QW(e){let t=e.row,n=YW/2,r=eG(t.lane);return e.child?(0,X.jsx)(`svg`,{"aria-hidden":!0,width:JW*(t.width+1),height:YW,className:`shrink-0`,children:t.after.map(e=>(0,X.jsx)(`line`,{x1:eG(e),x2:eG(e),y1:0,y2:YW,stroke:tG(e),strokeWidth:1},e))}):(0,X.jsxs)(`svg`,{"aria-hidden":!0,width:JW*(t.width+1),height:YW,className:`shrink-0`,children:[t.through.map(e=>(0,X.jsx)(`line`,{x1:eG(e),x2:eG(e),y1:0,y2:YW,stroke:tG(e),strokeWidth:1},`through-${e}`)),t.up.map(e=>(0,X.jsx)(`path`,{d:`M ${eG(e)} 0 Q ${eG(e)} ${n} ${r} ${n}`,fill:`none`,stroke:tG(e),strokeWidth:1},`up-${e}`)),t.down.map(e=>(0,X.jsx)(`path`,{d:`M ${r} ${n} Q ${eG(e)} ${n} ${eG(e)} ${YW}`,fill:`none`,stroke:tG(e),strokeWidth:1},`down-${e}`)),(0,X.jsx)(`circle`,{cx:r,cy:n,r:t.commit.parents.length>1?3.5:4,fill:t.commit.parents.length>1?`var(--sidebar)`:tG(t.lane),stroke:tG(t.lane),strokeWidth:t.commit.parents.length>1?2:0})]})}function $W(e,t){if(e.endsWith(`/HEAD`))return null;let n=e===`HEAD`||e.startsWith(`HEAD -> `),r=e.startsWith(`tag: `),i=e===t.upstream,a=e.replace(/^HEAD -> /,``).replace(/^tag: /,``);return(0,X.jsxs)(`span`,{title:a,className:He(`inline-flex h-4 max-w-32 items-center gap-0.5 rounded-full px-1.5 text-[11px] font-medium`,n&&`text-background bg-[#59A4F9]`,i&&`text-background bg-[#B180D7]`,!n&&!i&&`bg-muted text-foreground`),children:[(0,X.jsx)(Fe,{icon:r?op:i?de:y,className:`size-3 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:a})]},e)}function eG(e){return JW*(e+1)}function tG(e){return XW[e%XW.length]}function nG(e){let t=[];return e.map(e=>{let n=t,r=n.indexOf(e.hash),i=n.indexOf(null),a=r===-1?i===-1?n.length:i:r,o=n.map(t=>t===e.hash?null:t);o[a]=e.parents.at(0)??null;let s=e.parents.length>0?[a]:[];for(let t of e.parents.slice(1)){let e=o.indexOf(t);if(e!==-1){s.push(e);continue}let n=o.indexOf(null),r=n===-1?o.length:n;o[r]=t,s.push(r)}for(;o.length>0&&o.at(-1)===null;)o.pop();return t=o,{commit:e,lane:a,up:n.flatMap((t,n)=>t===e.hash?[n]:[]),through:n.flatMap((t,n)=>t!==null&&t!==e.hash?[n]:[]),down:s,after:o.flatMap((e,t)=>e===null?[]:[t]),width:Math.max(n.length,o.length,a+1)}})}function rG(e){let t=e.repo;function r(t,n){return(0,X.jsx)(c,{onSelect:()=>e.onCommit({...VW,...n}),children:t})}return(0,X.jsxs)(u,{children:[(0,X.jsx)(s,{asChild:!0,children:(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Fe,{icon:fe,className:`size-4`})})}),(0,X.jsxs)(o,{align:`end`,className:`bg-popover! w-56`,children:[(0,X.jsxs)(f,{children:[(0,X.jsx)(i,{children:`View & Sort`}),(0,X.jsxs)(m,{className:`w-44`,children:[(0,X.jsxs)(n,{value:e.settings.tree?`tree`:`list`,onValueChange:t=>e.onSettings({tree:t===`tree`}),children:[(0,X.jsx)(p,{value:`list`,children:`View as List`}),(0,X.jsx)(p,{value:`tree`,children:`View as Tree`})]}),(0,X.jsx)(a,{}),(0,X.jsxs)(n,{value:e.settings.sort,onValueChange:t=>{(t===`name`||t===`path`||t===`status`)&&e.onSettings({sort:t})},children:[(0,X.jsx)(p,{value:`name`,children:`Sort by Name`}),(0,X.jsx)(p,{value:`path`,children:`Sort by Path`}),(0,X.jsx)(p,{value:`status`,children:`Sort by Status`})]})]})]}),(0,X.jsx)(a,{}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(c,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(c,{onSelect:e.onCheckout,children:`Checkout to...`}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(a,{}),(0,X.jsxs)(f,{children:[(0,X.jsx)(i,{children:`Commit`}),(0,X.jsxs)(m,{className:`w-52`,children:[r(`Commit`,{}),r(`Commit Staged`,{all:!1}),r(`Commit All`,{all:!0}),(0,X.jsx)(c,{disabled:t.head===null,onSelect:e.onUndo,children:`Undo Last Commit`}),(0,X.jsx)(a,{}),r(`Commit (Amend)`,{amend:!0}),r(`Commit Staged (Amend)`,{all:!1,amend:!0}),r(`Commit All (Amend)`,{all:!0,amend:!0})]})]}),(0,X.jsxs)(f,{children:[(0,X.jsx)(i,{children:`Changes`}),(0,X.jsxs)(m,{className:`w-52`,children:[(0,X.jsx)(c,{onSelect:()=>e.onStage([...t.merge,...t.changes]),children:`Stage All Changes`}),(0,X.jsx)(c,{onSelect:()=>e.onUnstage(t.staged),children:`Unstage All Changes`}),(0,X.jsx)(c,{disabled:t.changes.length===0,onSelect:()=>e.onDiscard(t.changes),children:`Discard All Changes`})]})]}),(0,X.jsxs)(f,{children:[(0,X.jsx)(i,{children:`Pull, Push`}),(0,X.jsxs)(m,{className:`w-52`,children:[(0,X.jsx)(c,{onSelect:()=>e.onRemote(`git.sync`),children:`Sync`}),(0,X.jsx)(a,{}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`pull`,rebase:!0}),children:`Pull (Rebase)`}),(0,X.jsx)(a,{}),(0,X.jsx)(c,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(a,{}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`fetch`,prune:!0,all:!1}),children:`Fetch (Prune)`}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!0}),children:`Fetch From All Remotes`})]})]}),(0,X.jsxs)(f,{children:[(0,X.jsx)(i,{children:`Branch`}),(0,X.jsxs)(m,{className:`w-52`,children:[(0,X.jsx)(c,{onSelect:e.onCheckout,children:`Create Branch...`}),(0,X.jsx)(c,{disabled:t.branch===null||t.upstream!==null,onSelect:()=>e.onRemote(`git.push`),children:`Publish Branch...`})]})]}),(0,X.jsxs)(f,{children:[(0,X.jsx)(i,{children:`Stash`}),(0,X.jsxs)(m,{className:`w-56`,children:[(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`stash`,mode:`tracked`}),children:`Stash`}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`stash`,mode:`untracked`}),children:`Stash (Include Untracked)`}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`stash`,mode:`staged`}),children:`Stash Staged`}),(0,X.jsx)(a,{}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`unstash`,pop:!1}),children:`Apply Latest Stash`}),(0,X.jsx)(c,{onSelect:()=>e.onRun({kind:`unstash`,pop:!0}),children:`Pop Latest Stash`})]})]})]})]})}function iG(e){let[t,n]=(0,Y.useState)([]),r=(0,Y.useRef)(new Map),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=e.repos??[],l=c.length===1?c[0]:null,u=e.settings,d=Oe(e=>e.prefs);function f(e){return u.messages[e.path]??``}function p(t,n){return e.onPerform(()=>je(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:n}))}function m(t,n){return e.onPerform(()=>je(e.machine,n,{projectId:e.projectId,repo:t.path}))}async function g(t,n){let r=f(t).trim();if(r===``&&!n.amend){ke(`Please provide a commit message.`);return}let i=t.changes.length+t.merge.length>0;if(n.all===null&&!n.amend&&t.staged.length===0){if(!i){ke(`There are no changes to commit.`);return}if(!u.smartCommit){a({repo:t,options:n});return}}let o=n.all??(t.staged.length===0&&!n.amend&&i);await e.onPerform(async()=>{await je(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:{kind:`commit`,message:r,all:o,amend:n.amend}}),e.onMessage(t.path,``),n.then!==null&&await je(e.machine,n.then===`push`?`git.push`:`git.sync`,{projectId:e.projectId,repo:t.path})})}async function _(t){let i={};r.current.set(t.path,i),n(e=>[...e,t.path]);try{let n=await je(e.machine,`git.message`,{projectId:e.projectId,repo:t.path,staged:t.staged.length>0});r.current.get(t.path)===i&&e.onMessage(t.path,n)}catch(e){r.current.get(t.path)===i&&ke(e)}finally{r.current.get(t.path)===i&&v(t)}}function v(e){r.current.delete(e.path),n(t=>t.filter(t=>t!==e.path))}function y(t){e.onPerform(async()=>{e.onMessage(t.path,await je(e.machine,`git.undoCommit`,{projectId:e.projectId,repo:t.path}))})}function b(e,t){p(e,{kind:`unstage`,paths:t.flatMap(e=>e.from===null?[e.path]:[e.path,e.from])})}function ee(e,t){p(e,{kind:`stage`,paths:t.map(e=>e.path)})}function ae(t){return(0,X.jsx)(rG,{repo:t,settings:u,onSettings:e.onSettings,onCommit:e=>void g(t,e),onUndo:()=>y(t),onRun:e=>void p(t,e),onRemote:e=>void m(t,e),onStage:e=>ee(t,e),onUnstage:e=>b(t,e),onDiscard:e=>s({repo:t,resources:e}),onCheckout:()=>e.onCheckout(t)})}let oe=o?.resources??[],se=oe.filter(e=>e.status===`U`);return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border relative flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:u.tree?`View as List`:`View as Tree`,"aria-label":u.tree?`View as List`:`View as Tree`,onClick:()=>e.onSettings({tree:!u.tree}),children:(0,X.jsx)(Fe,{icon:u.tree?ip:rp,className:`size-4`})}),l!==null&&(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Commit`,"aria-label":`Commit`,disabled:e.busy,onClick:()=>void g(l,VW),children:(0,X.jsx)(Fe,{icon:re,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Refresh`,"aria-label":`Refresh`,onClick:e.onRefresh,children:(0,X.jsx)(Fe,{icon:qe,className:`size-4`})}),l!==null&&ae(l),(e.busy||t.length>0)&&(0,X.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 overflow-hidden`,children:(0,X.jsx)(`span`,{className:`bg-primary block h-full w-[2%] animate-[progress_4s_linear_infinite]`})})]}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[e.error!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:e.error}),e.error===null&&e.repos===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),e.error===null&&e.repos?.length===0&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`The folder currently open doesn't have a git repository.`}),c.map(n=>(0,X.jsxs)(`div`,{children:[l===null&&(0,X.jsxs)(`div`,{className:`group/row text-sidebar-foreground flex h-[22px] items-center gap-1.5 pr-1 pl-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`truncate font-semibold`,children:n.path===``?e.name:yp(n.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:n.branch??(n.head===null?``:TW(n.head))}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex`,children:(0,X.jsx)(KW,{title:`Commit`,icon:re,onClick:()=>void g(n,VW)})}),ae(n)]}),(0,X.jsx)(HW,{repo:n,message:f(n),generating:t.includes(n.path),busy:e.busy,nested:l===null,onMessage:t=>e.onMessage(n.path,t),onGenerate:()=>void _(n),onCancel:()=>v(n),onCommit:e=>void g(n,e),onRemote:e=>void m(n,e)}),(0,X.jsx)(WW,{repo:n,root:e.root,tree:u.tree,sort:u.sort,depth:+(l===null),active:e.active,onOpen:e.onOpen,onStage:e=>ee(n,e),onUnstage:e=>b(n,e),onDiscard:e=>s({repo:n,resources:e}),onIgnore:e=>void p(n,{kind:`ignore`,paths:e.map(e=>e.path)})})]},n.path))]}),c.length>0&&(0,X.jsx)(ZW,{machine:e.machine,projectId:e.projectId,repos:c,open:d.editor.graph,height:u.graphHeight,active:e.active,onToggle:()=>Ee({...d,editor:{...d.editor,graph:!d.editor.graph}}),onHeight:t=>e.onSettings({graphHeight:t}),onOpen:e.onOpen,onFetch:e=>void p(e,{kind:`fetch`,prune:!1,all:!0})}),(0,X.jsx)(te,{open:i!==null,onOpenChange:e=>{e||a(null)},children:(0,X.jsxs)(ie,{children:[(0,X.jsxs)(be,{children:[(0,X.jsx)(Se,{children:`There are no staged changes to commit.`}),(0,X.jsx)(ne,{children:`Would you like to stage all your changes and commit them directly?`})]}),(0,X.jsxs)(h,{children:[(0,X.jsx)(ue,{children:`Cancel`}),(0,X.jsx)(pe,{variant:`outline`,onClick:()=>{i!==null&&(e.onSettings({smartCommit:!0}),g(i.repo,{...i.options,all:!0}))},children:`Always`}),(0,X.jsx)(pe,{onClick:()=>{i!==null&&g(i.repo,{...i.options,all:!0})},children:`Yes`})]})]})}),(0,X.jsx)(te,{open:o!==null,onOpenChange:e=>{e||s(null)},children:(0,X.jsxs)(ie,{children:[(0,X.jsxs)(be,{children:[(0,X.jsx)(Se,{children:oe.length>1?`Are you sure you want to discard ALL changes in ${oe.length} files?`:se.length===1?`Are you sure you want to DELETE the following untracked file: '${yp(oe[0].path)}'?`:`Are you sure you want to discard changes in '${yp(oe.at(0)?.path??``)}'?`}),(0,X.jsxs)(ne,{children:[oe.length>1&&`This is IRREVERSIBLE! Your current working set will be FOREVER LOST if you proceed.`,oe.length===1&&se.length===1&&`This is IRREVERSIBLE! This file will be FOREVER LOST if you proceed.`]})]}),(0,X.jsxs)(h,{children:[(0,X.jsx)(ue,{children:`Cancel`}),(0,X.jsx)(pe,{variant:`destructive`,onClick:()=>{o!==null&&p(o.repo,{kind:`discard`,tracked:oe.filter(e=>e.status!==`U`).map(e=>e.path),untracked:se.map(e=>e.path)})},children:oe.length>1?`Discard All ${oe.length} Files`:se.length===1?`Delete File`:`Discard File`})]})]})})]})}var aG=3e3;function oG(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),a=(0,Y.useEffectEvent)(e.onLoaded);return(0,Y.useEffect)(()=>{let t=!0,r=!1;async function o(){if(!r){r=!0;try{let r=await je(e.machine,`git.changes`,{projectId:e.projectId});if(!t)return;i(null),n(e=>Ne(e,r)?e:r),a()}catch(e){t&&i(Ve(e))}finally{r=!1}}}function s(){document.hidden||o()}o();let c=window.setInterval(s,aG);return window.addEventListener(`focus`,s),()=>{t=!1,window.clearInterval(c),window.removeEventListener(`focus`,s)}},[e.machine,e.projectId,e.version]),{repos:t,error:r}}var sG=(0,Y.lazy)(async()=>({default:(await J(async()=>{let{ZoomableImage:e}=await import(`./zoomable-image-DAEgBZCp.js`);return{ZoomableImage:e}},__vite__mapDeps([16,17,2,18,19,20,21]))).ZoomableImage}));function cG(e){let t=Oe(t=>Pe(t,e.machine,e.projectId)),n=Te(),r=Oe(e=>e.prefs.editor),[i]=(0,Y.useState)(()=>pp(e.machine,e.projectId)),[a]=(0,Y.useState)(()=>new Map(i.tabs.map(e=>[e.spec.id,e.view]))),[o,s]=(0,Y.useState)(()=>({...i.settings,width:Math.min(i.settings.width,window.innerWidth*.6)})),[c,l]=(0,Y.useState)(i.expanded),[u,d]=(0,Y.useState)(0),[f,p]=(0,Y.useState)(0),[m,h]=(0,Y.useState)(null),g=xW(),v=g.editor,y=g.diff,b=(0,Y.useRef)(null),ee=(0,Y.useCallback)(()=>d(e=>e+1),[]),te=FW({machine:e.machine,projectId:e.projectId,saved:i,onSaved:ee,onClose:()=>{ve(),e.onClose()}}),ne=te.active;function re(){ne!==null&&te.reload(ne)}let ie=oG({machine:e.machine,projectId:e.projectId,version:u,onLoaded:re}),ae=ie.repos,oe=te.tabs.find(e=>e.spec.id===ne),se=oe?.document.status===`text`&&oe.spec.preview!==!0?oe.document:null,ce=oe?.document.status===`text`&&oe.spec.preview===!0?oe.document.modified:null,le=se?.original??null,ue=se?.modified??null,de=oe?.spec.right.kind===`worktree`,fe=ae?.find(e=>e.path===oe?.spec.repo)??ae?.at(0)??null,pe=le===null&&ue?.getLanguageId()===`markdown`?ue:null;(0,Y.useEffect)(()=>{oW().catch(ke)},[n]),(0,Y.useEffect)(()=>{v?.updateOptions(sW(r)),y?.updateOptions(sW(r)),cW(r).catch(ke)},[v,y,r]),(0,Y.useEffect)(()=>{y?.updateOptions({renderSideBySide:!o.inline,ignoreTrimWhitespace:!o.whitespace,hideUnchangedRegions:{enabled:o.collapse}})},[y,o.inline,o.whitespace,o.collapse]),(0,Y.useEffect)(()=>{if(v===null||y===null||(b.current!==null&&a.set(b.current.id,b.current.editor.saveViewState()),b.current=null,v.setModel(le===null?ue:null),y.setModel(le===null||ue===null?null:{original:le,modified:ue}),ue===null||ne===null))return;let e=le===null?v:y.getModifiedEditor();e.updateOptions({readOnly:!de}),y.updateOptions({readOnly:!de}),e.restoreViewState(a.get(ne)??null),e.focus(),b.current={id:ne,editor:e}},[v,y,le,ue,ne,de,a]),(0,Y.useEffect)(()=>te.releaseModels());let me=(0,Y.useEffectEvent)(re);(0,Y.useEffect)(()=>me(),[ne]),yW({machine:e.machine,projectId:e.projectId,spec:oe?.spec,original:le,modified:ue,onPerform:ge});function he(e){window.innerWidth<640&&_e({sidebar:!1}),te.open(e)}async function ge(e){p(e=>e+1);try{await e()}catch(e){ke(e)}finally{p(e=>e-1),ee()}}function _e(e){s(t=>({...t,...e}))}function ve(){b.current!==null&&a.set(b.current.id,b.current.editor.saveViewState()),mp(e.machine,e.projectId,{tabs:te.tabs.map(e=>({spec:e.spec,view:a.get(e.spec.id)??null})),active:ne,expanded:c,settings:o})}(0,Y.useEffect)(ve);let ye=(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Toggle Primary Side Bar`,"aria-label":`Toggle Primary Side Bar`,"aria-pressed":o.sidebar,onClick:()=>_e({sidebar:!o.sidebar}),children:(0,X.jsx)(Fe,{icon:_,className:`size-4`})}),be=(0,X.jsxs)(X.Fragment,{children:[ye,(0,X.jsx)(RW,{view:o.view,onView:e=>_e({view:e})})]});return(0,X.jsx)(Ge,{open:!0,onOpenChange:()=>te.requestClose(),children:(0,X.jsxs)(Ue,{"aria-describedby":void 0,showCloseButton:!1,className:`top-0 left-0 flex h-dvh w-dvw max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none border-0 p-0 sm:max-w-none`,onEscapeKeyDown:e=>e.preventDefault(),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),ne!==null&&te.save(ne,!1)),(e.metaKey||e.ctrlKey)&&e.key===`w`&&(e.preventDefault(),ne!==null&&te.close(ne)),(e.metaKey||e.ctrlKey)&&e.shiftKey&&e.key.toLowerCase()===`v`&&pe!==null&&(e.preventDefault(),_e({preview:!o.preview}))},children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:He(`border-sidebar-border relative shrink-0 border-r`,!o.sidebar&&`hidden`),style:{width:o.width},children:[o.view===`explorer`&&(0,X.jsx)(gp,{machine:e.machine,projectId:e.projectId,root:t?.path??``,header:be,expanded:c,onExpanded:l,active:oe?.spec.path??null,onOpen:e=>he(DW(``,e)),onPreview:e=>he(OW(``,e)),onRenamed:te.renamed,onDeleted:te.deleted}),o.view===`scm`&&(0,X.jsx)(iG,{machine:e.machine,projectId:e.projectId,name:t?.name??``,root:t?.path??``,header:be,repos:ae,error:ie.error,busy:f>0,settings:o,onSettings:_e,onMessage:(e,t)=>s(n=>({...n,messages:{...n.messages,[e]:t}})),active:ne,onOpen:he,onRefresh:ee,onPerform:ge,onCheckout:h}),(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`hover:bg-primary absolute inset-y-0 -right-0.5 z-10 w-1 cursor-col-resize touch-none transition-colors delay-100`,onPointerDown:e=>ze(e,e=>_e({width:Math.min(Math.max(e.clientX,200),window.innerWidth-240)}))})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-9 shrink-0 items-center shadow-[inset_0_-1px_0_var(--sidebar-border)]`,children:[!o.sidebar&&(0,X.jsx)(`div`,{className:`shrink-0 px-1.5`,children:ye}),(0,X.jsx)(We,{className:`sr-only`,children:`Editor`}),(0,X.jsx)(bp,{tabs:te.tabs.map(e=>({id:e.spec.id,path:e.spec.path,label:e.spec.label})),active:ne,dirty:te.dirty.map(e=>e.spec.id),onSelect:te.setActive,onClose:te.close}),oe!==void 0&&le!==null&&(0,X.jsx)(zW,{settings:o,onSettings:_e,onOpenFile:()=>he(DW(oe.spec.repo,oe.spec.path)),onPrevious:()=>y?.goToDiff(`previous`),onNext:()=>y?.goToDiff(`next`)}),pe!==null&&(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,className:`ml-1.5 shrink-0`,title:`Toggle Preview`,"aria-label":`Toggle Preview`,"aria-pressed":o.preview,onClick:()=>_e({preview:!o.preview}),children:(0,X.jsx)(Fe,{icon:cp,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,className:`mx-1.5 shrink-0`,title:`Close`,"aria-label":`Close`,onClick:te.requestClose,children:(0,X.jsx)(Fe,{icon:Me,className:`size-4`})})]}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:He(`relative min-w-0 flex-1`,pe!==null&&o.preview&&`max-sm:hidden`,ce!==null&&`hidden`),children:[(0,X.jsx)(`div`,{ref:g.codeHost,className:He(`absolute inset-0`,(ue===null||le!==null)&&`hidden`)}),(0,X.jsx)(`div`,{ref:g.diffHost,className:He(`absolute inset-0`,(ue===null||le===null)&&`hidden`)}),oe?.document.status===`image`&&(0,X.jsx)(Y.Suspense,{children:(0,X.jsx)(sG,{src:oe.document.src,alt:oe.spec.path})}),(0,X.jsx)(lp,{document:oe?.document,view:o.view})]}),pe!==null&&o.preview&&v!==null&&oe!==void 0&&(0,X.jsx)(lW,{machine:e.machine,projectId:e.projectId,path:oe.spec.path,model:pe,editor:v,onOpen:e=>he(DW(``,e))}),ce!==null&&oe!==void 0&&(0,X.jsx)(lW,{machine:e.machine,projectId:e.projectId,path:oe.spec.path,model:ce,editor:null,onOpen:e=>he(DW(``,e))},oe.spec.id)]})]})]}),(0,X.jsx)(_W,{editor:ue===null?null:le===null?v:y?.getModifiedEditor()??null,language:se?.language??null,children:fe!==null&&(0,X.jsx)(BW,{repo:fe,busy:f>0,onCheckout:()=>h(fe),onSync:()=>void ge(()=>je(e.machine,`git.sync`,{projectId:e.projectId,repo:fe.path})),onPublish:()=>void ge(()=>je(e.machine,`git.push`,{projectId:e.projectId,repo:fe.path}))})}),(0,X.jsx)(fp,{}),(0,X.jsx)(gW,{open:te.closing!==null,paths:te.closingTabs.map(e=>e.spec.path),onCancel:()=>te.setClosing(null),onFinish:e=>void te.finish(e)}),(0,X.jsx)(hW,{...te.conflict}),m!==null&&(0,X.jsx)(xe,{machine:e.machine,projectId:e.projectId,repo:{...m,changed:m.merge.length+m.staged.length+m.changes.length},onRefresh:ee,onClose:()=>h(null)})]})})}export{cG as EditorDialog};
52
+ It is recommended to remove them from the file. This can be configured via \`editor.unusualLineTerminators\`.`,Qd(e.uri)),primaryButton:x(1635,`&&Remove Unusual Line Terminators`),cancelButton:x(1636,`Ignore`)})}finally{this._isPresentingDialog=!1}t.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):LH(this._codeEditorService,e,!0)}};zH=PH([FH(1,fa),FH(2,ec)],zH),Rs(zH.ID,zH,1);var BH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},VH=function(e,t){return function(n,r){t(n,r,e)}},HH=class{constructor(){this.selector={language:`*`}}provideDocumentHighlights(e,t,n){if(e.isDisposed())return;let r=[],i=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return i?e.findMatches(i.word,!0,!1,!0,iu,!1).map(e=>({range:e.range,kind:Tf.Text})):Promise.resolve(r)}provideMultiDocumentHighlights(e,t,n,r){if(e.isDisposed())return;let i=new Dl,a=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!a)return Promise.resolve(i);for(let t of[e,...n]){if(t.isDisposed())continue;let e=t.findMatches(a.word,!0,!1,!0,iu,!1).map(e=>({range:e.range,kind:Tf.Text}));e&&i.set(t.uri,e)}return i}},UH=class extends G{constructor(e){super(),this._register(e.documentHighlightProvider.register(`*`,new HH)),this._register(e.multiDocumentHighlightProvider.register(`*`,new HH))}};UH=BH([VH(0,R)],UH);var WH=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},GH=function(e,t){return function(n,r){t(n,r,e)}},KH,qH,JH=new j(`hasWordHighlights`,!1);function YH(e,t,n,r){let i=e.ordered(t);return Jn(i.map(e=>()=>Promise.resolve(e.provideDocumentHighlights(t,n,r)).then(void 0,tc)),e=>e!=null).then(e=>{if(e){let n=new Dl;return n.set(t.uri,e),n}return new Dl})}function XH(e,t,n,r,i){let a=e.ordered(t);return Jn(a.map(e=>()=>{let a=i.filter(e=>Gf(e)).filter(t=>Ld(e.selector,t.uri,t.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(e.provideMultiDocumentHighlights(t,n,a,r)).then(void 0,tc)}),e=>e!=null)}var ZH=class{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||=At(e=>this._compute(this._model,this._selection,this._wordSeparators,e)),this._result}_getCurrentWordRange(e,t){let n=e.getWordAtPosition(t.getPosition());return n?new C(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}cancel(){this.result.cancel()}},QH=class extends ZH{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return YH(this._providers,e,t.getPosition(),r).then(e=>e||new Dl)}},$H=class extends ZH{constructor(e,t,n,r,i){super(e,t,n),this._providers=r,this._otherModels=i}_compute(e,t,n,r){return XH(this._providers,e,t.getPosition(),r,this._otherModels).then(e=>e||new Dl)}};function eU(e,t,n,r){return new QH(t,n,r,e)}function tU(e,t,n,r,i){return new $H(t,n,r,e,i)}Bd(`_executeDocumentHighlights`,async(e,t,n)=>(await YH(e.get(R).documentHighlightProvider,t,n,T.None))?.get(t.uri));var nU=class{static{KH=this}static{this.storedDecorationIDs=new Dl}static{this.query=null}constructor(e,t,n,r,i,a,o,s){this.toUnhook=new F,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Dl,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new ir(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=a,this.textModelService=i,this.configurationService=o,this.logService=s,this._hasWordHighlights=JH.bindTo(r),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||this.occurrencesHighlightEnablement!==`off`&&this.runDelayer.trigger(()=>{this._onPositionChanged(e)}).catch(ot)})),this.toUnhook.add(e.onDidFocusEditorText(e=>{this.occurrencesHighlightEnablement!==`off`&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}).catch(ot))})),this.toUnhook.add(e.onDidChangeModelContent(e=>{Xr(this.model.uri,`output`)||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(e=>{!e.newModelUrl&&e.oldModelUrl?this._stopSingular():KH.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(e=>{let t=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==t)switch(this.occurrencesHighlightEnablement=t,t){case`off`:this._stopAll();break;case`singleFile`:this._stopAll(KH.query?.modelInfo?.modelURI);break;case`multiFile`:KH.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`)){let e=o.getValue(`editor.occurrencesHighlightDelay`);this.occurrencesHighlightDelay!==e&&(this.occurrencesHighlightDelay=e)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{let e=this.codeEditorService.getFocusedCodeEditor();e?e.getModel()?.uri.scheme===dl.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==dl.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,KH.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!==`off`&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}).catch(ot))}stop(){this.occurrencesHighlightEnablement!==`off`&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(C.compareRangesUsingStarts)}moveNext(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);wo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);wo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;let e=KH.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),KH.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){let t=this.codeEditorService.listCodeEditors(),n=[];for(let r of t){if(!r.hasModel()||Gt(r.getModel().uri,e))continue;let t=KH.storedDecorationIDs.get(r.getModel().uri);if(!t)continue;r.removeDecorations(t),n.push(r.getModel().uri);let i=rU.get(r);i?.wordHighlighter&&i.wordHighlighter.decorations.length>0&&(i.wordHighlighter.decorations.clear(),i.wordHighlighter.workerRequest=null,i.wordHighlighter._hasWordHighlights.set(!1))}for(let e of n)KH.storedDecorationIDs.delete(e)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==dl.vscodeNotebookCell&&KH.query?.modelInfo?.modelURI.scheme!==dl.vscodeNotebookCell?(KH.query=null,this._run()):KH.query?.modelInfo&&(KH.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||=(this.workerRequestTokenId++,!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||=(this.workerRequestTokenId++,!0)}_onPositionChanged(e){this.occurrencesHighlightEnablement===`off`||e.source!==`api`&&e.reason!==3?this._stopAll():this._run()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===dl.vscodeNotebookCell){let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){let n=r.getModel();n&&n!==e&&n.uri.scheme===dl.vscodeNotebookCell&&t.push(n)}return t}let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){if(!Hl(r))continue;let n=r.getModel();n&&e===n.modified&&t.push(n.modified)}if(t.length)return t;if(this.occurrencesHighlightEnablement===`singleFile`)return[];for(let r of n){let n=r.getModel();n&&n!==e&&t.push(n)}return t}async _run(e,t){if(this.editor.hasTextFocus()){let e=this.editor.getSelection();if(!e||e.startLineNumber!==e.endLineNumber){KH.query=null,this._stopAll();return}let t=e.startColumn,n=e.endColumn,r=this._getWord();if(!r||r.startColumn>t||r.endColumn<n){KH.query=null,this._stopAll();return}KH.query={modelInfo:{modelURI:this.model.uri,selection:e}}}else if(!KH.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),Gt(this.editor.getModel().uri,KH.query.modelInfo?.modelURI)){if(!e){let e=this.decorations.getRanges();for(let t of e)if(t.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);let n=++this.workerRequestTokenId;this.workerRequestCompleted=!1;let r=this.getOtherModelsToHighlight(this.editor.getModel());if(!KH.query||!KH.query.modelInfo)return;let i=await this.textModelService.createModelReference(KH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(i.object.textEditorModel,KH.query.modelInfo.selection,r),this.workerRequest?.result.then(e=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=e||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},ot)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{i.dispose()}}else if(this.model.uri.scheme===dl.vscodeNotebookCell){let e=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!KH.query||!KH.query.modelInfo)return;let n=await this.textModelService.createModelReference(KH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(n.object.textEditorModel,KH.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(n=>{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=n||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},ot)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{n.dispose()}}}computeWithModel(e,t,n){return n.length?tU(this.multiDocumentProviders,e,t,this.editor.getOption(148),n):eU(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){let t=new Date().getTime(),n=this.lastCursorPositionChangeTime+e;t>=n?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},n-t)}renderDecorations(){this.renderDecorationsTimer=void 0;let e=this.codeEditorService.listCodeEditors();for(let t of e){let e=rU.get(t);if(!e)continue;let n=[],r=t.getModel()?.uri;if(r&&this.workerRequestValue.has(r)){let i=KH.storedDecorationIDs.get(r),a=this.workerRequestValue.get(r);if(a)for(let e of a)e.range&&n.push({range:e.range,options:bz(e.kind)});let o=[];t.changeDecorations(e=>{o=e.deltaDecorations(i??[],n)}),KH.storedDecorationIDs=KH.storedDecorationIDs.set(r,o),n.length>0&&(e.wordHighlighter?.decorations.set(n),e.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}};nU=KH=WH([GH(4,qi),GH(5,ec),GH(6,Gi),GH(7,Fu)],nU);var rU=class extends G{static{qH=this}static{this.ID=`editor.contrib.wordHighlighter`}static get(e){return e.getContribution(qH.ID)}constructor(e,t,n,r,i,a,o){super(),this._wordHighlighter=null;let s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==dl.accessibleView&&(this._wordHighlighter=new nU(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,i,r,a,o))};this._register(e.onDidChangeModel(e=>{this._wordHighlighter&&=(!e.newModelUrl&&e.oldModelUrl?.scheme!==dl.vscodeNotebookCell&&this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),null),s()})),s()}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(),null),super.dispose()}};rU=qH=WH([GH(1,za),GH(2,R),GH(3,ec),GH(4,qi),GH(5,Gi),GH(6,Fu)],rU);var iU=class extends W{constructor(e,t){super(t),this._isNext=e}run(e,t){let n=rU.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}},aU=class extends iU{constructor(){super(!0,{id:`editor.action.wordHighlight.next`,label:L(1646,`Go to Next Symbol Highlight`),precondition:JH,kbOpts:{kbExpr:E.editorTextFocus,primary:65,weight:100}})}},oU=class extends iU{constructor(){super(!1,{id:`editor.action.wordHighlight.prev`,label:L(1647,`Go to Previous Symbol Highlight`),precondition:JH,kbOpts:{kbExpr:E.editorTextFocus,primary:1089,weight:100}})}},sU=class extends W{constructor(){super({id:`editor.action.wordHighlight.trigger`,label:L(1648,`Trigger Symbol Highlight`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:0,weight:100}})}run(e,t){let n=rU.get(t);n&&n.restoreViewState(!0)}};Rs(rU.ID,rU,0),z(aU),z(oU),z(sU),rt(UH);var cU=class extends ad{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;let r=Mt(t.getOption(148),t.getOption(147)),i=t.getModel(),a=t.getSelections(),o=a.length>1,s=a.map(e=>{let t=new A(e.positionLineNumber,e.positionColumn),n=this._move(r,i,t,this._wordNavigationType,o);return this._moveTo(e,n,this._inSelectionMode)});if(i.pushStackElement(),t._getViewModel().setCursorStates(`moveWordCommand`,3,s.map(e=>pd.fromModelSelection(e))),s.length===1){let e=new A(s[0].positionLineNumber,s[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,n){return n?new q(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new q(t.lineNumber,t.column,t.lineNumber,t.column)}},lU=class extends cU{_move(e,t,n,r,i){return wd.moveWordLeft(e,t,n,r,i)}},uU=class extends cU{_move(e,t,n,r,i){return wd.moveWordRight(e,t,n,r)}},dU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartLeft`,precondition:void 0})}},fU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndLeft`,precondition:void 0})}},pU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:`cursorWordLeft`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(eo,nd)?.negate()),primary:2063,mac:{primary:527},weight:100}})}},mU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartLeftSelect`,precondition:void 0})}},hU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndLeftSelect`,precondition:void 0})}},gU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:`cursorWordLeftSelect`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(eo,nd)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}},_U=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityLeft`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Mt(Yi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},vU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityLeftSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Mt(Yi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},yU=class extends uU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartRight`,precondition:void 0})}},bU=class extends uU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndRight`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(eo,nd)?.negate()),primary:2065,mac:{primary:529},weight:100}})}},xU=class extends uU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordRight`,precondition:void 0})}},SU=class extends uU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartRightSelect`,precondition:void 0})}},CU=class extends uU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndRightSelect`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(eo,nd)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}},wU=class extends uU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordRightSelect`,precondition:void 0})}},TU=class extends uU{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityRight`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Mt(Yi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},EU=class extends uU{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityRightSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Mt(Yi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},DU=class extends ad{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){let r=e?.get(Rn);if(!t.hasModel()||!r)return;let i=Mt(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections(),s=t.getOption(10),c=t.getOption(15),l=r.getLanguageConfiguration(a.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),d=o.map(e=>{let n=this._delete({wordSeparators:i,model:a,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:s,autoClosingQuotes:c,autoClosingPairs:l,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new $c(n,``)});t.pushUndoStop(),t.executeCommands(this.id,d),t.pushUndoStop()}},OU=class extends DU{_delete(e,t){return wd.deleteWordLeft(e,t)||new C(1,1,1,1)}},kU=class extends DU{_delete(e,t){let n=wd.deleteWordRight(e,t);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new C(r,i,r,i)}},AU=class extends OU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartLeft`,precondition:E.writable})}},jU=class extends OU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndLeft`,precondition:E.writable})}},MU=class extends OU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordLeft`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}},NU=class extends kU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartRight`,precondition:E.writable})}},PU=class extends kU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndRight`,precondition:E.writable})}},FU=class extends kU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordRight`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}},IU=class extends W{constructor(){super({id:`deleteInsideWord`,precondition:E.writable,label:L(1650,`Delete Word`),metadata:{description:L(1651,`Delete the word at the cursor`),args:[{name:`args`,schema:{type:`object`,properties:{onlyWord:{type:`boolean`,default:!1,description:x(1649,`Delete only the word and leave surrounding whitespace`)}}}}]}})}run(e,t,n){if(!t.hasModel())return;let r=!!(n&&typeof n==`object`&&n.onlyWord),i=Mt(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections().map(e=>{let t=wd.deleteInsideWord(i,a,e,r);return new $c(t,``)});t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}};H(new dU),H(new fU),H(new pU),H(new mU),H(new hU),H(new gU),H(new yU),H(new bU),H(new xU),H(new SU),H(new CU),H(new wU),H(new _U),H(new vU),H(new TU),H(new EU),H(new AU),H(new jU),H(new MU),H(new NU),H(new PU),H(new FU),z(IU);var LU=class extends DU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordPartLeft`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){return ou.deleteWordPartLeft(e)||new C(1,1,1,1)}},RU=class extends DU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordPartRight`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let n=ou.deleteWordPartRight(e);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new C(r,i,r,i)}},zU=class extends cU{_move(e,t,n,r,i){return ou.moveWordPartLeft(e,t,n,i)}},BU=class extends zU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordPartLeft`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:783},weight:100}})}};Bn.registerCommandAlias(`cursorWordPartStartLeft`,`cursorWordPartLeft`);var VU=class extends zU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordPartLeftSelect`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}};Bn.registerCommandAlias(`cursorWordPartStartLeftSelect`,`cursorWordPartLeftSelect`);var HU=class extends cU{_move(e,t,n,r,i){return ou.moveWordPartRight(e,t,n)}},UU=class extends HU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordPartRight`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:785},weight:100}})}},WU=class extends HU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordPartRightSelect`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}};H(new LU),H(new RU),H(new BU),H(new VU),H(new UU),H(new WU);var GU=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>J(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-BscAjiQZ.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-C6YyR8OD.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-CYlAq2b0.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-b97czJOk.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DFPxpIYQ.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}],KU=Object.fromEntries(GU.map(e=>[e.id,e.import])),qU=nt({langs:Xf,themes:KU,engine:()=>(0,Zf.createOnigurumaEngine)(J(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:JU,codeToHast:YU,codeToTokens:XU,codeToTokensBase:ZU,codeToTokensWithThemes:QU,getSingletonHighlighter:$U,getLastGrammarState:eW}=et(qU,{guessEmbeddedLanguages:tt});self.MonacoEnvironment={async getWorker(){return new(await(J(()=>import(`./editor.worker-CGG2Yh4v.js`),[]))).default}};function tW(e,t){let n=tu.registerCommand(`offsite.block`,(e,n)=>t(n)),r=e===`stage`?`Stage`:`Unstage`,i={id:e===`stage`?`add`:`remove`},a=[On.appendMenuItem(D.DiffEditorHunkToolbar,{command:{id:`offsite.block`,title:`${r} Block`,icon:i},group:`primary`,order:10}),On.appendMenuItem(D.DiffEditorSelectionToolbar,{command:{id:`offsite.block`,title:`${r} Selection`,icon:i},group:`primary`,order:10})];return()=>{n.dispose();for(let e of a)e.dispose()}}function nW(e,t,n){let r=t.getValue();for(let i of n.innerChanges.slice().reverse()){let n=i.modifiedRange;r=r.slice(0,t.getOffsetAt({lineNumber:n.startLineNumber,column:n.startColumn}))+e.getValueInRange(i.originalRange)+r.slice(t.getOffsetAt({lineNumber:n.endLineNumber,column:n.endColumn}))}return r}var rW=qU({themes:[],langs:[]}),iW=new Map([[`tsx`,()=>J(()=>import(`./typescript-Dy13l_qr.js`),__vite__mapDeps([13,8,1,2,3,4]))],[`jsx`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`json`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`jsonc`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`shellscript`,()=>J(()=>import(`./shell-CC2rA5mh.js`),[])],[`docker`,()=>J(()=>import(`./dockerfile-DZFCIeNp.js`),[])],[`c`,()=>J(()=>import(`./cpp-C7h46wYY.js`),[])],[`objective-cpp`,()=>J(()=>import(`./cpp-C7h46wYY.js`),[])],[`vue`,()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))],[`svelte`,()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))]]);async function aW(e){let t=Xe(e),n=Yf.find(e=>e.id===t||e.aliases?.includes(t)===!0);if(n===void 0)return{id:`plaintext`,name:`Plain Text`};let r=await rW;if(!r.getLoadedLanguages().includes(n.id)){if(await r.loadLanguage(n.import),!Jc.getLanguages().some(e=>e.id===n.id)){Jc.register({id:n.id});let e=iW.get(n.id);e!==void 0&&Jc.setLanguageConfiguration(n.id,(await e()).conf)}await oW()}return{id:n.id,name:n.name}}async function oW(){let e=Te(),t=GU.find(t=>t.id===e.codeTheme);if(t===void 0)throw Error(`unknown code theme ${e.codeTheme}`);let n=(await t.import()).default,r=await rW;await r.loadTheme({...n,colors:{...n.colors,"editor.background":e.background}}),Tp(r,Yu),tu.setTheme(e.codeTheme)}function sW(e){return{fontFamily:e.font.family,fontSize:e.font.size,lineHeight:e.font.lineHeight,fontLigatures:e.font.ligatures?e.font.features===``||e.font.features:!1,cursorStyle:e.cursor.style===`bar`?`line`:e.cursor.style,cursorBlinking:e.cursor.blink?`expand`:`solid`,tabSize:e.tabSize,insertSpaces:!0,detectIndentation:!1,trimAutoWhitespace:!1,wordWrap:e.wordWrap?`on`:`off`,wrappingStrategy:`advanced`,minimap:{enabled:!1},stickyScroll:{enabled:!1},overviewRulerBorder:!1,padding:{top:3,bottom:48},cursorSurroundingLines:2,copyWithSyntaxHighlighting:!1,accessibilitySupport:`off`,guides:{bracketPairs:!0,bracketPairsHorizontal:!1,highlightActiveBracketPair:!0,highlightActiveIndentation:!0},dragAndDrop:!1,glyphMargin:!1,useTabStops:!1,selectionHighlight:!1,emptySelectionClipboard:!1,renderWhitespace:`selection`,smartSelect:{selectLeadingAndTrailingWhitespace:!1},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},scrollBeyondLastLine:!1,smoothScrolling:!0,hover:{above:!1},find:{cursorMoveOnType:!1},acceptSuggestionOnCommitCharacter:!1,suggestSelection:`first`,suggest:{localityBonus:!0,insertMode:`replace`,snippetsPreventQuickSuggestions:!1},quickSuggestions:{comments:`on`,strings:`on`,other:`on`},quickSuggestionsDelay:0}}async function cW(e){await document.fonts.load(`${e.font.size}px ${e.font.family}`),tu.remeasureFonts()}function lW(e){let t=e.model,n=e.editor,r=e.machine,i=e.projectId,a=e.path,o=(0,Y.useRef)(null),s=(0,Y.useCallback)(e=>{let n=t.onDidChangeContent(e);return()=>n.dispose()},[t]),c=(0,Y.useDeferredValue)((0,Y.useSyncExternalStore)(s,()=>t.getValue())),l=(0,Y.useMemo)(()=>({img(e){return(0,X.jsx)(uW,{machine:r,projectId:i,file:a,src:e.src,alt:e.alt,width:e.width,height:e.height})}}),[r,i,a]);return(0,Y.useEffect)(()=>{if(n===null)return;let e=n.onDidScrollChange(e=>{let t=o.current;t!==null&&e.scrollTopChanged&&!t.matches(`:hover`)&&(t.scrollTop=e.scrollTop/(n.getScrollHeight()-n.getLayoutInfo().height)*(t.scrollHeight-t.clientHeight))});return()=>e.dispose()},[n]),(0,X.jsx)(`div`,{ref:o,className:He(`border-sidebar-border bg-background min-w-0 flex-1 overflow-y-auto p-6`,n!==null&&`border-l`),onScroll:e=>{let t=e.currentTarget;n!==null&&t.matches(`:hover`)&&n.setScrollTop(t.scrollTop/(t.scrollHeight-t.clientHeight)*(n.getScrollHeight()-n.getLayoutInfo().height),tu.ScrollType.Immediate)},onClickCapture:t=>{let n=(t.target instanceof Element?t.target.closest(`a`):null)?.getAttribute(`href`)??null;n===null||dW(n)||(t.preventDefault(),t.stopPropagation(),n.startsWith(`#`)?pW(t.currentTarget,n.slice(1))?.scrollIntoView():e.onOpen(fW(a,n)))},children:(0,X.jsx)(ce,{text:c.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,``),components:l})})}function uW(e){let t=e.src??``,n=dW(t),[r,i]=(0,Y.useState)(void 0);return(0,Y.useEffect)(()=>{if(n)return;let r=!0;async function a(){try{let n=await c(e.machine,e.projectId,fW(e.file,t));r&&i(n)}catch{r&&i(void 0)}}return a(),()=>{r=!1}},[n,e.machine,e.projectId,e.file,t]),(0,X.jsx)(`img`,{src:n?t:r,alt:e.alt,width:e.width,height:e.height,className:`max-w-full`})}function dW(e){return/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}function fW(e,t){let n=e.split(`/`).map(encodeURIComponent).join(`/`),r=new URL(t,`file:///${n}`).pathname.slice(1);try{return decodeURIComponent(r)}catch{return r}}function pW(e,t){return[...e.querySelectorAll(`h1, h2, h3, h4, h5, h6`)].find(e=>mW(e.textContent)===t.toLowerCase())}function mW(e){return e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu,``).replaceAll(/\s/g,`-`)}function hW(e){return(0,X.jsx)(fe,{open:e.path!==null,onOpenChange:t=>{t||e.onCancel()},children:(0,X.jsxs)(ne,{children:[(0,X.jsxs)(Ce,{children:[(0,X.jsx)(_,{children:`${yp(e.path??``)} changed on disk`}),(0,X.jsx)(h,{children:`Something else changed this file after you opened it. Overwriting replaces that version with yours.`})]}),(0,X.jsxs)(ye,{children:[(0,X.jsx)(ie,{children:`Cancel`}),(0,X.jsx)(le,{onClick:e.onOverwrite,children:`Overwrite`})]})]})})}function gW(e){return(0,X.jsx)(fe,{open:e.open,onOpenChange:t=>{t||e.onCancel()},children:(0,X.jsxs)(ne,{children:[(0,X.jsxs)(Ce,{children:[(0,X.jsx)(_,{children:e.paths.length===1?`Do you want to save the changes you made to ${yp(e.paths[0])}?`:`Do you want to save the changes to the following ${e.paths.length} files?`}),(0,X.jsxs)(h,{children:[e.paths.length>1&&`${e.paths.map(yp).join(`, `)}. `,`Your changes will be lost if you don't save them.`]})]}),(0,X.jsxs)(ye,{children:[(0,X.jsx)(ie,{children:`Cancel`}),(0,X.jsx)(le,{variant:`outline`,onClick:()=>e.onFinish(!1),children:`Don't Save`}),(0,X.jsx)(le,{onClick:()=>e.onFinish(!0),children:e.paths.length===1?`Save`:`Save All`})]})]})})}function _W(e){let[t,n]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{let t=e.editor;if(t===null)return;n(vW(t));let r=[t.onDidChangeCursorSelection(()=>n(vW(t))),t.onDidChangeModel(()=>n(vW(t))),t.onDidChangeModelOptions(()=>n(vW(t)))];return()=>{for(let e of r)e.dispose()}},[e.editor]),(0,X.jsxs)(`div`,{className:`bg-sidebar border-sidebar-border text-muted-foreground flex h-[22px] shrink-0 items-center justify-end gap-4 border-t px-3 text-xs whitespace-nowrap`,children:[e.children,e.language!==null&&t!==null&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{children:[`Ln `,t.line,`, Col `,t.column,t.selected>0&&` (${t.selected} selected)`]}),(0,X.jsxs)(`span`,{children:[t.spaces?`Spaces`:`Tab Size`,`: `,t.tabSize]}),(0,X.jsx)(`span`,{children:`UTF-8`}),(0,X.jsx)(`span`,{children:t.eol}),(0,X.jsx)(`span`,{children:e.language})]})]})}function vW(e){let t=e.getModel(),n=e.getSelection();if(t===null||n===null)return null;let r=t.getOptions();return{line:n.positionLineNumber,column:n.positionColumn,selected:t.getValueLengthInRange(n),tabSize:r.tabSize,spaces:r.insertSpaces,eol:t.getEndOfLineSequence()===tu.EndOfLineSequence.LF?`LF`:`CRLF`}}function yW(e){let t=bW(e.spec),n=t?.kind??null,r=(0,Y.useEffectEvent)(n=>{let r=e.spec,i=e.original,a=e.modified;if(r===void 0||t===null||i===null||a===null)throw Error(`This diff has no blocks to stage`);e.onPerform(()=>Ae(e.machine,`git.run`,{projectId:e.projectId,repo:r.repo,action:{kind:`stageContent`,path:t.path,content:t.kind===`stage`?n.originalWithModifiedChanges:nW(i,a,n.mapping)}}))});(0,Y.useEffect)(()=>{if(n!==null)return tW(n,r)},[n])}function bW(e){return e?.left?.kind===`git`&&e.left.ref===``&&e.right.kind===`worktree`?{kind:`stage`,path:e.left.path}:e?.left?.kind===`git`&&e.right.kind===`git`&&e.right.ref===``?{kind:`unstage`,path:e.right.path}:null}function xW(){let[e,t]=(0,Y.useState)(null),[n,r]=(0,Y.useState)(null);return{editor:e,diff:n,codeHost:(0,Y.useCallback)(e=>{if(e===null)return;let n=tu.create(e,{automaticLayout:!0,model:null});return t(n),()=>n.dispose()},[]),diffHost:(0,Y.useCallback)(e=>{if(e===null)return;let t=tu.createDiffEditor(e,{automaticLayout:!0,originalEditable:!1,experimental:{showMoves:!0},useInlineViewWhenSpaceIsLimited:!0});return r(t),()=>t.dispose()},[])}}var SW={M:`Modified`,T:`Type Changed`,A:`Added`,D:`Deleted`,R:`Renamed`,C:`Copied`,U:`Untracked`,"!":`Conflict`},CW={M:`text-warning`,T:`text-warning`,A:`text-success`,D:`text-destructive`,R:`text-success`,C:`text-success`,U:`text-success`,"!":`text-destructive`};function wW(e,t){return e===``?t:`${e}/${t}`}function TW(e){return e.slice(0,7)}function EW(e,t,n){let r=wW(e,n.path),i={kind:`git`,ref:``,path:n.path};function a(t,n,i){return{id:`${t}:${r}`,repo:e,path:r,label:`${yp(r)} (${t})`,left:n,right:i}}return t===`merge`?a(`Working Tree`,null,{kind:`worktree`}):t===`staged`&&n.status===`A`?a(`Index`,null,i):t===`staged`&&n.status===`D`?a(`Deleted`,null,{kind:`git`,ref:`HEAD`,path:n.path}):t===`staged`?a(`Index`,{kind:`git`,ref:`HEAD`,path:n.from??n.path},i):n.status===`U`?a(`Untracked`,null,{kind:`worktree`}):n.status===`A`?a(`Intent to Add`,null,{kind:`worktree`}):n.status===`D`?a(`Deleted`,null,i):a(`Working Tree`,i,{kind:`worktree`})}function DW(e,t){return{id:`File:${t}`,repo:e,path:t,label:yp(t),left:null,right:{kind:`worktree`}}}function OW(e,t){return{...DW(e,t),id:`Preview:${t}`,label:`${yp(t)} (Preview)`,preview:!0}}function kW(e,t){let n=wW(e,t.path);return{id:`HEAD:${n}`,repo:e,path:n,label:`${yp(n)} (HEAD)`,left:null,right:{kind:`git`,ref:`HEAD`,path:t.from??t.path}}}function AW(e,t,n){let r=wW(e,n.path),i=t.parents.at(0)??null;return{id:`${t.hash}:${r}`,repo:e,path:r,label:`${yp(r)} (${i===null?`empty`:TW(i)} ↔ ${TW(t.hash)})`,left:i===null||n.status===`A`?{kind:`empty`}:{kind:`git`,ref:i,path:n.from??n.path},right:n.status===`D`?{kind:`empty`}:{kind:`git`,ref:t.hash,path:n.path}}}function jW(e,t){return[...e].sort((e,n)=>t===`name`?yp(e.path).localeCompare(yp(n.path))||e.path.localeCompare(n.path):t===`status`&&e.status.localeCompare(n.status)||e.path.localeCompare(n.path))}function MW(e,t){let n={folders:new Map,files:[]};for(let t of e){let e=n,r=vp(t.path);for(let t of r===``?[]:r.split(`/`)){let n=e.folders.get(t)??{folders:new Map,files:[]};e.folders.set(t,n),e=n}e.files.push(t)}return NW(n,``,t)}function NW(e,t,n){return[...[...e.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(e=>{let r=e[0],i=e[1];for(;i.files.length===0&&i.folders.size===1;){let e=[...i.folders][0];r=`${r}/${e[0]}`,i=e[1]}let a=t===``?r:`${t}/${r}`,o=NW(i,a,n);return{kind:`folder`,path:a,label:r,children:o,resources:o.flatMap(e=>e.kind===`file`?[e.resource]:e.resources)}}),...jW(e.files,n).map(e=>({kind:`file`,resource:e}))]}var PW=new WeakSet;function FW(e){let[t,n]=(0,Y.useState)(()=>({tabs:e.saved.tabs.map(e=>({spec:e.spec,document:{status:`loading`}})),active:e.saved.active})),r=(0,Y.useRef)(t),i=(0,Y.useRef)(!0),a=(0,Y.useRef)(new Set),o=(0,Y.useRef)(Promise.resolve()),s=t.tabs,c=t.active,[l,u]=(0,Y.useState)(null);_e(fe,!0);let[d,f]=(0,Y.useState)(null),p=s.filter(e=>e.document.status===`text`&&e.document.dirty),m=l?.kind===`tab`?s.filter(e=>e.spec.id===l.id):p,h=p.length>0;(0,Y.useEffect)(()=>{if(!h)return;function e(e){e.preventDefault()}return addEventListener(`beforeunload`,e),()=>removeEventListener(`beforeunload`,e)},[h]),(0,Y.useEffect)(()=>(i.current=!0,()=>{i.current=!1,queueMicrotask(()=>{if(i.current)return;let e=new Set([...a.current,...r.current.tabs.flatMap(e=>IW(e.document))]);for(let t of e)t.dispose()})}),[]);function g(e){r.current={...r.current,...e},n(r.current)}function _(e){g({active:e})}function v(){let e=new Set(s.flatMap(e=>IW(e.document)));for(let t of a.current)e.has(t)||t.dispose();a.current=e}async function y(t,n){if(n.kind===`empty`)return``;if(n.kind===`git`)return Ae(e.machine,`git.show`,{projectId:e.projectId,repo:t.repo,ref:n.ref,path:n.path});let r=await Ae(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return r.kind===`text`?r.content:null}function b(e){return Promise.all([e.left===null?``:y(e,e.left),y(e,e.right)])}function ee(e,t){g({tabs:r.current.tabs.map(n=>n.spec.id===e?{...n,document:t}:n)})}async function te(t){try{if(t.left===null&&t.right.kind===`worktree`){let n=await Ae(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return n.kind===`image`?{status:`image`,src:`data:${n.mediaType};base64,${n.data}`}:n.kind===`large`?{status:`large`,size:n.size,limit:n.limit}:n.kind===`binary`?{status:`binary`}:await ne(t,``,n.content)}let n=await b(t);return n[0]===null||n[1]===null?{status:`binary`}:await ne(t,n[0],n[1])}catch(e){return{status:`error`,message:Ve(e)}}}async function ne(e,t,n){let i=await aW(e.path),a=e.left===null?null:tu.createModel(t,i.id),o=tu.createModel(n,i.id);return o.onDidChangeContent(()=>{if(PW.has(o))return;let e=r.current.tabs,t=e.find(e=>e.document.status===`text`&&e.document.modified===o);if(t===void 0||t.document.status!==`text`)return;let n=o.getAlternativeVersionId()!==t.document.saved;t.document.dirty!==n&&g({tabs:e.map(e=>e===t?{...t,document:{...t.document,dirty:n}}:e)})}),{status:`text`,original:a,modified:o,language:i.name,saved:o.getAlternativeVersionId(),dirty:!1,base:n}}async function re(e){let t=r.current.tabs.find(t=>t.spec.id===e);if(t?.document.status!==`text`||t.document.dirty)return;let n=t.document,i=n.modified.getAlternativeVersionId();try{let a=await b(t.spec);if(n.modified.isDisposed()||n.modified.getAlternativeVersionId()!==i)return;let o=a[1];if(a[0]===null||o===null){ee(e,{status:`binary`});return}n.original!==null&&LW(n.original,a[0]),PW.add(n.modified),LW(n.modified,o),PW.delete(n.modified);let s=n.modified.getAlternativeVersionId();(s!==i||o!==n.base)&&g({tabs:r.current.tabs.map(e=>e.document.status===`text`&&e.document.modified===n.modified?{...e,document:{...e.document,saved:s,base:o}}:e)})}catch(t){ee(e,{status:`error`,message:Ve(t)})}}async function ie(e){g({active:e.id}),r.current.tabs.some(t=>t.spec.id===e.id)||(g({tabs:[...r.current.tabs,{spec:e,document:{status:`loading`}}]}),await ae(e))}async function ae(e){let t=await te(e),n=r.current.tabs.some(t=>t.spec.id===e.id&&t.document.status===`loading`);if(!i.current||!n)for(let e of IW(t))e.dispose();else ee(e.id,t)}function oe(e,t){let n=o.current.then(()=>se(e,t));return o.current=n,n}async function se(t,n){let i=r.current.tabs.find(e=>e.spec.id===t);if(i?.document.status!==`text`||!i.document.dirty||i.document.modified.isDisposed()||i.spec.right.kind!==`worktree`||i.spec.preview===!0)return!0;let a=i.document.modified,o=a.getAlternativeVersionId(),s=a.getValue();try{if(!await Ae(e.machine,`files.write`,{projectId:e.projectId,path:i.spec.path,content:s,base:n?null:i.document.base}))return f(i.spec),!1}catch(e){return ke(e),!1}return g({tabs:r.current.tabs.map(e=>e.document.status===`text`&&e.document.modified===a?{...e,document:{...e.document,saved:o,dirty:a.getAlternativeVersionId()!==o,base:s}}:e)}),e.onSaved(),!0}function ce(e){let t=r.current,n=t.tabs.filter(t=>!e(t.spec)),i=t.tabs.findIndex(e=>e.spec.id===t.active);g({tabs:n,active:i!==-1&&e(t.tabs[i].spec)?n.at(Math.min(i,n.length-1))?.spec.id??null:t.active})}function le(e,t){function n(n){return n===e?t:n.startsWith(`${e}/`)?`${t}${n.slice(e.length)}`:n}let i=r.current,a=i.tabs.map(e=>e.spec.id===DW(e.spec.repo,e.spec.path).id?{...e,spec:DW(e.spec.repo,n(e.spec.path))}:e.spec.id===OW(e.spec.repo,e.spec.path).id?{...e,spec:OW(e.spec.repo,n(e.spec.path))}:e),o=i.tabs.findIndex(e=>e.spec.id===i.active);g({tabs:a,active:o===-1?i.active:a[o].spec.id})}function ue(e){ce(t=>t.right.kind===`worktree`&&(t.path===e||t.path.startsWith(`${e}/`)))}function de(e){p.some(t=>t.spec.id===e)?u({kind:`tab`,id:e}):ce(t=>t.id===e)}function fe(){p.length>0?u({kind:`dialog`}):e.onClose()}async function pe(t){l!==null&&(u(null),t&&(await Promise.all(m.map(e=>oe(e.spec.id,!1)))).includes(!1)||(l.kind===`tab`&&ce(e=>e.id===l.id),l.kind===`dialog`&&e.onClose()))}function me(){d!==null&&oe(d.id,!0),f(null)}let he=(0,Y.useEffectEvent)(()=>{for(let t of e.saved.tabs)ae(t.spec)});return(0,Y.useEffect)(()=>he(),[]),{tabs:s,active:c,setActive:_,dirty:p,closing:l,setClosing:u,closingTabs:m,conflict:{path:d?.path??null,onCancel:()=>f(null),onOverwrite:me},open:ie,reload:re,save:oe,close:de,renamed:le,deleted:ue,requestClose:fe,finish:pe,releaseModels:v}}function IW(e){return e.status===`text`?e.original===null?[e.modified]:[e.original,e.modified]:[]}function LW(e,t){let n=e.getValue(),r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r++;let i=0;for(;i<n.length-r&&i<t.length-r&&n[n.length-1-i]===t[t.length-1-i];)i++;(r!==n.length||r!==t.length)&&e.applyEdits([{range:bd.fromPositions(e.getPositionAt(r),e.getPositionAt(n.length-i)),text:t.slice(r,t.length-i)}])}function RW(e){return(0,X.jsxs)(n,{children:[(0,X.jsxs)(me,{className:`hover:bg-accent data-[state=open]:bg-accent mr-auto ml-1 flex h-6 min-w-0 cursor-pointer items-center gap-1 rounded-sm px-1 text-[11px] font-bold tracking-wide uppercase outline-none`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.view===`explorer`?`Explorer`:`Source Control`}),(0,X.jsx)(Fe,{icon:d,className:`size-3.5 shrink-0`})]}),(0,X.jsx)(s,{align:`start`,className:`bg-popover! w-44`,children:(0,X.jsxs)(p,{value:e.view,onValueChange:t=>{(t===`explorer`||t===`scm`)&&e.onView(t)},children:[(0,X.jsx)(i,{value:`explorer`,children:`Explorer`}),(0,X.jsx)(i,{value:`scm`,children:`Source Control`})]})})]})}function zW(e){return(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 pl-1.5`,children:[(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Open File`,"aria-label":`Open File`,onClick:e.onOpenFile,children:(0,X.jsx)(Fe,{icon:pe,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Previous Change`,"aria-label":`Previous Change`,onClick:e.onPrevious,children:(0,X.jsx)(Fe,{icon:we,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Next Change`,"aria-label":`Next Change`,onClick:e.onNext,children:(0,X.jsx)(Fe,{icon:Se,className:`size-4`})}),(0,X.jsxs)(n,{children:[(0,X.jsx)(me,{asChild:!0,children:(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,children:(0,X.jsx)(Fe,{icon:y,className:`size-4`})})}),(0,X.jsxs)(s,{align:`end`,className:`bg-popover! w-80`,children:[(0,X.jsx)(a,{checked:e.settings.inline,onCheckedChange:t=>e.onSettings({inline:t}),children:`Inline View`}),(0,X.jsx)(a,{checked:e.settings.whitespace,onCheckedChange:t=>e.onSettings({whitespace:t}),children:`Show Leading/Trailing Whitespace Differences`}),(0,X.jsx)(a,{checked:e.settings.collapse,onCheckedChange:t=>e.onSettings({collapse:t}),children:`Collapse Unchanged Regions`})]})]})]})}function BW(e){let t=e.repo;return(0,X.jsxs)(`div`,{className:`mr-auto -ml-1.5 flex h-full items-center`,children:[(0,X.jsxs)(`button`,{type:`button`,title:`${t.branch??`HEAD`} (Git) - Checkout Branch/Tag...`,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onCheckout,children:[(0,X.jsx)(Fe,{icon:ve,className:`size-3.5`}),t.branch??(t.head===null?`HEAD`:TW(t.head)),t.changes.length>0&&`*`,t.staged.length>0&&`+`,t.merge.length>0&&`!`]}),t.upstream!==null&&(0,X.jsxs)(`button`,{type:`button`,title:`Synchronize Changes`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onSync,children:[(0,X.jsx)(Fe,{icon:de,className:He(`size-3.5`,e.busy&&`animate-spin`)}),(t.behind>0||t.ahead>0)&&`${t.behind}↓ ${t.ahead}↑`]}),t.upstream===null&&t.branch!==null&&t.remote&&(0,X.jsx)(`button`,{type:`button`,title:`Publish Branch`,"aria-label":`Publish Branch`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onPublish,children:(0,X.jsx)(Fe,{icon:ae,className:`size-3.5`})})]})}var VW={all:null,amend:!1,then:null};function HW(e){let t=e.repo,r=t.merge.length+t.staged.length+t.changes.length>0,i=!r&&t.branch!==null&&t.upstream===null&&t.remote,a=!r&&t.upstream!==null&&(t.ahead>0||t.behind>0);return(0,X.jsxs)(`div`,{className:He(`grid gap-1.5 pt-1.5 pr-2 pb-1.5`,e.nested?`pl-4`:`pl-2`),children:[(0,X.jsxs)(`div`,{className:`bg-input/40 border-input focus-within:border-primary relative rounded-sm border`,children:[(0,X.jsx)(`textarea`,{rows:7,"aria-label":`Source Control Input`,value:e.message,placeholder:`Message (${Be===`⌘`?`⌘Enter`:`Ctrl+Enter`} to commit on "${t.branch??(t.head===null?`HEAD`:TW(t.head))}")`,className:`placeholder:text-muted-foreground block w-full resize-none bg-transparent py-1 pr-7 pl-2 text-[13px] leading-[18px] outline-none`,onChange:t=>e.onMessage(t.target.value),onKeyDown:t=>{(t.metaKey||t.ctrlKey)&&t.key===`Enter`&&(t.preventDefault(),e.onCommit({...VW,then:`push`}))}}),(0,X.jsx)(`button`,{type:`button`,title:e.generating?`Cancel`:`Generate Commit Message`,"aria-label":e.generating?`Cancel`:`Generate Commit Message`,className:`text-muted-foreground hover:text-foreground hover:bg-accent absolute top-[3px] right-[3px] grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:e.generating?e.onCancel:e.onGenerate,children:(0,X.jsx)(Fe,{icon:e.generating?ap:he,className:`size-3.5`})})]}),i&&(0,X.jsxs)(Ie,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.push`),children:[(0,X.jsx)(Fe,{icon:ae}),`Publish Branch`]}),a&&(0,X.jsxs)(Ie,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.sync`),children:[(0,X.jsx)(Fe,{icon:de}),`Sync Changes`,t.behind>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[t.behind,(0,X.jsx)(Fe,{icon:Se,className:`size-3`})]}),t.ahead>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[t.ahead,(0,X.jsx)(Fe,{icon:we,className:`size-3`})]})]}),!i&&!a&&(0,X.jsxs)(`div`,{className:`flex`,children:[(0,X.jsxs)(Ie,{size:`xs`,className:`flex-1 rounded-sm rounded-r-none [&:active:not([aria-haspopup])]:scale-100`,disabled:!r||e.busy,onClick:()=>e.onCommit({...VW,then:`push`}),children:[(0,X.jsx)(Fe,{icon:be}),`Commit & Push`]}),(0,X.jsxs)(n,{children:[(0,X.jsx)(me,{asChild:!0,children:(0,X.jsx)(Ie,{size:`xs`,className:`rounded-sm rounded-l-none px-1 before:absolute before:inset-y-1 before:-left-px before:w-px before:bg-white/10`,disabled:!r||e.busy,title:`More Actions...`,"aria-label":`More Commit Actions`,children:(0,X.jsx)(Fe,{icon:d})})}),(0,X.jsxs)(s,{align:`end`,className:`bg-popover! w-48`,children:[(0,X.jsx)(l,{onSelect:()=>e.onCommit(VW),children:`Commit`}),(0,X.jsx)(l,{onSelect:()=>e.onCommit({...VW,amend:!0}),children:`Commit (Amend)`}),(0,X.jsx)(l,{onSelect:()=>e.onCommit({...VW,then:`push`}),children:`Commit & Push`}),(0,X.jsx)(l,{onSelect:()=>e.onCommit({...VW,then:`sync`}),children:`Commit & Sync`})]})]})]})]})}var UW=[{id:`merge`,title:`Merge Changes`},{id:`staged`,title:`Staged Changes`},{id:`changes`,title:`Changes`}];function WW(e){let[n,r]=(0,Y.useState)([]),[i,a]=(0,Y.useState)(null),o=t(),s=e.repo;function c(e){r(n.includes(e)?n.filter(t=>t!==e):[...n,e])}function l(t,n,r){let i=r===`group`?`All Changes`:`Changes`;return(0,X.jsxs)(X.Fragment,{children:[r===`file`&&n[0].status!==`D`&&(0,X.jsx)(KW,{title:`Open File`,icon:pe,onClick:()=>e.onOpen(DW(s.path,wW(s.path,n[0].path)))}),t===`changes`&&(0,X.jsx)(KW,{title:`Discard ${i}`,icon:sp,onClick:()=>e.onDiscard(n)}),t===`staged`&&(0,X.jsx)(KW,{title:`Unstage ${i}`,icon:$f,onClick:()=>e.onUnstage(n)}),t!==`staged`&&(0,X.jsx)(KW,{title:t===`merge`&&r===`group`?`Stage All Merge Changes`:`Stage ${i}`,icon:Qf,onClick:()=>e.onStage(n)})]})}function u(t,n,r){let i=EW(s.path,t,n),o=wW(s.path,n.path);return(0,X.jsxs)(`div`,{"data-resource":!0,role:`button`,tabIndex:0,title:`${e.root}/${o} • ${SW[n.status]}`,className:He(`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,i.id===e.active&&`bg-sidebar-row-active`),style:{paddingLeft:20+r*8},onClick:()=>e.onOpen(i),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(i)},onContextMenu:()=>a({group:t,resource:n}),children:[(0,X.jsx)(Ke,{path:n.path}),(0,X.jsx)(`span`,{className:He(`min-w-0 shrink-0 truncate`,CW[n.status],n.status===`D`&&`line-through`),children:yp(n.path)}),!e.tree&&(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:vp(n.path)}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(t,[n],`file`)}),(0,X.jsx)(`span`,{className:He(`w-3.5 text-center text-xs`,CW[n.status]),children:n.status})]})]},`${t}:${n.path}`)}function d(e,t,r){return t.map(t=>{if(t.kind===`file`)return u(e,t.resource,r);let i=`${s.path}:${e}:${t.path}`,a=!n.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:t.path,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+r*8},onClick:()=>c(i),onKeyDown:e=>{e.key===`Enter`&&c(i)},children:[(0,X.jsx)(GW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(e,t.resources,`folder`)})]}),a&&d(e,t.children,r+1)]},i)})}return(0,X.jsxs)(ue,{children:[(0,X.jsx)(ee,{asChild:!0,children:(0,X.jsx)(`div`,{onContextMenu:e=>{e.target instanceof Element&&e.target.closest(`[data-resource]`)!==null||e.preventDefault()},children:UW.map(t=>{let r=s[t.id];if(r.length===0)return null;let i=`${s.path}:${t.id}`,a=!n.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+e.depth*8},onClick:()=>c(i),onKeyDown:e=>{e.key===`Enter`&&c(i)},children:[(0,X.jsx)(GW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.title}),(0,X.jsx)(`span`,{className:`hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(t.id,r,`group`)}),(0,X.jsx)(`span`,{className:`bg-muted text-foreground grid h-4.5 min-w-4.5 shrink-0 place-items-center rounded-full px-1 text-[11px] tabular-nums`,children:r.length})]}),a&&(e.tree?d(t.id,MW(r,e.sort),e.depth+1):jW(r,e.sort).map(n=>u(t.id,n,e.depth+1)))]},t.id)})})}),i!==null&&(0,X.jsxs)(oe,{className:`min-w-52`,children:[(0,X.jsx)(g,{onSelect:()=>e.onOpen(EW(s.path,i.group,i.resource)),children:`Open Changes`}),i.resource.status!==`D`&&(0,X.jsx)(g,{onSelect:()=>e.onOpen(DW(s.path,wW(s.path,i.resource.path))),children:`Open File`}),i.resource.status!==`U`&&i.resource.status!==`A`&&(0,X.jsx)(g,{onSelect:()=>e.onOpen(kW(s.path,i.resource)),children:`Open File (HEAD)`}),(0,X.jsx)(v,{}),i.group===`staged`&&(0,X.jsx)(g,{onSelect:()=>e.onUnstage([i.resource]),children:`Unstage Changes`}),i.group!==`staged`&&(0,X.jsx)(g,{onSelect:()=>e.onStage([i.resource]),children:`Stage Changes`}),i.group===`changes`&&(0,X.jsx)(g,{onSelect:()=>e.onDiscard([i.resource]),children:`Discard Changes`}),i.resource.status===`U`&&(0,X.jsx)(g,{onSelect:()=>e.onIgnore([i.resource]),children:`Add to .gitignore`}),(0,X.jsx)(v,{}),(0,X.jsx)(g,{onSelect:()=>void o.copy(`${e.root}/${wW(s.path,i.resource.path)}`),children:`Copy Path`}),(0,X.jsx)(g,{onSelect:()=>void o.copy(wW(s.path,i.resource.path)),children:`Copy Relative Path`})]})]})}function GW(e){return(0,X.jsx)(Fe,{icon:Je,"aria-hidden":!0,className:He(`text-muted-foreground size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)})}function KW(e){return(0,X.jsx)(`button`,{type:`button`,title:e.title,"aria-label":e.title,className:`text-foreground hover:bg-accent grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:t=>{t.stopPropagation(),e.onClick()},children:(0,X.jsx)(Fe,{icon:e.icon,className:`size-4`})})}var qW=50,JW=11,YW=22,XW=[`#59A4F9`,`#FFB000`,`#DC267F`,`#994F00`,`#40B0A6`,`#B66DFF`];function ZW(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(qW),[l,u]=(0,Y.useState)(0),[d,f]=(0,Y.useState)([]),[p,m]=(0,Y.useState)({}),h=e.repos.find(e=>e.path===t)??e.repos.at(0),g=h?.path??null,_=h?.head??null,v=h?.upstream??null,y=h?.behind??0;(0,Y.useEffect)(()=>{if(g===null||_===null){i([]);return}let t=!0;return Ae(e.machine,`git.history`,{projectId:e.projectId,repo:g,limit:s}).then(e=>{t&&(i(e),o(null))},e=>{t&&o(Ve(e))}),()=>{t=!1}},[e.machine,e.projectId,g,_,v,y,s,l]);async function b(t){if(d.includes(t.hash))f(d.filter(e=>e!==t.hash));else if(f([...d,t.hash]),h!==void 0&&p[t.hash]===void 0)try{let n=await Ae(e.machine,`git.commitFiles`,{projectId:e.projectId,repo:h.path,hash:t.hash,parent:t.parents.at(0)??null});m(e=>({...e,[t.hash]:n}))}catch(e){ke(e)}}let ee=nG(r??[]);return(0,X.jsxs)(`div`,{className:He(`border-sidebar-border relative flex shrink-0 flex-col border-t`,e.open&&`min-h-20`),style:e.open?{height:e.height}:void 0,children:[e.open&&(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,className:`hover:bg-primary absolute inset-x-0 -top-0.5 z-10 h-1 cursor-row-resize touch-none transition-colors delay-100`,onPointerDown:t=>{let n=t.currentTarget.parentElement?.parentElement;if(n==null)return;let r=n.getBoundingClientRect();ze(t,t=>e.onHeight(Math.min(Math.max(r.bottom-t.clientY,80),r.height-120)))}}),(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row text-sidebar-foreground flex h-[22px] shrink-0 cursor-pointer items-center gap-0.5 pr-2 pl-0.5 outline-none select-none`,onClick:e.onToggle,onKeyDown:t=>{t.key===`Enter`&&e.onToggle()},children:[(0,X.jsx)(Fe,{icon:Je,"aria-hidden":!0,className:He(`size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-bold tracking-wide uppercase`,children:`Graph`}),e.repos.length>1&&(0,X.jsx)(`select`,{"aria-label":`Repository`,value:h?.path??``,className:`bg-sidebar text-muted-foreground max-w-28 cursor-pointer truncate text-xs outline-none`,onClick:e=>e.stopPropagation(),onChange:e=>{n(e.target.value),f([]),c(qW)},children:e.repos.map(e=>(0,X.jsx)(`option`,{value:e.path,children:e.path===``?`.`:e.path},e.path))}),e.open&&h!==void 0&&(0,X.jsxs)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex`,children:[(0,X.jsx)(KW,{title:`Fetch From All Remotes`,icon:ep,onClick:()=>e.onFetch(h)}),(0,X.jsx)(KW,{title:`Refresh`,icon:qe,onClick:()=>u(l+1)})]})]}),e.open&&(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[a!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:a}),a===null&&ee.length===0&&r!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:`No commits yet.`}),a===null&&h!==void 0&&ee.map(t=>{let n=t.commit,r=d.includes(n.hash);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${n.author}, ${new Date(n.date).toLocaleString()}\n\n${n.subject}\n\n${TW(n.hash)}`,className:`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,onClick:()=>void b(n),onKeyDown:e=>{e.key===`Enter`&&b(n)},children:[(0,X.jsx)(QW,{row:t,child:!1}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.subject}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 shrink-[2] truncate text-xs`,children:n.author}),(0,X.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:n.refs.map(e=>$W(e,h))})]}),r&&(p[n.hash]??[]).map(r=>{let i=AW(h.path,n,r);return(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${r.path} • ${SW[r.status]}`,className:He(`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,i.id===e.active&&`bg-sidebar-row-active`),onClick:()=>e.onOpen(i),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(i)},children:[(0,X.jsx)(QW,{row:t,child:!0}),(0,X.jsx)(Ke,{path:r.path}),(0,X.jsx)(`span`,{className:He(`min-w-0 shrink-0 truncate`,CW[r.status],r.status===`D`&&`line-through`),children:yp(r.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:vp(r.path)}),(0,X.jsx)(`span`,{className:He(`ml-auto w-3.5 shrink-0 text-center text-xs`,CW[r.status]),children:r.status})]},r.path)})]},n.hash)}),r!==null&&r.length===s&&(0,X.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground w-full cursor-pointer px-4 py-1 text-left text-xs`,onClick:()=>c(s+qW),children:`Load More…`})]})]})}function QW(e){let t=e.row,n=YW/2,r=eG(t.lane);return e.child?(0,X.jsx)(`svg`,{"aria-hidden":!0,width:JW*(t.width+1),height:YW,className:`shrink-0`,children:t.after.map(e=>(0,X.jsx)(`line`,{x1:eG(e),x2:eG(e),y1:0,y2:YW,stroke:tG(e),strokeWidth:1},e))}):(0,X.jsxs)(`svg`,{"aria-hidden":!0,width:JW*(t.width+1),height:YW,className:`shrink-0`,children:[t.through.map(e=>(0,X.jsx)(`line`,{x1:eG(e),x2:eG(e),y1:0,y2:YW,stroke:tG(e),strokeWidth:1},`through-${e}`)),t.up.map(e=>(0,X.jsx)(`path`,{d:`M ${eG(e)} 0 Q ${eG(e)} ${n} ${r} ${n}`,fill:`none`,stroke:tG(e),strokeWidth:1},`up-${e}`)),t.down.map(e=>(0,X.jsx)(`path`,{d:`M ${r} ${n} Q ${eG(e)} ${n} ${eG(e)} ${YW}`,fill:`none`,stroke:tG(e),strokeWidth:1},`down-${e}`)),(0,X.jsx)(`circle`,{cx:r,cy:n,r:t.commit.parents.length>1?3.5:4,fill:t.commit.parents.length>1?`var(--sidebar)`:tG(t.lane),stroke:tG(t.lane),strokeWidth:t.commit.parents.length>1?2:0})]})}function $W(e,t){if(e.endsWith(`/HEAD`))return null;let n=e===`HEAD`||e.startsWith(`HEAD -> `),r=e.startsWith(`tag: `),i=e===t.upstream,a=e.replace(/^HEAD -> /,``).replace(/^tag: /,``);return(0,X.jsxs)(`span`,{title:a,className:He(`inline-flex h-4 max-w-32 items-center gap-0.5 rounded-full px-1.5 text-[11px] font-medium`,n&&`text-background bg-[#59A4F9]`,i&&`text-background bg-[#B180D7]`,!n&&!i&&`bg-muted text-foreground`),children:[(0,X.jsx)(Fe,{icon:r?op:i?re:ve,className:`size-3 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:a})]},e)}function eG(e){return JW*(e+1)}function tG(e){return XW[e%XW.length]}function nG(e){let t=[];return e.map(e=>{let n=t,r=n.indexOf(e.hash),i=n.indexOf(null),a=r===-1?i===-1?n.length:i:r,o=n.map(t=>t===e.hash?null:t);o[a]=e.parents.at(0)??null;let s=e.parents.length>0?[a]:[];for(let t of e.parents.slice(1)){let e=o.indexOf(t);if(e!==-1){s.push(e);continue}let n=o.indexOf(null),r=n===-1?o.length:n;o[r]=t,s.push(r)}for(;o.length>0&&o.at(-1)===null;)o.pop();return t=o,{commit:e,lane:a,up:n.flatMap((t,n)=>t===e.hash?[n]:[]),through:n.flatMap((t,n)=>t!==null&&t!==e.hash?[n]:[]),down:s,after:o.flatMap((e,t)=>e===null?[]:[t]),width:Math.max(n.length,o.length,a+1)}})}function rG(e){let t=e.repo;function a(t,n){return(0,X.jsx)(l,{onSelect:()=>e.onCommit({...VW,...n}),children:t})}return(0,X.jsxs)(n,{children:[(0,X.jsx)(me,{asChild:!0,children:(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Fe,{icon:y,className:`size-4`})})}),(0,X.jsxs)(s,{align:`end`,className:`bg-popover! w-56`,children:[(0,X.jsxs)(m,{children:[(0,X.jsx)(o,{children:`View & Sort`}),(0,X.jsxs)(r,{className:`w-44`,children:[(0,X.jsxs)(p,{value:e.settings.tree?`tree`:`list`,onValueChange:t=>e.onSettings({tree:t===`tree`}),children:[(0,X.jsx)(i,{value:`list`,children:`View as List`}),(0,X.jsx)(i,{value:`tree`,children:`View as Tree`})]}),(0,X.jsx)(f,{}),(0,X.jsxs)(p,{value:e.settings.sort,onValueChange:t=>{(t===`name`||t===`path`||t===`status`)&&e.onSettings({sort:t})},children:[(0,X.jsx)(i,{value:`name`,children:`Sort by Name`}),(0,X.jsx)(i,{value:`path`,children:`Sort by Path`}),(0,X.jsx)(i,{value:`status`,children:`Sort by Status`})]})]})]}),(0,X.jsx)(f,{}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(l,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(l,{onSelect:e.onCheckout,children:`Checkout to...`}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(f,{}),(0,X.jsxs)(m,{children:[(0,X.jsx)(o,{children:`Commit`}),(0,X.jsxs)(r,{className:`w-52`,children:[a(`Commit`,{}),a(`Commit Staged`,{all:!1}),a(`Commit All`,{all:!0}),(0,X.jsx)(l,{disabled:t.head===null,onSelect:e.onUndo,children:`Undo Last Commit`}),(0,X.jsx)(f,{}),a(`Commit (Amend)`,{amend:!0}),a(`Commit Staged (Amend)`,{all:!1,amend:!0}),a(`Commit All (Amend)`,{all:!0,amend:!0})]})]}),(0,X.jsxs)(m,{children:[(0,X.jsx)(o,{children:`Changes`}),(0,X.jsxs)(r,{className:`w-52`,children:[(0,X.jsx)(l,{onSelect:()=>e.onStage([...t.merge,...t.changes]),children:`Stage All Changes`}),(0,X.jsx)(l,{onSelect:()=>e.onUnstage(t.staged),children:`Unstage All Changes`}),(0,X.jsx)(l,{disabled:t.changes.length===0,onSelect:()=>e.onDiscard(t.changes),children:`Discard All Changes`})]})]}),(0,X.jsxs)(m,{children:[(0,X.jsx)(o,{children:`Pull, Push`}),(0,X.jsxs)(r,{className:`w-52`,children:[(0,X.jsx)(l,{onSelect:()=>e.onRemote(`git.sync`),children:`Sync`}),(0,X.jsx)(f,{}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`pull`,rebase:!0}),children:`Pull (Rebase)`}),(0,X.jsx)(f,{}),(0,X.jsx)(l,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(f,{}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`fetch`,prune:!0,all:!1}),children:`Fetch (Prune)`}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!0}),children:`Fetch From All Remotes`})]})]}),(0,X.jsxs)(m,{children:[(0,X.jsx)(o,{children:`Branch`}),(0,X.jsxs)(r,{className:`w-52`,children:[(0,X.jsx)(l,{onSelect:e.onCheckout,children:`Create Branch...`}),(0,X.jsx)(l,{disabled:t.branch===null||t.upstream!==null,onSelect:()=>e.onRemote(`git.push`),children:`Publish Branch...`})]})]}),(0,X.jsxs)(m,{children:[(0,X.jsx)(o,{children:`Stash`}),(0,X.jsxs)(r,{className:`w-56`,children:[(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`stash`,mode:`tracked`}),children:`Stash`}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`stash`,mode:`untracked`}),children:`Stash (Include Untracked)`}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`stash`,mode:`staged`}),children:`Stash Staged`}),(0,X.jsx)(f,{}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`unstash`,pop:!1}),children:`Apply Latest Stash`}),(0,X.jsx)(l,{onSelect:()=>e.onRun({kind:`unstash`,pop:!0}),children:`Pop Latest Stash`})]})]})]})]})}function iG(e){let[t,n]=(0,Y.useState)([]),r=(0,Y.useRef)(new Map),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=e.repos??[],l=c.length===1?c[0]:null,u=e.settings,d=Oe(e=>e.prefs);function f(e){return u.messages[e.path]??``}function p(t,n){return e.onPerform(()=>Ae(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:n}))}function m(t,n){return e.onPerform(()=>Ae(e.machine,n,{projectId:e.projectId,repo:t.path}))}async function g(t,n){let r=f(t).trim();if(r===``&&!n.amend){ke(`Please provide a commit message.`);return}let i=t.changes.length+t.merge.length>0;if(n.all===null&&!n.amend&&t.staged.length===0){if(!i){ke(`There are no changes to commit.`);return}if(!u.smartCommit){a({repo:t,options:n});return}}let o=n.all??(t.staged.length===0&&!n.amend&&i);await e.onPerform(async()=>{await Ae(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:{kind:`commit`,message:r,all:o,amend:n.amend}}),e.onMessage(t.path,``),n.then!==null&&await Ae(e.machine,n.then===`push`?`git.push`:`git.sync`,{projectId:e.projectId,repo:t.path})})}async function v(t){let i={};r.current.set(t.path,i),n(e=>[...e,t.path]);try{let n=await Ae(e.machine,`git.message`,{projectId:e.projectId,repo:t.path,staged:t.staged.length>0});r.current.get(t.path)===i&&e.onMessage(t.path,n)}catch(e){r.current.get(t.path)===i&&ke(e)}finally{r.current.get(t.path)===i&&y(t)}}function y(e){r.current.delete(e.path),n(t=>t.filter(t=>t!==e.path))}function b(t){e.onPerform(async()=>{e.onMessage(t.path,await Ae(e.machine,`git.undoCommit`,{projectId:e.projectId,repo:t.path}))})}function ee(e,t){p(e,{kind:`unstage`,paths:t.flatMap(e=>e.from===null?[e.path]:[e.path,e.from])})}function te(e,t){p(e,{kind:`stage`,paths:t.map(e=>e.path)})}function re(t){return(0,X.jsx)(rG,{repo:t,settings:u,onSettings:e.onSettings,onCommit:e=>void g(t,e),onUndo:()=>b(t),onRun:e=>void p(t,e),onRemote:e=>void m(t,e),onStage:e=>te(t,e),onUnstage:e=>ee(t,e),onDiscard:e=>s({repo:t,resources:e}),onCheckout:()=>e.onCheckout(t)})}let ae=o?.resources??[],oe=ae.filter(e=>e.status===`U`);return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border relative flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:u.tree?`View as List`:`View as Tree`,"aria-label":u.tree?`View as List`:`View as Tree`,onClick:()=>e.onSettings({tree:!u.tree}),children:(0,X.jsx)(Fe,{icon:u.tree?ip:rp,className:`size-4`})}),l!==null&&(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Commit`,"aria-label":`Commit`,disabled:e.busy,onClick:()=>void g(l,VW),children:(0,X.jsx)(Fe,{icon:be,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Refresh`,"aria-label":`Refresh`,onClick:e.onRefresh,children:(0,X.jsx)(Fe,{icon:qe,className:`size-4`})}),l!==null&&re(l),(e.busy||t.length>0)&&(0,X.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 overflow-hidden`,children:(0,X.jsx)(`span`,{className:`bg-primary block h-full w-[2%] animate-[progress_4s_linear_infinite]`})})]}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[e.error!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:e.error}),e.error===null&&e.repos===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),e.error===null&&e.repos?.length===0&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`The folder currently open doesn't have a git repository.`}),c.map(n=>(0,X.jsxs)(`div`,{children:[l===null&&(0,X.jsxs)(`div`,{className:`group/row text-sidebar-foreground flex h-[22px] items-center gap-1.5 pr-1 pl-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`truncate font-semibold`,children:n.path===``?e.name:yp(n.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:n.branch??(n.head===null?``:TW(n.head))}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex`,children:(0,X.jsx)(KW,{title:`Commit`,icon:be,onClick:()=>void g(n,VW)})}),re(n)]}),(0,X.jsx)(HW,{repo:n,message:f(n),generating:t.includes(n.path),busy:e.busy,nested:l===null,onMessage:t=>e.onMessage(n.path,t),onGenerate:()=>void v(n),onCancel:()=>y(n),onCommit:e=>void g(n,e),onRemote:e=>void m(n,e)}),(0,X.jsx)(WW,{repo:n,root:e.root,tree:u.tree,sort:u.sort,depth:+(l===null),active:e.active,onOpen:e.onOpen,onStage:e=>te(n,e),onUnstage:e=>ee(n,e),onDiscard:e=>s({repo:n,resources:e}),onIgnore:e=>void p(n,{kind:`ignore`,paths:e.map(e=>e.path)})})]},n.path))]}),c.length>0&&(0,X.jsx)(ZW,{machine:e.machine,projectId:e.projectId,repos:c,open:d.editor.graph,height:u.graphHeight,active:e.active,onToggle:()=>De({...d,editor:{...d.editor,graph:!d.editor.graph}}),onHeight:t=>e.onSettings({graphHeight:t}),onOpen:e.onOpen,onFetch:e=>void p(e,{kind:`fetch`,prune:!1,all:!0})}),(0,X.jsx)(fe,{open:i!==null,onOpenChange:e=>{e||a(null)},children:(0,X.jsxs)(ne,{children:[(0,X.jsxs)(Ce,{children:[(0,X.jsx)(_,{children:`There are no staged changes to commit.`}),(0,X.jsx)(h,{children:`Would you like to stage all your changes and commit them directly?`})]}),(0,X.jsxs)(ye,{children:[(0,X.jsx)(ie,{children:`Cancel`}),(0,X.jsx)(le,{variant:`outline`,onClick:()=>{i!==null&&(e.onSettings({smartCommit:!0}),g(i.repo,{...i.options,all:!0}))},children:`Always`}),(0,X.jsx)(le,{onClick:()=>{i!==null&&g(i.repo,{...i.options,all:!0})},children:`Yes`})]})]})}),(0,X.jsx)(fe,{open:o!==null,onOpenChange:e=>{e||s(null)},children:(0,X.jsxs)(ne,{children:[(0,X.jsxs)(Ce,{children:[(0,X.jsx)(_,{children:ae.length>1?`Are you sure you want to discard ALL changes in ${ae.length} files?`:oe.length===1?`Are you sure you want to DELETE the following untracked file: '${yp(ae[0].path)}'?`:`Are you sure you want to discard changes in '${yp(ae.at(0)?.path??``)}'?`}),(0,X.jsxs)(h,{children:[ae.length>1&&`This is IRREVERSIBLE! Your current working set will be FOREVER LOST if you proceed.`,ae.length===1&&oe.length===1&&`This is IRREVERSIBLE! This file will be FOREVER LOST if you proceed.`]})]}),(0,X.jsxs)(ye,{children:[(0,X.jsx)(ie,{children:`Cancel`}),(0,X.jsx)(le,{variant:`destructive`,onClick:()=>{o!==null&&p(o.repo,{kind:`discard`,tracked:ae.filter(e=>e.status!==`U`).map(e=>e.path),untracked:oe.map(e=>e.path)})},children:ae.length>1?`Discard All ${ae.length} Files`:oe.length===1?`Delete File`:`Discard File`})]})]})})]})}var aG=3e3;function oG(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),a=(0,Y.useEffectEvent)(e.onLoaded);return(0,Y.useEffect)(()=>{let t=!0,r=!1;async function o(){if(!r){r=!0;try{let r=await Ae(e.machine,`git.changes`,{projectId:e.projectId});if(!t)return;i(null),n(e=>Me(e,r)?e:r),a()}catch(e){t&&i(Ve(e))}finally{r=!1}}}function s(){document.hidden||o()}o();let c=window.setInterval(s,aG);return window.addEventListener(`focus`,s),()=>{t=!1,window.clearInterval(c),window.removeEventListener(`focus`,s)}},[e.machine,e.projectId,e.version]),{repos:t,error:r}}var sG=(0,Y.lazy)(async()=>({default:(await J(async()=>{let{ZoomableImage:e}=await import(`./zoomable-image-DAEgBZCp.js`);return{ZoomableImage:e}},__vite__mapDeps([16,17,2,18,19,20,21]))).ZoomableImage}));function cG(e){let t=Oe(t=>Pe(t,e.machine,e.projectId)),n=Ee(),r=Oe(e=>e.prefs.editor),[i]=(0,Y.useState)(()=>pp(e.machine,e.projectId)),[a]=(0,Y.useState)(()=>new Map(i.tabs.map(e=>[e.spec.id,e.view]))),[o,s]=(0,Y.useState)(()=>({...i.settings,width:Math.min(i.settings.width,window.innerWidth*.6)})),[c,l]=(0,Y.useState)(i.expanded),[d,f]=(0,Y.useState)(0),[p,m]=(0,Y.useState)(0),[h,g]=(0,Y.useState)(null),_=xW(),v=_.editor,y=_.diff,b=(0,Y.useRef)(null),ee=(0,Y.useCallback)(()=>f(e=>e+1),[]),te=FW({machine:e.machine,projectId:e.projectId,saved:i,onSaved:ee,onClose:()=>{ye(),e.onClose()}}),ne=te.active;function re(){ne!==null&&te.reload(ne)}let ie=oG({machine:e.machine,projectId:e.projectId,version:d,onLoaded:re}),ae=ie.repos,oe=te.tabs.find(e=>e.spec.id===ne),se=oe?.document.status===`text`&&oe.spec.preview!==!0?oe.document:null,ce=oe?.document.status===`text`&&oe.spec.preview===!0?oe.document.modified:null,le=se?.original??null,ue=se?.modified??null,de=oe?.spec.right.kind===`worktree`,fe=ae?.find(e=>e.path===oe?.spec.repo)??ae?.at(0)??null,pe=le===null&&ue?.getLanguageId()===`markdown`?ue:null;(0,Y.useEffect)(()=>{oW().catch(ke)},[n]),(0,Y.useEffect)(()=>{v?.updateOptions(sW(r)),y?.updateOptions(sW(r)),cW(r).catch(ke)},[v,y,r]),(0,Y.useEffect)(()=>{y?.updateOptions({renderSideBySide:!o.inline,ignoreTrimWhitespace:!o.whitespace,hideUnchangedRegions:{enabled:o.collapse}})},[y,o.inline,o.whitespace,o.collapse]),(0,Y.useEffect)(()=>{if(v===null||y===null||(b.current!==null&&a.set(b.current.id,b.current.editor.saveViewState()),b.current=null,v.setModel(le===null?ue:null),y.setModel(le===null||ue===null?null:{original:le,modified:ue}),ue===null||ne===null))return;let e=le===null?v:y.getModifiedEditor();e.updateOptions({readOnly:!de}),y.updateOptions({readOnly:!de}),e.restoreViewState(a.get(ne)??null),e.focus(),b.current={id:ne,editor:e}},[v,y,le,ue,ne,de,a]),(0,Y.useEffect)(()=>te.releaseModels());let me=(0,Y.useEffectEvent)(re);(0,Y.useEffect)(()=>me(),[ne]),yW({machine:e.machine,projectId:e.projectId,spec:oe?.spec,original:le,modified:ue,onPerform:_e});function he(e){window.innerWidth<640&&ve({sidebar:!1}),te.open(e)}async function _e(e){m(e=>e+1);try{await e()}catch(e){ke(e)}finally{m(e=>e-1),ee()}}function ve(e){s(t=>({...t,...e}))}function ye(){b.current!==null&&a.set(b.current.id,b.current.editor.saveViewState()),mp(e.machine,e.projectId,{tabs:te.tabs.map(e=>({spec:e.spec,view:a.get(e.spec.id)??null})),active:ne,expanded:c,settings:o})}(0,Y.useEffect)(ye);let be=(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,title:`Toggle Primary Side Bar`,"aria-label":`Toggle Primary Side Bar`,"aria-pressed":o.sidebar,onClick:()=>ve({sidebar:!o.sidebar}),children:(0,X.jsx)(Fe,{icon:ge,className:`size-4`})}),xe=(0,X.jsxs)(X.Fragment,{children:[be,(0,X.jsx)(RW,{view:o.view,onView:e=>ve({view:e})})]});return(0,X.jsx)(Ge,{open:!0,onOpenChange:()=>te.requestClose(),children:(0,X.jsxs)(Ue,{"aria-describedby":void 0,showCloseButton:!1,className:`top-0 left-0 flex h-dvh w-dvw max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none border-0 p-0 sm:max-w-none`,onEscapeKeyDown:e=>e.preventDefault(),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),ne!==null&&te.save(ne,!1)),(e.metaKey||e.ctrlKey)&&e.key===`w`&&(e.preventDefault(),ne!==null&&te.close(ne)),(e.metaKey||e.ctrlKey)&&e.shiftKey&&e.key.toLowerCase()===`v`&&pe!==null&&(e.preventDefault(),ve({preview:!o.preview}))},children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:He(`border-sidebar-border relative shrink-0 border-r`,!o.sidebar&&`hidden`),style:{width:o.width},children:[o.view===`explorer`&&(0,X.jsx)(gp,{machine:e.machine,projectId:e.projectId,root:t?.path??``,header:xe,expanded:c,onExpanded:l,active:oe?.spec.path??null,onOpen:e=>he(DW(``,e)),onPreview:e=>he(OW(``,e)),onRenamed:te.renamed,onDeleted:te.deleted}),o.view===`scm`&&(0,X.jsx)(iG,{machine:e.machine,projectId:e.projectId,name:t?.name??``,root:t?.path??``,header:xe,repos:ae,error:ie.error,busy:p>0,settings:o,onSettings:ve,onMessage:(e,t)=>s(n=>({...n,messages:{...n.messages,[e]:t}})),active:ne,onOpen:he,onRefresh:ee,onPerform:_e,onCheckout:g}),(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`hover:bg-primary absolute inset-y-0 -right-0.5 z-10 w-1 cursor-col-resize touch-none transition-colors delay-100`,onPointerDown:e=>ze(e,e=>ve({width:Math.min(Math.max(e.clientX,200),window.innerWidth-240)}))})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-9 shrink-0 items-center shadow-[inset_0_-1px_0_var(--sidebar-border)]`,children:[!o.sidebar&&(0,X.jsx)(`div`,{className:`shrink-0 px-1.5`,children:be}),(0,X.jsx)(We,{className:`sr-only`,children:`Editor`}),(0,X.jsx)(bp,{tabs:te.tabs.map(e=>({id:e.spec.id,path:e.spec.path,label:e.spec.label})),active:ne,dirty:te.dirty.map(e=>e.spec.id),onSelect:te.setActive,onClose:te.close}),oe!==void 0&&le!==null&&(0,X.jsx)(zW,{settings:o,onSettings:ve,onOpenFile:()=>he(DW(oe.spec.repo,oe.spec.path)),onPrevious:()=>y?.goToDiff(`previous`),onNext:()=>y?.goToDiff(`next`)}),pe!==null&&(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,className:`ml-1.5 shrink-0`,title:`Toggle Preview`,"aria-label":`Toggle Preview`,"aria-pressed":o.preview,onClick:()=>ve({preview:!o.preview}),children:(0,X.jsx)(Fe,{icon:cp,className:`size-4`})}),(0,X.jsx)(Ie,{size:`icon-micro`,variant:`ghost`,className:`mx-1.5 shrink-0`,title:`Close`,"aria-label":`Close`,onClick:te.requestClose,children:(0,X.jsx)(Fe,{icon:Ne,className:`size-4`})})]}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:He(`relative min-w-0 flex-1`,pe!==null&&o.preview&&`max-sm:hidden`,ce!==null&&`hidden`),children:[(0,X.jsx)(`div`,{ref:_.codeHost,className:He(`absolute inset-0`,(ue===null||le!==null)&&`hidden`)}),(0,X.jsx)(`div`,{ref:_.diffHost,className:He(`absolute inset-0`,(ue===null||le===null)&&`hidden`)}),oe?.document.status===`image`&&(0,X.jsx)(Y.Suspense,{children:(0,X.jsx)(sG,{src:oe.document.src,alt:oe.spec.path})}),(0,X.jsx)(lp,{document:oe?.document,view:o.view})]}),pe!==null&&o.preview&&v!==null&&oe!==void 0&&(0,X.jsx)(lW,{machine:e.machine,projectId:e.projectId,path:oe.spec.path,model:pe,editor:v,onOpen:e=>he(DW(``,e))}),ce!==null&&oe!==void 0&&(0,X.jsx)(lW,{machine:e.machine,projectId:e.projectId,path:oe.spec.path,model:ce,editor:null,onOpen:e=>he(DW(``,e))},oe.spec.id)]})]})]}),(0,X.jsx)(_W,{editor:ue===null?null:le===null?v:y?.getModifiedEditor()??null,language:se?.language??null,children:fe!==null&&(0,X.jsx)(BW,{repo:fe,busy:p>0,onCheckout:()=>g(fe),onSync:()=>void _e(()=>Ae(e.machine,`git.sync`,{projectId:e.projectId,repo:fe.path})),onPublish:()=>void _e(()=>Ae(e.machine,`git.push`,{projectId:e.projectId,repo:fe.path}))})}),(0,X.jsx)(fp,{}),(0,X.jsx)(gW,{open:te.closing!==null,paths:te.closingTabs.map(e=>e.spec.path),onCancel:()=>te.setClosing(null),onFinish:e=>void te.finish(e)}),(0,X.jsx)(hW,{...te.conflict}),h!==null&&(0,X.jsx)(u,{machine:e.machine,projectId:e.projectId,repo:{...h,changed:h.merge.length+h.staged.length+h.changes.length},onRefresh:ee,onClose:()=>g(null)})]})})}export{cG as EditorDialog};