@xano/xanoscript-monaco-editor 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -126
- package/dist/.vite/manifest.json +54 -54
- package/dist/assets/{editor-BivTGeL1.js → editor-4HUBGwOu.js} +1 -1
- package/dist/assets/{extensionHost.worker-bYZXB0kM.js → extensionHost.worker-BEj8h9xB.js} +7 -7
- package/dist/assets/{files.contribution._fileEditorFactory-vS4ZLYi1.js → files.contribution._fileEditorFactory-YNF_vxMj.js} +1 -1
- package/dist/assets/{iconv-lite-umd-DQaTktu2.js → iconv-lite-umd-BCZHOywd.js} +2 -7
- package/dist/assets/{iconv-lite-umd-DYWd8cEa.js → iconv-lite-umd-BGIeO9cR.js} +2 -7
- package/dist/assets/{index-CrbRjSB_.js → index-9GTRLRSC.js} +1 -1
- package/dist/assets/{index-BGwiFEyd.js → index-B48SQPT2.js} +1 -1
- package/dist/assets/{index-VRHnXpb2.js → index-B7W-kS7G.js} +1 -1
- package/dist/assets/{index-51WpeTZl.js → index-CBODr4QR.js} +3 -3
- package/dist/assets/{index-C3pnKX8a.js → index-Cw1WVxjJ.js} +1 -1
- package/dist/assets/{index-BwfWF2CI.js → index-DSexFukl.js} +47 -47
- package/dist/assets/{index-C25FTAfE.js → index-DV2XmbY1.js} +1 -1
- package/dist/assets/{index-B132pG6E.js → index-DoXiLhIy.js} +2 -2
- package/dist/assets/{index-DgK2LcnW.js → index-r-mEMSNw.js} +2 -2
- package/dist/assets/{index-yPQeQvu7.js → index-sQEJqDvC.js} +1 -1
- package/dist/assets/main--VvQJcub.js +4 -0
- package/dist/assets/main-DUUA0eUQ.js +4 -0
- package/dist/assets/main-DWv94O3B.js +1 -0
- package/dist/assets/main-Du3mMy1c.js +1 -0
- package/dist/assets/{tokenClassificationRegistry-DcBtqg2t.js → tokenClassificationRegistry-CZyxOMX0.js} +1 -1
- package/dist/assets/{views-hUfpm9tT.js → views-Bu3Oa5Y-.js} +3 -3
- package/dist/assets/{views-C4cPu3oQ.css → views-qXWInm-E.css} +1 -1
- package/dist/assets/workbenchThemeService.service-CXlQNmVU.js +1 -0
- package/dist/assets/{worker-BIMDXoFp.js → worker-BiA-ZZ0u.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/logic-assistant-script.js +22301 -16325
- package/dist/logic-assistant-script.js.map +4 -4
- package/dist/worker.js +20541 -14435
- package/dist/worker.js.map +4 -4
- package/package.json +3 -1
- package/dist/assets/main-D6ceXGB_.js +0 -4
- package/dist/assets/main-DNugpDp4.js +0 -4
- package/dist/assets/main-FP17jmvp.js +0 -1
- package/dist/assets/main-b5eBH2vx.js +0 -1
- package/dist/assets/workbenchThemeService.service-qBFVnuYD.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as ee,b$ as on,bX as Y,cI as Mn,cJ as be,cK as w,cL as an,cM as Gt,cN as On,E as I,A as cn,cO as j,cP as xn,cQ as kn,cR as oe,cS as P,bM as Hn,bN as N,bP as ot,$ as C,cT as Ni,bU as Re,cU as se,cV as mi,cW as ct,cX as pi,cY as at,W as L,cZ as pe,j as Ae,bH as hn,d as V,q as g,aj as le,bZ as Te,bY as B,c_ as Ss,c$ as As,f as T,g as d,m as Cs,bh as F,bD as tt,bE as Z,Z as _e,d0 as ge,d1 as Fn,a7 as S,d2 as Es,d3 as ln,d4 as Jt,d5 as Lt,d6 as Gn,d7 as Wn,d8 as Mt,d9 as Qt,a4 as qe,da as H,db as Se,dc as $,dd as Vi,U as bi,de as zn,df as Un,dg as Ti,dh as dn,di as Is,dj as Ts,dk as Kn,dl as me,dm as Yn,dn as it,dp as ys,dq as un,dr as Xn,ds as z,dt as vt,du as Je,h as Qe,dv as fn,dw as et,dx as re,dy as gn,dz as Zn,dA as $n,dB as jn,ck as h,bu as A,c0 as ie,bA as te,dC as Ee,cc as st,dD as qn,dE as K,dF as Ie,dG as Jn,ao as wt,dH as mn,a9 as Si,dI as Qn,dJ as er,dK as tr,dL as ir,t as Ce,dM as sr,an as ei,dN as At,dO as pn,dP as nr,dQ as yi,dR as _,dS as Vs,dT as rr,by as Wt,ch as Ai,bx as ae,ci as or,bw as ar,O as bn,dU as cr,bW as Ct,ce as hr,cf as lr,dV as vs,dW as nt,bz as dr,dX as ws,dY as ti,dZ as Bi,d_ as ve,d$ as Bs,e0 as ur,e1 as gt,e2 as Ot,G as ne,e3 as _t,e4 as Li,e5 as De,e6 as Sn,e7 as Ls,cl as v,e8 as fr,e9 as gr,ea as mr,eb as pr,cw as br,aJ as E,cp as y,cv as Sr,cr as yt,cs as vi,ct as zt,cu as mt,cn as O,co as Ar,cq as Ms,ec as Ut,ed as Cr,ee as Ci,ef as Mi,eg as x,eh as Os,ei as W,ej as Er,ek as Ir,el as Tr,em as yr,cz as vr,cy as wr,en as xs,eo as _r,ep as ks,eq as ce,er as Oi,cm as lt,es as Kt,et as xi,eu as Dr,ev as Rr,aK as R,ew as Hs,bo as An,ex as Fs,ey as Pr,ez as Nr,eA as Vr,z as Yt,eB as Cn,eC as Br,bJ as Lr,eD as Mr,eE as Or,eF as Xt,eG as xr,eH as wi,eI as kr,eJ as Hr,eK as Fr,eL as Gr,eM as Wr,eN as zr,eO as Ur,eP as Kr,eQ as Yr,eR as Xr,eS as Zr,eT as En,eU as $r,eV as _s,eW as Gs,eX as jr,eY as In,a6 as Tn,eZ as ki,e_ as yn,bK as Ds,bL as Rs,e$ as qr,bO as Ps,f0 as Zt,f1 as Jr,f2 as Qr,f3 as Ne,f4 as eo,f5 as to,f6 as io,f7 as so,f8 as no,a8 as J,f9 as Ws,fa as ro,fb as oo,fc as ao,fd as co,fe as ho,ff as zs,fg as lo,fh as Us,fi as Ks,fj as uo,fk as fo,fl as go,fm as mo,fn as po,fo as bo,fp as So,fq as Ao,fr as Co,fs as Eo,N as Io,ft as To,fu as yo,fv as vo,fw as vn,fx as wo,fy as Ys,fz as _o,fA as Do,fB as Ro,fC as Xs,fD as Ns,ak as Le,fE as wn,fF as Et,fG as $t,fH as _n,fI as Dn,fJ as Po,fK as _i,fL as Zs,fM as No,fN as Vo,fO as Bo,fP as Lo,fQ as $s,fR as Mo,fS as Oo,fT as xo,fU as ko,fV as Ho,fW as Fo,fX as Go,fY as Wo,fZ as zo,bT as Uo,f_ as js,f$ as Ko,g0 as Yo,g1 as Xo,g2 as Zo,g3 as $o,g4 as jo,g5 as qo,g6 as Jo,g7 as Qo,u as ea,g8 as ta,g9 as ia,p as sa,ga as Rn,X as na,Y as ra,gb as oa,gc as aa,gd as ca,ge as ha,gf as la,gg as da,gh as ua,gi as fa,gj as Ei,b2 as ga,gk as ma,gl as pa,aH as ba,gm as Sa,cb as Aa,gn as Ca,go as Ea,gp as Ia,gq as Ta,gr as ya,cd as va}from"./index-BwfWF2CI.js";import{cD as Yc,cE as Xc,cB as Zc,cH as $c,cF as jc,cC as qc,cG as Jc,cA as Qc}from"./index-BwfWF2CI.js";import{S as wa,P as _a,A as Da,c as Ra,d as Tt,D as U,g as Pa,a as Na,E as Va,B as Ba}from"./views-hUfpm9tT.js";import{E as La}from"./files.contribution._fileEditorFactory-vS4ZLYi1.js";import"./workbenchThemeService.service-qBFVnuYD.js";const Ma=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Pn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var X;(function(u){u[u.ADD=0]="ADD",u[u.CHANGE=1]="CHANGE",u[u.EXPAND_COLLAPSE=2]="EXPAND_COLLAPSE",u[u.REMOVE=3]="REMOVE"})(X||(X={}));var St;(function(u){u[u.ADD=0]="ADD",u[u.REMOVE=1]="REMOVE"})(St||(St={}));class Oa extends ee{constructor(e,t){super(),this.item=e,this.onClose=t,this._onDidClose=this._register(new I),this.onDidClose=this._onDidClose.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.registerListeners()}registerListeners(){this._register(this.item.onDidChangeVisibility(e=>this._onDidChangeVisibility.fire(e))),oe.once(this.item.onDidClose)(()=>{this._onDidClose.fire(),this.dispose()})}get progress(){return this.item.progress}updateSeverity(e){this.item.updateSeverity(e)}updateMessage(e){this.item.updateMessage(e)}updateActions(e){this.item.updateActions(e)}close(){this.onClose(this.item),this.dispose()}}const ui=class ui extends ee{constructor(){super(...arguments),this._onDidChangeNotification=this._register(new I),this.onDidChangeNotification=this._onDidChangeNotification.event,this._onDidChangeStatusMessage=this._register(new I),this.onDidChangeStatusMessage=this._onDidChangeStatusMessage.event,this._onDidChangeFilter=this._register(new I),this.onDidChangeFilter=this._onDidChangeFilter.event,this._notifications=[],this.filter={global:w.OFF,sources:new Map}}get notifications(){return this._notifications}get statusMessage(){return this._statusMessage}setFilter(e){let t=!1;typeof e.global=="number"&&(t=this.filter.global!==e.global,this.filter.global=e.global);let i=!1;e.sources&&(i=!kn(this.filter.sources,e.sources),this.filter.sources=e.sources),(t||i)&&this._onDidChangeFilter.fire({global:t?e.global:void 0,sources:i?e.sources:void 0})}addNotification(e){const t=this.createViewItem(e);return t?(this.findNotification(t)?.close(),this._notifications.splice(0,0,t),this._onDidChangeNotification.fire({item:t,index:0,kind:X.ADD}),new Oa(t,s=>this.onClose(s))):ui.NO_OP_NOTIFICATION}onClose(e){const t=this.findNotification(e);t&&t!==e?t.close():e.close()}findNotification(e){return this._notifications.find(t=>t.equals(e))}createViewItem(e){const t=xt.create(e,this.filter);if(!t)return;const i=(n,o)=>{const a=this._notifications.indexOf(t);a>=0&&this._onDidChangeNotification.fire({item:t,index:a,kind:n,detail:o})},s=t.onDidChangeExpansion(()=>i(X.EXPAND_COLLAPSE)),r=t.onDidChangeContent(n=>i(X.CHANGE,n.kind));return oe.once(t.onDidClose)(()=>{s.dispose(),r.dispose();const n=this._notifications.indexOf(t);n>=0&&(this._notifications.splice(n,1),this._onDidChangeNotification.fire({item:t,index:n,kind:X.REMOVE}))}),t}showStatusMessage(e,t){const i=ka.create(e,t);return i?(this._statusMessage=i,this._onDidChangeStatusMessage.fire({kind:St.ADD,item:i}),{close:()=>{this._statusMessage===i&&(this._statusMessage=void 0,this._onDidChangeStatusMessage.fire({kind:St.REMOVE,item:i}))}}):{close:()=>{}}}};ui.NO_OP_NOTIFICATION=new xn;let qs=ui;function Di(u){return u instanceof xt}var Q;(function(u){u[u.SEVERITY=0]="SEVERITY",u[u.MESSAGE=1]="MESSAGE",u[u.ACTIONS=2]="ACTIONS",u[u.PROGRESS=3]="PROGRESS"})(Q||(Q={}));class xa extends ee{constructor(){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._state=Object.create(null)}get state(){return this._state}infinite(){this._state.infinite||(this._state.infinite=!0,this._state.total=void 0,this._state.worked=void 0,this._state.done=void 0,this._onDidChange.fire())}done(){this._state.done||(this._state.done=!0,this._state.infinite=void 0,this._state.total=void 0,this._state.worked=void 0,this._onDidChange.fire())}total(e){this._state.total!==e&&(this._state.total=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire())}worked(e){typeof this._state.worked=="number"?this._state.worked+=e:this._state.worked=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire()}}const ye=class ye extends ee{static create(e,t){if(!e||!e.message||on(e.message))return;let i;typeof e.severity=="number"?i=e.severity:i=Y.Info;const s=ye.parseNotificationMessage(e.message);if(!s)return;let r;e.actions?r=e.actions:Mn(e.message)&&(r={primary:e.message.actions});let n=e.priority??be.DEFAULT;return(n===be.DEFAULT||n===be.OPTIONAL)&&i!==Y.Error&&(t.global===w.ERROR?n=be.SILENT:an(e.source)&&t.sources.get(e.source.id)===w.ERROR&&(n=be.SILENT)),new ye(e.id,i,e.sticky,n,s,e.source,e.progress,r)}static parseNotificationMessage(e){let t;if(e instanceof Error?t=Gt(e,!1):typeof e=="string"&&(t=e),!t)return;const i=t;t.length>ye.MAX_MESSAGE_LENGTH&&(t=`${t.substr(0,ye.MAX_MESSAGE_LENGTH)}...`),t=t.replace(/(\r\n|\n|\r)/gm," ").trim();const s=On(t);return{raw:i,linkedText:s,original:e}}constructor(e,t,i,s,r,n,o,a){super(),this.id=e,this._severity=t,this._sticky=i,this._priority=s,this._message=r,this._source=n,this._visible=!1,this._onDidChangeExpansion=this._register(new I),this.onDidChangeExpansion=this._onDidChangeExpansion.event,this._onDidClose=this._register(new I),this.onDidClose=this._onDidClose.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,o&&this.setProgress(o),this.setActions(a)}setProgress(e){e.infinite?this.progress.infinite():e.total&&(this.progress.total(e.total),e.worked&&this.progress.worked(e.worked))}setActions(e={primary:[],secondary:[]}){this._actions={primary:Array.isArray(e.primary)?e.primary:[],secondary:Array.isArray(e.secondary)?e.secondary:[]},this._expanded=e.primary&&e.primary.length>0}get canCollapse(){return!this.hasActions}get expanded(){return!!this._expanded}get severity(){return this._severity}get sticky(){if(this._sticky)return!0;const e=this.hasActions;return!!(e&&this._severity===Y.Error||!e&&this._expanded||this._progress&&!this._progress.state.done)}get priority(){return this._priority}get hasActions(){return!this._actions||!this._actions.primary?!1:this._actions.primary.length>0}get hasProgress(){return!!this._progress}get progress(){return this._progress||(this._progress=this._register(new xa),this._register(this._progress.onDidChange(()=>this._onDidChangeContent.fire({kind:Q.PROGRESS})))),this._progress}get message(){return this._message}get source(){return typeof this._source=="string"?this._source:this._source?this._source.label:void 0}get sourceId(){return this._source&&typeof this._source!="string"&&"id"in this._source?this._source.id:void 0}get actions(){return this._actions}get visible(){return this._visible}updateSeverity(e){e!==this._severity&&(this._severity=e,this._onDidChangeContent.fire({kind:Q.SEVERITY}))}updateMessage(e){const t=ye.parseNotificationMessage(e);!t||t.raw===this._message.raw||(this._message=t,this._onDidChangeContent.fire({kind:Q.MESSAGE}))}updateActions(e){this.setActions(e),this._onDidChangeContent.fire({kind:Q.ACTIONS})}updateVisibility(e){this._visible!==e&&(this._visible=e,this._onDidChangeVisibility.fire(e))}expand(){this._expanded||!this.canCollapse||(this._expanded=!0,this._onDidChangeExpansion.fire())}collapse(e){!this._expanded||!this.canCollapse||(this._expanded=!1,e||this._onDidChangeExpansion.fire())}toggle(){this._expanded?this.collapse():this.expand()}close(){this._onDidClose.fire(),this.dispose()}equals(e){if(this.hasProgress||e.hasProgress)return!1;if(typeof this.id=="string"||typeof e.id=="string")return this.id===e.id;if(typeof this._source=="object"){if(this._source.label!==e.source||this._source.id!==e.sourceId)return!1}else if(this._source!==e.source)return!1;if(this._message.raw!==e.message.raw)return!1;const t=this._actions&&this._actions.primary||[],i=e.actions&&e.actions.primary||[];return cn(t,i,(s,r)=>s.id+s.label===r.id+r.label)}};ye.MAX_MESSAGE_LENGTH=1e3;let xt=ye;class ii extends j{constructor(e,t){super(e,t.label,void 0,!0,async()=>{t.run(),this._onDidRun.fire()}),this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event,this._keepOpen=!!t.keepOpen,this._menu=!t.isSecondary&&t.menu?t.menu.map((i,s)=>new ii(`${e}.${s}`,i)):void 0}get menu(){return this._menu}get keepOpen(){return this._keepOpen}}class ka{static create(e,t){if(!e||on(e))return;let i;if(e instanceof Error?i=Gt(e,!1):typeof e=="string"&&(i=e),!!i)return{message:i,options:t}}}const Hi="notifications.showList",kt="notifications.hideList",Ha="notifications.toggleList",Ri="notifications.hideToasts",Js="notifications.focusToasts",Fa="notifications.focusNextToast",Ga="notifications.focusPreviousToast",Wa="notifications.focusFirstToast",za="notifications.focusLastToast",Fi="notification.collapse",Gi="notification.expand",Qs="notification.acceptPrimaryAction",Ua="notification.toggle",Wi="notification.clear",si="notifications.clearAll",ni="notifications.toggleDoNotDisturbMode",ri="notifications.toggleDoNotDisturbModeBySource";function Ve(u,e){if(Di(e))return e;const t=u.lastFocusedList;if(t instanceof As){let i=t.getFocusedElements()[0];if(Di(i)||t.isDOMFocused()&&(i=t.element(0)),Di(i))return i}}function Ka(u,e,t){P.registerCommandAndKeybindingRule({id:Hi,weight:N.WorkbenchContrib,primary:Hn(ot.CtrlCmd|C.KeyK,ot.CtrlCmd|ot.Shift|C.KeyN),handler:()=>{e.hide(),u.show()}}),P.registerCommandAndKeybindingRule({id:kt,weight:N.WorkbenchContrib+50,when:Ni,primary:C.Escape,handler:()=>u.hide()}),Re.registerCommand(Ha,()=>{u.isVisible?u.hide():(e.hide(),u.show())}),P.registerCommandAndKeybindingRule({id:Wi,weight:N.WorkbenchContrib,when:se,primary:C.Delete,mac:{primary:ot.CtrlCmd|C.Backspace},handler:(s,r)=>{const n=s.get(mi),o=Ve(s.get(ct),r);o&&!o.hasProgress&&(o.close(),n.playSignal(pi.clear))}}),P.registerCommandAndKeybindingRule({id:Gi,weight:N.WorkbenchContrib,when:se,primary:C.RightArrow,handler:(s,r)=>{Ve(s.get(ct),r)?.expand()}}),P.registerCommandAndKeybindingRule({id:Qs,weight:N.WorkbenchContrib,when:at.or(se,pe),primary:ot.CtrlCmd|ot.Shift|C.KeyA,handler:s=>{const r=s.get(L).createInstance(Ht),n=Ve(s.get(ct))||t.notifications.at(0);if(!n)return;const o=n.actions?.primary?n.actions.primary.at(0):void 0;o&&(r.run(o,n),n.close(),r.dispose())}}),P.registerCommandAndKeybindingRule({id:Fi,weight:N.WorkbenchContrib,when:se,primary:C.LeftArrow,handler:(s,r)=>{Ve(s.get(ct),r)?.collapse()}}),P.registerCommandAndKeybindingRule({id:Ua,weight:N.WorkbenchContrib,when:se,primary:C.Space,secondary:[C.Enter],handler:s=>{Ve(s.get(ct))?.toggle()}}),Re.registerCommand(Ri,s=>{e.hide()}),P.registerKeybindingRule({id:Ri,weight:N.WorkbenchContrib-50,when:pe,primary:C.Escape}),P.registerKeybindingRule({id:Ri,weight:N.WorkbenchContrib+100,when:at.and(pe,se),primary:C.Escape}),Re.registerCommand(Js,()=>e.focus()),P.registerCommandAndKeybindingRule({id:Fa,weight:N.WorkbenchContrib,when:at.and(se,pe),primary:C.DownArrow,handler:()=>{e.focusNext()}}),P.registerCommandAndKeybindingRule({id:Ga,weight:N.WorkbenchContrib,when:at.and(se,pe),primary:C.UpArrow,handler:()=>{e.focusPrevious()}}),P.registerCommandAndKeybindingRule({id:Wa,weight:N.WorkbenchContrib,when:at.and(se,pe),primary:C.PageUp,secondary:[C.Home],handler:()=>{e.focusFirst()}}),P.registerCommandAndKeybindingRule({id:za,weight:N.WorkbenchContrib,when:at.and(se,pe),primary:C.PageDown,secondary:[C.End],handler:()=>{e.focusLast()}}),Re.registerCommand(si,()=>u.clearAll()),Re.registerCommand(ni,s=>{const r=s.get(Ae);r.setFilter(r.getFilter()===w.ERROR?w.OFF:w.ERROR)}),Re.registerCommand(ri,s=>{const r=s.get(Ae),n=s.get(hn),o=r.getFilters().sort((l,m)=>l.label.localeCompare(m.label)),a=new V,c=a.add(n.createQuickPick());c.items=o.map(l=>({id:l.id,label:l.label,tooltip:`${l.label} (${l.id})`,filter:l.filter})),c.canSelectMany=!0,c.placeholder=g(3394,"Select sources to enable all notifications from"),c.selectedItems=c.items.filter(l=>l.filter===w.OFF),c.show(),a.add(c.onDidAccept(async()=>{for(const l of c.items)r.setFilter({id:l.id,label:l.label,filter:c.selectedItems.includes(l)?w.OFF:w.ERROR});c.hide()})),a.add(c.onDidHide(()=>a.dispose()))});const i=le(3395,"Notifications");Te.appendMenuItem(B.CommandPalette,{command:{id:Hi,title:le(3396,"Show Notifications"),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:kt,title:le(3397,"Hide Notifications"),category:i},when:Ni}),Te.appendMenuItem(B.CommandPalette,{command:{id:si,title:le(3398,"Clear All Notifications"),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:Qs,title:le(3399,"Accept Notification Primary Action"),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:ni,title:le(3400,"Toggle Do Not Disturb Mode"),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:ri,title:le(3401,"Toggle Do Not Disturb Mode By Source..."),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:Js,title:le(3402,"Focus Notification Toast"),category:i},when:pe})}let Ht=class extends Ss{constructor(e,t){super(),this.telemetryService=e,this.notificationService=t}async runAction(e,t){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.id,from:"message"});try{await super.runAction(e,t)}catch(i){this.notificationService.error(i)}}};Ht=T([d(0,Cs),d(1,Ae)],Ht);const Ya=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));_e(Pn);const Xa=tt("notifications-clear",Z.close,g(3367,"Icon for the clear action in notifications.")),Za=tt("notifications-clear-all",Z.clearAll,g(3368,"Icon for the clear all action in notifications.")),$a=tt("notifications-hide",Z.chevronDown,g(3369,"Icon for the hide action in notifications.")),ja=tt("notifications-expand",Z.chevronUp,g(3370,"Icon for the expand action in notifications.")),qa=tt("notifications-collapse",Z.chevronDown,g(3371,"Icon for the collapse action in notifications.")),Ja=tt("notifications-configure",Z.gear,g(3372,"Icon for the configure action in notifications.")),Nn=tt("notifications-do-not-disturb",Z.bellSlash,g(3373,"Icon for the mute all action in notifications."));var Oe;let Dt=(Oe=class extends j{constructor(e,t,i){super(e,t,F.asClassName(Xa)),this.commandService=i}async run(e){this.commandService.executeCommand(Wi,e)}},Oe.ID=Wi,Oe.LABEL=g(3374,"Clear Notification"),Oe);Dt=T([d(2,ge)],Dt);var xe;let Rt=(xe=class extends j{constructor(e,t,i){super(e,t,F.asClassName(Za)),this.commandService=i}async run(){this.commandService.executeCommand(si)}},xe.ID=si,xe.LABEL=g(3375,"Clear All Notifications"),xe);Rt=T([d(2,ge)],Rt);var ke;let oi=(ke=class extends j{constructor(e,t,i){super(e,t,F.asClassName(Nn)),this.commandService=i}async run(){this.commandService.executeCommand(ni)}},ke.ID=ni,ke.LABEL=g(3376,"Toggle Do Not Disturb Mode"),ke);oi=T([d(2,ge)],oi);var He;let ai=(He=class extends j{constructor(e,t,i){super(e,t),this.commandService=i}async run(){this.commandService.executeCommand(ri)}},He.ID=ri,He.LABEL=g(3377,"Toggle Do Not Disturb Mode By Source..."),He);ai=T([d(2,ge)],ai);const fi=class fi extends j{constructor(e,t){super(e,t,F.asClassName(Nn))}};fi.ID="workbench.action.configureDoNotDisturbMode",fi.LABEL=g(3378,"Configure Do Not Disturb...");let dt=fi;var Fe;let Pt=(Fe=class extends j{constructor(e,t,i){super(e,t,F.asClassName($a)),this.commandService=i}async run(){this.commandService.executeCommand(kt)}},Fe.ID=kt,Fe.LABEL=g(3379,"Hide Notifications"),Fe);Pt=T([d(2,ge)],Pt);var Ge;let Nt=(Ge=class extends j{constructor(e,t,i){super(e,t,F.asClassName(ja)),this.commandService=i}async run(e){this.commandService.executeCommand(Gi,e)}},Ge.ID=Gi,Ge.LABEL=g(3380,"Expand Notification"),Ge);Nt=T([d(2,ge)],Nt);var We;let Vt=(We=class extends j{constructor(e,t,i){super(e,t,F.asClassName(qa)),this.commandService=i}async run(e){this.commandService.executeCommand(Fi,e)}},We.ID=Fi,We.LABEL=g(3381,"Collapse Notification"),We);Vt=T([d(2,ge)],Vt);const gi=class gi extends j{constructor(e,t,i){super(e,t,F.asClassName(Ja)),this.notification=i}};gi.ID="workbench.action.configureNotification",gi.LABEL=g(3382,"More Actions...");let pt=gi;var ze;let Bt=(ze=class extends j{constructor(e,t,i){super(e,t),this.clipboardService=i}run(e){return this.clipboardService.writeText(e.message.raw)}},ze.ID="workbench.action.copyNotificationMessage",ze.LABEL=g(3383,"Copy Text"),ze);Bt=T([d(2,Fn)],Bt);var zi,ue;const fe=class fe{constructor(e){this.offsetHelper=this.createOffsetHelper(e)}createOffsetHelper(e){return e.appendChild(S(".notification-offset-helper"))}getHeight(e){if(!e.expanded)return fe.ROW_HEIGHT;let t=fe.ROW_HEIGHT;const i=this.computePreferredHeight(e);if(fe.LINE_HEIGHT<i){const r=i-fe.LINE_HEIGHT;t+=r}return(e.source||Qt(e.actions&&e.actions.primary))&&(t+=fe.ROW_HEIGHT),t===fe.ROW_HEIGHT&&e.collapse(!0),t}computePreferredHeight(e){let t=0;e.hasProgress||t++,e.canCollapse&&t++,Qt(e.actions&&e.actions.secondary)&&t++,this.offsetHelper.style.width=`${450-(40+t*30-Math.max(t-1,0)*4)}px`;const i=Vn.render(e.message);this.offsetHelper.appendChild(i);const s=Math.max(this.offsetHelper.offsetHeight,this.offsetHelper.scrollHeight);return qe(this.offsetHelper),s}getTemplateId(e){if(e instanceof xt)return ci.TEMPLATE_ID;throw new Error("unknown element type: "+e)}};fe.ROW_HEIGHT=42,fe.LINE_HEIGHT=22;let Ui=fe;class Vn{static render(e,t){const i=S("span");for(const s of e.linkedText.nodes)if(typeof s=="string")i.appendChild(document.createTextNode(s));else{let r=s.title;!r&&s.href.startsWith("command:")?r=g(3424,"Click to execute command '{0}'",s.href.substr(8)):r||(r=s.href);const n=S("a",{href:s.href,title:r,tabIndex:0},s.label);if(t){const o=p=>{Kn(p)&&Se.stop(p,!0),t.callback(s.href)},a=t.toDispose.add(new Ti(n,$.CLICK)).event,c=t.toDispose.add(new Ti(n,$.KEY_DOWN)).event,l=oe.chain(c,p=>p.filter(b=>{const M=new dn(b);return M.equals(C.Space)||M.equals(C.Enter)}));t.toDispose.add(Is.addTarget(n));const m=t.toDispose.add(new Ti(n,Ts.Tap)).event;oe.any(a,m,l)(o,null,t.toDispose)}i.appendChild(n)}return i}}var Ue;let ci=(Ue=class{constructor(e,t,i,s){this.actionRunner=e,this.contextMenuService=t,this.instantiationService=i,this.notificationService=s}get templateId(){return zi.TEMPLATE_ID}renderTemplate(e){const t=Object.create(null);t.toDispose=new V,t.container=S(".notification-list-item"),t.mainRow=S(".notification-list-item-main-row"),t.icon=S(".notification-list-item-icon.codicon"),t.message=S(".notification-list-item-message");const i=this,s=S(".notification-list-item-toolbar-container");return t.toolbar=new Es(s,{ariaLabel:g(3425,"Notification Actions"),actionViewItemProvider:(r,n)=>{if(r instanceof pt)return t.toDispose.add(new ln(r,{getActions(){const o=[],a={id:r.notification.sourceId,label:r.notification.source};if(an(a)){const c=i.notificationService.getFilter(a)===w.ERROR;o.push(Jt({id:a.id,label:c?g(3426,"Turn On All Notifications from '{0}'",a.label):g(3427,"Turn Off Info and Warning Notifications from '{0}'",a.label),run:()=>i.notificationService.setFilter({...a,filter:c?w.OFF:w.ERROR})})),r.notification.actions?.secondary?.length&&o.push(new Lt)}return Array.isArray(r.notification.actions?.secondary)&&o.push(...r.notification.actions.secondary),o}},this.contextMenuService,{...n,actionRunner:this.actionRunner,classNames:r.class}))},actionRunner:this.actionRunner}),t.toDispose.add(t.toolbar),t.detailsRow=S(".notification-list-item-details-row"),t.source=S(".notification-list-item-source"),t.buttonsContainer=S(".notification-list-item-buttons-container"),e.appendChild(t.container),t.container.appendChild(t.detailsRow),t.detailsRow.appendChild(t.source),t.detailsRow.appendChild(t.buttonsContainer),t.container.appendChild(t.mainRow),t.mainRow.appendChild(t.icon),t.mainRow.appendChild(t.message),t.mainRow.appendChild(s),t.progress=new Gn(e,Wn),t.toDispose.add(t.progress),t.renderer=this.instantiationService.createInstance(Ki,t,this.actionRunner),t.toDispose.add(t.renderer),t}renderElement(e,t,i){i.renderer.setInput(e)}disposeTemplate(e){Mt(e.toDispose)}},zi=Ue,Ue.TEMPLATE_ID="notification",Ue);ci=zi=T([d(1,me),d(2,L),d(3,Ae)],ci);var Ke;let Ki=(Ke=class extends ee{constructor(e,t,i,s,r,n,o){super(),this.template=e,this.actionRunner=t,this.openerService=i,this.instantiationService=s,this.keybindingService=r,this.contextMenuService=n,this.hoverService=o,this.inputDisposables=this._register(new V),ue.closeNotificationAction||(ue.closeNotificationAction=s.createInstance(Dt,Dt.ID,Dt.LABEL),ue.expandNotificationAction=s.createInstance(Nt,Nt.ID,Nt.LABEL),ue.collapseNotificationAction=s.createInstance(Vt,Vt.ID,Vt.LABEL))}setInput(e){this.inputDisposables.clear(),this.render(e)}render(e){this.template.container.classList.toggle("expanded",e.expanded),this.inputDisposables.add(H(this.template.container,$.MOUSE_UP,r=>{r.button===1&&Se.stop(r,!0)})),this.inputDisposables.add(H(this.template.container,$.AUXCLICK,r=>{!e.hasProgress&&r.button===1&&(Se.stop(r,!0),e.close())})),this.renderSeverity(e);const t=this.inputDisposables.add(this.hoverService.setupManagedHover(Vi("mouse"),this.template.message,"")),i=this.renderMessage(e,t);this.renderSecondaryActions(e,i);const s=this.inputDisposables.add(this.hoverService.setupManagedHover(Vi("mouse"),this.template.source,""));this.renderSource(e,s),this.renderButtons(e),this.renderProgress(e),this.inputDisposables.add(e.onDidChangeContent(r=>{switch(r.kind){case Q.SEVERITY:this.renderSeverity(e);break;case Q.PROGRESS:this.renderProgress(e);break;case Q.MESSAGE:this.renderMessage(e,t);break}}))}renderSeverity(e){ue.SEVERITIES.forEach(t=>{e.severity!==t&&this.template.icon.classList.remove(...F.asClassNameArray(this.toSeverityIcon(t)))}),this.template.icon.classList.add(...F.asClassNameArray(this.toSeverityIcon(e.severity)))}renderMessage(e,t){qe(this.template.message),this.template.message.appendChild(Vn.render(e.message,{callback:s=>this.openerService.open(bi.parse(s),{allowCommands:!0}),toDispose:this.inputDisposables}));const i=e.canCollapse&&!e.expanded&&this.template.message.scrollWidth>this.template.message.clientWidth;return t.update(i?this.template.message.textContent+"":""),i}renderSecondaryActions(e,t){const i=[];if(Qt(e.actions?.secondary)){const r=this.instantiationService.createInstance(pt,pt.ID,pt.LABEL,e);i.push(r),this.inputDisposables.add(r)}let s=!1;e.canCollapse&&(e.expanded||e.source||t)&&(s=!0),s&&i.push(e.expanded?ue.collapseNotificationAction:ue.expandNotificationAction),e.hasProgress||i.push(ue.closeNotificationAction),this.template.toolbar.clear(),this.template.toolbar.context=e,i.forEach(r=>this.template.toolbar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)}))}renderSource(e,t){e.expanded&&e.source?(this.template.source.textContent=g(3428,"Source: {0}",e.source),t.update(e.source)):(this.template.source.textContent="",t.update(""))}renderButtons(e){qe(this.template.buttonsContainer);const t=e.actions?e.actions.primary:void 0;if(e.expanded&&Qt(t)){const i=this,s=this.inputDisposables.add(new class extends Ss{async runAction(n){i.actionRunner.run(n,e),(!(n instanceof ii)||!n.keepOpen)&&e.close()}}),r=this.inputDisposables.add(new zn(this.template.buttonsContainer));for(let n=0;n<t.length;n++){const o=t[n],a={title:!0,secondary:n>0,...Un},c=o instanceof ii?o.menu:void 0,l=this.inputDisposables.add(c?r.addButtonWithDropdown({...a,contextMenuProvider:this.contextMenuService,actions:c,actionRunner:s}):r.addButton(a));l.label=o.label,this.inputDisposables.add(l.onDidClick(m=>{m&&Se.stop(m,!0),s.run(o)}))}}}renderProgress(e){if(!e.hasProgress){this.template.progress.stop().hide();return}const t=e.progress.state;t.infinite?this.template.progress.infinite().show():typeof t.total=="number"||typeof t.worked=="number"?(typeof t.total=="number"&&!this.template.progress.hasTotal()&&this.template.progress.total(t.total),typeof t.worked=="number"&&this.template.progress.setWorked(t.worked).show()):this.template.progress.done().hide()}toSeverityIcon(e){switch(e){case Y.Warning:return Z.warning;case Y.Error:return Z.error}return Z.info}getKeybindingLabel(e){const t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}},ue=Ke,Ke.SEVERITIES=[Y.Info,Y.Warning,Y.Error],Ke);Ki=ue=T([d(2,Yn),d(3,L),d(4,it),d(5,me),d(6,ys)],Ki);_e(Ya);let hi=class extends ee{constructor(e,t,i,s){super(),this.container=e,this.options=t,this.instantiationService=i,this.contextMenuService=s,this.viewModel=[]}show(){this.isVisible||(this.list||this.createNotificationsList(),this.isVisible=!0)}createNotificationsList(){this.listContainer=S(".notifications-list-container");const e=this._register(this.instantiationService.createInstance(Ht)),t=this.instantiationService.createInstance(ci,e),i=this.listDelegate=new Ui(this.listContainer),s=this.options,r=this.list=this._register(this.instantiationService.createInstance(As,"NotificationsList",this.listContainer,i,[t],{...s,setRowLineHeight:!1,horizontalScrolling:!1,overrideStyles:{listBackground:un},accessibilityProvider:this.instantiationService.createInstance(Yi,s)})),n=this._register(this.instantiationService.createInstance(Bt,Bt.ID,Bt.LABEL));this._register(r.onContextMenu(a=>{a.element&&this.contextMenuService.showContextMenu({getAnchor:()=>a.anchor,getActions:()=>[n],getActionsContext:()=>a.element,actionRunner:e})})),this._register(r.onMouseDblClick(a=>a.element.toggle()));const o=this._register(Xn(r.getHTMLElement()));this._register(o.onDidBlur(()=>{z(this.listContainer).document.hasFocus()&&r.setFocus([])})),se.bindTo(r.contextKeyService),this._register(r.onDidChangeSelection(a=>{a.indexes.length>0&&r.setSelection([])})),this.container.appendChild(this.listContainer)}updateNotificationsList(e,t,i=[]){const[s,r]=vt(this.list,this.listContainer),n=Je(r),o=s.getFocus()[0],a=this.viewModel[o];let c=null;if(typeof o=="number"&&(c=s.getRelativeTop(o)),this.viewModel.splice(e,t,...i),s.splice(e,t,i),s.layout(),this.viewModel.length===0)this.hide();else if(typeof o=="number"){let l=0;if(a){let m=this.viewModel.indexOf(a);m===-1&&(m=o-1),m<this.viewModel.length&&m>=0&&(l=m)}typeof c=="number"&&s.reveal(l,c),s.setFocus([l])}this.isVisible&&n&&s.domFocus()}updateNotificationHeight(e){const t=this.viewModel.indexOf(e);if(t===-1)return;const[i,s]=vt(this.list,this.listDelegate);i.updateElementHeight(t,s.getHeight(e)),i.layout()}hide(){!this.isVisible||!this.list||(this.isVisible=!1,this.list.splice(0,this.viewModel.length),this.viewModel=[])}focusFirst(){this.list&&(this.list.focusFirst(),this.list.domFocus())}hasFocus(){return this.listContainer?Je(this.listContainer):!1}layout(e,t){this.listContainer&&this.list&&(this.listContainer.style.width=`${e}px`,typeof t=="number"&&(this.list.getHTMLElement().style.maxHeight=`${t}px`),this.list.layout())}dispose(){this.hide(),super.dispose()}};hi=T([d(2,L),d(3,me)],hi);let Yi=class{constructor(e,t,i){this._options=e,this._keybindingService=t,this._configurationService=i}getAriaLabel(e){let t;const i=this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel();return this._configurationService.getValue("accessibility.verbosity.notification")&&(t=i?g(3403,"Inspect the response in the accessible view with {0}",i):g(3404,"Inspect the response in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding")),e.source?t?g(3407,"{0}, source: {1}, notification, {2}",e.message.raw,e.source,t):g(3408,"{0}, source: {1}, notification",e.message.raw,e.source):t?g(3405,"{0}, notification, {1}",e.message.raw,t):g(3406,"{0}, notification",e.message.raw)}getWidgetAriaLabel(){return this._options.widgetAriaLabel??g(3409,"Notifications List")}getRole(){return"dialog"}};Yi=T([d(1,it),d(2,Qe)],Yi);var ht;_e(Ma);_e(Pn);var we;let Xi=(we=class extends fn{constructor(e,t,i,s,r,n,o,a,c,l,m){super(i),this.container=e,this.model=t,this.instantiationService=s,this.layoutService=r,this.editorGroupService=o,this.keybindingService=a,this.notificationService=c,this.accessibilitySignalService=l,this.contextMenuService=m,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.notificationsCenterVisibleContextKey=Ni.bindTo(n),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(et.lift(e)))),this._register(this.notificationService.onDidChangeFilter(()=>this.onDidChangeFilter()))}onDidChangeFilter(){this.notificationService.getFilter()===w.ERROR&&this.hide()}get isVisible(){return!!this._isVisible}show(){if(this._isVisible){const i=re(this.notificationsList);i.show(),i.focusFirst();return}this.notificationsCenterContainer||this.create(),this.updateTitle();const[e,t]=vt(this.notificationsList,this.notificationsCenterContainer);this._isVisible=!0,t.classList.add("visible"),e.show(),this.layout(this.workbenchDimensions),e.updateNotificationsList(0,0,this.model.notifications),e.focusFirst(),this.updateStyles(),this.model.notifications.forEach(i=>i.updateVisibility(!0)),this.notificationsCenterVisibleContextKey.set(!0),this._onDidChangeVisibility.fire()}updateTitle(){const[e,t]=vt(this.notificationsCenterTitle,this.clearAllAction);this.model.notifications.length===0?(e.textContent=g(3387,"No new notifications"),t.enabled=!1):(e.textContent=g(3388,"Notifications"),t.enabled=this.model.notifications.some(i=>!i.hasProgress))}create(){this.notificationsCenterContainer=S(".notifications-center"),this.notificationsCenterHeader=S(".notifications-center-header"),this.notificationsCenterContainer.appendChild(this.notificationsCenterHeader),this.notificationsCenterTitle=S("span.notifications-center-header-title"),this.notificationsCenterHeader.appendChild(this.notificationsCenterTitle);const e=S(".notifications-center-header-toolbar");this.notificationsCenterHeader.appendChild(e);const t=this._register(this.instantiationService.createInstance(Ht)),i=this,s=this._register(new Es(e,{ariaLabel:g(3389,"Notification Center Actions"),actionRunner:t,actionViewItemProvider:(n,o)=>{if(n.id===dt.ID)return this._register(this.instantiationService.createInstance(ln,n,{getActions(){const a=[Jt({id:oi.ID,label:i.notificationService.getFilter()===w.OFF?g(3390,"Enable Do Not Disturb Mode"):g(3391,"Disable Do Not Disturb Mode"),run:()=>i.notificationService.setFilter(i.notificationService.getFilter()===w.OFF?w.ERROR:w.OFF)})],c=i.notificationService.getFilters().sort((l,m)=>l.label.localeCompare(m.label));for(const l of c.slice(0,ht.MAX_NOTIFICATION_SOURCES))a.length===1&&a.push(new Lt),a.push(Jt({id:`${oi.ID}.${l.id}`,label:l.label,checked:l.filter!==w.ERROR,run:()=>i.notificationService.setFilter({...l,filter:l.filter===w.ERROR?w.OFF:w.ERROR})}));return c.length>ht.MAX_NOTIFICATION_SOURCES&&(a.push(new Lt),a.push(i._register(i.instantiationService.createInstance(ai,ai.ID,g(3392,"More…"))))),a}},this.contextMenuService,{...o,actionRunner:t,classNames:n.class,keybindingProvider:a=>this.keybindingService.lookupKeybinding(a.id)}))}}));this.clearAllAction=this._register(this.instantiationService.createInstance(Rt,Rt.ID,Rt.LABEL)),s.push(this.clearAllAction,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(this.clearAllAction)}),this.configureDoNotDisturbAction=this._register(this.instantiationService.createInstance(dt,dt.ID,dt.LABEL)),s.push(this.configureDoNotDisturbAction,{icon:!0,label:!1});const r=this._register(this.instantiationService.createInstance(Pt,Pt.ID,Pt.LABEL));s.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)}),this.notificationsList=this.instantiationService.createInstance(hi,this.notificationsCenterContainer,{widgetAriaLabel:g(3393,"Notifications Center")}),this.container.appendChild(this.notificationsCenterContainer)}getKeybindingLabel(e){const t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}onDidChangeNotification(e){if(!this._isVisible)return;let t=!1;const[i,s]=vt(this.notificationsList,this.notificationsCenterContainer);switch(e.kind){case X.ADD:i.updateNotificationsList(e.index,0,[e.item]),e.item.updateVisibility(!0);break;case X.CHANGE:switch(e.detail){case Q.ACTIONS:i.updateNotificationsList(e.index,1,[e.item]);break;case Q.MESSAGE:e.item.expanded&&i.updateNotificationHeight(e.item);break}break;case X.EXPAND_COLLAPSE:i.updateNotificationsList(e.index,1,[e.item]);break;case X.REMOVE:t=Je(s),i.updateNotificationsList(e.index,1),e.item.updateVisibility(!1);break}this.updateTitle(),this.model.notifications.length===0&&(this.hide(),t&&this.editorGroupService.activeGroup.focus())}hide(){if(!this._isVisible||!this.notificationsCenterContainer||!this.notificationsList)return;const e=Je(this.notificationsCenterContainer);this._isVisible=!1,this.notificationsCenterContainer.classList.remove("visible"),this.notificationsList.hide(),this.model.notifications.forEach(t=>t.updateVisibility(!1)),this.notificationsCenterVisibleContextKey.set(!1),this._onDidChangeVisibility.fire(),e&&this.editorGroupService.activeGroup.focus()}updateStyles(){if(this.notificationsCenterContainer&&this.notificationsCenterHeader){const e=this.getColor(gn);this.notificationsCenterContainer.style.boxShadow=e?`0 0 8px 2px ${e}`:"";const t=this.getColor(Zn);this.notificationsCenterContainer.style.border=t?`1px solid ${t}`:"";const i=this.getColor($n);this.notificationsCenterHeader.style.color=i??"";const s=this.getColor(jn);this.notificationsCenterHeader.style.background=s??""}}layout(e){if(this.workbenchDimensions=e,this._isVisible&&this.notificationsCenterContainer){const t=ht.MAX_DIMENSIONS.width,i=ht.MAX_DIMENSIONS.height;let s=t,r=i;this.workbenchDimensions&&(s=this.workbenchDimensions.width,s-=16,r=this.workbenchDimensions.height-35,this.layoutService.isVisible(h.STATUSBAR_PART,A)&&(r-=22),this.layoutService.isVisible(h.TITLEBAR_PART,A)&&(r-=22),r-=24),re(this.notificationsList).layout(Math.min(t,s),Math.min(i,r))}}clearAll(){this.hide();for(const e of[...this.model.notifications])e.hasProgress||e.close(),this.accessibilitySignalService.playSignal(pi.clear)}},ht=we,we.MAX_DIMENSIONS=new et(450,400),we.MAX_NOTIFICATION_SOURCES=10,we);Xi=ht=T([d(2,ie),d(3,L),d(4,te),d(5,Ee),d(6,st),d(7,it),d(8,Ae),d(9,mi),d(10,me)],Xi);class Qa extends ee{constructor(e){super(),this.model=e;for(const t of e.notifications)this.triggerAriaAlert(t);this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}onDidChangeNotification(e){e.kind===X.ADD&&(this.triggerAriaAlert(e.item),e.item.severity===Y.Error&&(e.item.message.original instanceof Error?console.error(e.item.message.original):console.error(Gt(e.item.message.linkedText.toString(),!0))))}triggerAriaAlert(e){if(e.priority===be.SILENT)return;const t=e.onDidChangeContent(i=>{i.kind===Q.MESSAGE&&this.doTriggerAriaAlert(e)});oe.once(e.onDidClose)(()=>t.dispose()),this.doTriggerAriaAlert(e)}doTriggerAriaAlert(e){let t;e.severity===Y.Error?t=g(3384,"Error: {0}",e.message.linkedText.toString()):e.severity===Y.Warning?t=g(3385,"Warning: {0}",e.message.linkedText.toString()):t=g(3386,"Info: {0}",e.message.linkedText.toString()),qn(t)}}let Zi=class extends ee{constructor(e,t,i){super(),this.model=e,this.statusbarService=t,this.notificationService=i,this.newNotificationsCount=0,this.isNotificationsCenterVisible=!1,this.isNotificationsToastsVisible=!1,this.updateNotificationsCenterStatusItem(),e.statusMessage&&this.doSetStatusMessage(e.statusMessage),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.model.onDidChangeStatusMessage(e=>this.onDidChangeStatusMessage(e))),this._register(this.notificationService.onDidChangeFilter(()=>this.updateNotificationsCenterStatusItem()))}onDidChangeNotification(e){this.isNotificationsCenterVisible||(e.kind===X.ADD?this.newNotificationsCount++:e.kind===X.REMOVE&&this.newNotificationsCount>0&&this.newNotificationsCount--),this.updateNotificationsCenterStatusItem()}updateNotificationsCenterStatusItem(){let e=0;if(!this.isNotificationsCenterVisible&&!this.isNotificationsToastsVisible)for(const i of this.model.notifications)i.hasProgress&&e++;let t={name:g(3410,"Notifications"),text:`${e>0||this.newNotificationsCount>0?"$(bell-dot)":"$(bell)"}`,ariaLabel:g(3410,"Notifications"),command:this.isNotificationsCenterVisible?kt:Hi,tooltip:this.getTooltip(e),showBeak:this.isNotificationsCenterVisible};this.notificationService.getFilter()===w.ERROR&&(t={...t,text:`${e>0||this.newNotificationsCount>0?"$(bell-slash-dot)":"$(bell-slash)"}`,ariaLabel:g(3411,"Do Not Disturb"),tooltip:g(3412,"Do Not Disturb Mode is Enabled")}),this.notificationsCenterStatusItem?this.notificationsCenterStatusItem.update(t):this.notificationsCenterStatusItem=this.statusbarService.addEntry(t,"status.notifications",K.RIGHT,Number.NEGATIVE_INFINITY)}getTooltip(e){return this.isNotificationsCenterVisible?g(3413,"Hide Notifications"):this.model.notifications.length===0?g(3414,"No Notifications"):e===0?this.newNotificationsCount===0?g(3415,"No New Notifications"):this.newNotificationsCount===1?g(3416,"1 New Notification"):g(3417,"{0} New Notifications",this.newNotificationsCount):this.newNotificationsCount===0?g(3418,"No New Notifications ({0} in progress)",e):this.newNotificationsCount===1?g(3419,"1 New Notification ({0} in progress)",e):g(3420,"{0} New Notifications ({1} in progress)",this.newNotificationsCount,e)}update(e,t){let i=!1;this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.newNotificationsCount=0,i=!0),this.isNotificationsToastsVisible!==t&&(this.isNotificationsToastsVisible=t,i=!0),i&&this.updateNotificationsCenterStatusItem()}onDidChangeStatusMessage(e){const t=e.item;switch(e.kind){case St.ADD:this.doSetStatusMessage(t);break;case St.REMOVE:this.currentStatusMessage&&this.currentStatusMessage[0]===t&&(Mt(this.currentStatusMessage[1]),this.currentStatusMessage=void 0);break}}doSetStatusMessage(e){const t=e.message,i=e.options&&typeof e.options.showAfter=="number"?e.options.showAfter:0,s=e.options&&typeof e.options.hideAfter=="number"?e.options.hideAfter:-1;this.currentStatusMessage&&Mt(this.currentStatusMessage[1]);let r,n=setTimeout(()=>{r=this.statusbarService.addEntry({name:g(3421,"Status Message"),text:t,ariaLabel:t},"status.message",K.LEFT,Number.NEGATIVE_INFINITY),n=void 0},i),o;const a={dispose:()=>{n&&clearTimeout(n),o&&clearTimeout(o),r?.dispose()}};s>0&&(o=setTimeout(()=>a.dispose(),s)),this.currentStatusMessage=[e,a]}};Zi=T([d(1,Ie),d(2,Ae)],Zi);const ec=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Pe;_e(ec);var he;(function(u){u[u.HIDDEN_OR_VISIBLE=0]="HIDDEN_OR_VISIBLE",u[u.HIDDEN=1]="HIDDEN",u[u.VISIBLE=2]="VISIBLE"})(he||(he={}));var de;let $i=(de=class extends fn{get isVisible(){return!!this._isVisible}constructor(e,t,i,s,r,n,o,a,c){super(r),this.container=e,this.model=t,this.instantiationService=i,this.layoutService=s,this.editorGroupService=n,this.lifecycleService=a,this.hostService=c,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._isVisible=!1,this.mapNotificationToToast=new Map,this.mapNotificationToDisposable=new Map,this.addedToastsIntervalCounter=new Jn(Pe.SPAM_PROTECTION.interval),this.notificationsToastsVisibleContextKey=pe.bindTo(o),this.registerListeners()}registerListeners(){this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(et.lift(e)))),this.lifecycleService.when(wt.Restored).then(()=>{this.model.notifications.forEach(e=>this.addToast(e)),this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}),this._register(this.model.onDidChangeFilter(({global:e,sources:t})=>{if(e===w.ERROR)this.hide();else if(t)for(const[i]of this.mapNotificationToToast)typeof i.sourceId=="string"&&t.get(i.sourceId)===w.ERROR&&i.severity!==Y.Error&&i.priority!==be.URGENT&&this.removeToast(i)}))}onDidChangeNotification(e){switch(e.kind){case X.ADD:return this.addToast(e.item);case X.REMOVE:return this.removeToast(e.item)}}addToast(e){if(this.isNotificationsCenterVisible||e.priority===be.SILENT)return;if(e.priority===be.OPTIONAL){const i=mn();if(Si(i)&&Qn(i)&&er(i,this.layoutService.mainContainer))return}if(this.addedToastsIntervalCounter.increment()>Pe.SPAM_PROTECTION.limit)return;const t=new V;this.mapNotificationToDisposable.set(e,t),t.add(tr(z(this.container),()=>this.doAddToast(e,t)))}doAddToast(e,t){let i=this.notificationsToastsContainer;i||(i=this.notificationsToastsContainer=S(".notifications-toasts"),this.container.appendChild(i)),i.classList.add("visible");const s=S(".notification-toast-container"),r=i.firstChild;r?i.insertBefore(s,r):i.appendChild(s);const n=S(".notification-toast");s.appendChild(n);const o=this.instantiationService.createInstance(hi,n,{verticalScrollMode:ir.Hidden,widgetAriaLabel:e.source?g(3423,"{0}, source: {1}, notification",e.message.raw,e.source):g(3422,"{0}, notification",e.message.raw)});t.add(o);const a={item:e,list:o,container:s,toast:n};this.mapNotificationToToast.set(e,a),t.add(Ce(()=>this.updateToastVisibility(a,!1))),o.show();const c=this.computeMaxDimensions();this.layoutLists(c.width),o.updateNotificationsList(0,0,[e]),this.layoutContainer(c.height),t.add(e.onDidChangeExpansion(()=>{o.updateNotificationsList(0,1,[e])})),t.add(e.onDidChangeContent(l=>{switch(l.kind){case Q.ACTIONS:o.updateNotificationsList(0,1,[e]);break;case Q.MESSAGE:e.expanded&&o.updateNotificationHeight(e);break}})),oe.once(e.onDidClose)(()=>{this.removeToast(e)}),this.purgeNotification(e,s,o,t),this.updateStyles(),this.notificationsToastsVisibleContextKey.set(!0),n.classList.add("notification-fade-in"),t.add(H(n,"transitionend",()=>{n.classList.remove("notification-fade-in"),n.classList.add("notification-fade-in-done")})),e.updateVisibility(!0),this._isVisible||(this._isVisible=!0,this._onDidChangeVisibility.fire())}purgeNotification(e,t,i,s){let r=!1;s.add(H(t,$.MOUSE_OVER,()=>r=!0)),s.add(H(t,$.MOUSE_OUT,()=>r=!1));let n,o;const a=()=>{n=setTimeout(()=>{this.hostService.hasFocus?e.sticky||i.hasFocus()||r?a():this.removeToast(e):o||(o=this.hostService.onDidChangeFocus(c=>{c&&a()}),s.add(o))},Pe.PURGE_TIMEOUT[e.severity])};a(),s.add(Ce(()=>clearTimeout(n)))}removeToast(e){let t=!1;const i=this.mapNotificationToToast.get(e);i&&(Je(i.container)&&(t=!(this.focusNext()||this.focusPrevious())),this.mapNotificationToToast.delete(e));const s=this.mapNotificationToDisposable.get(e);s&&(Mt(s),this.mapNotificationToDisposable.delete(e)),this.mapNotificationToToast.size>0?this.layout(this.workbenchDimensions):(this.doHide(),t&&this.editorGroupService.activeGroup.focus())}removeToasts(){this.mapNotificationToToast.clear(),this.mapNotificationToDisposable.forEach(e=>Mt(e)),this.mapNotificationToDisposable.clear(),this.doHide()}doHide(){this.notificationsToastsContainer?.classList.remove("visible"),this.notificationsToastsVisibleContextKey.set(!1),this._isVisible&&(this._isVisible=!1,this._onDidChangeVisibility.fire())}hide(){const e=this.notificationsToastsContainer?Je(this.notificationsToastsContainer):!1;this.removeToasts(),e&&this.editorGroupService.activeGroup.focus()}focus(){const e=this.getToasts(he.VISIBLE);return e.length>0?(e[0].list.focusFirst(),!0):!1}focusNext(){const e=this.getToasts(he.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){const s=e[t+1];if(s)return s.list.focusFirst(),!0;break}return!1}focusPrevious(){const e=this.getToasts(he.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){const s=e[t-1];if(s)return s.list.focusFirst(),!0;break}return!1}focusFirst(){const e=this.getToasts(he.VISIBLE)[0];return e?(e.list.focusFirst(),!0):!1}focusLast(){const e=this.getToasts(he.VISIBLE);return e.length>0?(e[e.length-1].list.focusFirst(),!0):!1}update(e){this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.isNotificationsCenterVisible&&this.removeToasts())}updateStyles(){this.mapNotificationToToast.forEach(({toast:e})=>{const t=this.getColor(un);e.style.background=t||"";const i=this.getColor(gn);e.style.boxShadow=i?`0 0 8px 2px ${i}`:"";const s=this.getColor(sr);e.style.border=s?`1px solid ${s}`:""})}getToasts(e){const t=[];return this.mapNotificationToToast.forEach(i=>{switch(e){case he.HIDDEN_OR_VISIBLE:t.push(i);break;case he.HIDDEN:this.isToastInDOM(i)||t.push(i);break;case he.VISIBLE:this.isToastInDOM(i)&&t.push(i);break}}),t.reverse()}layout(e){this.workbenchDimensions=e;const t=this.computeMaxDimensions();t.height&&this.layoutContainer(t.height),this.layoutLists(t.width)}computeMaxDimensions(){const e=Pe.MAX_WIDTH;let t=e,i;return this.workbenchDimensions&&(t=this.workbenchDimensions.width,t-=16,i=this.workbenchDimensions.height,this.layoutService.isVisible(h.STATUSBAR_PART,A)&&(i-=22),this.layoutService.isVisible(h.TITLEBAR_PART,A)&&(i-=22),i-=24),new et(Math.min(e,t),i??0)}layoutLists(e){this.mapNotificationToToast.forEach(({list:t})=>t.layout(e))}layoutContainer(e){let t=e,i=Math.round(e*.618),s=0;for(const r of this.getToasts(he.HIDDEN_OR_VISIBLE)){r.container.style.opacity="0",this.updateToastVisibility(r,!0),t-=r.container.offsetHeight,i-=r.container.offsetHeight;let n=!1;s===Pe.MAX_NOTIFICATIONS?n=!1:(s===0&&t>=0||s>0&&i>=0)&&(n=!0),this.updateToastVisibility(r,n),r.container.style.opacity="",n&&s++}}updateToastVisibility(e,t){if(this.isToastInDOM(e)===t)return;const i=re(this.notificationsToastsContainer);t?i.appendChild(e.container):e.container.remove(),e.item.updateVisibility(t)}isToastInDOM(e){return!!e.container.parentElement}},Pe=de,de.MAX_WIDTH=450,de.MAX_NOTIFICATIONS=3,de.PURGE_TIMEOUT={[Y.Info]:15e3,[Y.Warning]:18e3,[Y.Error]:2e4},de.SPAM_PROTECTION={interval:800,limit:de.MAX_NOTIFICATIONS},de);$i=Pe=T([d(2,L),d(3,te),d(4,ie),d(5,st),d(6,Ee),d(7,ei),d(8,At)],$i);var D;(function(u){u.SIDEBAR_HIDDEN="nosidebar",u.MAIN_EDITOR_AREA_HIDDEN="nomaineditorarea",u.PANEL_HIDDEN="nopanel",u.AUXILIARYBAR_HIDDEN="noauxiliarybar",u.STATUSBAR_HIDDEN="nostatusbar",u.FULLSCREEN="fullscreen",u.MAXIMIZED="maximized",u.WINDOW_BORDER="border"})(D||(D={}));const tc=["chat.commandCenter.enabled","workbench.navigationControl.enabled","workbench.experimental.share.enabled"],ic=[_.ACTIVITY_BAR_LOCATION,_.COMMAND_CENTER,...tc,_.EDITOR_ACTIONS_LOCATION,_.LAYOUT_ACTIONS,ws.MenuBarVisibility,ti.TITLE_BAR_STYLE,ti.CUSTOM_TITLE_BAR_VISIBILITY],en=new et(Hs.width,Hs.height);class sc extends ee{get activeContainer(){return this.getContainerFromDocument(pn())}get containers(){const e=[];for(const{window:t}of nr())e.push(this.getContainerFromDocument(t.document));return e}getContainerFromDocument(e){return e===this.mainContainer.ownerDocument?this.mainContainer:e.body.getElementsByClassName("monaco-workbench")[0]}whenContainerStylesLoaded(e){return this.containerStylesLoaded.get(e.vscodeWindowId)}get mainContainerDimension(){return this._mainContainerDimension}get activeContainerDimension(){return this.getContainerDimension(this.activeContainer)}getContainerDimension(e){return e===this.mainContainer?this.mainContainerDimension:yi(e)}get mainContainerOffset(){return this.computeContainerOffset(A)}get activeContainerOffset(){return this.computeContainerOffset(z(this.activeContainer))}computeContainerOffset(e){let t=0,i=0;this.isVisible(h.BANNER_PART)&&(t=this.getPart(h.BANNER_PART).maximumHeight,i=t);const s=this.isVisible(h.TITLEBAR_PART,e);return s&&(t+=this.getPart(h.TITLEBAR_PART).maximumHeight,i=t),s&&this.configurationService.getValue(_.COMMAND_CENTER)!==!1&&(i=6),{top:t,quickPickTop:i}}constructor(e){super(),this.parent=e,this._onDidChangeZenMode=this._register(new I),this.onDidChangeZenMode=this._onDidChangeZenMode.event,this._onDidChangeMainEditorCenteredLayout=this._register(new I),this.onDidChangeMainEditorCenteredLayout=this._onDidChangeMainEditorCenteredLayout.event,this._onDidChangePanelAlignment=this._register(new I),this.onDidChangePanelAlignment=this._onDidChangePanelAlignment.event,this._onDidChangeWindowMaximized=this._register(new I),this.onDidChangeWindowMaximized=this._onDidChangeWindowMaximized.event,this._onDidChangePanelPosition=this._register(new I),this.onDidChangePanelPosition=this._onDidChangePanelPosition.event,this._onDidChangePartVisibility=this._register(new I),this.onDidChangePartVisibility=this._onDidChangePartVisibility.event,this._onDidChangeNotificationsVisibility=this._register(new I),this.onDidChangeNotificationsVisibility=this._onDidChangeNotificationsVisibility.event,this._onDidLayoutMainContainer=this._register(new I),this.onDidLayoutMainContainer=this._onDidLayoutMainContainer.event,this._onDidLayoutActiveContainer=this._register(new I),this.onDidLayoutActiveContainer=this._onDidLayoutActiveContainer.event,this._onDidLayoutContainer=this._register(new I),this.onDidLayoutContainer=this._onDidLayoutContainer.event,this._onDidAddContainer=this._register(new I),this.onDidAddContainer=this._onDidAddContainer.event,this._onDidChangeActiveContainer=this._register(new I),this.onDidChangeActiveContainer=this._onDidChangeActiveContainer.event,this.mainContainer=document.createElement("div"),this.containerStylesLoaded=new Map,this.parts=new Map,this.initialized=!1,this.disposed=!1,this._openedDefaultEditors=!1,this.whenReadyPromise=new Vs,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new Vs,this.whenRestored=this.whenRestoredPromise.p,this.restored=!1,rr(e)}initLayout(e){this.environmentService=e.get(Wt),this.configurationService=e.get(Qe),this.hostService=e.get(At),this.contextService=e.get(Ai),this.storageService=e.get(ae),this.workingCopyBackupService=e.get(or),this.themeService=e.get(ie),this.extensionService=e.get(ar),this.logService=e.get(bn),this.telemetryService=e.get(Cs),this.auxiliaryWindowService=e.get(cr),this.editorService=e.get(Ct),this.editorGroupService=e.get(st),this.mainPartEditorService=this.editorService.createScoped(this.editorGroupService.mainPart,this._store),this.paneCompositeService=e.get(hr),this.viewDescriptorService=e.get(lr),this.titleService=e.get(vs),this.notificationService=e.get(Ae),this.statusBarService=e.get(Ie),e.get(nt),this.registerLayoutListeners(),this.initLayoutState(e.get(ei),e.get(dr))}registerLayoutListeners(){const e=()=>{this.isVisible(h.EDITOR_PART,A)||this.toggleMaximizedPanel()};this.editorGroupService.whenRestored.then(()=>{this._register(this.mainPartEditorService.onDidVisibleEditorsChange(e)),this._register(this.editorGroupService.mainPart.onDidActivateGroup(e)),this._register(this.mainPartEditorService.onDidActiveEditorChange(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED))))}),this._register(this.configurationService.onDidChangeConfiguration(i=>{if([...ic,q.SIDEBAR_POSITION,q.STATUSBAR_VISIBLE].some(s=>i.affectsConfiguration(s))){const s=i.affectsConfiguration("workbench.experimental.share.enabled")&&this.configurationService.getValue("workbench.experimental.share.enabled"),r=i.affectsConfiguration("workbench.navigationControl.enabled")&&this.configurationService.getValue("workbench.navigationControl.enabled");if((s||r)&&this.configurationService.getValue(_.COMMAND_CENTER)===!1){this.configurationService.updateValue(_.COMMAND_CENTER,!0);return}const n=i.affectsConfiguration(_.EDITOR_ACTIONS_LOCATION)&&this.configurationService.getValue(_.EDITOR_ACTIONS_LOCATION)===Bi.TITLEBAR,o=i.affectsConfiguration(_.COMMAND_CENTER)&&this.configurationService.getValue(_.COMMAND_CENTER),a=i.affectsConfiguration(_.LAYOUT_ACTIONS)&&this.configurationService.getValue(_.LAYOUT_ACTIONS);if((i.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)&&[ve.TOP,ve.BOTTOM].includes(this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION))||n||o||a)&&this.configurationService.getValue(ti.CUSTOM_TITLE_BAR_VISIBILITY)===Bs.NEVER){this.configurationService.updateValue(ti.CUSTOM_TITLE_BAR_VISIBILITY,Bs.AUTO);return}this.doUpdateLayoutConfiguration()}})),this._register(ur(i=>this.onFullscreenChanged(i))),this._register(this.editorGroupService.mainPart.onDidAddGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidRemoveGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidChangeGroupMaximized(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)))),this._register(H(this.mainContainer,$.SCROLL,()=>this.mainContainer.scrollTop=0)),(gt||Ot||ne)&&!_t(this.configurationService)&&this._register(this.titleService.onMenubarVisibilityChange(i=>this.onMenubarToggled(i))),this._register(this.themeService.onDidColorThemeChange(()=>this.updateWindowsBorder())),this._register(this.hostService.onDidChangeFocus(i=>this.onWindowFocusChanged(i))),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChanged())),ne&&typeof navigator.windowControlsOverlay=="object"&&this._register(H(navigator.windowControlsOverlay,"geometrychange",()=>this.onDidChangeWCO())),this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({window:i,disposables:s})=>{const r=i.window.vscodeWindowId;this.containerStylesLoaded.set(r,i.whenStylesHaveLoaded),i.whenStylesHaveLoaded.then(()=>this.containerStylesLoaded.delete(r)),s.add(Ce(()=>this.containerStylesLoaded.delete(r)));const n=s.add(new V);this._onDidAddContainer.fire({container:i.container,disposables:n}),s.add(i.onDidLayout(o=>this.handleContainerDidLayout(i.container,o)))}))}onMenubarToggled(e){if(e!==this.state.runtime.menuBar.toggled){this.state.runtime.menuBar.toggled=e;const t=Li(this.configurationService);ne&&t==="toggle"?this.workbenchGrid.setViewVisible(this.titleBarPartView,De(this.configurationService,A,this.state.runtime.menuBar.toggled)):this.state.runtime.mainWindowFullscreen&&(t==="toggle"||t==="classic")&&this.workbenchGrid.setViewVisible(this.titleBarPartView,De(this.configurationService,A,this.state.runtime.menuBar.toggled)),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),Sn(e)&&this._onDidLayoutActiveContainer.fire(t),this._onDidLayoutContainer.fire({container:e,dimension:t})}onFullscreenChanged(e){e===A.vscodeWindowId&&(this.state.runtime.mainWindowFullscreen=Ls(A),this.state.runtime.mainWindowFullscreen?this.mainContainer.classList.add(D.FULLSCREEN):(this.mainContainer.classList.remove(D.FULLSCREEN),this.stateModel.getRuntimeValue(f.ZEN_MODE_EXIT_INFO).transitionedToFullScreen&&this.isZenModeActive()&&this.toggleZenMode()),this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen,this.workbenchGrid.setViewVisible(this.titleBarPartView,De(this.configurationService,A,this.state.runtime.menuBar.toggled)),this.updateWindowsBorder(!0))}onActiveWindowChanged(){const e=this.getActiveContainerId();this.state.runtime.activeContainerId!==e&&(this.state.runtime.activeContainerId=e,this.updateWindowsBorder(),this._onDidChangeActiveContainer.fire())}onWindowFocusChanged(e){this.state.runtime.hasFocus!==e&&(this.state.runtime.hasFocus=e,this.updateWindowsBorder())}getActiveContainerId(){const e=this.activeContainer;return z(e).vscodeWindowId}doUpdateLayoutConfiguration(e){this.updateCustomTitleBarVisibility(),this.updateMenubarVisibility(!!e),this.editorGroupService.whenRestored.then(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED),e))}setSideBarPosition(e){const t=this.getPart(h.ACTIVITYBAR_PART),i=this.getPart(h.SIDEBAR_PART),s=this.getPart(h.AUXILIARYBAR_PART),r=e===v.LEFT?"left":"right",n=e===v.RIGHT?"left":"right",o=this.getPanelAlignment(),a=this.getPanelPosition();this.stateModel.setRuntimeValue(f.SIDEBAR_POSITON,e);const c=re(t.getContainer()),l=re(i.getContainer()),m=re(s.getContainer());c.classList.remove(n),l.classList.remove(n),c.classList.add(r),l.classList.add(r),m.classList.remove(r),m.classList.add(n),t.updateStyles(),i.updateStyles(),s.updateStyles(),this.adjustPartPositions(e,o,a)}updateWindowsBorder(e=!1){if(ne||gt||(gt||Ot)&&fr(this.configurationService)||_t(this.configurationService))return;const t=this.themeService.getColorTheme(),i=t.getColor(gr),s=t.getColor(mr),r=this.hasMainWindowBorder();for(const n of this.containers){const o=n===this.mainContainer,a=this.activeContainer===n;let c=!1;if(!this.state.runtime.mainWindowFullscreen&&(i||s)){c=!0;const l=a&&this.state.runtime.hasFocus?i:s??i;n.style.setProperty("--window-border-color",l?.toString()??"transparent")}o&&(this.state.runtime.mainWindowBorder=c),n.classList.toggle(D.WINDOW_BORDER,c)}!e&&r!==this.hasMainWindowBorder()&&this.layout()}initLayoutState(e,t){this._mainContainerDimension=yi(this.parent,en),this.stateModel=new ji(this.storageService,this.configurationService,this.contextService),this.stateModel.load(this._mainContainerDimension),this.stateModel.getRuntimeValue(f.PANEL_HIDDEN)&&this.stateModel.getRuntimeValue(f.EDITOR_HIDDEN)&&this.stateModel.setRuntimeValue(f.EDITOR_HIDDEN,!1),this._register(this.stateModel.onDidChangeState(n=>{n.key===f.ACTIVITYBAR_HIDDEN&&this.setActivityBarHidden(n.value),n.key===f.STATUSBAR_HIDDEN&&this.setStatusBarHidden(n.value),n.key===f.SIDEBAR_POSITON&&this.setSideBarPosition(n.value),n.key===f.PANEL_POSITION&&this.setPanelPosition(n.value),n.key===f.PANEL_ALIGNMENT&&this.setPanelAlignment(n.value),this.doUpdateLayoutConfiguration()}));const i=this.getInitialEditorsState();i&&this.logService.trace("Initial editor state",i);const s={layout:{editors:i?.layout},editor:{restoreEditors:this.shouldRestoreEditors(this.contextService,i),editorsToOpen:this.resolveEditorsToOpen(t,i)},views:{defaults:this.getDefaultLayoutViews(this.environmentService,this.storageService),containerToRestore:{}}},r={activeContainerId:this.getActiveContainerId(),mainWindowFullscreen:Ls(A),hasFocus:this.hostService.hasFocus,maximized:new Set,mainWindowBorder:!1,menuBar:{toggled:!1},zenMode:{transitionDisposables:new pr}};if(this.state={initialization:s,runtime:r},this.isVisible(h.SIDEBAR_PART)){let n;!this.environmentService.isBuilt||e.startupKind===br.ReloadedWindow||this.environmentService.isExtensionDevelopment&&!this.environmentService.extensionTestsLocationURI?n=this.storageService.get(wa.activeViewletSettingsKey,E.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(y.Sidebar)?.id):n=this.viewDescriptorService.getDefaultViewContainer(y.Sidebar)?.id,n?this.state.initialization.views.containerToRestore.sideBar=n:this.stateModel.setRuntimeValue(f.SIDEBAR_HIDDEN,!0)}if(this.isVisible(h.PANEL_PART)){const n=this.storageService.get(_a.activePanelSettingsKey,E.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(y.Panel)?.id);n?this.state.initialization.views.containerToRestore.panel=n:this.stateModel.setRuntimeValue(f.PANEL_HIDDEN,!0)}if(this.isVisible(h.AUXILIARYBAR_PART)){const n=this.storageService.get(Da.activeViewSettingsKey,E.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(y.AuxiliaryBar)?.id);n?this.state.initialization.views.containerToRestore.auxiliaryBar=n:this.stateModel.setRuntimeValue(f.AUXILIARYBAR_HIDDEN,!0)}this.updateWindowsBorder(!0)}getDefaultLayoutViews(e,t){const i=e.options?.defaultLayout;if(!i||!i.force&&!t.isNew(E.WORKSPACE))return;const{views:s}=i;if(s?.length)return s.map(r=>r.id)}shouldRestoreEditors(e,t){return Sr(e.getWorkspace())?!1:!!(this.configurationService.getValue("window.restoreWindows")==="preserve")||t===void 0}willRestoreEditors(){return this.state.initialization.editor.restoreEditors}async resolveEditorsToOpen(e,t){if(t){const i=yt(await vi(t.filesToMerge,e,this.logService));if(i.length===4&&zt(i[0])&&zt(i[1])&&zt(i[2])&&zt(i[3]))return[{editor:{input1:{resource:i[0].resource},input2:{resource:i[1].resource},base:{resource:i[2].resource},result:{resource:i[3].resource},options:{pinned:!0}}}];const s=yt(await vi(t.filesToDiff,e,this.logService));if(s.length===2)return[{editor:{original:{resource:s[0].resource},modified:{resource:s[1].resource},options:{pinned:!0}}}];const r=[],n=await vi(t.filesToOpenOrCreate,e,this.logService);for(let o=0;o<n.length;o++){const a=n[o];a&&r.push({editor:a,viewColumn:t.filesToOpenOrCreate?.[o].viewColumn})}return r}else if(this.contextService.getWorkbenchState()===mt.EMPTY&&this.configurationService.getValue("workbench.startupEditor")==="newUntitledFile")return this.editorGroupService.hasRestorableState?[]:await this.workingCopyBackupService.hasBackups()?[]:[{editor:{resource:void 0}}];return[]}get openedDefaultEditors(){return this._openedDefaultEditors}getInitialEditorsState(){const e=this.environmentService.options?.defaultLayout;if((e?.editors?.length||e?.layout?.editors)&&(e.force||this.storageService.isNew(E.WORKSPACE)))return this._openedDefaultEditors=!0,{layout:e.layout?.editors,filesToOpenOrCreate:e?.editors?.map(r=>({viewColumn:r.viewColumn,fileUri:bi.revive(r.uri),openOnlyIfExists:r.openOnlyIfExists,options:r.options}))};const{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}=this.environmentService;if(t||i||s)return{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}}isRestored(){return this.restored}restoreParts(){const e=[],t=[];e.push((async()=>{O("code/willRestoreEditors"),await this.editorGroupService.whenReady,O("code/restoreEditors/editorGroupsReady"),this.state.initialization.layout?.editors&&this.editorGroupService.mainPart.applyLayout(this.state.initialization.layout.editors);const n=await this.state.initialization.editor.editorsToOpen;O("code/restoreEditors/editorsToOpenResolved");let o;if(n.length){const a=this.editorGroupService.mainPart.getGroups(Ar.GRID_APPEARANCE),c=new Map;for(const l of n){const m=a[(l.viewColumn??1)-1];let p=c.get(m.id);p||(p=new Set,c.set(m.id,p)),p.add(l.editor)}o=Promise.all(Array.from(c).map(async([l,m])=>{try{await this.editorService.openEditors(Array.from(m),l,{validateTrust:!0})}catch(p){this.logService.error(p)}}))}t.push(Promise.all([o?.finally(()=>O("code/restoreEditors/editorsOpened")),this.editorGroupService.whenRestored.finally(()=>O("code/restoreEditors/editorGroupsRestored"))]).finally(()=>{O("code/didRestoreEditors")}))})());const i=(async()=>{if(this.state.initialization.views.defaults?.length){O("code/willOpenDefaultViews");const n=[],o=l=>{const m=this.viewDescriptorService.getViewLocationById(l.id);if(m!==null){const p=this.viewDescriptorService.getViewContainerByViewId(l.id);if(p){l.order>=(n?.[m]?.order??0)&&(n[m]={id:p.id,order:l.order});const b=this.viewDescriptorService.getViewContainerModel(p);return b.setCollapsed(l.id,!1),b.setVisible(l.id,!0),!0}}return!1},a=[...this.state.initialization.views.defaults].reverse().map((l,m)=>({id:l,order:m}));let c=a.length;for(;c;)c--,o(a[c])&&a.splice(c,1);if(a.length){await this.extensionService.whenInstalledExtensionsRegistered();let l=a.length;for(;l;)l--,o(a[l])&&a.splice(l,1)}n[y.Sidebar]&&(this.state.initialization.views.containerToRestore.sideBar=n[y.Sidebar].id),n[y.Panel]&&(this.state.initialization.views.containerToRestore.panel=n[y.Panel].id),n[y.AuxiliaryBar]&&(this.state.initialization.views.containerToRestore.auxiliaryBar=n[y.AuxiliaryBar].id),O("code/didOpenDefaultViews")}})();e.push(i),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.sideBar&&(O("code/willRestoreViewlet"),await this.openViewContainer(y.Sidebar,this.state.initialization.views.containerToRestore.sideBar),O("code/didRestoreViewlet"))})()),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.panel&&(O("code/willRestorePanel"),await this.openViewContainer(y.Panel,this.state.initialization.views.containerToRestore.panel),O("code/didRestorePanel"))})()),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.auxiliaryBar&&(O("code/willRestoreAuxiliaryBar"),await this.openViewContainer(y.AuxiliaryBar,this.state.initialization.views.containerToRestore.auxiliaryBar),O("code/didRestoreAuxiliaryBar"))})());const s=this.isZenModeActive(),r=tn(this.configurationService).restore;s&&(this.setZenModeActive(!r),this.toggleZenMode(!1,!0)),this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)&&this.centerMainEditorLayout(!0,!0),Ms.settled(e).finally(()=>{this.whenReadyPromise.complete(),Ms.settled(t).finally(()=>{this.restored=!0,this.whenRestoredPromise.complete()})})}async openViewContainer(e,t,i){let s=await this.paneCompositeService.openPaneComposite(t,e,i);s||(s=await this.paneCompositeService.openPaneComposite(this.viewDescriptorService.getDefaultViewContainer(e)?.id,e,i),!s&&await this.paneCompositeService.openPaneComposite(this.paneCompositeService.getVisiblePaneCompositeIds(e).at(0),e,i))}registerPart(e){const t=e.getId();return this.parts.set(t,e),Ce(()=>this.parts.delete(t))}getPart(e){const t=this.parts.get(e);if(!t)throw new Error(`Unknown part ${e}`);return t}registerNotifications(e){this._register(e.onDidChangeNotificationsVisibility(t=>this._onDidChangeNotificationsVisibility.fire(t)))}hasFocus(e){const t=this.getContainer(Ut(),e);if(!t)return!1;const i=mn();return i?Cr(i,t):!1}_getFocusedPart(){for(const e of this.parts.keys())if(this.hasFocus(e))return e}focusPart(e,t=A){const i=this.getContainer(t,e)??this.mainContainer;switch(e){case h.EDITOR_PART:this.editorGroupService.getPart(i).activeGroup.focus();break;case h.PANEL_PART:{this.paneCompositeService.getActivePaneComposite(y.Panel)?.focus();break}case h.SIDEBAR_PART:{this.paneCompositeService.getActivePaneComposite(y.Sidebar)?.focus();break}case h.AUXILIARYBAR_PART:{this.paneCompositeService.getActivePaneComposite(y.AuxiliaryBar)?.focus();break}case h.ACTIVITYBAR_PART:this.getPart(h.SIDEBAR_PART).focusActivityBar();break;case h.STATUSBAR_PART:this.statusBarService.getPart(i).focus();break;default:i?.focus()}}getContainer(e,t){if(typeof t>"u")return this.getContainerFromDocument(e.document);if(e===A)return this.getPart(t).getContainer();let i;if(t===h.EDITOR_PART?i=this.editorGroupService.getPart(this.getContainerFromDocument(e.document)):t===h.STATUSBAR_PART?i=this.statusBarService.getPart(this.getContainerFromDocument(e.document)):t===h.TITLEBAR_PART&&(i=this.titleService.getPart(this.getContainerFromDocument(e.document))),i instanceof Ci)return i.getContainer()}isVisible(e,t=A){if(t!==A&&e===h.EDITOR_PART)return!0;switch(e){case h.TITLEBAR_PART:return this.initialized?this.workbenchGrid.isViewVisible(this.titleBarPartView):De(this.configurationService,A,this.state.runtime.menuBar.toggled);case h.SIDEBAR_PART:return!this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN);case h.PANEL_PART:return!this.stateModel.getRuntimeValue(f.PANEL_HIDDEN);case h.AUXILIARYBAR_PART:return!this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN);case h.STATUSBAR_PART:return!this.stateModel.getRuntimeValue(f.STATUSBAR_HIDDEN);case h.ACTIVITYBAR_PART:return!this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN);case h.EDITOR_PART:return!this.stateModel.getRuntimeValue(f.EDITOR_HIDDEN);case h.BANNER_PART:return this.initialized?this.workbenchGrid.isViewVisible(this.bannerPartView):!1;default:return!1}}shouldShowBannerFirst(){return ne&&!Mi()}focus(){this.isPanelMaximized()&&this.mainContainer===this.activeContainer?this.focusPart(h.PANEL_PART):this.focusPart(h.EDITOR_PART,z(this.activeContainer))}focusPanelOrEditor(){const e=this.paneCompositeService.getActivePaneComposite(y.Panel);(this.hasFocus(h.PANEL_PART)||!this.isVisible(h.EDITOR_PART))&&e?e.focus():this.focus()}getMaximumEditorDimensions(e){const t=z(e),i=this.getContainerDimension(e);if(e===this.mainContainer){const s=x(this.getPanelPosition()),r=(this.isVisible(h.ACTIVITYBAR_PART)?this.activityBarPartView.minimumWidth:0)+(this.isVisible(h.SIDEBAR_PART)?this.sideBarPartView.minimumWidth:0)+(this.isVisible(h.PANEL_PART)&&!s?this.panelPartView.minimumWidth:0)+(this.isVisible(h.AUXILIARYBAR_PART)?this.auxiliaryBarPartView.minimumWidth:0),n=(this.isVisible(h.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(h.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0)+(this.isVisible(h.PANEL_PART)&&s?this.panelPartView.minimumHeight:0),o=i.width-r,a=i.height-n;return{width:o,height:a}}else{const s=(this.isVisible(h.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(h.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0);return{width:i.width,height:i.height-s}}}isZenModeActive(){return this.stateModel.getRuntimeValue(f.ZEN_MODE_ACTIVE)}setZenModeActive(e){this.stateModel.setRuntimeValue(f.ZEN_MODE_ACTIVE,e)}toggleZenMode(e,t=!1){const i=this._getFocusedPart();this.setZenModeActive(!this.isZenModeActive()),this.state.runtime.zenMode.transitionDisposables.clearAndDisposeAll();const s=a=>{for(const c of this.mainPartEditorService.visibleTextEditorControls){if(!a&&Rr(c)&&c.hasModel()){const l=c.getModel();a=this.configurationService.getValue("editor.lineNumbers",{resource:l.uri,overrideIdentifier:l.getLanguageId()})}a||(a=this.configurationService.getValue("editor.lineNumbers")),c.updateOptions({lineNumbers:a})}};let r=!1;const n=tn(this.configurationService),o=this.stateModel.getRuntimeValue(f.ZEN_MODE_EXIT_INFO);this.isZenModeActive()?(r=!this.state.runtime.mainWindowFullscreen&&n.fullScreen&&!Os,t||(o.transitionedToFullScreen=r,o.transitionedToCenteredEditorLayout=!this.isMainEditorLayoutCentered()&&n.centerLayout,o.handleNotificationsDoNotDisturbMode=this.notificationService.getFilter()===w.OFF,o.wasVisible.sideBar=this.isVisible(h.SIDEBAR_PART),o.wasVisible.panel=this.isVisible(h.PANEL_PART),o.wasVisible.auxiliaryBar=this.isVisible(h.AUXILIARYBAR_PART),this.stateModel.setRuntimeValue(f.ZEN_MODE_EXIT_INFO,o)),this.setPanelHidden(!0,!0),this.setAuxiliaryBarHidden(!0,!0),this.setSideBarHidden(!0),n.hideActivityBar&&this.setActivityBarHidden(!0),n.hideStatusBar&&this.setStatusBarHidden(!0),n.hideLineNumbers&&(s("off"),this.state.runtime.zenMode.transitionDisposables.set(W.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s("off")))),n.showTabs!==this.editorGroupService.partOptions.showTabs&&this.state.runtime.zenMode.transitionDisposables.set(W.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:n.showTabs})),n.silentNotifications&&o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(w.ERROR),n.centerLayout&&this.centerMainEditorLayout(!0,!0),this.state.runtime.zenMode.transitionDisposables.set("configurationChange",this.configurationService.onDidChangeConfiguration(a=>{if(a.affectsConfiguration(W.HIDE_ACTIVITYBAR)||a.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)){const c=this.configurationService.getValue(W.HIDE_ACTIVITYBAR),l=this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION);this.setActivityBarHidden(c?!0:l===ve.TOP||l===ve.BOTTOM)}if(a.affectsConfiguration(W.HIDE_STATUSBAR)){const c=this.configurationService.getValue(W.HIDE_STATUSBAR);this.setStatusBarHidden(c)}if(a.affectsConfiguration(W.CENTER_LAYOUT)){const c=this.configurationService.getValue(W.CENTER_LAYOUT);this.centerMainEditorLayout(c,!0)}if(a.affectsConfiguration(W.SHOW_TABS)){const c=this.configurationService.getValue(W.SHOW_TABS)??"multiple";this.state.runtime.zenMode.transitionDisposables.set(W.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:c}))}if(a.affectsConfiguration(W.SILENT_NOTIFICATIONS)){const c=!!this.configurationService.getValue(W.SILENT_NOTIFICATIONS);o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(c?w.ERROR:w.OFF)}if(a.affectsConfiguration(W.HIDE_LINENUMBERS)){const c=this.configurationService.getValue(W.HIDE_LINENUMBERS)?"off":void 0;s(c),this.state.runtime.zenMode.transitionDisposables.set(W.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s(c)))}}))):(o.wasVisible.panel&&this.setPanelHidden(!1,!0),o.wasVisible.auxiliaryBar&&this.setAuxiliaryBarHidden(!1,!0),o.wasVisible.sideBar&&this.setSideBarHidden(!1),this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN,!0)||this.setActivityBarHidden(!1),this.stateModel.getRuntimeValue(f.STATUSBAR_HIDDEN,!0)||this.setStatusBarHidden(!1),o.transitionedToCenteredEditorLayout&&this.centerMainEditorLayout(!1,!0),o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(w.OFF),s(),r=o.transitionedToFullScreen&&this.state.runtime.mainWindowFullscreen),e||this.layout(),r&&this.hostService.toggleFullScreen(A),i&&this.isVisible(i,z(this.activeContainer))?Er(i)?this.focusPart(i,z(this.activeContainer)):this.focusPart(i):this.focus(),this._onDidChangeZenMode.fire(this.isZenModeActive())}setStatusBarHidden(e){this.stateModel.setRuntimeValue(f.STATUSBAR_HIDDEN,e),e?this.mainContainer.classList.add(D.STATUSBAR_HIDDEN):this.mainContainer.classList.remove(D.STATUSBAR_HIDDEN),this.workbenchGrid.setViewVisible(this.statusBarPartView,!e)}createWorkbenchLayout(){const e=this.getPart(h.TITLEBAR_PART),t=this.getPart(h.BANNER_PART),i=this.getPart(h.EDITOR_PART),s=this.getPart(h.ACTIVITYBAR_PART),r=this.getPart(h.PANEL_PART),n=this.getPart(h.AUXILIARYBAR_PART),o=this.getPart(h.SIDEBAR_PART),a=this.getPart(h.STATUSBAR_PART);this.titleBarPartView=e,this.bannerPartView=t,this.sideBarPartView=o,this.activityBarPartView=s,this.editorPartView=i,this.panelPartView=r,this.auxiliaryBarPartView=n,this.statusBarPartView=a;const c={[h.ACTIVITYBAR_PART]:this.activityBarPartView,[h.BANNER_PART]:this.bannerPartView,[h.TITLEBAR_PART]:this.titleBarPartView,[h.EDITOR_PART]:this.editorPartView,[h.PANEL_PART]:this.panelPartView,[h.SIDEBAR_PART]:this.sideBarPartView,[h.STATUSBAR_PART]:this.statusBarPartView,[h.AUXILIARYBAR_PART]:this.auxiliaryBarPartView},l=({type:p})=>c[p],m=Ra.deserialize(this.createGridDescriptor(),{fromJSON:l},{proportionalLayout:!1});this.mainContainer.prepend(m.element),this.mainContainer.setAttribute("role","application"),this.workbenchGrid=m,this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen;for(const p of[e,i,s,r,o,a,n,t])this._register(p.onDidVisibilityChange(b=>{p===o?this.setSideBarHidden(!b):p===r?this.setPanelHidden(!b,!0):p===n?this.setAuxiliaryBarHidden(!b,!0):p===i&&this.setEditorHidden(!b),this._onDidChangePartVisibility.fire(),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}));this._register(this.storageService.onWillSaveState(p=>{const b=this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView):this.workbenchGrid.getViewSize(this.sideBarPartView).width;this.stateModel.setInitializationValue(f.SIDEBAR_SIZE,b);const M=this.stateModel.getRuntimeValue(f.PANEL_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView):x(this.stateModel.getRuntimeValue(f.PANEL_POSITION))?this.workbenchGrid.getViewSize(this.panelPartView).height:this.workbenchGrid.getViewSize(this.panelPartView).width;this.stateModel.setInitializationValue(f.PANEL_SIZE,M);const G=this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView):this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width;this.stateModel.setInitializationValue(f.AUXILIARYBAR_SIZE,G),this.stateModel.save(!0,!0)}))}layout(){this.disposed||(this._mainContainerDimension=yi(this.state.runtime.mainWindowFullscreen?A.document.body:this.parent,en),this.logService.trace(`Layout#layout, height: ${this._mainContainerDimension.height}, width: ${this._mainContainerDimension.width}`),Ir(this.mainContainer,0,0,0,0,"relative"),Tr(this.mainContainer,this._mainContainerDimension.width,this._mainContainerDimension.height),this.workbenchGrid.layout(this._mainContainerDimension.width,this._mainContainerDimension.height),this.initialized=!0,this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension))}isMainEditorLayoutCentered(){return this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)}centerMainEditorLayout(e,t){this.stateModel.setRuntimeValue(f.MAIN_EDITOR_CENTERED,e);const s=yt(this.editorGroupService.mainPart.groups.map(a=>a.activeEditor)).some(a=>a instanceof yr?this.configurationService.getValue("diffEditor.renderSideBySide"):!!a?.hasCapability(vr.MultipleEditors)),r=this.editorGroupService.getLayout();let n=!1;r.orientation===wr.HORIZONTAL?n=r.groups.length>1:n=r.groups.some(a=>a.groups&&a.groups.length>1),this.configurationService.getValue("workbench.editor.centeredLayoutAutoResize")&&(n&&!this.editorGroupService.mainPart.hasMaximizedGroup()||s)&&(e=!1),this.editorGroupService.mainPart.isLayoutCentered()!==e&&(this.editorGroupService.mainPart.centerLayout(e),t||this.layout()),this._onDidChangeMainEditorCenteredLayout.fire(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED))}getSize(e){return this.workbenchGrid.getViewSize(this.getPart(e))}setSize(e,t){this.workbenchGrid.resizeView(this.getPart(e),t)}resizePart(e,t,i){const s=Math.sign(t)*xs(Ut(),Math.abs(t)),r=Math.sign(i)*xs(Ut(),Math.abs(i));let n;switch(e){case h.SIDEBAR_PART:n=this.workbenchGrid.getViewSize(this.sideBarPartView),this.workbenchGrid.resizeView(this.sideBarPartView,{width:n.width+s,height:n.height});break;case h.PANEL_PART:n=this.workbenchGrid.getViewSize(this.panelPartView),this.workbenchGrid.resizeView(this.panelPartView,{width:n.width+(x(this.getPanelPosition())?0:s),height:n.height+(x(this.getPanelPosition())?r:0)});break;case h.AUXILIARYBAR_PART:n=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{width:n.width+s,height:n.height});break;case h.EDITOR_PART:if(n=this.workbenchGrid.getViewSize(this.editorPartView),this.editorGroupService.mainPart.count===1)this.workbenchGrid.resizeView(this.editorPartView,{width:n.width+s,height:n.height+r});else{const o=this.editorGroupService.mainPart.activeGroup,{width:a,height:c}=this.editorGroupService.mainPart.getSize(o);this.editorGroupService.mainPart.setSize(o,{width:a+s,height:c+r});const{width:l,height:m}=this.editorGroupService.mainPart.getSize(o);(r&&c===m||s&&a===l)&&this.workbenchGrid.resizeView(this.editorPartView,{width:n.width+(s&&a===l?s:0),height:n.height+(r&&c===m?r:0)})}break;default:return}}setActivityBarHidden(e){this.stateModel.setRuntimeValue(f.ACTIVITYBAR_HIDDEN,e),this.workbenchGrid.setViewVisible(this.activityBarPartView,!e)}setBannerHidden(e){this.workbenchGrid.setViewVisible(this.bannerPartView,!e)}setEditorHidden(e){this.stateModel.setRuntimeValue(f.EDITOR_HIDDEN,e),e?this.mainContainer.classList.add(D.MAIN_EDITOR_AREA_HIDDEN):this.mainContainer.classList.remove(D.MAIN_EDITOR_AREA_HIDDEN),this.workbenchGrid.setViewVisible(this.editorPartView,!e),e&&!this.isVisible(h.PANEL_PART)&&this.setPanelHidden(!1,!0)}getLayoutClasses(){return yt([this.isVisible(h.SIDEBAR_PART)?void 0:D.SIDEBAR_HIDDEN,this.isVisible(h.EDITOR_PART,A)?void 0:D.MAIN_EDITOR_AREA_HIDDEN,this.isVisible(h.PANEL_PART)?void 0:D.PANEL_HIDDEN,this.isVisible(h.AUXILIARYBAR_PART)?void 0:D.AUXILIARYBAR_HIDDEN,this.isVisible(h.STATUSBAR_PART)?void 0:D.STATUSBAR_HIDDEN,this.state.runtime.mainWindowFullscreen?D.FULLSCREEN:void 0])}setSideBarHidden(e){if(this.stateModel.setRuntimeValue(f.SIDEBAR_HIDDEN,e),e?this.mainContainer.classList.add(D.SIDEBAR_HIDDEN):this.mainContainer.classList.remove(D.SIDEBAR_HIDDEN),e&&this.paneCompositeService.getActivePaneComposite(y.Sidebar))this.paneCompositeService.hideActivePaneComposite(y.Sidebar),this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(y.Sidebar)){const t=this.paneCompositeService.getLastActivePaneCompositeId(y.Sidebar);t&&this.openViewContainer(y.Sidebar,t,!0)}this.workbenchGrid.setViewVisible(this.sideBarPartView,!e)}hasViews(e){const t=this.viewDescriptorService.getViewContainerById(e);if(!t)return!1;const i=this.viewDescriptorService.getViewContainerModel(t);return i?i.activeViewDescriptors.length>=1:!1}adjustPartPositions(e,t,i){const s=!x(i),r=s||!(t==="center"||e===v.LEFT&&t==="right"||e===v.RIGHT&&t==="left"),n=s||!(t==="center"||e===v.RIGHT&&t==="right"||e===v.LEFT&&t==="left"),o=this.isVisible(h.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).width:Tt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumWidth),a=this.isVisible(h.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).height:Tt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumHeight),c=this.isVisible(h.SIDEBAR_PART)?this.workbenchGrid.getViewSize(this.sideBarPartView).width:Tt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView)??this.sideBarPartView.minimumWidth),l=this.isVisible(h.AUXILIARYBAR_PART)?this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width:Tt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView)??this.auxiliaryBarPartView.minimumWidth),m=[h.PANEL_PART,h.SIDEBAR_PART,h.AUXILIARYBAR_PART].find(p=>this.hasFocus(p));e===v.LEFT?(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,0]),this.workbenchGrid.moveView(this.sideBarPartView,c,r?this.editorPartView:this.activityBarPartView,r?U.Left:U.Right),n?this.workbenchGrid.moveView(this.auxiliaryBarPartView,l,this.editorPartView,U.Right):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,-1])):(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,-1]),this.workbenchGrid.moveView(this.sideBarPartView,c,r?this.editorPartView:this.activityBarPartView,r?U.Right:U.Left),n?this.workbenchGrid.moveView(this.auxiliaryBarPartView,l,this.editorPartView,U.Left):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,0])),m&&this.focusPart(m),s&&(this.workbenchGrid.moveView(this.panelPartView,o,this.editorPartView,i===v.LEFT?U.Left:U.Right),this.workbenchGrid.resizeView(this.panelPartView,{height:a,width:o})),this.isVisible(h.SIDEBAR_PART)&&this.workbenchGrid.resizeView(this.sideBarPartView,{height:this.workbenchGrid.getViewSize(this.sideBarPartView).height,width:c}),this.isVisible(h.AUXILIARYBAR_PART)&&this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{height:this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).height,width:l})}setPanelAlignment(e){x(this.getPanelPosition())||this.setPanelPosition(v.BOTTOM),e!=="center"&&this.isPanelMaximized()&&this.toggleMaximizedPanel(),this.stateModel.setRuntimeValue(f.PANEL_ALIGNMENT,e),this.adjustPartPositions(this.getSideBarPosition(),e,this.getPanelPosition()),this._onDidChangePanelAlignment.fire(e)}setPanelHidden(e,t){if(!this.workbenchGrid)return;const i=!this.isVisible(h.PANEL_PART);this.stateModel.setRuntimeValue(f.PANEL_HIDDEN,e);const s=this.isPanelMaximized(),r=this.panelOpensMaximized();e?this.mainContainer.classList.add(D.PANEL_HIDDEN):this.mainContainer.classList.remove(D.PANEL_HIDDEN);let n=!1;if(e&&this.paneCompositeService.getActivePaneComposite(y.Panel))this.paneCompositeService.hideActivePaneComposite(y.Panel),n=!Os;else if(!e&&!this.paneCompositeService.getActivePaneComposite(y.Panel)){let o=this.paneCompositeService.getLastActivePaneCompositeId(y.Panel);(!o||!this.hasViews(o))&&(o=this.viewDescriptorService.getViewContainersByLocation(y.Panel).find(a=>this.hasViews(a.id))?.id),o&&this.openViewContainer(y.Panel,o,!t)}e&&s&&this.toggleMaximizedPanel(),i!==e&&(this.workbenchGrid.setViewVisible(this.panelPartView,!e),e?this.stateModel.setRuntimeValue(f.PANEL_WAS_LAST_MAXIMIZED,s):!t&&s!==r&&this.toggleMaximizedPanel(),n&&this.editorGroupService.mainPart.activeGroup.focus())}toggleMaximizedPanel(){const e=this.workbenchGrid.getViewSize(this.panelPartView),t=this.getPanelPosition(),i=this.isPanelMaximized();i?(this.setEditorHidden(!1),this.workbenchGrid.resizeView(this.panelPartView,{width:x(t)?e.width:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH),height:x(t)?this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT):e.height})):(this.isVisible(h.PANEL_PART)&&(x(t)?this.stateModel.setRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT,e.height):this.stateModel.setRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH,e.width)),this.setEditorHidden(!0)),this.stateModel.setRuntimeValue(f.PANEL_WAS_LAST_MAXIMIZED,!i)}panelOpensMaximized(){if(this.getPanelAlignment()!=="center"&&x(this.getPanelPosition()))return!1;const e=_r(this.configurationService.getValue(Me.PANEL_OPENS_MAXIMIZED)),t=this.stateModel.getRuntimeValue(f.PANEL_WAS_LAST_MAXIMIZED);return e===ks.ALWAYS||e===ks.REMEMBER_LAST&&t}setAuxiliaryBarHidden(e,t){if(this.stateModel.setRuntimeValue(f.AUXILIARYBAR_HIDDEN,e),e?this.mainContainer.classList.add(D.AUXILIARYBAR_HIDDEN):this.mainContainer.classList.remove(D.AUXILIARYBAR_HIDDEN),e&&this.paneCompositeService.getActivePaneComposite(y.AuxiliaryBar))this.paneCompositeService.hideActivePaneComposite(y.AuxiliaryBar),this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(y.AuxiliaryBar)){let i=this.paneCompositeService.getLastActivePaneCompositeId(y.AuxiliaryBar);(!i||!this.hasViews(i))&&(i=this.viewDescriptorService.getViewContainersByLocation(y.AuxiliaryBar).find(s=>this.hasViews(s.id))?.id),i&&this.openViewContainer(y.AuxiliaryBar,i,!t)}this.workbenchGrid.setViewVisible(this.auxiliaryBarPartView,!e)}setPartHidden(e,t){switch(t){case h.ACTIVITYBAR_PART:return this.setActivityBarHidden(e);case h.SIDEBAR_PART:return this.setSideBarHidden(e);case h.EDITOR_PART:return this.setEditorHidden(e);case h.BANNER_PART:return this.setBannerHidden(e);case h.AUXILIARYBAR_PART:return this.setAuxiliaryBarHidden(e);case h.PANEL_PART:return this.setPanelHidden(e)}}hasMainWindowBorder(){return this.state.runtime.mainWindowBorder}getMainWindowBorderRadius(){return this.state.runtime.mainWindowBorder&&ce?"10px":void 0}isPanelMaximized(){return(this.getPanelAlignment()==="center"||!x(this.getPanelPosition()))&&!this.isVisible(h.EDITOR_PART,A)}getSideBarPosition(){return this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON)}getPanelAlignment(){return this.stateModel.getRuntimeValue(f.PANEL_ALIGNMENT)}updateMenubarVisibility(e){const t=De(this.configurationService,A,this.state.runtime.menuBar.toggled);!e&&this.workbenchGrid&&t!==this.isVisible(h.TITLEBAR_PART,A)&&this.workbenchGrid.setViewVisible(this.titleBarPartView,t)}updateCustomTitleBarVisibility(){const e=De(this.configurationService,A,this.state.runtime.menuBar.toggled),t=this.isVisible(h.TITLEBAR_PART);e!==t&&this.workbenchGrid.setViewVisible(this.titleBarPartView,e)}toggleMenuBar(){let e=Li(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=Oi(this.configurationService)?"toggle":"compact":t="classic",this.configurationService.updateValue(ws.MenuBarVisibility,t)}getPanelPosition(){return this.stateModel.getRuntimeValue(f.PANEL_POSITION)}setPanelPosition(e){this.isVisible(h.PANEL_PART)||this.setPanelHidden(!1);const t=this.getPart(h.PANEL_PART),i=lt(this.getPanelPosition()),s=lt(e),r=re(t.getContainer());r.classList.remove(i),r.classList.add(s),t.updateStyles();const n=this.workbenchGrid.getViewSize(this.panelPartView),o=this.workbenchGrid.getViewSize(this.sideBarPartView),a=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView);let c=!this.isVisible(h.EDITOR_PART,A);s!==i&&!c&&(x(e)?this.stateModel.setRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH,n.width):x(Kt(i))&&this.stateModel.setRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT,n.height)),x(e)&&this.getPanelAlignment()!=="center"&&c&&(this.toggleMaximizedPanel(),c=!1),this.stateModel.setRuntimeValue(f.PANEL_POSITION,e);const l=this.isVisible(h.SIDEBAR_PART),m=this.isVisible(h.AUXILIARYBAR_PART),p=this.hasFocus(h.PANEL_PART);e===v.BOTTOM?this.workbenchGrid.moveView(this.panelPartView,c?n.height:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,U.Down):e===v.TOP?this.workbenchGrid.moveView(this.panelPartView,c?n.height:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,U.Up):e===v.RIGHT?this.workbenchGrid.moveView(this.panelPartView,c?n.width:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,U.Right):this.workbenchGrid.moveView(this.panelPartView,c?n.width:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,U.Left),p&&this.focusPart(h.PANEL_PART),this.workbenchGrid.resizeView(this.sideBarPartView,o),l||this.setSideBarHidden(!0),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,a),m||this.setAuxiliaryBarHidden(!0),x(e)&&this.adjustPartPositions(this.getSideBarPosition(),this.getPanelAlignment(),e),this._onDidChangePanelPosition.fire(s)}isWindowMaximized(e){return this.state.runtime.maximized.has(xi(e))}updateWindowMaximizedState(e,t){this.mainContainer.classList.toggle(D.MAXIMIZED,t);const i=xi(e);t!==this.state.runtime.maximized.has(i)&&(t?this.state.runtime.maximized.add(i):this.state.runtime.maximized.delete(i),this.updateWindowsBorder(),this._onDidChangeWindowMaximized.fire({windowId:i,maximized:t}))}getVisibleNeighborPart(e,t){if(!this.workbenchGrid||!this.isVisible(e,A))return;const i=this.workbenchGrid.getNeighborViews(this.getPart(e),t,!1);if(i)for(const s of i){const r=[h.ACTIVITYBAR_PART,h.EDITOR_PART,h.PANEL_PART,h.AUXILIARYBAR_PART,h.SIDEBAR_PART,h.STATUSBAR_PART,h.TITLEBAR_PART].find(n=>this.getPart(n)===s&&this.isVisible(n,A));if(r!==void 0)return r}}onDidChangeWCO(){const e=this.workbenchGrid.getNeighborViews(this.titleBarPartView,U.Up,!1).length>0,t=this.shouldShowBannerFirst();e!==t&&this.workbenchGrid.moveView(this.bannerPartView,Tt.Distribute,this.titleBarPartView,t?U.Up:U.Down),this.workbenchGrid.setViewVisible(this.titleBarPartView,De(this.configurationService,A,this.state.runtime.menuBar.toggled))}arrangeEditorNodes(e,t,i){if(!e.sideBar&&!e.auxiliaryBar)return e.editor.size=t,e.editor;const s=[e.editor];return e.editor.size=i,e.sideBar&&(this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON)===v.LEFT?s.splice(0,0,e.sideBar):s.push(e.sideBar),e.editor.size-=this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN)?0:e.sideBar.size),e.auxiliaryBar&&(this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON)===v.RIGHT?s.splice(0,0,e.auxiliaryBar):s.push(e.auxiliaryBar),e.editor.size-=this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size),{type:"branch",data:s,size:t}}arrangeMiddleSectionNodes(e,t,i){const s=this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN)?0:e.activityBar.size,r=this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN)?0:e.sideBar.size,n=this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size,o=this.stateModel.getInitializationValue(f.PANEL_SIZE)?0:e.panel.size,a=this.stateModel.getRuntimeValue(f.PANEL_POSITION),c=this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON),l=[];if(!x(a))l.push(e.editor),e.editor.size=t-s-r-o-n,a===v.RIGHT?l.push(e.panel):l.splice(0,0,e.panel),c===v.LEFT?(l.push(e.auxiliaryBar),l.splice(0,0,e.sideBar),l.splice(0,0,e.activityBar)):(l.splice(0,0,e.auxiliaryBar),l.push(e.sideBar),l.push(e.activityBar));else{const m=this.stateModel.getRuntimeValue(f.PANEL_ALIGNMENT),p=!(m==="center"||c===v.LEFT&&m==="right"||c===v.RIGHT&&m==="left"),b=!(m==="center"||c===v.RIGHT&&m==="right"||c===v.LEFT&&m==="left"),M=t-s-(p?0:r)-(b?0:n),G=this.arrangeEditorNodes({editor:e.editor,sideBar:p?e.sideBar:void 0,auxiliaryBar:b?e.auxiliaryBar:void 0},i-o,M);l.push({type:"branch",data:a===v.BOTTOM?[G,e.panel]:[e.panel,G],size:M}),p||(c===v.LEFT?l.splice(0,0,e.sideBar):l.push(e.sideBar)),b||(c===v.RIGHT?l.splice(0,0,e.auxiliaryBar):l.push(e.auxiliaryBar)),c===v.LEFT?l.splice(0,0,e.activityBar):l.push(e.activityBar)}return l}createGridDescriptor(){const{width:e,height:t}=this._mainContainerDimension,i=this.stateModel.getInitializationValue(f.SIDEBAR_SIZE),s=this.stateModel.getInitializationValue(f.AUXILIARYBAR_SIZE),r=this.stateModel.getInitializationValue(f.PANEL_SIZE),n=this.titleBarPartView.minimumHeight,o=this.bannerPartView.minimumHeight,a=this.statusBarPartView.minimumHeight,c=this.activityBarPartView.minimumWidth,l=t-n-a,m=[{type:"leaf",data:{type:h.TITLEBAR_PART},size:n,visible:this.isVisible(h.TITLEBAR_PART,A)},{type:"leaf",data:{type:h.BANNER_PART},size:o,visible:!1}],p={type:"leaf",data:{type:h.ACTIVITYBAR_PART},size:c,visible:!this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN)},b={type:"leaf",data:{type:h.SIDEBAR_PART},size:i,visible:!this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN)},M={type:"leaf",data:{type:h.AUXILIARYBAR_PART},size:s,visible:this.isVisible(h.AUXILIARYBAR_PART)},G={type:"leaf",data:{type:h.EDITOR_PART},size:0,visible:!this.stateModel.getRuntimeValue(f.EDITOR_HIDDEN)},rt={type:"leaf",data:{type:h.PANEL_PART},size:r,visible:!this.stateModel.getRuntimeValue(f.PANEL_HIDDEN)},It=this.arrangeMiddleSectionNodes({activityBar:p,auxiliaryBar:M,editor:G,panel:rt,sideBar:b},e,l),Ii={root:{type:"branch",size:e,data:[...this.shouldShowBannerFirst()?m.reverse():m,{type:"branch",data:It,size:l},{type:"leaf",data:{type:h.STATUSBAR_PART},size:a,visible:!this.stateModel.getRuntimeValue(f.STATUSBAR_HIDDEN)}]},orientation:Dr.VERTICAL,width:e,height:t},Ln={activityBarVisible:!this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN),sideBarVisible:!this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN),auxiliaryBarVisible:!this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN),panelVisible:!this.stateModel.getRuntimeValue(f.PANEL_HIDDEN),statusbarVisible:!this.stateModel.getRuntimeValue(f.STATUSBAR_HIDDEN),sideBarPosition:lt(this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON)),panelPosition:lt(this.stateModel.getRuntimeValue(f.PANEL_POSITION))};return this.telemetryService.publicLog2("startupLayout",Ln),Ii}dispose(){super.dispose(),this.disposed=!0}}function tn(u){return u.getValue(Me.ZEN_MODE_CONFIG)}class Bn{constructor(e,t,i,s){this.name=e,this.scope=t,this.target=i,this.defaultValue=s}}class k extends Bn{constructor(e,t,i,s,r){super(e,t,i,s),this.zenModeIgnore=r,this.runtime=!0}}class Pi extends Bn{constructor(){super(...arguments),this.runtime=!1}}const f={MAIN_EDITOR_CENTERED:new k("editor.centered",E.WORKSPACE,R.MACHINE,!1),ZEN_MODE_ACTIVE:new k("zenMode.active",E.WORKSPACE,R.MACHINE,!1),ZEN_MODE_EXIT_INFO:new k("zenMode.exitInfo",E.WORKSPACE,R.MACHINE,{transitionedToCenteredEditorLayout:!1,transitionedToFullScreen:!1,handleNotificationsDoNotDisturbMode:!1,wasVisible:{auxiliaryBar:!1,panel:!1,sideBar:!1}}),SIDEBAR_SIZE:new Pi("sideBar.size",E.PROFILE,R.MACHINE,200),AUXILIARYBAR_SIZE:new Pi("auxiliaryBar.size",E.PROFILE,R.MACHINE,200),PANEL_SIZE:new Pi("panel.size",E.PROFILE,R.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_HEIGHT:new k("panel.lastNonMaximizedHeight",E.PROFILE,R.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_WIDTH:new k("panel.lastNonMaximizedWidth",E.PROFILE,R.MACHINE,300),PANEL_WAS_LAST_MAXIMIZED:new k("panel.wasLastMaximized",E.WORKSPACE,R.MACHINE,!1),SIDEBAR_POSITON:new k("sideBar.position",E.WORKSPACE,R.MACHINE,v.LEFT),PANEL_POSITION:new k("panel.position",E.WORKSPACE,R.MACHINE,v.BOTTOM),PANEL_ALIGNMENT:new k("panel.alignment",E.PROFILE,R.USER,"center"),ACTIVITYBAR_HIDDEN:new k("activityBar.hidden",E.WORKSPACE,R.MACHINE,!1,!0),SIDEBAR_HIDDEN:new k("sideBar.hidden",E.WORKSPACE,R.MACHINE,!1),EDITOR_HIDDEN:new k("editor.hidden",E.WORKSPACE,R.MACHINE,!1),PANEL_HIDDEN:new k("panel.hidden",E.WORKSPACE,R.MACHINE,!0),AUXILIARYBAR_HIDDEN:new k("auxiliaryBar.hidden",E.WORKSPACE,R.MACHINE,!0),STATUSBAR_HIDDEN:new k("statusBar.hidden",E.WORKSPACE,R.MACHINE,!1,!0)};var Me;(function(u){u.AUXILIARYBAR_DEFAULT_VISIBILITY="workbench.secondarySideBar.defaultVisibility",u.ACTIVITY_BAR_VISIBLE="workbench.activityBar.visible",u.PANEL_POSITION="workbench.panel.defaultLocation",u.PANEL_OPENS_MAXIMIZED="workbench.panel.opensMaximized",u.ZEN_MODE_CONFIG="zenMode",u.EDITOR_CENTERED_LAYOUT_AUTO_RESIZE="workbench.editor.centeredLayoutAutoResize"})(Me||(Me={}));var q;(function(u){u.STATUSBAR_VISIBLE="workbench.statusBar.visible",u.SIDEBAR_POSITION="workbench.sideBar.location"})(q||(q={}));const ut=class ut extends ee{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.contextService=i,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this.stateCache=new Map,this._register(this.configurationService.onDidChangeConfiguration(s=>this.updateStateFromLegacySettings(s)))}updateStateFromLegacySettings(e){e.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)&&this.setRuntimeValueAndFire(f.ACTIVITYBAR_HIDDEN,this.isActivityBarHidden()),e.affectsConfiguration(q.STATUSBAR_VISIBLE)&&this.setRuntimeValueAndFire(f.STATUSBAR_HIDDEN,!this.configurationService.getValue(q.STATUSBAR_VISIBLE)),e.affectsConfiguration(q.SIDEBAR_POSITION)&&this.setRuntimeValueAndFire(f.SIDEBAR_POSITON,Kt(this.configurationService.getValue(q.SIDEBAR_POSITION)??"left"))}updateLegacySettingsFromState(e,t){const i=this.getRuntimeValue(f.ZEN_MODE_ACTIVE);e.zenModeIgnore&&i||(e===f.ACTIVITYBAR_HIDDEN?this.configurationService.updateValue(_.ACTIVITY_BAR_LOCATION,t?ve.HIDDEN:void 0):e===f.STATUSBAR_HIDDEN?this.configurationService.updateValue(q.STATUSBAR_VISIBLE,!t):e===f.SIDEBAR_POSITON&&this.configurationService.updateValue(q.SIDEBAR_POSITION,lt(t)))}load(e){let t;for(t in f){const s=f[t],r=this.loadKeyFromStorage(s);r!==void 0&&this.stateCache.set(s.name,r)}this.stateCache.set(f.ACTIVITYBAR_HIDDEN.name,this.isActivityBarHidden()),this.stateCache.set(f.STATUSBAR_HIDDEN.name,!this.configurationService.getValue(q.STATUSBAR_VISIBLE)),this.stateCache.set(f.SIDEBAR_POSITON.name,Kt(this.configurationService.getValue(q.SIDEBAR_POSITION)??"left"));const i=this.contextService.getWorkbenchState();f.SIDEBAR_SIZE.defaultValue=Math.min(300,e.width/4),f.SIDEBAR_HIDDEN.defaultValue=i===mt.EMPTY,f.AUXILIARYBAR_SIZE.defaultValue=Math.min(300,e.width/4),f.AUXILIARYBAR_HIDDEN.defaultValue=(()=>{switch(this.configurationService.getValue(Me.AUXILIARYBAR_DEFAULT_VISIBILITY)){case"visible":return!1;case"visibleInWorkspace":return i===mt.EMPTY;default:return!0}})(),f.PANEL_SIZE.defaultValue=this.stateCache.get(f.PANEL_POSITION.name)??x(f.PANEL_POSITION.defaultValue)?e.height/3:e.width/4,f.PANEL_POSITION.defaultValue=Kt(this.configurationService.getValue(Me.PANEL_POSITION)??"bottom");for(t in f){const s=f[t];this.stateCache.get(s.name)===void 0&&this.stateCache.set(s.name,s.defaultValue)}this._register(this.storageService.onDidChangeValue(E.PROFILE,void 0,this._store)(s=>{let r;for(r in f){const n=f[r];if(n instanceof k&&n.scope===E.PROFILE&&n.target===R.USER&&`${ut.STORAGE_PREFIX}${n.name}`===s.key){const o=this.loadKeyFromStorage(n)??n.defaultValue;this.stateCache.get(n.name)!==o&&(this.stateCache.set(n.name,o),this._onDidChangeState.fire({key:n,value:o}))}}}))}save(e,t){let i;const s=this.getRuntimeValue(f.ZEN_MODE_ACTIVE);for(i in f){const r=f[i];if(e&&r.scope===E.WORKSPACE||t&&r.scope===E.PROFILE){if(s&&r instanceof k&&r.zenModeIgnore)continue;this.saveKeyToStorage(r)}}}getInitializationValue(e){return this.stateCache.get(e.name)}setInitializationValue(e,t){this.stateCache.set(e.name,t)}getRuntimeValue(e,t){if(t)switch(e){case f.ACTIVITYBAR_HIDDEN:this.stateCache.set(e.name,this.isActivityBarHidden());break;case f.STATUSBAR_HIDDEN:this.stateCache.set(e.name,!this.configurationService.getValue(q.STATUSBAR_VISIBLE));break;case f.SIDEBAR_POSITON:this.stateCache.set(e.name,this.configurationService.getValue(q.SIDEBAR_POSITION)??"left");break}return this.stateCache.get(e.name)}setRuntimeValue(e,t){this.stateCache.set(e.name,t);const i=this.getRuntimeValue(f.ZEN_MODE_ACTIVE);e.scope===E.PROFILE&&(!i||!e.zenModeIgnore)&&(this.saveKeyToStorage(e),this.updateLegacySettingsFromState(e,t))}isActivityBarHidden(){const e=this.configurationService.getValue(Me.ACTIVITY_BAR_VISIBLE);return e!==void 0?!e:this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION)!==ve.DEFAULT}setRuntimeValueAndFire(e,t){this.stateCache.get(e.name)!==t&&(this.setRuntimeValue(e,t),this._onDidChangeState.fire({key:e,value:t}))}saveKeyToStorage(e){const t=this.stateCache.get(e.name);this.storageService.store(`${ut.STORAGE_PREFIX}${e.name}`,typeof t=="object"?JSON.stringify(t):t,e.scope,e.target)}loadKeyFromStorage(e){let t=this.storageService.get(`${ut.STORAGE_PREFIX}${e.name}`,e.scope);if(t!==void 0)switch(typeof e.defaultValue){case"boolean":t=t==="true";break;case"number":t=parseInt(t);break;case"object":t=JSON.parse(t);break}return t}};ut.STORAGE_PREFIX="workbench.";let ji=ut;const nc=5e3;let qi=class extends ee{constructor(e,t,i){super(),this._accessibilitySignalService=i,this._scheduler=new An(()=>{this._signalLoop=this._accessibilitySignalService.playSignalLoop(pi.progress,t??nc)},e),this._scheduler.schedule()}dispose(){super.dispose(),this._signalLoop?.dispose(),this._scheduler.dispose()}};qi=T([d(2,mi)],qi);class rc{constructor(){this.priority=90,this.name="notifications",this.when=se,this.type=Fs.View}getProvider(e){const t=e.get(Pr),i=e.get(ct),s=e.get(ge),r=e.get(mi);function n(){const o=Ve(i);if(!o)return;s.executeCommand("notifications.showList");let a;const c=i.lastFocusedList;if(c instanceof As&&(a=c.indexOf(o)),a===void 0)return;function l(){if(s.executeCommand("notifications.showList"),c&&a!==void 0){c.domFocus();try{c.setFocus([a])}catch{}}}function m(){const b=Ve(i),M=b?.message.original.toString();if(b)return b.source?g(3364,"{0} Source: {1}",M,b.source):g(3365,"{0}",M)}const p=m();if(p)return o.onDidClose(()=>t.next()),new Nr(Vr.Notification,{type:Fs.View},()=>p,()=>l(),"accessibility.verbosity.notification",void 0,oc(o,r),()=>{if(c)return l(),c.focusNext(),m()},()=>{if(c)return l(),c.focusPrevious(),m()})}return n()}}function oc(u,e){let t;if(u.actions&&(t=[],u.actions.primary&&t.push(...u.actions.primary),u.actions.secondary&&t.push(...u.actions.secondary)),t)for(const s of t){s.class=F.asClassName(Z.bell);const r=s.run;s.run=()=>{r(),u.close()}}const i=t?.find(s=>s.label.includes("Manage Extension"));return i&&(i.class=F.asClassName(Z.gear)),t&&t.push({id:"clearNotification",label:g(3366,"Clear Notification"),tooltip:g(3366,"Clear Notification"),run:()=>{u.close(),e.playSignal(pi.clear)},enabled:!0,class:F.asClassName(Z.clearAll)}),t}class ac extends sc{constructor(e,t,i,s){super(e),this.options=t,this.serviceCollection=i,this._onWillShutdown=this._register(new I),this.onWillShutdown=this._onWillShutdown.event,this._onDidShutdown=this._register(new I),this.onDidShutdown=this._onDidShutdown.event,this.previousUnexpectedError={message:void 0,time:0},O("code/willStartWorkbench"),this.registerErrorHandler(s),this.parent.appendChild(this.mainContainer)}registerErrorHandler(e){A.addEventListener("unhandledrejection",t=>{Yt(t.reason),t.preventDefault()}),Cn(t=>this.handleUnexpectedError(t,e))}handleUnexpectedError(e,t){const i=Gt(e,!0);if(!i)return;const s=Date.now();i===this.previousUnexpectedError.message&&s-this.previousUnexpectedError.time<=1e3||(this.previousUnexpectedError.time=s,this.previousUnexpectedError.message=i,t.error(i))}startup(){try{this._register(Br(175));const e=this.initServices(this.serviceCollection);return e.invokeFunction(t=>{const i=t.get(ei),s=t.get(ae),r=t.get(Qe),n=t.get(At),o=t.get(Lr),a=t.get(Ae);this.initLayout(t),this.registerListeners(i,s,r,n,o),this.renderWorkbench(e,a,s,r),this.createWorkbenchLayout(),this.layout(),this.restore(i)}),e}catch(e){throw Yt(e),e}}initServices(e){e.set(te,this);const t=Mr();for(const[s,r]of t)e.set(s,r);const i=new Or(e,!0);return i.invokeFunction(s=>{const r=s.get(ei),n=s.get(Qe);typeof n.acquireInstantiationService=="function"&&n.acquireInstantiationService(i),r.phase=wt.Ready}),i}registerListeners(e,t,i,s,r){this._register(i.onDidChangeConfiguration(n=>this.updateFontAliasing(n,i))),Xt?this._register(t.onWillSaveState(n=>{n.reason===xr.SHUTDOWN&&this.storeFontInfo(t)})):this._register(e.onWillShutdown(()=>this.storeFontInfo(t))),this._register(e.onWillShutdown(n=>this._onWillShutdown.fire(n))),this._register(e.onDidShutdown(()=>{this._onDidShutdown.fire(),this.dispose()})),this._register(s.onDidChangeFocus(n=>{n||t.flush()})),this._register(r.onWillShowDialog(()=>this.mainContainer.classList.add("modal-dialog-visible"))),this._register(r.onDidShowDialog(()=>this.mainContainer.classList.remove("modal-dialog-visible")))}updateFontAliasing(e,t){if(!ce||e&&!e.affectsConfiguration("workbench.fontAliasing"))return;const i=t.getValue("workbench.fontAliasing");if(this.fontAliasing===i)return;this.fontAliasing=i;const s=["antialiased","none","auto"];this.mainContainer.classList.remove(...s.map(r=>`monaco-font-aliasing-${r}`)),s.some(r=>r===i)&&this.mainContainer.classList.add(`monaco-font-aliasing-${i}`)}restoreFontInfo(e,t){const i=e.get("editorFontInfo",E.APPLICATION);if(i)try{const s=JSON.parse(i);Array.isArray(s)&&wi.restoreFontInfo(A,s)}catch{}wi.readFontInfo(A,kr.createFromRawSettings(t.getValue("editor"),Hr.getInstance(A).value))}storeFontInfo(e){const t=wi.serializeFontInfo(A);t&&e.store("editorFontInfo",JSON.stringify(t),E.APPLICATION,R.MACHINE)}renderWorkbench(e,t,i,s){Fr(this.mainContainer),Gr((o,a)=>e.createInstance(qi,o,a));const n=yt(["monaco-workbench",gt?"windows":Ot?"linux":"mac",ne?"web":void 0,Wr?"chromium":zr?"firefox":Ur?"safari":void 0,...this.getLayoutClasses(),...this.options?.extraClasses?this.options.extraClasses:[]]);this.mainContainer.classList.add(...n),this.updateFontAliasing(void 0,s),this.restoreFontInfo(i,s);for(const{id:o,role:a,classes:c,options:l}of[{id:h.TITLEBAR_PART,role:"none",classes:["titlebar"]},{id:h.BANNER_PART,role:"banner",classes:["banner"]},{id:h.ACTIVITYBAR_PART,role:"none",classes:["activitybar",this.getSideBarPosition()===v.LEFT?"left":"right"]},{id:h.SIDEBAR_PART,role:"none",classes:["sidebar",this.getSideBarPosition()===v.LEFT?"left":"right"]},{id:h.EDITOR_PART,role:"main",classes:["editor"],options:{restorePreviousState:this.willRestoreEditors()}},{id:h.PANEL_PART,role:"none",classes:["panel","basepanel",lt(this.getPanelPosition())]},{id:h.AUXILIARYBAR_PART,role:"none",classes:["auxiliarybar","basepanel",this.getSideBarPosition()===v.LEFT?"right":"left"]},{id:h.STATUSBAR_PART,role:"status",classes:["statusbar"]}]){const m=this.createPart(o,a,c);O(`code/willCreatePart/${o}`),this.getPart(o).create(m,l),O(`code/didCreatePart/${o}`)}this.createNotificationsHandlers(e,t)}createPart(e,t,i){const s=document.createElement(t==="status"?"footer":"div");return s.classList.add("part",...i),s.id=e,s.setAttribute("role",t),t==="status"&&s.setAttribute("aria-live","off"),s}createNotificationsHandlers(e,t){const i=this._register(e.createInstance(Xi,this.mainContainer,t.model)),s=this._register(e.createInstance($i,this.mainContainer,t.model));this._register(e.createInstance(Qa,t.model));const r=e.createInstance(Zi,t.model);this._register(i.onDidChangeVisibility(()=>{r.update(i.isVisible,s.isVisible),s.update(i.isVisible)})),this._register(s.onDidChangeVisibility(()=>{r.update(i.isVisible,s.isVisible)})),Ka(i,s,t.model),Kr.register(new rc),this.registerNotifications({onDidChangeNotificationsVisibility:oe.map(oe.any(s.onDidChangeVisibility,i.onDidChangeVisibility),()=>s.isVisible||i.isVisible)})}restore(e){try{this.restoreParts()}catch(t){Yt(t)}this.whenReady.finally(()=>Promise.race([this.whenRestored,Yr(2e3)]).finally(()=>{function t(){O("code/didStartWorkbench"),performance.measure("perf: workbench create & restore","code/didLoadWorkbenchMain","code/didStartWorkbench")}this.isRestored()?t():this.whenRestored.finally(()=>t()),e.phase=wt.Restored,this._register(new An(()=>{this._register(Xr(A,()=>e.phase=wt.Eventually,2500))},2500)).schedule()}))}}const cc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ji;let Qi=class{constructor(e,t,i,s){this._disposables=new V,this._onDidChangeVisibility=this._disposables.add(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.element=document.createElement("div"),this.element.classList.add("command-center");const r=i.createInstance(Zr,this.element,B.CommandCenter,{contextMenu:B.TitleBarContext,hiddenItemStrategy:En.NoHide,toolbarOptions:{primaryGroup:()=>!0},telemetrySource:"commandCenter",actionViewItemProvider:(n,o)=>n instanceof $r&&n.item.submenu===B.CommandCenterCenter?i.createInstance(es,n,e,{...o,hoverDelegate:t}):_s(i,n,{...o,hoverDelegate:t})});this._disposables.add(oe.filter(s.onShow,()=>Sn(this.element),this._disposables)(this._setVisibility.bind(this,!1))),this._disposables.add(s.onHide(this._setVisibility.bind(this,!0))),this._disposables.add(r)}_setVisibility(e){this.element.classList.toggle("hide",!e),this._onDidChangeVisibility.fire()}dispose(){this._disposables.dispose()}};Qi=T([d(2,L),d(3,hn)],Qi);var Ye;let es=(Ye=class extends Gs{constructor(e,t,i,s,r,n,o){super(void 0,e.actions.find(a=>a.id==="workbench.action.quickOpenWithModes")??e.actions[0],i),this._submenu=e,this._windowTitle=t,this._hoverService=s,this._keybindingService=r,this._instaService=n,this._editorGroupService=o,this._hoverDelegate=i.hoverDelegate??Vi("mouse")}render(e){super.render(e),e.classList.add("command-center-center"),e.classList.toggle("multiple",this._submenu.actions.length>1);const t=this._store.add(this._hoverService.setupManagedHover(this._hoverDelegate,e,this.getTooltip()));this._store.add(this._windowTitle.onDidChange(()=>{t.update(this.getTooltip())}));const i=[];for(const s of this._submenu.actions)s instanceof jr?i.push(s.actions):i.push([s]);for(let s=0;s<i.length;s++){const r=i[s],n=this._instaService.createInstance(In,e,{hiddenItemStrategy:En.NoHide,telemetrySource:"commandCenterCenter",actionViewItemProvider:(o,a)=>{if(a={...a,hoverDelegate:this._hoverDelegate},o.id!==Ji._quickOpenCommandId)return _s(this._instaService,o,a);const c=this;return this._instaService.createInstance(class extends Gs{constructor(){super(void 0,o,a)}render(m){super.render(m),m.classList.toggle("command-center-quick-pick"),m.role="button";const p=this.action,b=document.createElement("span");b.ariaHidden="true",b.className=p.class??"",b.classList.add("search-icon");const M=this._getLabel(),G=document.createElement("span");G.classList.add("search-label"),G.innerText=M,Tn(m,b,G);const rt=this._store.add(c._hoverService.setupManagedHover(c._hoverDelegate,m,this.getTooltip()));this._store.add(c._windowTitle.onDidChange(()=>{rt.update(this.getTooltip()),G.innerText=this._getLabel()})),this._store.add(c._editorGroupService.onDidChangeEditorPartOptions(({newPartOptions:It,oldPartOptions:Ii})=>{It.showTabs!==Ii.showTabs&&(rt.update(this.getTooltip()),G.innerText=this._getLabel())}))}getTooltip(){return c.getTooltip()}_getLabel(){const{prefix:m,suffix:p}=c._windowTitle.getTitleDecorations();let b=c._windowTitle.workspaceName;return c._windowTitle.isCustomTitleFormat()?b=c._windowTitle.getWindowTitle():c._editorGroupService.partOptions.showTabs==="none"&&(b=c._windowTitle.fileName??b),b||(b=g(3486,"Search")),m&&(b=g(3487,"{0} {1}",m,b)),p&&(b=g(3488,"{0} {1}",b,p)),b.replaceAll(/\r\n|\r|\n/g,"⏎")}})}});if(n.setActions(r),this._store.add(n),s<i.length-1){const o=ki(Z.circleSmallFilled);o.style.padding="0 12px",o.style.height="100%",o.style.opacity="0.5",e.appendChild(o)}}}getTooltip(){const e=this._keybindingService.lookupKeybinding(this.action.id)?.getLabel();return e?g(3489,"Search {0} ({1}) — {2}",this._windowTitle.workspaceName,e,this._windowTitle.value):g(3490,"Search {0} — {1}",this._windowTitle.workspaceName,this._windowTitle.value)}},Ji=Ye,Ye._quickOpenCommandId="workbench.action.quickOpenWithModes",Ye);es=Ji=T([d(3,ys),d(4,it),d(5,L),d(6,st)],es);Te.appendMenuItem(B.CommandCenter,{submenu:B.CommandCenterCenter,title:g(3491,"Command Center"),icon:Z.shield,order:101});var ts;_e(cc);let is=class extends yn{constructor(e,t,i){super("workbench.titleService",i,t),this.instantiationService=e,this.properties=void 0,this.variables=new Map,this.mainPart=this._register(this.createMainTitlebarPart()),this.onMenubarVisibilityChange=this.mainPart.onMenubarVisibilityChange,this._register(this.registerPart(this.mainPart)),this.registerActions(),this.registerAPICommands()}createMainTitlebarPart(){return this.instantiationService.createInstance(ss)}registerActions(){const e=this;this._register(Ds(class extends Rs{constructor(){super({id:"workbench.action.focusTitleBar",title:le(3525,"Focus Title Bar"),category:Ps.View,f1:!0,precondition:qr})}run(){e.getPartByDocument(pn())?.focus()}}))}registerAPICommands(){this._register(Re.registerCommand({id:"registerWindowTitleVariable",handler:(e,t,i)=>{this.registerVariables([{name:t,contextKey:i}])},metadata:{description:"Registers a new title variable",args:[{name:"name",schema:{type:"string"},description:"The name of the variable to register"},{name:"contextKey",schema:{type:"string"},description:"The context key to use for the value of the variable"}]}}))}createAuxiliaryTitlebarPart(e,t,i){const s=S(".part.titlebar",{role:"none"});s.style.position="relative",e.insertBefore(s,e.firstChild);const r=new V,n=this.doCreateAuxiliaryTitlebarPart(s,t,i);return r.add(this.registerPart(n)),r.add(oe.runAndSubscribe(n.onDidChange,()=>s.style.height=`${n.height}px`)),n.create(s),this.properties&&n.updateProperties(this.properties),this.variables.size&&n.registerVariables(Array.from(this.variables.values())),oe.once(n.onWillDispose)(()=>r.dispose()),n}doCreateAuxiliaryTitlebarPart(e,t,i){return i.createInstance(ns,e,t,this.mainPart)}updateProperties(e){this.properties=e;for(const t of this.parts)t.updateProperties(e)}registerVariables(e){const t=[];for(const i of e)this.variables.has(i.name)||(this.variables.set(i.name,i),t.push(i));for(const i of this.parts)i.registerVariables(t)}};is=T([d(0,L),d(1,ae),d(2,ie)],is);let li=class extends Ci{get minimumHeight(){const e=ne&&Mi();let t=this.isCommandCenterVisible||e?Jr:30;return e&&(t=Math.max(t,Qr(z(this.element))?.height??0)),t/(this.preventZoom?Zt(z(this.element)):1)}get maximumHeight(){return this.minimumHeight}constructor(e,t,i,s,r,n,o,a,c,l,m,p,b,M,G){super(e,{hasTitle:!1},a,c,l),this.editorGroupsContainer=i,this.contextMenuService=s,this.configurationService=r,this.environmentService=n,this.instantiationService=o,this.storageService=c,this.contextKeyService=m,this.hostService=p,this.editorService=b,this.menuService=M,this.keybindingService=G,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this._onMenubarVisibilityChange=this._register(new I),this.onMenubarVisibilityChange=this._onMenubarVisibilityChange.event,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this.customMenubar=this._register(new Ne),this.actionToolBarDisposable=this._register(new V),this.editorActionsChangeDisposable=this._register(new V),this.globalToolbarMenuDisposables=this._register(new V),this.editorToolbarMenuDisposables=this._register(new V),this.layoutToolbarMenuDisposables=this._register(new V),this.activityToolbarDisposables=this._register(new V),this.titleDisposables=this._register(new V),this.isInactive=!1,this.isCompact=!1,this.isAuxiliary=t.vscodeWindowId!==A.vscodeWindowId,this.isCompactContextKey=eo.bindTo(this.contextKeyService),this.titleBarStyle=to(this.configurationService),this.windowTitle=this._register(o.createInstance(io,t)),this.hoverDelegate=this._register(so()),this.registerListeners(xi(t))}registerListeners(e){this._register(this.hostService.onDidChangeFocus(t=>t?this.onFocus():this.onBlur())),this._register(this.hostService.onDidChangeActiveWindow(t=>t===e?this.onFocus():this.onBlur())),this._register(this.configurationService.onDidChangeConfiguration(t=>this.onConfigurationChanged(t))),this._register(this.editorGroupsContainer.onDidChangeEditorPartOptions(t=>this.onEditorPartConfigurationChange(t)))}onBlur(){this.isInactive=!0,this.updateStyles()}onFocus(){this.isInactive=!1,this.updateStyles()}onEditorPartConfigurationChange({oldPartOptions:e,newPartOptions:t}){(e.editorActionsLocation!==t.editorActionsLocation||e.showTabs!==t.showTabs)&&this.actionToolBar&&(this.createActionToolBar(),this.createActionToolBarMenus({editorActions:!0}),this._onDidChange.fire(void 0))}onConfigurationChanged(e){if(!this.isAuxiliary&&!Oi(this.configurationService,this.titleBarStyle)&&(!ce||ne)&&e.affectsConfiguration(ws.MenuBarVisibility)&&(this.currentMenubarVisibility==="compact"?this.uninstallMenubar():this.installMenubar()),this.actionToolBar){const t=e.affectsConfiguration(_.LAYOUT_ACTIONS),i=e.affectsConfiguration(_.ACTIVITY_BAR_LOCATION);(t||i)&&(this.createActionToolBarMenus({layoutActions:t,activityActions:i}),this._onDidChange.fire(void 0))}e.affectsConfiguration(_.COMMAND_CENTER)&&this.recreateTitle()}recreateTitle(){this.createTitle(),this._onDidChange.fire(void 0)}updateOptions(e){const t=this.isCompact;this.isCompact=e.compact,this.isCompactContextKey.set(this.isCompact),t!==this.isCompact&&(this.recreateTitle(),this.createActionToolBarMenus(!0))}installMenubar(){this.menubar||(this.customMenubar.value=this.instantiationService.createInstance(no),this.menubar=J(this.leftContent,S("div.menubar")),this.menubar.setAttribute("role","menubar"),this._register(this.customMenubar.value.onVisibilityChange(e=>this.onMenubarVisibilityChanged(e))),this.customMenubar.value.create(this.menubar))}uninstallMenubar(){this.customMenubar.value=void 0,this.menubar?.remove(),this.menubar=void 0,this.onMenubarVisibilityChanged(!1)}onMenubarVisibilityChanged(e){(ne||gt||Ot)&&(this.lastLayoutDimensions&&this.layout(this.lastLayoutDimensions.width,this.lastLayoutDimensions.height),this._onMenubarVisibilityChange.fire(e))}updateProperties(e){this.windowTitle.updateProperties(e)}registerVariables(e){this.windowTitle.registerVariables(e)}createContentArea(e){if(this.element=e,this.rootContainer=J(e,S(".titlebar-container")),this.leftContent=J(this.rootContainer,S(".titlebar-left")),this.centerContent=J(this.rootContainer,S(".titlebar-center")),this.rightContent=J(this.rootContainer,S(".titlebar-right")),(gt||Ot)&&!_t(this.configurationService,this.titleBarStyle)&&(this.appIcon=Ws(this.leftContent,S("a.window-appicon"))),this.dragRegion=Ws(this.rootContainer,S("div.titlebar-drag-region")),!this.isAuxiliary&&!Oi(this.configurationService,this.titleBarStyle)&&(!ce||ne)&&this.currentMenubarVisibility!=="compact"&&this.installMenubar(),this.title=J(this.centerContent,S("div.window-title")),this.createTitle(),this.actionToolBarElement=J(this.rightContent,S("div.action-toolbar-container")),this.createActionToolBar(),this.createActionToolBarMenus(),!_t(this.configurationService,this.titleBarStyle)){let t=ce?"left":"right";ce&&Xt&&ro.Locale(oo).value?.textInfo?.direction==="rtl"&&(t="right"),ce&&Xt&&t==="left"||ao(this.configurationService)===co.HIDDEN||(this.windowControlsContainer=J(t==="left"?this.leftContent:this.rightContent,S("div.window-controls-container")),ne&&J(t==="left"?this.rightContent:this.leftContent,S("div.window-controls-container")),Mi()&&this.windowControlsContainer.classList.add("wco-enabled"))}return this._register(H(this.rootContainer,$.CONTEXT_MENU,t=>{Se.stop(t);let i;ce&&Si(t.target)&&ho(t.target,this.title)?i=B.TitleBarTitleContext:i=B.TitleBarContext,this.onContextMenu(t,i)})),ce&&this._register(H(this.title,$.MOUSE_DOWN,t=>{t.metaKey&&(Se.stop(t,!0),this.onContextMenu(t,B.TitleBarTitleContext))},!0)),this.updateStyles(),this.element}createTitle(){this.titleDisposables.clear();const e=_t(this.configurationService,this.titleBarStyle);if(!this.isCommandCenterVisible)e||(this.title.innerText=this.windowTitle.value,this.titleDisposables.add(this.windowTitle.onDidChange(()=>{this.title.innerText=this.windowTitle.value,this.lastLayoutDimensions&&this.updateLayout(this.lastLayoutDimensions)})));else{const t=this.instantiationService.createInstance(Qi,this.windowTitle,this.hoverDelegate);Tn(this.title,t.element),this.titleDisposables.add(t)}}actionViewItemProvider(e,t){if(!this.isAuxiliary){if(e.id===zs)return this.instantiationService.createInstance(lo,{position:()=>Us.BELOW},t);if(e.id===Ks)return this.instantiationService.createInstance(uo,{position:()=>Us.BELOW},t)}const i=this.editorGroupsContainer.activeGroup?.activeEditorPane;if(i&&i instanceof fo){const s=i.getActionViewItem(e,t);if(s)return s}return _s(this.instantiationService,e,{...t,menuAsChild:!1})}getKeybinding(e){const t=this.editorGroupsContainer.activeGroup?.activeEditorPane?.scopedContextKeyService??this.contextKeyService;return this.keybindingService.lookupKeybinding(e.id,t)}createActionToolBar(){this.actionToolBarDisposable.clear(),this.actionToolBar=this.actionToolBarDisposable.add(this.instantiationService.createInstance(In,this.actionToolBarElement,{contextMenu:B.TitleBarContext,orientation:po.HORIZONTAL,ariaLabel:g(3526,"Title actions"),getKeyBinding:e=>this.getKeybinding(e),overflowBehavior:{maxItems:9,exempted:[Ks,zs,...mo]},anchorAlignmentProvider:()=>go.RIGHT,telemetrySource:"titlePart",highlightToggledItems:this.editorActionsEnabled||this.isAuxiliary,actionViewItemProvider:(e,t)=>this.actionViewItemProvider(e,t),hoverDelegate:this.hoverDelegate})),this.editorActionsEnabled&&this.actionToolBarDisposable.add(this.editorGroupsContainer.onDidChangeActiveGroup(()=>this.createActionToolBarMenus({editorActions:!0})))}createActionToolBarMenus(e=!0){e===!0&&(e={editorActions:!0,layoutActions:!0,globalActions:!0,activityActions:!0});const t=()=>{const i={primary:[],secondary:[]};if(this.editorActionsEnabled){this.editorActionsChangeDisposable.clear();const s=this.editorGroupsContainer.activeGroup;if(s){const r=s.createEditorActions(this.editorActionsChangeDisposable,this.isAuxiliary&&this.isCompact?B.CompactWindowEditorTitle:B.EditorTitle);i.primary.push(...r.actions.primary),i.secondary.push(...r.actions.secondary),this.editorActionsChangeDisposable.add(r.onDidChange(()=>t()))}}this.globalToolbarMenu&&Ys(this.globalToolbarMenu.getActions(),i),this.layoutToolbarMenu&&Ys(this.layoutToolbarMenu.getActions(),i,()=>!this.editorActionsEnabled||this.isCompact),this.activityActionsEnabled&&(_o(this.storageService)&&i.primary.push(Do),i.primary.push(Ro)),this.actionToolBar.setActions(Xs(i.primary),Xs(i.secondary))};if(e.editorActions)if(this.editorToolbarMenuDisposables.clear(),this.editorActionsEnabled&&this.editorService.activeEditor!==void 0){const i={groupId:this.editorGroupsContainer.activeGroup.id};this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new bo(i)),this.actionToolBar.context=i}else this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new Ss),this.actionToolBar.context=void 0;e.layoutActions&&(this.layoutToolbarMenuDisposables.clear(),this.layoutControlEnabled?(this.layoutToolbarMenu=this.menuService.createMenu(B.LayoutControlMenu,this.contextKeyService),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu.onDidChange(()=>t()))):this.layoutToolbarMenu=void 0),e.globalActions&&(this.globalToolbarMenuDisposables.clear(),this.globalActionsEnabled?(this.globalToolbarMenu=this.menuService.createMenu(B.TitleBar,this.contextKeyService),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu.onDidChange(()=>t()))):this.globalToolbarMenu=void 0),e.activityActions&&(this.activityToolbarDisposables.clear(),this.activityActionsEnabled&&this.activityToolbarDisposables.add(this.storageService.onDidChangeValue(E.PROFILE,So.ACCOUNTS_VISIBILITY_PREFERENCE_KEY,this._store)(()=>t()))),t()}updateStyles(){if(super.updateStyles(),this.element){this.isInactive?this.element.classList.add("inactive"):this.element.classList.remove("inactive");const e=this.getColor(this.isInactive?Ao:Co,(s,r)=>s.isOpaque()?s:s.makeOpaque(Eo(r)))||"";this.element.style.backgroundColor=e,this.appIconBadge&&(this.appIconBadge.style.backgroundColor=e),e&&Io.fromHex(e).isLighter()?this.element.classList.add("light"):this.element.classList.remove("light");const t=this.getColor(this.isInactive?To:yo);this.element.style.color=t||"";const i=this.getColor(vo);this.element.style.borderBottom=i?`1px solid ${i}`:""}}onContextMenu(e,t){const i=new vn(z(this.element),e);this.contextMenuService.showContextMenu({getAnchor:()=>i,menuId:t,contextKeyService:this.contextKeyService,domForShadowRoot:ce&&Xt?i.target:void 0})}get currentMenubarVisibility(){return this.isAuxiliary?"hidden":Li(this.configurationService)}get layoutControlEnabled(){return this.configurationService.getValue(_.LAYOUT_ACTIONS)!==!1}get isCommandCenterVisible(){return!this.isCompact&&this.configurationService.getValue(_.COMMAND_CENTER)!==!1}get editorActionsEnabled(){return this.editorGroupsContainer.partOptions.editorActionsLocation===Bi.TITLEBAR||this.editorGroupsContainer.partOptions.editorActionsLocation===Bi.DEFAULT&&this.editorGroupsContainer.partOptions.showTabs===wo.NONE}get activityActionsEnabled(){const e=this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION);return!this.isCompact&&!this.isAuxiliary&&(e===ve.TOP||e===ve.BOTTOM)}get globalActionsEnabled(){return!this.isCompact}get hasZoomableElements(){const e=!(this.currentMenubarVisibility==="hidden"||this.currentMenubarVisibility==="compact"||!ne&&ce),t=this.isCommandCenterVisible,i=this.globalActionsEnabled||this.layoutControlEnabled||this.editorActionsEnabled||this.activityActionsEnabled;return e||t||i}get preventZoom(){return Zt(z(this.element))<1||!this.hasZoomableElements}layout(e,t){this.updateLayout(new et(e,t)),super.layoutContents(e,t)}updateLayout(e){this.lastLayoutDimensions=e;{const t=Zt(z(this.element));if(this.element.style.setProperty("--zoom-factor",t.toString()),this.rootContainer.classList.toggle("counter-zoom",this.preventZoom),this.customMenubar.value){const i=new et(0,e.height);this.customMenubar.value.layout(i)}}}focus(){this.customMenubar.value?this.customMenubar.value.toggleFocus():this.element.querySelector('[tabindex]:not([tabindex="-1"])')?.focus()}toJSON(){return{type:h.TITLEBAR_PART}}dispose(){this._onWillDispose.fire(),super.dispose()}};li=T([d(3,me),d(4,Qe),d(5,Wt),d(6,L),d(7,ie),d(8,ae),d(9,te),d(10,Ee),d(11,At),d(12,Ct),d(13,Ns),d(14,it)],li);let ss=class extends li{constructor(e,t,i,s,r,n,o,a,c,l,m,p,b){super(h.TITLEBAR_PART,A,l.mainPart,e,t,i,s,r,n,o,a,c,m,p,b)}};ss=T([d(0,me),d(1,Qe),d(2,Wt),d(3,L),d(4,ie),d(5,ae),d(6,te),d(7,Ee),d(8,At),d(9,st),d(10,Ct),d(11,Ns),d(12,it)],ss);var Xe;let ns=(Xe=class extends li{get height(){return this.minimumHeight}constructor(e,t,i,s,r,n,o,a,c,l,m,p,b,M,G,rt){const It=ts.COUNTER++;super(`workbench.parts.auxiliaryTitle.${It}`,z(e),t,s,r,n,o,a,c,l,m,p,M,G,rt),this.container=e,this.mainTitlebar=i}get preventZoom(){return Zt(z(this.element))<1||!this.mainTitlebar.hasZoomableElements}},ts=Xe,Xe.COUNTER=1,Xe);ns=ts=T([d(3,me),d(4,Qe),d(5,Wt),d(6,L),d(7,ie),d(8,ae),d(9,te),d(10,Ee),d(11,At),d(12,st),d(13,Ct),d(14,Ns),d(15,it)],ns);function hc(){return{[vs.toString()]:new Le(is,[],!1)}}wn(async u=>{u.get(vs)});const lc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class dc extends j{constructor(e,t,i){super(e,t,void 0,!0),this.model=i,this.checked=!i.isHidden(e)}async run(){this.model.isHidden(this.id)?this.model.show(this.id):this.model.hide(this.id)}}class uc extends j{constructor(e,t,i){super(e,g(3482,"Hide '{0}'",t),void 0,!0),this.model=i}async run(){this.model.hide(this.id)}}let rs=class extends j{constructor(e,t){super("statusbar.manage.extension",g(3483,"Manage Extension")),this.extensionId=e,this.commandService=t}run(){return this.commandService.executeCommand("_extensions.manage",this.extensionId)}};rs=T([d(1,ge)],rs);P.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusPrevious",weight:N.WorkbenchContrib,primary:C.LeftArrow,secondary:[C.UpArrow],when:Et,handler:u=>{u.get(Ie).focusPreviousEntry()}});P.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusNext",weight:N.WorkbenchContrib,primary:C.RightArrow,secondary:[C.DownArrow],when:Et,handler:u=>{u.get(Ie).focusNextEntry()}});P.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusFirst",weight:N.WorkbenchContrib,primary:C.Home,when:Et,handler:u=>{const e=u.get(Ie);e.focus(!1),e.focusNextEntry()}});P.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusLast",weight:N.WorkbenchContrib,primary:C.End,when:Et,handler:u=>{const e=u.get(Ie);e.focus(!1),e.focusPreviousEntry()}});P.registerCommandAndKeybindingRule({id:"workbench.statusBar.clearFocus",weight:N.WorkbenchContrib,primary:C.Escape,when:Et,handler:u=>{const e=u.get(Ie),t=u.get(Ct);e.isEntryFocused()?e.focus(!1):t.activeEditorPane&&t.activeEditorPane.focus()}});class fc extends Rs{constructor(){super({id:"workbench.action.focusStatusBar",title:le(3484,"Focus Status Bar"),category:Ps.View,f1:!0})}async run(e){e.get(te).focusPart(h.STATUSBAR_PART,Ut())}}Ds(fc);const Be=class Be extends ee{get entries(){return this._entries.slice(0)}get lastFocusedEntry(){return this._lastFocusedEntry&&!this.isHidden(this._lastFocusedEntry.id)?this._lastFocusedEntry:void 0}constructor(e){super(),this.storageService=e,this._onDidChangeEntryVisibility=this._register(new I),this.onDidChangeEntryVisibility=this._onDidChangeEntryVisibility.event,this._entries=[],this.hidden=new Set,this.restoreState(),this.registerListeners()}restoreState(){const e=this.storageService.get(Be.HIDDEN_ENTRIES_KEY,E.PROFILE);if(e)try{this.hidden=new Set(JSON.parse(e))}catch{}}registerListeners(){this._register(this.storageService.onDidChangeValue(E.PROFILE,Be.HIDDEN_ENTRIES_KEY,this._store)(()=>this.onDidStorageValueChange()))}onDidStorageValueChange(){const e=new Set(this.hidden);this.hidden.clear(),this.restoreState();const t=new Set;for(const i of e)this.hidden.has(i)||t.add(i);for(const i of this.hidden)e.has(i)||t.add(i);if(t.size>0)for(const i of this._entries)t.has(i.id)&&(this.updateVisibility(i.id,!0),t.delete(i.id))}add(e){this._entries.push(e),this.updateVisibility(e,!1),this.sort(),this.markFirstLastVisibleEntry()}remove(e){const t=this._entries.indexOf(e);t>=0&&(this._entries.splice(t,1),this._entries.some(i=>$t(i.priority.primary)&&i.priority.primary.location.id===e.id)&&this.sort(),this.markFirstLastVisibleEntry())}isHidden(e){return this.hidden.has(e)}hide(e){this.hidden.has(e)||(this.hidden.add(e),this.updateVisibility(e,!0),this.saveState())}show(e){this.hidden.has(e)&&(this.hidden.delete(e),this.updateVisibility(e,!0),this.saveState())}findEntry(e){return this._entries.find(t=>t.container===e)}getEntries(e){return this._entries.filter(t=>t.alignment===e)}focusNextEntry(){this.focusEntry(1,0)}focusPreviousEntry(){this.focusEntry(-1,this.entries.length-1)}isEntryFocused(){return!!this.getFocusedEntry()}getFocusedEntry(){return this._entries.find(e=>Je(e.container))}focusEntry(e,t){const i=n=>{let o=n,a=o>=0&&o<this._entries.length?this._entries[o]:void 0;for(;a&&this.isHidden(a.id);)o+=e,a=o>=0&&o<this._entries.length?this._entries[o]:void 0;return a},s=this.getFocusedEntry();if(s){const n=i(this._entries.indexOf(s)+e);if(n){this._lastFocusedEntry=n,n.labelContainer.focus();return}}const r=i(t);r&&(this._lastFocusedEntry=r,r.labelContainer.focus())}updateVisibility(e,t){if(typeof e=="string"){const i=e;for(const s of this._entries)s.id===i&&this.updateVisibility(s,t)}else{const i=e,s=this.isHidden(i.id);s?_n(i.container):Dn(i.container),t&&this._onDidChangeEntryVisibility.fire({id:i.id,visible:!s}),this.markFirstLastVisibleEntry()}}saveState(){this.hidden.size>0?this.storageService.store(Be.HIDDEN_ENTRIES_KEY,JSON.stringify(Array.from(this.hidden.values())),E.PROFILE,R.USER):this.storageService.remove(Be.HIDDEN_ENTRIES_KEY,E.PROFILE)}sort(){const e=new Set(this._entries.map(n=>n.id)),t=new Map,i=new Map;for(let n=0;n<this._entries.length;n++){const o=this._entries[n];if(typeof o.priority.primary=="number"||!e.has(o.priority.primary.location.id))t.set(o,n);else{const a=o.priority.primary.location.id;let c=i.get(a);if(!c){for(const l of i.values())if(l.has(a)){c=l;break}c||(c=new Map,i.set(a,c))}c.set(o.id,o)}}const s=Array.from(t.keys());s.sort((n,o)=>{if(n.alignment===o.alignment){const a=typeof n.priority.primary=="number"?n.priority.primary:n.priority.primary.location.priority,c=typeof o.priority.primary=="number"?o.priority.primary:o.priority.primary.location.priority;return a!==c?c-a:n.priority.secondary!==o.priority.secondary?o.priority.secondary-n.priority.secondary:t.get(n)-t.get(o)}return n.alignment===K.LEFT?-1:o.alignment===K.LEFT?1:0});let r;if(i.size>0){r=[];for(const n of s){const o=i.get(n.id),a=o?Array.from(o.values()):void 0;a&&r.push(...a.filter(c=>$t(c.priority.primary)&&c.priority.primary.alignment===K.LEFT).sort((c,l)=>l.priority.secondary-c.priority.secondary)),r.push(n),a&&r.push(...a.filter(c=>$t(c.priority.primary)&&c.priority.primary.alignment===K.RIGHT).sort((c,l)=>l.priority.secondary-c.priority.secondary)),i.delete(n.id)}for(const[,n]of i)r.push(...Array.from(n.values()).sort((o,a)=>a.priority.secondary-o.priority.secondary))}else r=s;this._entries=r}markFirstLastVisibleEntry(){this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(K.LEFT)),this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(K.RIGHT))}doMarkFirstLastVisibleStatusbarItem(e){let t,i;for(const s of e)s.container.classList.remove("first-visible-item","last-visible-item"),!this.isHidden(s.id)&&(t||(t=s),i=s);t?.container.classList.add("first-visible-item"),i?.container.classList.add("last-visible-item")}};Be.HIDDEN_ENTRIES_KEY="workbench.statusbar.hidden";let os=Be,as=class extends ee{get name(){return re(this.entry).name}get hasCommand(){return typeof this.entry?.command<"u"}constructor(e,t,i,s,r,n,o,a){super(),this.container=e,this.hoverDelegate=i,this.commandService=s,this.hoverService=r,this.notificationService=n,this.telemetryService=o,this.themeService=a,this.entry=void 0,this.foregroundListener=this._register(new Ne),this.backgroundListener=this._register(new Ne),this.commandMouseListener=this._register(new Ne),this.commandTouchListener=this._register(new Ne),this.commandKeyboardListener=this._register(new Ne),this.hover=void 0,this.labelContainer=S("a.statusbar-item-label",{role:"button",tabIndex:-1}),this._register(Is.addTarget(this.labelContainer)),this.label=this._register(new gc(this.labelContainer)),this.container.appendChild(this.labelContainer),this.beakContainer=S(".status-bar-item-beak-container"),this.container.appendChild(this.beakContainer),this.update(t)}update(e){if(this.label.showProgress=e.showProgress??!1,(!this.entry||e.text!==this.entry.text)&&(this.label.text=e.text,e.text?Dn(this.labelContainer):_n(this.labelContainer)),(!this.entry||e.ariaLabel!==this.entry.ariaLabel)&&(this.container.setAttribute("aria-label",e.ariaLabel),this.labelContainer.setAttribute("aria-label",e.ariaLabel)),(!this.entry||e.role!==this.entry.role)&&this.labelContainer.setAttribute("role",e.role||"button"),!this.entry||!this.isEqualTooltip(this.entry,e)){let i,s;Po(e.tooltip)?(s=e.tooltip.content,i={actions:e.tooltip.commands.map(n=>({commandId:n.id,label:n.title,run:()=>this.executeCommand(n)}))}):s=e.tooltip;const r=_i(s)?{markdown:s,markdownNotSupportedFallback:void 0}:s;this.hover?this.hover.update(r,i):this.hover=this._register(this.hoverService.setupManagedHover(this.hoverDelegate,this.container,r,i))}if(!this.entry||e.command!==this.entry.command){this.commandMouseListener.clear(),this.commandTouchListener.clear(),this.commandKeyboardListener.clear();const i=e.command;i&&(i!==Zs||this.hover)?(this.commandMouseListener.value=H(this.labelContainer,$.CLICK,()=>this.executeCommand(i)),this.commandTouchListener.value=H(this.labelContainer,Ts.Tap,()=>this.executeCommand(i)),this.commandKeyboardListener.value=H(this.labelContainer,$.KEY_DOWN,s=>{const r=new dn(s);r.equals(C.Space)||r.equals(C.Enter)?(Se.stop(s),this.executeCommand(i)):(r.equals(C.Escape)||r.equals(C.LeftArrow)||r.equals(C.RightArrow))&&(Se.stop(s),this.hover?.hide())}),this.labelContainer.classList.remove("disabled")):this.labelContainer.classList.add("disabled")}(!this.entry||e.showBeak!==this.entry.showBeak)&&(e.showBeak?this.container.classList.add("has-beak"):this.container.classList.remove("has-beak"));const t=!!e.backgroundColor||e.kind&&e.kind!=="standard";if(!this.entry||e.kind!==this.entry.kind){for(const i of No)this.container.classList.remove(`${i}-kind`);e.kind&&e.kind!=="standard"&&this.container.classList.add(`${e.kind}-kind`),this.container.classList.toggle("has-background-color",t)}(!this.entry||e.color!==this.entry.color)&&this.applyColor(this.labelContainer,e.color),(!this.entry||e.backgroundColor!==this.entry.backgroundColor)&&(this.container.classList.toggle("has-background-color",t),this.applyColor(this.container,e.backgroundColor,!0)),this.entry=e}isEqualTooltip({tooltip:e},{tooltip:t}){return e===void 0?t===void 0:_i(e)?_i(t)&&Vo(e,t):e===t}async executeCommand(e){if(e===Zs)this.hover?.show(!0);else{const t=typeof e=="string"?e:e.id,i=typeof e=="string"?[]:e.arguments??[];this.telemetryService.publicLog2("workbenchActionExecuted",{id:t,from:"status bar"});try{await this.commandService.executeCommand(t,...i)}catch(s){this.notificationService.error(Gt(s))}}}applyColor(e,t,i){let s;if(i?this.backgroundListener.clear():this.foregroundListener.clear(),t)if(Bo(t)){s=this.themeService.getColorTheme().getColor(t.id)?.toString();const r=this.themeService.onDidColorThemeChange(n=>{const o=n.getColor(t.id)?.toString();i?e.style.backgroundColor=o??"":e.style.color=o??""});i?this.backgroundListener.value=r:this.foregroundListener.value=r}else s=t;i?e.style.backgroundColor=s??"":e.style.color=s??""}};as=T([d(3,ge),d(4,ys),d(5,Ae),d(6,Cs),d(7,ie)],as);class gc extends Lo{constructor(e){super(e),this.container=e,this.progressCodicon=ki($s),this.currentText="",this.currentShowProgress=!1}set showProgress(e){this.currentShowProgress!==e&&(this.currentShowProgress=e,this.progressCodicon=ki(e==="syncing"?$s:Mo),this.text=this.currentText)}set text(e){if(this.currentShowProgress){this.container.firstChild!==this.progressCodicon&&this.container.appendChild(this.progressCodicon);for(const i of Array.from(this.container.childNodes))i!==this.progressCodicon&&i.remove();let t=e??"";t&&(t=` ${t}`),J(this.container,...Oo(t))}else super.text=e}}var jt,cs;_e(lc);var Ze;let Ft=(Ze=class extends Ci{constructor(e,t,i,s,r,n,o,a){super(e,{hasTitle:!1},i,r,n),this.instantiationService=t,this.contextService=s,this.contextMenuService=o,this.contextKeyService=a,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=jt.HEIGHT,this.maximumHeight=jt.HEIGHT,this.pendingEntries=[],this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this.onDidOverrideEntry=this._register(new I),this.entryOverrides=new Map,this.compactEntriesDisposable=this._register(new Ne),this.styleOverrides=new Set,this.viewModel=this._register(new os(r)),this.onDidChangeEntryVisibility=this.viewModel.onDidChangeEntryVisibility,this.hoverDelegate=this._register(this.instantiationService.createInstance(xo,"element",{instantHover:!0,dynamicDelay(c){if(typeof c=="function"||Si(c)||ko(c)&&typeof c.markdown=="function"||Ho(c))return 500}},(c,l)=>({persistence:{hideOnKeyDown:!0,sticky:l},appearance:{maxHeightRatio:.9}}))),this.registerListeners()}registerListeners(){this._register(this.onDidChangeEntryVisibility(()=>this.updateCompactEntries())),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.updateStyles()))}overrideEntry(e,t){return this.entryOverrides.set(e,t),this.onDidOverrideEntry.fire(e),Ce(()=>{this.entryOverrides.get(e)===t&&(this.entryOverrides.delete(e),this.onDidOverrideEntry.fire(e))})}withEntryOverride(e,t){const i=this.entryOverrides.get(t);return i&&(e={...e,...i}),e}addEntry(e,t,i,s=0){let r;return Fo(s)?r=s:r={primary:s,secondary:Go(t)},this.element?this.doAddEntry(e,t,i,r):this.doAddPendingEntry(e,t,i,r)}doAddPendingEntry(e,t,i,s){const r={entry:e,id:t,alignment:i,priority:s};return this.pendingEntries.push(r),{update:o=>{r.accessor?r.accessor.update(o):r.entry=o},dispose:()=>{r.accessor?r.accessor.dispose():this.pendingEntries=this.pendingEntries.filter(o=>o!==r)}}}doAddEntry(e,t,i,s){const r=new V,n=this.doCreateStatusItem(t,i),o=r.add(this.instantiationService.createInstance(as,n,this.withEntryOverride(e,t),this.hoverDelegate)),a=new class{constructor(){this.id=t,this.extensionId=e.extensionId,this.alignment=i,this.priority=s,this.container=n,this.labelContainer=o.labelContainer}get name(){return o.name}get hasCommand(){return o.hasCommand}},{needsFullRefresh:c}=this.doAddOrRemoveModelEntry(a,!0);c?this.appendStatusbarEntries():this.appendStatusbarEntry(a);let l=e;const m={update:p=>{l=p,o.update(this.withEntryOverride(p,t))},dispose:()=>{const{needsFullRefresh:p}=this.doAddOrRemoveModelEntry(a,!1);p?this.appendStatusbarEntries():(n.remove(),this.updateCompactEntries()),r.dispose()}};return r.add(this.onDidOverrideEntry.event(p=>{p===t&&m.update(l)})),m}doCreateStatusItem(e,t,...i){const s=S(".statusbar-item",{id:e});return i&&s.classList.add(...i),t===K.RIGHT?s.classList.add("right"):s.classList.add("left"),s}doAddOrRemoveModelEntry(e,t){const i=this.viewModel.entries;t?this.viewModel.add(e):this.viewModel.remove(e);const s=this.viewModel.entries;return t?i.splice(s.indexOf(e),0,e):i.splice(i.indexOf(e),1),{needsFullRefresh:!cn(i,s)}}isEntryVisible(e){return!this.viewModel.isHidden(e)}updateEntryVisibility(e,t){t?this.viewModel.show(e):this.viewModel.hide(e)}focusNextEntry(){this.viewModel.focusNextEntry()}focusPreviousEntry(){this.viewModel.focusPreviousEntry()}isEntryFocused(){return this.viewModel.isEntryFocused()}focus(e=!0){this.getContainer()?.focus();const t=this.viewModel.lastFocusedEntry;e&&t&&setTimeout(()=>t.labelContainer.focus(),0)}createContentArea(e){this.element=e;const t=this._register(this.contextKeyService.createScoped(this.element));return Et.bindTo(t).set(!0),this.leftItemsContainer=S(".left-items.items-container"),this.element.appendChild(this.leftItemsContainer),this.element.tabIndex=0,this.rightItemsContainer=S(".right-items.items-container"),this.element.appendChild(this.rightItemsContainer),this._register(H(e,$.CONTEXT_MENU,i=>this.showContextMenu(i))),this._register(Is.addTarget(e)),this._register(H(e,Ts.Contextmenu,i=>this.showContextMenu(i))),this.createInitialStatusbarEntries(),this.element}createInitialStatusbarEntries(){for(this.appendStatusbarEntries();this.pendingEntries.length;){const e=this.pendingEntries.shift();e&&(e.accessor=this.addEntry(e.entry,e.id,e.alignment,e.priority.primary))}}appendStatusbarEntries(){const e=re(this.leftItemsContainer),t=re(this.rightItemsContainer);qe(e),qe(t);for(const i of[...this.viewModel.getEntries(K.LEFT),...this.viewModel.getEntries(K.RIGHT).reverse()])(i.alignment===K.LEFT?e:t).appendChild(i.container);this.updateCompactEntries()}appendStatusbarEntry(e){const t=this.viewModel.getEntries(e.alignment);e.alignment===K.RIGHT&&t.reverse();const i=re(e.alignment===K.LEFT?this.leftItemsContainer:this.rightItemsContainer),s=t.indexOf(e);s+1===t.length?i.appendChild(e.container):i.insertBefore(e.container,t[s+1].container),this.updateCompactEntries()}updateCompactEntries(){const e=this.viewModel.entries,t=new Map;for(const n of e)this.viewModel.isHidden(n.id)||t.set(n.id,n),n.container.classList.remove("compact-left","compact-right");const i=new Map;for(const n of t.values())if($t(n.priority.primary)&&n.priority.primary.compact){const o=n.priority.primary.location.id,a=t.get(o);if(!a)continue;let c=i.get(o);if(!c){for(const l of i.values())if(l.has(o)){c=l;break}c||(c=new Map,i.set(o,c))}c.set(n.id,n),c.set(a.id,a),n.priority.primary.alignment===K.LEFT?(a.container.classList.add("compact-left"),n.container.classList.add("compact-right")):(a.container.classList.add("compact-right"),n.container.classList.add("compact-left"))}const s=this.getColor(Wo),r=this.getColor(zo);if(this.compactEntriesDisposable.value=new V,s&&r&&!Uo(this.theme.type))for(const[,n]of i)for(const o of n.values())o.hasCommand&&(this.compactEntriesDisposable.value.add(H(o.labelContainer,$.MOUSE_OVER,()=>{n.forEach(a=>a.labelContainer.style.backgroundColor=s),o.labelContainer.style.backgroundColor=r})),this.compactEntriesDisposable.value.add(H(o.labelContainer,$.MOUSE_OUT,()=>{n.forEach(a=>a.labelContainer.style.backgroundColor="")})))}showContextMenu(e){Se.stop(e,!0);const t=new vn(z(this.element),e);let i;this.contextMenuService.showContextMenu({getAnchor:()=>t,getActions:()=>(i=this.getContextMenuActions(t),i),onHide:()=>{i&&ia(i)}})}getContextMenuActions(e){const t=[];t.push(Jt({id:js.ID,label:g(3485,"Hide Status Bar"),run:()=>this.instantiationService.invokeFunction(r=>new js().run(r))})),t.push(new Lt);const i=new Set;for(const r of this.viewModel.entries)i.has(r.id)||(t.push(new dc(r.id,r.name,this.viewModel)),i.add(r.id));let s;for(let r=e.target;r;r=r.parentElement){const n=this.viewModel.findEntry(r);if(n){s=n;break}}return s&&(t.push(new Lt),s.extensionId&&t.push(this.instantiationService.createInstance(rs,s.extensionId)),t.push(new uc(s.id,s.name,this.viewModel))),t}updateStyles(){super.updateStyles();const e=re(this.getContainer()),t=[...this.styleOverrides].sort((a,c)=>a.priority-c.priority)[0],i=this.getColor(t?.background??(this.contextService.getWorkbenchState()!==mt.EMPTY?Ko:Yo))||"";e.style.backgroundColor=i;const s=this.getColor(t?.foreground??(this.contextService.getWorkbenchState()!==mt.EMPTY?Xo:Zo))||"";e.style.color=s;const r=this.getColor($o),n=this.getColor(t?.border??(this.contextService.getWorkbenchState()!==mt.EMPTY?jo:qo))||this.getColor(Jo);n?(e.classList.add("status-border-top"),e.style.setProperty("--status-border-top-color",n)):(e.classList.remove("status-border-top"),e.style.removeProperty("--status-border-top-color"));const o=this.getColor(Qo);this.styleElement||(this.styleElement=ea(e)),this.styleElement.textContent=`
|
|
1
|
+
import{D as ee,b$ as on,bX as Y,cI as Mn,cJ as be,cK as w,cL as an,cM as Gt,cN as On,E as I,A as cn,cO as j,cP as xn,cQ as kn,cR as oe,cS as P,bM as Hn,bN as N,bP as ot,$ as C,cT as Ni,bU as Re,cU as se,cV as mi,cW as ct,cX as pi,cY as at,W as L,cZ as pe,j as Ae,bH as hn,d as V,q as g,aj as le,bZ as Te,bY as B,c_ as Ss,c$ as As,f as T,g as d,m as Cs,bh as F,bD as tt,bE as Z,Z as _e,d0 as ge,d1 as Fn,a7 as S,d2 as Es,d3 as ln,d4 as Jt,d5 as Lt,d6 as Gn,d7 as Wn,d8 as Mt,d9 as Qt,a4 as qe,da as H,db as Se,dc as $,dd as Vi,U as bi,de as zn,df as Un,dg as Ti,dh as dn,di as Is,dj as Ts,dk as Kn,dl as me,dm as Yn,dn as it,dp as ys,dq as un,dr as Xn,ds as z,dt as vt,du as Je,h as Qe,dv as fn,dw as et,dx as re,dy as gn,dz as Zn,dA as $n,dB as jn,ck as h,bu as A,c0 as ie,bA as te,dC as Ee,cc as st,dD as qn,dE as K,dF as Ie,dG as Jn,ao as wt,dH as mn,a9 as Si,dI as Qn,dJ as er,dK as tr,dL as ir,t as Ce,dM as sr,an as ei,dN as At,dO as pn,dP as nr,dQ as yi,dR as _,dS as Vs,dT as rr,by as Wt,ch as Ai,bx as ae,ci as or,bw as ar,O as bn,dU as cr,bW as Ct,ce as hr,cf as lr,dV as vs,dW as nt,bz as dr,dX as ws,dY as ti,dZ as Bi,d_ as ve,d$ as Bs,e0 as ur,e1 as gt,e2 as Ot,G as ne,e3 as _t,e4 as Li,e5 as De,e6 as Sn,e7 as Ls,cl as v,e8 as fr,e9 as gr,ea as mr,eb as pr,cw as br,aJ as E,cp as y,cv as Sr,cr as yt,cs as vi,ct as zt,cu as mt,cn as O,co as Ar,cq as Ms,ec as Ut,ed as Cr,ee as Ci,ef as Mi,eg as x,eh as Os,ei as W,ej as Er,ek as Ir,el as Tr,em as yr,cz as vr,cy as wr,en as xs,eo as _r,ep as ks,eq as ce,er as Oi,cm as lt,es as Kt,et as xi,eu as Dr,ev as Rr,aK as R,ew as Hs,bo as An,ex as Fs,ey as Pr,ez as Nr,eA as Vr,z as Yt,eB as Cn,eC as Br,bJ as Lr,eD as Mr,eE as Or,eF as Xt,eG as xr,eH as wi,eI as kr,eJ as Hr,eK as Fr,eL as Gr,eM as Wr,eN as zr,eO as Ur,eP as Kr,eQ as Yr,eR as Xr,eS as Zr,eT as En,eU as $r,eV as _s,eW as Gs,eX as jr,eY as In,a6 as Tn,eZ as ki,e_ as yn,bK as Ds,bL as Rs,e$ as qr,bO as Ps,f0 as Zt,f1 as Jr,f2 as Qr,f3 as Ne,f4 as eo,f5 as to,f6 as io,f7 as so,f8 as no,a8 as J,f9 as Ws,fa as ro,fb as oo,fc as ao,fd as co,fe as ho,ff as zs,fg as lo,fh as Us,fi as Ks,fj as uo,fk as fo,fl as go,fm as mo,fn as po,fo as bo,fp as So,fq as Ao,fr as Co,fs as Eo,N as Io,ft as To,fu as yo,fv as vo,fw as vn,fx as wo,fy as Ys,fz as _o,fA as Do,fB as Ro,fC as Xs,fD as Ns,ak as Le,fE as wn,fF as Et,fG as $t,fH as _n,fI as Dn,fJ as Po,fK as _i,fL as Zs,fM as No,fN as Vo,fO as Bo,fP as Lo,fQ as $s,fR as Mo,fS as Oo,fT as xo,fU as ko,fV as Ho,fW as Fo,fX as Go,fY as Wo,fZ as zo,bT as Uo,f_ as js,f$ as Ko,g0 as Yo,g1 as Xo,g2 as Zo,g3 as $o,g4 as jo,g5 as qo,g6 as Jo,g7 as Qo,u as ea,g8 as ta,g9 as ia,p as sa,ga as Rn,X as na,Y as ra,gb as oa,gc as aa,gd as ca,ge as ha,gf as la,gg as da,gh as ua,gi as fa,gj as Ei,b2 as ga,gk as ma,gl as pa,aH as ba,gm as Sa,cb as Aa,gn as Ca,go as Ea,gp as Ia,gq as Ta,gr as ya,cd as va}from"./index-DSexFukl.js";import{cD as Yc,cE as Xc,cB as Zc,cH as $c,cF as jc,cC as qc,cG as Jc,cA as Qc}from"./index-DSexFukl.js";import{S as wa,P as _a,A as Da,c as Ra,d as Tt,D as U,g as Pa,a as Na,E as Va,B as Ba}from"./views-Bu3Oa5Y-.js";import{E as La}from"./files.contribution._fileEditorFactory-YNF_vxMj.js";import"./workbenchThemeService.service-CXlQNmVU.js";const Ma=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Pn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var X;(function(u){u[u.ADD=0]="ADD",u[u.CHANGE=1]="CHANGE",u[u.EXPAND_COLLAPSE=2]="EXPAND_COLLAPSE",u[u.REMOVE=3]="REMOVE"})(X||(X={}));var St;(function(u){u[u.ADD=0]="ADD",u[u.REMOVE=1]="REMOVE"})(St||(St={}));class Oa extends ee{constructor(e,t){super(),this.item=e,this.onClose=t,this._onDidClose=this._register(new I),this.onDidClose=this._onDidClose.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.registerListeners()}registerListeners(){this._register(this.item.onDidChangeVisibility(e=>this._onDidChangeVisibility.fire(e))),oe.once(this.item.onDidClose)(()=>{this._onDidClose.fire(),this.dispose()})}get progress(){return this.item.progress}updateSeverity(e){this.item.updateSeverity(e)}updateMessage(e){this.item.updateMessage(e)}updateActions(e){this.item.updateActions(e)}close(){this.onClose(this.item),this.dispose()}}const ui=class ui extends ee{constructor(){super(...arguments),this._onDidChangeNotification=this._register(new I),this.onDidChangeNotification=this._onDidChangeNotification.event,this._onDidChangeStatusMessage=this._register(new I),this.onDidChangeStatusMessage=this._onDidChangeStatusMessage.event,this._onDidChangeFilter=this._register(new I),this.onDidChangeFilter=this._onDidChangeFilter.event,this._notifications=[],this.filter={global:w.OFF,sources:new Map}}get notifications(){return this._notifications}get statusMessage(){return this._statusMessage}setFilter(e){let t=!1;typeof e.global=="number"&&(t=this.filter.global!==e.global,this.filter.global=e.global);let i=!1;e.sources&&(i=!kn(this.filter.sources,e.sources),this.filter.sources=e.sources),(t||i)&&this._onDidChangeFilter.fire({global:t?e.global:void 0,sources:i?e.sources:void 0})}addNotification(e){const t=this.createViewItem(e);return t?(this.findNotification(t)?.close(),this._notifications.splice(0,0,t),this._onDidChangeNotification.fire({item:t,index:0,kind:X.ADD}),new Oa(t,s=>this.onClose(s))):ui.NO_OP_NOTIFICATION}onClose(e){const t=this.findNotification(e);t&&t!==e?t.close():e.close()}findNotification(e){return this._notifications.find(t=>t.equals(e))}createViewItem(e){const t=xt.create(e,this.filter);if(!t)return;const i=(n,o)=>{const a=this._notifications.indexOf(t);a>=0&&this._onDidChangeNotification.fire({item:t,index:a,kind:n,detail:o})},s=t.onDidChangeExpansion(()=>i(X.EXPAND_COLLAPSE)),r=t.onDidChangeContent(n=>i(X.CHANGE,n.kind));return oe.once(t.onDidClose)(()=>{s.dispose(),r.dispose();const n=this._notifications.indexOf(t);n>=0&&(this._notifications.splice(n,1),this._onDidChangeNotification.fire({item:t,index:n,kind:X.REMOVE}))}),t}showStatusMessage(e,t){const i=ka.create(e,t);return i?(this._statusMessage=i,this._onDidChangeStatusMessage.fire({kind:St.ADD,item:i}),{close:()=>{this._statusMessage===i&&(this._statusMessage=void 0,this._onDidChangeStatusMessage.fire({kind:St.REMOVE,item:i}))}}):{close:()=>{}}}};ui.NO_OP_NOTIFICATION=new xn;let qs=ui;function Di(u){return u instanceof xt}var Q;(function(u){u[u.SEVERITY=0]="SEVERITY",u[u.MESSAGE=1]="MESSAGE",u[u.ACTIONS=2]="ACTIONS",u[u.PROGRESS=3]="PROGRESS"})(Q||(Q={}));class xa extends ee{constructor(){super(),this._onDidChange=this._register(new I),this.onDidChange=this._onDidChange.event,this._state=Object.create(null)}get state(){return this._state}infinite(){this._state.infinite||(this._state.infinite=!0,this._state.total=void 0,this._state.worked=void 0,this._state.done=void 0,this._onDidChange.fire())}done(){this._state.done||(this._state.done=!0,this._state.infinite=void 0,this._state.total=void 0,this._state.worked=void 0,this._onDidChange.fire())}total(e){this._state.total!==e&&(this._state.total=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire())}worked(e){typeof this._state.worked=="number"?this._state.worked+=e:this._state.worked=e,this._state.infinite=void 0,this._state.done=void 0,this._onDidChange.fire()}}const ye=class ye extends ee{static create(e,t){if(!e||!e.message||on(e.message))return;let i;typeof e.severity=="number"?i=e.severity:i=Y.Info;const s=ye.parseNotificationMessage(e.message);if(!s)return;let r;e.actions?r=e.actions:Mn(e.message)&&(r={primary:e.message.actions});let n=e.priority??be.DEFAULT;return(n===be.DEFAULT||n===be.OPTIONAL)&&i!==Y.Error&&(t.global===w.ERROR?n=be.SILENT:an(e.source)&&t.sources.get(e.source.id)===w.ERROR&&(n=be.SILENT)),new ye(e.id,i,e.sticky,n,s,e.source,e.progress,r)}static parseNotificationMessage(e){let t;if(e instanceof Error?t=Gt(e,!1):typeof e=="string"&&(t=e),!t)return;const i=t;t.length>ye.MAX_MESSAGE_LENGTH&&(t=`${t.substr(0,ye.MAX_MESSAGE_LENGTH)}...`),t=t.replace(/(\r\n|\n|\r)/gm," ").trim();const s=On(t);return{raw:i,linkedText:s,original:e}}constructor(e,t,i,s,r,n,o,a){super(),this.id=e,this._severity=t,this._sticky=i,this._priority=s,this._message=r,this._source=n,this._visible=!1,this._onDidChangeExpansion=this._register(new I),this.onDidChangeExpansion=this._onDidChangeExpansion.event,this._onDidClose=this._register(new I),this.onDidClose=this._onDidClose.event,this._onDidChangeContent=this._register(new I),this.onDidChangeContent=this._onDidChangeContent.event,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,o&&this.setProgress(o),this.setActions(a)}setProgress(e){e.infinite?this.progress.infinite():e.total&&(this.progress.total(e.total),e.worked&&this.progress.worked(e.worked))}setActions(e={primary:[],secondary:[]}){this._actions={primary:Array.isArray(e.primary)?e.primary:[],secondary:Array.isArray(e.secondary)?e.secondary:[]},this._expanded=e.primary&&e.primary.length>0}get canCollapse(){return!this.hasActions}get expanded(){return!!this._expanded}get severity(){return this._severity}get sticky(){if(this._sticky)return!0;const e=this.hasActions;return!!(e&&this._severity===Y.Error||!e&&this._expanded||this._progress&&!this._progress.state.done)}get priority(){return this._priority}get hasActions(){return!this._actions||!this._actions.primary?!1:this._actions.primary.length>0}get hasProgress(){return!!this._progress}get progress(){return this._progress||(this._progress=this._register(new xa),this._register(this._progress.onDidChange(()=>this._onDidChangeContent.fire({kind:Q.PROGRESS})))),this._progress}get message(){return this._message}get source(){return typeof this._source=="string"?this._source:this._source?this._source.label:void 0}get sourceId(){return this._source&&typeof this._source!="string"&&"id"in this._source?this._source.id:void 0}get actions(){return this._actions}get visible(){return this._visible}updateSeverity(e){e!==this._severity&&(this._severity=e,this._onDidChangeContent.fire({kind:Q.SEVERITY}))}updateMessage(e){const t=ye.parseNotificationMessage(e);!t||t.raw===this._message.raw||(this._message=t,this._onDidChangeContent.fire({kind:Q.MESSAGE}))}updateActions(e){this.setActions(e),this._onDidChangeContent.fire({kind:Q.ACTIONS})}updateVisibility(e){this._visible!==e&&(this._visible=e,this._onDidChangeVisibility.fire(e))}expand(){this._expanded||!this.canCollapse||(this._expanded=!0,this._onDidChangeExpansion.fire())}collapse(e){!this._expanded||!this.canCollapse||(this._expanded=!1,e||this._onDidChangeExpansion.fire())}toggle(){this._expanded?this.collapse():this.expand()}close(){this._onDidClose.fire(),this.dispose()}equals(e){if(this.hasProgress||e.hasProgress)return!1;if(typeof this.id=="string"||typeof e.id=="string")return this.id===e.id;if(typeof this._source=="object"){if(this._source.label!==e.source||this._source.id!==e.sourceId)return!1}else if(this._source!==e.source)return!1;if(this._message.raw!==e.message.raw)return!1;const t=this._actions&&this._actions.primary||[],i=e.actions&&e.actions.primary||[];return cn(t,i,(s,r)=>s.id+s.label===r.id+r.label)}};ye.MAX_MESSAGE_LENGTH=1e3;let xt=ye;class ii extends j{constructor(e,t){super(e,t.label,void 0,!0,async()=>{t.run(),this._onDidRun.fire()}),this._onDidRun=this._register(new I),this.onDidRun=this._onDidRun.event,this._keepOpen=!!t.keepOpen,this._menu=!t.isSecondary&&t.menu?t.menu.map((i,s)=>new ii(`${e}.${s}`,i)):void 0}get menu(){return this._menu}get keepOpen(){return this._keepOpen}}class ka{static create(e,t){if(!e||on(e))return;let i;if(e instanceof Error?i=Gt(e,!1):typeof e=="string"&&(i=e),!!i)return{message:i,options:t}}}const Hi="notifications.showList",kt="notifications.hideList",Ha="notifications.toggleList",Ri="notifications.hideToasts",Js="notifications.focusToasts",Fa="notifications.focusNextToast",Ga="notifications.focusPreviousToast",Wa="notifications.focusFirstToast",za="notifications.focusLastToast",Fi="notification.collapse",Gi="notification.expand",Qs="notification.acceptPrimaryAction",Ua="notification.toggle",Wi="notification.clear",si="notifications.clearAll",ni="notifications.toggleDoNotDisturbMode",ri="notifications.toggleDoNotDisturbModeBySource";function Ve(u,e){if(Di(e))return e;const t=u.lastFocusedList;if(t instanceof As){let i=t.getFocusedElements()[0];if(Di(i)||t.isDOMFocused()&&(i=t.element(0)),Di(i))return i}}function Ka(u,e,t){P.registerCommandAndKeybindingRule({id:Hi,weight:N.WorkbenchContrib,primary:Hn(ot.CtrlCmd|C.KeyK,ot.CtrlCmd|ot.Shift|C.KeyN),handler:()=>{e.hide(),u.show()}}),P.registerCommandAndKeybindingRule({id:kt,weight:N.WorkbenchContrib+50,when:Ni,primary:C.Escape,handler:()=>u.hide()}),Re.registerCommand(Ha,()=>{u.isVisible?u.hide():(e.hide(),u.show())}),P.registerCommandAndKeybindingRule({id:Wi,weight:N.WorkbenchContrib,when:se,primary:C.Delete,mac:{primary:ot.CtrlCmd|C.Backspace},handler:(s,r)=>{const n=s.get(mi),o=Ve(s.get(ct),r);o&&!o.hasProgress&&(o.close(),n.playSignal(pi.clear))}}),P.registerCommandAndKeybindingRule({id:Gi,weight:N.WorkbenchContrib,when:se,primary:C.RightArrow,handler:(s,r)=>{Ve(s.get(ct),r)?.expand()}}),P.registerCommandAndKeybindingRule({id:Qs,weight:N.WorkbenchContrib,when:at.or(se,pe),primary:ot.CtrlCmd|ot.Shift|C.KeyA,handler:s=>{const r=s.get(L).createInstance(Ht),n=Ve(s.get(ct))||t.notifications.at(0);if(!n)return;const o=n.actions?.primary?n.actions.primary.at(0):void 0;o&&(r.run(o,n),n.close(),r.dispose())}}),P.registerCommandAndKeybindingRule({id:Fi,weight:N.WorkbenchContrib,when:se,primary:C.LeftArrow,handler:(s,r)=>{Ve(s.get(ct),r)?.collapse()}}),P.registerCommandAndKeybindingRule({id:Ua,weight:N.WorkbenchContrib,when:se,primary:C.Space,secondary:[C.Enter],handler:s=>{Ve(s.get(ct))?.toggle()}}),Re.registerCommand(Ri,s=>{e.hide()}),P.registerKeybindingRule({id:Ri,weight:N.WorkbenchContrib-50,when:pe,primary:C.Escape}),P.registerKeybindingRule({id:Ri,weight:N.WorkbenchContrib+100,when:at.and(pe,se),primary:C.Escape}),Re.registerCommand(Js,()=>e.focus()),P.registerCommandAndKeybindingRule({id:Fa,weight:N.WorkbenchContrib,when:at.and(se,pe),primary:C.DownArrow,handler:()=>{e.focusNext()}}),P.registerCommandAndKeybindingRule({id:Ga,weight:N.WorkbenchContrib,when:at.and(se,pe),primary:C.UpArrow,handler:()=>{e.focusPrevious()}}),P.registerCommandAndKeybindingRule({id:Wa,weight:N.WorkbenchContrib,when:at.and(se,pe),primary:C.PageUp,secondary:[C.Home],handler:()=>{e.focusFirst()}}),P.registerCommandAndKeybindingRule({id:za,weight:N.WorkbenchContrib,when:at.and(se,pe),primary:C.PageDown,secondary:[C.End],handler:()=>{e.focusLast()}}),Re.registerCommand(si,()=>u.clearAll()),Re.registerCommand(ni,s=>{const r=s.get(Ae);r.setFilter(r.getFilter()===w.ERROR?w.OFF:w.ERROR)}),Re.registerCommand(ri,s=>{const r=s.get(Ae),n=s.get(hn),o=r.getFilters().sort((l,m)=>l.label.localeCompare(m.label)),a=new V,c=a.add(n.createQuickPick());c.items=o.map(l=>({id:l.id,label:l.label,tooltip:`${l.label} (${l.id})`,filter:l.filter})),c.canSelectMany=!0,c.placeholder=g(3394,"Select sources to enable all notifications from"),c.selectedItems=c.items.filter(l=>l.filter===w.OFF),c.show(),a.add(c.onDidAccept(async()=>{for(const l of c.items)r.setFilter({id:l.id,label:l.label,filter:c.selectedItems.includes(l)?w.OFF:w.ERROR});c.hide()})),a.add(c.onDidHide(()=>a.dispose()))});const i=le(3395,"Notifications");Te.appendMenuItem(B.CommandPalette,{command:{id:Hi,title:le(3396,"Show Notifications"),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:kt,title:le(3397,"Hide Notifications"),category:i},when:Ni}),Te.appendMenuItem(B.CommandPalette,{command:{id:si,title:le(3398,"Clear All Notifications"),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:Qs,title:le(3399,"Accept Notification Primary Action"),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:ni,title:le(3400,"Toggle Do Not Disturb Mode"),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:ri,title:le(3401,"Toggle Do Not Disturb Mode By Source..."),category:i}}),Te.appendMenuItem(B.CommandPalette,{command:{id:Js,title:le(3402,"Focus Notification Toast"),category:i},when:pe})}let Ht=class extends Ss{constructor(e,t){super(),this.telemetryService=e,this.notificationService=t}async runAction(e,t){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.id,from:"message"});try{await super.runAction(e,t)}catch(i){this.notificationService.error(i)}}};Ht=T([d(0,Cs),d(1,Ae)],Ht);const Ya=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));_e(Pn);const Xa=tt("notifications-clear",Z.close,g(3367,"Icon for the clear action in notifications.")),Za=tt("notifications-clear-all",Z.clearAll,g(3368,"Icon for the clear all action in notifications.")),$a=tt("notifications-hide",Z.chevronDown,g(3369,"Icon for the hide action in notifications.")),ja=tt("notifications-expand",Z.chevronUp,g(3370,"Icon for the expand action in notifications.")),qa=tt("notifications-collapse",Z.chevronDown,g(3371,"Icon for the collapse action in notifications.")),Ja=tt("notifications-configure",Z.gear,g(3372,"Icon for the configure action in notifications.")),Nn=tt("notifications-do-not-disturb",Z.bellSlash,g(3373,"Icon for the mute all action in notifications."));var Oe;let Dt=(Oe=class extends j{constructor(e,t,i){super(e,t,F.asClassName(Xa)),this.commandService=i}async run(e){this.commandService.executeCommand(Wi,e)}},Oe.ID=Wi,Oe.LABEL=g(3374,"Clear Notification"),Oe);Dt=T([d(2,ge)],Dt);var xe;let Rt=(xe=class extends j{constructor(e,t,i){super(e,t,F.asClassName(Za)),this.commandService=i}async run(){this.commandService.executeCommand(si)}},xe.ID=si,xe.LABEL=g(3375,"Clear All Notifications"),xe);Rt=T([d(2,ge)],Rt);var ke;let oi=(ke=class extends j{constructor(e,t,i){super(e,t,F.asClassName(Nn)),this.commandService=i}async run(){this.commandService.executeCommand(ni)}},ke.ID=ni,ke.LABEL=g(3376,"Toggle Do Not Disturb Mode"),ke);oi=T([d(2,ge)],oi);var He;let ai=(He=class extends j{constructor(e,t,i){super(e,t),this.commandService=i}async run(){this.commandService.executeCommand(ri)}},He.ID=ri,He.LABEL=g(3377,"Toggle Do Not Disturb Mode By Source..."),He);ai=T([d(2,ge)],ai);const fi=class fi extends j{constructor(e,t){super(e,t,F.asClassName(Nn))}};fi.ID="workbench.action.configureDoNotDisturbMode",fi.LABEL=g(3378,"Configure Do Not Disturb...");let dt=fi;var Fe;let Pt=(Fe=class extends j{constructor(e,t,i){super(e,t,F.asClassName($a)),this.commandService=i}async run(){this.commandService.executeCommand(kt)}},Fe.ID=kt,Fe.LABEL=g(3379,"Hide Notifications"),Fe);Pt=T([d(2,ge)],Pt);var Ge;let Nt=(Ge=class extends j{constructor(e,t,i){super(e,t,F.asClassName(ja)),this.commandService=i}async run(e){this.commandService.executeCommand(Gi,e)}},Ge.ID=Gi,Ge.LABEL=g(3380,"Expand Notification"),Ge);Nt=T([d(2,ge)],Nt);var We;let Vt=(We=class extends j{constructor(e,t,i){super(e,t,F.asClassName(qa)),this.commandService=i}async run(e){this.commandService.executeCommand(Fi,e)}},We.ID=Fi,We.LABEL=g(3381,"Collapse Notification"),We);Vt=T([d(2,ge)],Vt);const gi=class gi extends j{constructor(e,t,i){super(e,t,F.asClassName(Ja)),this.notification=i}};gi.ID="workbench.action.configureNotification",gi.LABEL=g(3382,"More Actions...");let pt=gi;var ze;let Bt=(ze=class extends j{constructor(e,t,i){super(e,t),this.clipboardService=i}run(e){return this.clipboardService.writeText(e.message.raw)}},ze.ID="workbench.action.copyNotificationMessage",ze.LABEL=g(3383,"Copy Text"),ze);Bt=T([d(2,Fn)],Bt);var zi,ue;const fe=class fe{constructor(e){this.offsetHelper=this.createOffsetHelper(e)}createOffsetHelper(e){return e.appendChild(S(".notification-offset-helper"))}getHeight(e){if(!e.expanded)return fe.ROW_HEIGHT;let t=fe.ROW_HEIGHT;const i=this.computePreferredHeight(e);if(fe.LINE_HEIGHT<i){const r=i-fe.LINE_HEIGHT;t+=r}return(e.source||Qt(e.actions&&e.actions.primary))&&(t+=fe.ROW_HEIGHT),t===fe.ROW_HEIGHT&&e.collapse(!0),t}computePreferredHeight(e){let t=0;e.hasProgress||t++,e.canCollapse&&t++,Qt(e.actions&&e.actions.secondary)&&t++,this.offsetHelper.style.width=`${450-(40+t*30-Math.max(t-1,0)*4)}px`;const i=Vn.render(e.message);this.offsetHelper.appendChild(i);const s=Math.max(this.offsetHelper.offsetHeight,this.offsetHelper.scrollHeight);return qe(this.offsetHelper),s}getTemplateId(e){if(e instanceof xt)return ci.TEMPLATE_ID;throw new Error("unknown element type: "+e)}};fe.ROW_HEIGHT=42,fe.LINE_HEIGHT=22;let Ui=fe;class Vn{static render(e,t){const i=S("span");for(const s of e.linkedText.nodes)if(typeof s=="string")i.appendChild(document.createTextNode(s));else{let r=s.title;!r&&s.href.startsWith("command:")?r=g(3424,"Click to execute command '{0}'",s.href.substr(8)):r||(r=s.href);const n=S("a",{href:s.href,title:r,tabIndex:0},s.label);if(t){const o=p=>{Kn(p)&&Se.stop(p,!0),t.callback(s.href)},a=t.toDispose.add(new Ti(n,$.CLICK)).event,c=t.toDispose.add(new Ti(n,$.KEY_DOWN)).event,l=oe.chain(c,p=>p.filter(b=>{const M=new dn(b);return M.equals(C.Space)||M.equals(C.Enter)}));t.toDispose.add(Is.addTarget(n));const m=t.toDispose.add(new Ti(n,Ts.Tap)).event;oe.any(a,m,l)(o,null,t.toDispose)}i.appendChild(n)}return i}}var Ue;let ci=(Ue=class{constructor(e,t,i,s){this.actionRunner=e,this.contextMenuService=t,this.instantiationService=i,this.notificationService=s}get templateId(){return zi.TEMPLATE_ID}renderTemplate(e){const t=Object.create(null);t.toDispose=new V,t.container=S(".notification-list-item"),t.mainRow=S(".notification-list-item-main-row"),t.icon=S(".notification-list-item-icon.codicon"),t.message=S(".notification-list-item-message");const i=this,s=S(".notification-list-item-toolbar-container");return t.toolbar=new Es(s,{ariaLabel:g(3425,"Notification Actions"),actionViewItemProvider:(r,n)=>{if(r instanceof pt)return t.toDispose.add(new ln(r,{getActions(){const o=[],a={id:r.notification.sourceId,label:r.notification.source};if(an(a)){const c=i.notificationService.getFilter(a)===w.ERROR;o.push(Jt({id:a.id,label:c?g(3426,"Turn On All Notifications from '{0}'",a.label):g(3427,"Turn Off Info and Warning Notifications from '{0}'",a.label),run:()=>i.notificationService.setFilter({...a,filter:c?w.OFF:w.ERROR})})),r.notification.actions?.secondary?.length&&o.push(new Lt)}return Array.isArray(r.notification.actions?.secondary)&&o.push(...r.notification.actions.secondary),o}},this.contextMenuService,{...n,actionRunner:this.actionRunner,classNames:r.class}))},actionRunner:this.actionRunner}),t.toDispose.add(t.toolbar),t.detailsRow=S(".notification-list-item-details-row"),t.source=S(".notification-list-item-source"),t.buttonsContainer=S(".notification-list-item-buttons-container"),e.appendChild(t.container),t.container.appendChild(t.detailsRow),t.detailsRow.appendChild(t.source),t.detailsRow.appendChild(t.buttonsContainer),t.container.appendChild(t.mainRow),t.mainRow.appendChild(t.icon),t.mainRow.appendChild(t.message),t.mainRow.appendChild(s),t.progress=new Gn(e,Wn),t.toDispose.add(t.progress),t.renderer=this.instantiationService.createInstance(Ki,t,this.actionRunner),t.toDispose.add(t.renderer),t}renderElement(e,t,i){i.renderer.setInput(e)}disposeTemplate(e){Mt(e.toDispose)}},zi=Ue,Ue.TEMPLATE_ID="notification",Ue);ci=zi=T([d(1,me),d(2,L),d(3,Ae)],ci);var Ke;let Ki=(Ke=class extends ee{constructor(e,t,i,s,r,n,o){super(),this.template=e,this.actionRunner=t,this.openerService=i,this.instantiationService=s,this.keybindingService=r,this.contextMenuService=n,this.hoverService=o,this.inputDisposables=this._register(new V),ue.closeNotificationAction||(ue.closeNotificationAction=s.createInstance(Dt,Dt.ID,Dt.LABEL),ue.expandNotificationAction=s.createInstance(Nt,Nt.ID,Nt.LABEL),ue.collapseNotificationAction=s.createInstance(Vt,Vt.ID,Vt.LABEL))}setInput(e){this.inputDisposables.clear(),this.render(e)}render(e){this.template.container.classList.toggle("expanded",e.expanded),this.inputDisposables.add(H(this.template.container,$.MOUSE_UP,r=>{r.button===1&&Se.stop(r,!0)})),this.inputDisposables.add(H(this.template.container,$.AUXCLICK,r=>{!e.hasProgress&&r.button===1&&(Se.stop(r,!0),e.close())})),this.renderSeverity(e);const t=this.inputDisposables.add(this.hoverService.setupManagedHover(Vi("mouse"),this.template.message,"")),i=this.renderMessage(e,t);this.renderSecondaryActions(e,i);const s=this.inputDisposables.add(this.hoverService.setupManagedHover(Vi("mouse"),this.template.source,""));this.renderSource(e,s),this.renderButtons(e),this.renderProgress(e),this.inputDisposables.add(e.onDidChangeContent(r=>{switch(r.kind){case Q.SEVERITY:this.renderSeverity(e);break;case Q.PROGRESS:this.renderProgress(e);break;case Q.MESSAGE:this.renderMessage(e,t);break}}))}renderSeverity(e){ue.SEVERITIES.forEach(t=>{e.severity!==t&&this.template.icon.classList.remove(...F.asClassNameArray(this.toSeverityIcon(t)))}),this.template.icon.classList.add(...F.asClassNameArray(this.toSeverityIcon(e.severity)))}renderMessage(e,t){qe(this.template.message),this.template.message.appendChild(Vn.render(e.message,{callback:s=>this.openerService.open(bi.parse(s),{allowCommands:!0}),toDispose:this.inputDisposables}));const i=e.canCollapse&&!e.expanded&&this.template.message.scrollWidth>this.template.message.clientWidth;return t.update(i?this.template.message.textContent+"":""),i}renderSecondaryActions(e,t){const i=[];if(Qt(e.actions?.secondary)){const r=this.instantiationService.createInstance(pt,pt.ID,pt.LABEL,e);i.push(r),this.inputDisposables.add(r)}let s=!1;e.canCollapse&&(e.expanded||e.source||t)&&(s=!0),s&&i.push(e.expanded?ue.collapseNotificationAction:ue.expandNotificationAction),e.hasProgress||i.push(ue.closeNotificationAction),this.template.toolbar.clear(),this.template.toolbar.context=e,i.forEach(r=>this.template.toolbar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)}))}renderSource(e,t){e.expanded&&e.source?(this.template.source.textContent=g(3428,"Source: {0}",e.source),t.update(e.source)):(this.template.source.textContent="",t.update(""))}renderButtons(e){qe(this.template.buttonsContainer);const t=e.actions?e.actions.primary:void 0;if(e.expanded&&Qt(t)){const i=this,s=this.inputDisposables.add(new class extends Ss{async runAction(n){i.actionRunner.run(n,e),(!(n instanceof ii)||!n.keepOpen)&&e.close()}}),r=this.inputDisposables.add(new zn(this.template.buttonsContainer));for(let n=0;n<t.length;n++){const o=t[n],a={title:!0,secondary:n>0,...Un},c=o instanceof ii?o.menu:void 0,l=this.inputDisposables.add(c?r.addButtonWithDropdown({...a,contextMenuProvider:this.contextMenuService,actions:c,actionRunner:s}):r.addButton(a));l.label=o.label,this.inputDisposables.add(l.onDidClick(m=>{m&&Se.stop(m,!0),s.run(o)}))}}}renderProgress(e){if(!e.hasProgress){this.template.progress.stop().hide();return}const t=e.progress.state;t.infinite?this.template.progress.infinite().show():typeof t.total=="number"||typeof t.worked=="number"?(typeof t.total=="number"&&!this.template.progress.hasTotal()&&this.template.progress.total(t.total),typeof t.worked=="number"&&this.template.progress.setWorked(t.worked).show()):this.template.progress.done().hide()}toSeverityIcon(e){switch(e){case Y.Warning:return Z.warning;case Y.Error:return Z.error}return Z.info}getKeybindingLabel(e){const t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}},ue=Ke,Ke.SEVERITIES=[Y.Info,Y.Warning,Y.Error],Ke);Ki=ue=T([d(2,Yn),d(3,L),d(4,it),d(5,me),d(6,ys)],Ki);_e(Ya);let hi=class extends ee{constructor(e,t,i,s){super(),this.container=e,this.options=t,this.instantiationService=i,this.contextMenuService=s,this.viewModel=[]}show(){this.isVisible||(this.list||this.createNotificationsList(),this.isVisible=!0)}createNotificationsList(){this.listContainer=S(".notifications-list-container");const e=this._register(this.instantiationService.createInstance(Ht)),t=this.instantiationService.createInstance(ci,e),i=this.listDelegate=new Ui(this.listContainer),s=this.options,r=this.list=this._register(this.instantiationService.createInstance(As,"NotificationsList",this.listContainer,i,[t],{...s,setRowLineHeight:!1,horizontalScrolling:!1,overrideStyles:{listBackground:un},accessibilityProvider:this.instantiationService.createInstance(Yi,s)})),n=this._register(this.instantiationService.createInstance(Bt,Bt.ID,Bt.LABEL));this._register(r.onContextMenu(a=>{a.element&&this.contextMenuService.showContextMenu({getAnchor:()=>a.anchor,getActions:()=>[n],getActionsContext:()=>a.element,actionRunner:e})})),this._register(r.onMouseDblClick(a=>a.element.toggle()));const o=this._register(Xn(r.getHTMLElement()));this._register(o.onDidBlur(()=>{z(this.listContainer).document.hasFocus()&&r.setFocus([])})),se.bindTo(r.contextKeyService),this._register(r.onDidChangeSelection(a=>{a.indexes.length>0&&r.setSelection([])})),this.container.appendChild(this.listContainer)}updateNotificationsList(e,t,i=[]){const[s,r]=vt(this.list,this.listContainer),n=Je(r),o=s.getFocus()[0],a=this.viewModel[o];let c=null;if(typeof o=="number"&&(c=s.getRelativeTop(o)),this.viewModel.splice(e,t,...i),s.splice(e,t,i),s.layout(),this.viewModel.length===0)this.hide();else if(typeof o=="number"){let l=0;if(a){let m=this.viewModel.indexOf(a);m===-1&&(m=o-1),m<this.viewModel.length&&m>=0&&(l=m)}typeof c=="number"&&s.reveal(l,c),s.setFocus([l])}this.isVisible&&n&&s.domFocus()}updateNotificationHeight(e){const t=this.viewModel.indexOf(e);if(t===-1)return;const[i,s]=vt(this.list,this.listDelegate);i.updateElementHeight(t,s.getHeight(e)),i.layout()}hide(){!this.isVisible||!this.list||(this.isVisible=!1,this.list.splice(0,this.viewModel.length),this.viewModel=[])}focusFirst(){this.list&&(this.list.focusFirst(),this.list.domFocus())}hasFocus(){return this.listContainer?Je(this.listContainer):!1}layout(e,t){this.listContainer&&this.list&&(this.listContainer.style.width=`${e}px`,typeof t=="number"&&(this.list.getHTMLElement().style.maxHeight=`${t}px`),this.list.layout())}dispose(){this.hide(),super.dispose()}};hi=T([d(2,L),d(3,me)],hi);let Yi=class{constructor(e,t,i){this._options=e,this._keybindingService=t,this._configurationService=i}getAriaLabel(e){let t;const i=this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAriaLabel();return this._configurationService.getValue("accessibility.verbosity.notification")&&(t=i?g(3403,"Inspect the response in the accessible view with {0}",i):g(3404,"Inspect the response in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding")),e.source?t?g(3407,"{0}, source: {1}, notification, {2}",e.message.raw,e.source,t):g(3408,"{0}, source: {1}, notification",e.message.raw,e.source):t?g(3405,"{0}, notification, {1}",e.message.raw,t):g(3406,"{0}, notification",e.message.raw)}getWidgetAriaLabel(){return this._options.widgetAriaLabel??g(3409,"Notifications List")}getRole(){return"dialog"}};Yi=T([d(1,it),d(2,Qe)],Yi);var ht;_e(Ma);_e(Pn);var we;let Xi=(we=class extends fn{constructor(e,t,i,s,r,n,o,a,c,l,m){super(i),this.container=e,this.model=t,this.instantiationService=s,this.layoutService=r,this.editorGroupService=o,this.keybindingService=a,this.notificationService=c,this.accessibilitySignalService=l,this.contextMenuService=m,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.notificationsCenterVisibleContextKey=Ni.bindTo(n),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(et.lift(e)))),this._register(this.notificationService.onDidChangeFilter(()=>this.onDidChangeFilter()))}onDidChangeFilter(){this.notificationService.getFilter()===w.ERROR&&this.hide()}get isVisible(){return!!this._isVisible}show(){if(this._isVisible){const i=re(this.notificationsList);i.show(),i.focusFirst();return}this.notificationsCenterContainer||this.create(),this.updateTitle();const[e,t]=vt(this.notificationsList,this.notificationsCenterContainer);this._isVisible=!0,t.classList.add("visible"),e.show(),this.layout(this.workbenchDimensions),e.updateNotificationsList(0,0,this.model.notifications),e.focusFirst(),this.updateStyles(),this.model.notifications.forEach(i=>i.updateVisibility(!0)),this.notificationsCenterVisibleContextKey.set(!0),this._onDidChangeVisibility.fire()}updateTitle(){const[e,t]=vt(this.notificationsCenterTitle,this.clearAllAction);this.model.notifications.length===0?(e.textContent=g(3387,"No new notifications"),t.enabled=!1):(e.textContent=g(3388,"Notifications"),t.enabled=this.model.notifications.some(i=>!i.hasProgress))}create(){this.notificationsCenterContainer=S(".notifications-center"),this.notificationsCenterHeader=S(".notifications-center-header"),this.notificationsCenterContainer.appendChild(this.notificationsCenterHeader),this.notificationsCenterTitle=S("span.notifications-center-header-title"),this.notificationsCenterHeader.appendChild(this.notificationsCenterTitle);const e=S(".notifications-center-header-toolbar");this.notificationsCenterHeader.appendChild(e);const t=this._register(this.instantiationService.createInstance(Ht)),i=this,s=this._register(new Es(e,{ariaLabel:g(3389,"Notification Center Actions"),actionRunner:t,actionViewItemProvider:(n,o)=>{if(n.id===dt.ID)return this._register(this.instantiationService.createInstance(ln,n,{getActions(){const a=[Jt({id:oi.ID,label:i.notificationService.getFilter()===w.OFF?g(3390,"Enable Do Not Disturb Mode"):g(3391,"Disable Do Not Disturb Mode"),run:()=>i.notificationService.setFilter(i.notificationService.getFilter()===w.OFF?w.ERROR:w.OFF)})],c=i.notificationService.getFilters().sort((l,m)=>l.label.localeCompare(m.label));for(const l of c.slice(0,ht.MAX_NOTIFICATION_SOURCES))a.length===1&&a.push(new Lt),a.push(Jt({id:`${oi.ID}.${l.id}`,label:l.label,checked:l.filter!==w.ERROR,run:()=>i.notificationService.setFilter({...l,filter:l.filter===w.ERROR?w.OFF:w.ERROR})}));return c.length>ht.MAX_NOTIFICATION_SOURCES&&(a.push(new Lt),a.push(i._register(i.instantiationService.createInstance(ai,ai.ID,g(3392,"More…"))))),a}},this.contextMenuService,{...o,actionRunner:t,classNames:n.class,keybindingProvider:a=>this.keybindingService.lookupKeybinding(a.id)}))}}));this.clearAllAction=this._register(this.instantiationService.createInstance(Rt,Rt.ID,Rt.LABEL)),s.push(this.clearAllAction,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(this.clearAllAction)}),this.configureDoNotDisturbAction=this._register(this.instantiationService.createInstance(dt,dt.ID,dt.LABEL)),s.push(this.configureDoNotDisturbAction,{icon:!0,label:!1});const r=this._register(this.instantiationService.createInstance(Pt,Pt.ID,Pt.LABEL));s.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)}),this.notificationsList=this.instantiationService.createInstance(hi,this.notificationsCenterContainer,{widgetAriaLabel:g(3393,"Notifications Center")}),this.container.appendChild(this.notificationsCenterContainer)}getKeybindingLabel(e){const t=this.keybindingService.lookupKeybinding(e.id);return t?t.getLabel():null}onDidChangeNotification(e){if(!this._isVisible)return;let t=!1;const[i,s]=vt(this.notificationsList,this.notificationsCenterContainer);switch(e.kind){case X.ADD:i.updateNotificationsList(e.index,0,[e.item]),e.item.updateVisibility(!0);break;case X.CHANGE:switch(e.detail){case Q.ACTIONS:i.updateNotificationsList(e.index,1,[e.item]);break;case Q.MESSAGE:e.item.expanded&&i.updateNotificationHeight(e.item);break}break;case X.EXPAND_COLLAPSE:i.updateNotificationsList(e.index,1,[e.item]);break;case X.REMOVE:t=Je(s),i.updateNotificationsList(e.index,1),e.item.updateVisibility(!1);break}this.updateTitle(),this.model.notifications.length===0&&(this.hide(),t&&this.editorGroupService.activeGroup.focus())}hide(){if(!this._isVisible||!this.notificationsCenterContainer||!this.notificationsList)return;const e=Je(this.notificationsCenterContainer);this._isVisible=!1,this.notificationsCenterContainer.classList.remove("visible"),this.notificationsList.hide(),this.model.notifications.forEach(t=>t.updateVisibility(!1)),this.notificationsCenterVisibleContextKey.set(!1),this._onDidChangeVisibility.fire(),e&&this.editorGroupService.activeGroup.focus()}updateStyles(){if(this.notificationsCenterContainer&&this.notificationsCenterHeader){const e=this.getColor(gn);this.notificationsCenterContainer.style.boxShadow=e?`0 0 8px 2px ${e}`:"";const t=this.getColor(Zn);this.notificationsCenterContainer.style.border=t?`1px solid ${t}`:"";const i=this.getColor($n);this.notificationsCenterHeader.style.color=i??"";const s=this.getColor(jn);this.notificationsCenterHeader.style.background=s??""}}layout(e){if(this.workbenchDimensions=e,this._isVisible&&this.notificationsCenterContainer){const t=ht.MAX_DIMENSIONS.width,i=ht.MAX_DIMENSIONS.height;let s=t,r=i;this.workbenchDimensions&&(s=this.workbenchDimensions.width,s-=16,r=this.workbenchDimensions.height-35,this.layoutService.isVisible(h.STATUSBAR_PART,A)&&(r-=22),this.layoutService.isVisible(h.TITLEBAR_PART,A)&&(r-=22),r-=24),re(this.notificationsList).layout(Math.min(t,s),Math.min(i,r))}}clearAll(){this.hide();for(const e of[...this.model.notifications])e.hasProgress||e.close(),this.accessibilitySignalService.playSignal(pi.clear)}},ht=we,we.MAX_DIMENSIONS=new et(450,400),we.MAX_NOTIFICATION_SOURCES=10,we);Xi=ht=T([d(2,ie),d(3,L),d(4,te),d(5,Ee),d(6,st),d(7,it),d(8,Ae),d(9,mi),d(10,me)],Xi);class Qa extends ee{constructor(e){super(),this.model=e;for(const t of e.notifications)this.triggerAriaAlert(t);this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}onDidChangeNotification(e){e.kind===X.ADD&&(this.triggerAriaAlert(e.item),e.item.severity===Y.Error&&(e.item.message.original instanceof Error?console.error(e.item.message.original):console.error(Gt(e.item.message.linkedText.toString(),!0))))}triggerAriaAlert(e){if(e.priority===be.SILENT)return;const t=e.onDidChangeContent(i=>{i.kind===Q.MESSAGE&&this.doTriggerAriaAlert(e)});oe.once(e.onDidClose)(()=>t.dispose()),this.doTriggerAriaAlert(e)}doTriggerAriaAlert(e){let t;e.severity===Y.Error?t=g(3384,"Error: {0}",e.message.linkedText.toString()):e.severity===Y.Warning?t=g(3385,"Warning: {0}",e.message.linkedText.toString()):t=g(3386,"Info: {0}",e.message.linkedText.toString()),qn(t)}}let Zi=class extends ee{constructor(e,t,i){super(),this.model=e,this.statusbarService=t,this.notificationService=i,this.newNotificationsCount=0,this.isNotificationsCenterVisible=!1,this.isNotificationsToastsVisible=!1,this.updateNotificationsCenterStatusItem(),e.statusMessage&&this.doSetStatusMessage(e.statusMessage),this.registerListeners()}registerListeners(){this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e))),this._register(this.model.onDidChangeStatusMessage(e=>this.onDidChangeStatusMessage(e))),this._register(this.notificationService.onDidChangeFilter(()=>this.updateNotificationsCenterStatusItem()))}onDidChangeNotification(e){this.isNotificationsCenterVisible||(e.kind===X.ADD?this.newNotificationsCount++:e.kind===X.REMOVE&&this.newNotificationsCount>0&&this.newNotificationsCount--),this.updateNotificationsCenterStatusItem()}updateNotificationsCenterStatusItem(){let e=0;if(!this.isNotificationsCenterVisible&&!this.isNotificationsToastsVisible)for(const i of this.model.notifications)i.hasProgress&&e++;let t={name:g(3410,"Notifications"),text:`${e>0||this.newNotificationsCount>0?"$(bell-dot)":"$(bell)"}`,ariaLabel:g(3410,"Notifications"),command:this.isNotificationsCenterVisible?kt:Hi,tooltip:this.getTooltip(e),showBeak:this.isNotificationsCenterVisible};this.notificationService.getFilter()===w.ERROR&&(t={...t,text:`${e>0||this.newNotificationsCount>0?"$(bell-slash-dot)":"$(bell-slash)"}`,ariaLabel:g(3411,"Do Not Disturb"),tooltip:g(3412,"Do Not Disturb Mode is Enabled")}),this.notificationsCenterStatusItem?this.notificationsCenterStatusItem.update(t):this.notificationsCenterStatusItem=this.statusbarService.addEntry(t,"status.notifications",K.RIGHT,Number.NEGATIVE_INFINITY)}getTooltip(e){return this.isNotificationsCenterVisible?g(3413,"Hide Notifications"):this.model.notifications.length===0?g(3414,"No Notifications"):e===0?this.newNotificationsCount===0?g(3415,"No New Notifications"):this.newNotificationsCount===1?g(3416,"1 New Notification"):g(3417,"{0} New Notifications",this.newNotificationsCount):this.newNotificationsCount===0?g(3418,"No New Notifications ({0} in progress)",e):this.newNotificationsCount===1?g(3419,"1 New Notification ({0} in progress)",e):g(3420,"{0} New Notifications ({1} in progress)",this.newNotificationsCount,e)}update(e,t){let i=!1;this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.newNotificationsCount=0,i=!0),this.isNotificationsToastsVisible!==t&&(this.isNotificationsToastsVisible=t,i=!0),i&&this.updateNotificationsCenterStatusItem()}onDidChangeStatusMessage(e){const t=e.item;switch(e.kind){case St.ADD:this.doSetStatusMessage(t);break;case St.REMOVE:this.currentStatusMessage&&this.currentStatusMessage[0]===t&&(Mt(this.currentStatusMessage[1]),this.currentStatusMessage=void 0);break}}doSetStatusMessage(e){const t=e.message,i=e.options&&typeof e.options.showAfter=="number"?e.options.showAfter:0,s=e.options&&typeof e.options.hideAfter=="number"?e.options.hideAfter:-1;this.currentStatusMessage&&Mt(this.currentStatusMessage[1]);let r,n=setTimeout(()=>{r=this.statusbarService.addEntry({name:g(3421,"Status Message"),text:t,ariaLabel:t},"status.message",K.LEFT,Number.NEGATIVE_INFINITY),n=void 0},i),o;const a={dispose:()=>{n&&clearTimeout(n),o&&clearTimeout(o),r?.dispose()}};s>0&&(o=setTimeout(()=>a.dispose(),s)),this.currentStatusMessage=[e,a]}};Zi=T([d(1,Ie),d(2,Ae)],Zi);const ec=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Pe;_e(ec);var he;(function(u){u[u.HIDDEN_OR_VISIBLE=0]="HIDDEN_OR_VISIBLE",u[u.HIDDEN=1]="HIDDEN",u[u.VISIBLE=2]="VISIBLE"})(he||(he={}));var de;let $i=(de=class extends fn{get isVisible(){return!!this._isVisible}constructor(e,t,i,s,r,n,o,a,c){super(r),this.container=e,this.model=t,this.instantiationService=i,this.layoutService=s,this.editorGroupService=n,this.lifecycleService=a,this.hostService=c,this._onDidChangeVisibility=this._register(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._isVisible=!1,this.mapNotificationToToast=new Map,this.mapNotificationToDisposable=new Map,this.addedToastsIntervalCounter=new Jn(Pe.SPAM_PROTECTION.interval),this.notificationsToastsVisibleContextKey=pe.bindTo(o),this.registerListeners()}registerListeners(){this._register(this.layoutService.onDidLayoutMainContainer(e=>this.layout(et.lift(e)))),this.lifecycleService.when(wt.Restored).then(()=>{this.model.notifications.forEach(e=>this.addToast(e)),this._register(this.model.onDidChangeNotification(e=>this.onDidChangeNotification(e)))}),this._register(this.model.onDidChangeFilter(({global:e,sources:t})=>{if(e===w.ERROR)this.hide();else if(t)for(const[i]of this.mapNotificationToToast)typeof i.sourceId=="string"&&t.get(i.sourceId)===w.ERROR&&i.severity!==Y.Error&&i.priority!==be.URGENT&&this.removeToast(i)}))}onDidChangeNotification(e){switch(e.kind){case X.ADD:return this.addToast(e.item);case X.REMOVE:return this.removeToast(e.item)}}addToast(e){if(this.isNotificationsCenterVisible||e.priority===be.SILENT)return;if(e.priority===be.OPTIONAL){const i=mn();if(Si(i)&&Qn(i)&&er(i,this.layoutService.mainContainer))return}if(this.addedToastsIntervalCounter.increment()>Pe.SPAM_PROTECTION.limit)return;const t=new V;this.mapNotificationToDisposable.set(e,t),t.add(tr(z(this.container),()=>this.doAddToast(e,t)))}doAddToast(e,t){let i=this.notificationsToastsContainer;i||(i=this.notificationsToastsContainer=S(".notifications-toasts"),this.container.appendChild(i)),i.classList.add("visible");const s=S(".notification-toast-container"),r=i.firstChild;r?i.insertBefore(s,r):i.appendChild(s);const n=S(".notification-toast");s.appendChild(n);const o=this.instantiationService.createInstance(hi,n,{verticalScrollMode:ir.Hidden,widgetAriaLabel:e.source?g(3423,"{0}, source: {1}, notification",e.message.raw,e.source):g(3422,"{0}, notification",e.message.raw)});t.add(o);const a={item:e,list:o,container:s,toast:n};this.mapNotificationToToast.set(e,a),t.add(Ce(()=>this.updateToastVisibility(a,!1))),o.show();const c=this.computeMaxDimensions();this.layoutLists(c.width),o.updateNotificationsList(0,0,[e]),this.layoutContainer(c.height),t.add(e.onDidChangeExpansion(()=>{o.updateNotificationsList(0,1,[e])})),t.add(e.onDidChangeContent(l=>{switch(l.kind){case Q.ACTIONS:o.updateNotificationsList(0,1,[e]);break;case Q.MESSAGE:e.expanded&&o.updateNotificationHeight(e);break}})),oe.once(e.onDidClose)(()=>{this.removeToast(e)}),this.purgeNotification(e,s,o,t),this.updateStyles(),this.notificationsToastsVisibleContextKey.set(!0),n.classList.add("notification-fade-in"),t.add(H(n,"transitionend",()=>{n.classList.remove("notification-fade-in"),n.classList.add("notification-fade-in-done")})),e.updateVisibility(!0),this._isVisible||(this._isVisible=!0,this._onDidChangeVisibility.fire())}purgeNotification(e,t,i,s){let r=!1;s.add(H(t,$.MOUSE_OVER,()=>r=!0)),s.add(H(t,$.MOUSE_OUT,()=>r=!1));let n,o;const a=()=>{n=setTimeout(()=>{this.hostService.hasFocus?e.sticky||i.hasFocus()||r?a():this.removeToast(e):o||(o=this.hostService.onDidChangeFocus(c=>{c&&a()}),s.add(o))},Pe.PURGE_TIMEOUT[e.severity])};a(),s.add(Ce(()=>clearTimeout(n)))}removeToast(e){let t=!1;const i=this.mapNotificationToToast.get(e);i&&(Je(i.container)&&(t=!(this.focusNext()||this.focusPrevious())),this.mapNotificationToToast.delete(e));const s=this.mapNotificationToDisposable.get(e);s&&(Mt(s),this.mapNotificationToDisposable.delete(e)),this.mapNotificationToToast.size>0?this.layout(this.workbenchDimensions):(this.doHide(),t&&this.editorGroupService.activeGroup.focus())}removeToasts(){this.mapNotificationToToast.clear(),this.mapNotificationToDisposable.forEach(e=>Mt(e)),this.mapNotificationToDisposable.clear(),this.doHide()}doHide(){this.notificationsToastsContainer?.classList.remove("visible"),this.notificationsToastsVisibleContextKey.set(!1),this._isVisible&&(this._isVisible=!1,this._onDidChangeVisibility.fire())}hide(){const e=this.notificationsToastsContainer?Je(this.notificationsToastsContainer):!1;this.removeToasts(),e&&this.editorGroupService.activeGroup.focus()}focus(){const e=this.getToasts(he.VISIBLE);return e.length>0?(e[0].list.focusFirst(),!0):!1}focusNext(){const e=this.getToasts(he.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){const s=e[t+1];if(s)return s.list.focusFirst(),!0;break}return!1}focusPrevious(){const e=this.getToasts(he.VISIBLE);for(let t=0;t<e.length;t++)if(e[t].list.hasFocus()){const s=e[t-1];if(s)return s.list.focusFirst(),!0;break}return!1}focusFirst(){const e=this.getToasts(he.VISIBLE)[0];return e?(e.list.focusFirst(),!0):!1}focusLast(){const e=this.getToasts(he.VISIBLE);return e.length>0?(e[e.length-1].list.focusFirst(),!0):!1}update(e){this.isNotificationsCenterVisible!==e&&(this.isNotificationsCenterVisible=e,this.isNotificationsCenterVisible&&this.removeToasts())}updateStyles(){this.mapNotificationToToast.forEach(({toast:e})=>{const t=this.getColor(un);e.style.background=t||"";const i=this.getColor(gn);e.style.boxShadow=i?`0 0 8px 2px ${i}`:"";const s=this.getColor(sr);e.style.border=s?`1px solid ${s}`:""})}getToasts(e){const t=[];return this.mapNotificationToToast.forEach(i=>{switch(e){case he.HIDDEN_OR_VISIBLE:t.push(i);break;case he.HIDDEN:this.isToastInDOM(i)||t.push(i);break;case he.VISIBLE:this.isToastInDOM(i)&&t.push(i);break}}),t.reverse()}layout(e){this.workbenchDimensions=e;const t=this.computeMaxDimensions();t.height&&this.layoutContainer(t.height),this.layoutLists(t.width)}computeMaxDimensions(){const e=Pe.MAX_WIDTH;let t=e,i;return this.workbenchDimensions&&(t=this.workbenchDimensions.width,t-=16,i=this.workbenchDimensions.height,this.layoutService.isVisible(h.STATUSBAR_PART,A)&&(i-=22),this.layoutService.isVisible(h.TITLEBAR_PART,A)&&(i-=22),i-=24),new et(Math.min(e,t),i??0)}layoutLists(e){this.mapNotificationToToast.forEach(({list:t})=>t.layout(e))}layoutContainer(e){let t=e,i=Math.round(e*.618),s=0;for(const r of this.getToasts(he.HIDDEN_OR_VISIBLE)){r.container.style.opacity="0",this.updateToastVisibility(r,!0),t-=r.container.offsetHeight,i-=r.container.offsetHeight;let n=!1;s===Pe.MAX_NOTIFICATIONS?n=!1:(s===0&&t>=0||s>0&&i>=0)&&(n=!0),this.updateToastVisibility(r,n),r.container.style.opacity="",n&&s++}}updateToastVisibility(e,t){if(this.isToastInDOM(e)===t)return;const i=re(this.notificationsToastsContainer);t?i.appendChild(e.container):e.container.remove(),e.item.updateVisibility(t)}isToastInDOM(e){return!!e.container.parentElement}},Pe=de,de.MAX_WIDTH=450,de.MAX_NOTIFICATIONS=3,de.PURGE_TIMEOUT={[Y.Info]:15e3,[Y.Warning]:18e3,[Y.Error]:2e4},de.SPAM_PROTECTION={interval:800,limit:de.MAX_NOTIFICATIONS},de);$i=Pe=T([d(2,L),d(3,te),d(4,ie),d(5,st),d(6,Ee),d(7,ei),d(8,At)],$i);var D;(function(u){u.SIDEBAR_HIDDEN="nosidebar",u.MAIN_EDITOR_AREA_HIDDEN="nomaineditorarea",u.PANEL_HIDDEN="nopanel",u.AUXILIARYBAR_HIDDEN="noauxiliarybar",u.STATUSBAR_HIDDEN="nostatusbar",u.FULLSCREEN="fullscreen",u.MAXIMIZED="maximized",u.WINDOW_BORDER="border"})(D||(D={}));const tc=["chat.commandCenter.enabled","workbench.navigationControl.enabled","workbench.experimental.share.enabled"],ic=[_.ACTIVITY_BAR_LOCATION,_.COMMAND_CENTER,...tc,_.EDITOR_ACTIONS_LOCATION,_.LAYOUT_ACTIONS,ws.MenuBarVisibility,ti.TITLE_BAR_STYLE,ti.CUSTOM_TITLE_BAR_VISIBILITY],en=new et(Hs.width,Hs.height);class sc extends ee{get activeContainer(){return this.getContainerFromDocument(pn())}get containers(){const e=[];for(const{window:t}of nr())e.push(this.getContainerFromDocument(t.document));return e}getContainerFromDocument(e){return e===this.mainContainer.ownerDocument?this.mainContainer:e.body.getElementsByClassName("monaco-workbench")[0]}whenContainerStylesLoaded(e){return this.containerStylesLoaded.get(e.vscodeWindowId)}get mainContainerDimension(){return this._mainContainerDimension}get activeContainerDimension(){return this.getContainerDimension(this.activeContainer)}getContainerDimension(e){return e===this.mainContainer?this.mainContainerDimension:yi(e)}get mainContainerOffset(){return this.computeContainerOffset(A)}get activeContainerOffset(){return this.computeContainerOffset(z(this.activeContainer))}computeContainerOffset(e){let t=0,i=0;this.isVisible(h.BANNER_PART)&&(t=this.getPart(h.BANNER_PART).maximumHeight,i=t);const s=this.isVisible(h.TITLEBAR_PART,e);return s&&(t+=this.getPart(h.TITLEBAR_PART).maximumHeight,i=t),s&&this.configurationService.getValue(_.COMMAND_CENTER)!==!1&&(i=6),{top:t,quickPickTop:i}}constructor(e){super(),this.parent=e,this._onDidChangeZenMode=this._register(new I),this.onDidChangeZenMode=this._onDidChangeZenMode.event,this._onDidChangeMainEditorCenteredLayout=this._register(new I),this.onDidChangeMainEditorCenteredLayout=this._onDidChangeMainEditorCenteredLayout.event,this._onDidChangePanelAlignment=this._register(new I),this.onDidChangePanelAlignment=this._onDidChangePanelAlignment.event,this._onDidChangeWindowMaximized=this._register(new I),this.onDidChangeWindowMaximized=this._onDidChangeWindowMaximized.event,this._onDidChangePanelPosition=this._register(new I),this.onDidChangePanelPosition=this._onDidChangePanelPosition.event,this._onDidChangePartVisibility=this._register(new I),this.onDidChangePartVisibility=this._onDidChangePartVisibility.event,this._onDidChangeNotificationsVisibility=this._register(new I),this.onDidChangeNotificationsVisibility=this._onDidChangeNotificationsVisibility.event,this._onDidLayoutMainContainer=this._register(new I),this.onDidLayoutMainContainer=this._onDidLayoutMainContainer.event,this._onDidLayoutActiveContainer=this._register(new I),this.onDidLayoutActiveContainer=this._onDidLayoutActiveContainer.event,this._onDidLayoutContainer=this._register(new I),this.onDidLayoutContainer=this._onDidLayoutContainer.event,this._onDidAddContainer=this._register(new I),this.onDidAddContainer=this._onDidAddContainer.event,this._onDidChangeActiveContainer=this._register(new I),this.onDidChangeActiveContainer=this._onDidChangeActiveContainer.event,this.mainContainer=document.createElement("div"),this.containerStylesLoaded=new Map,this.parts=new Map,this.initialized=!1,this.disposed=!1,this._openedDefaultEditors=!1,this.whenReadyPromise=new Vs,this.whenReady=this.whenReadyPromise.p,this.whenRestoredPromise=new Vs,this.whenRestored=this.whenRestoredPromise.p,this.restored=!1,rr(e)}initLayout(e){this.environmentService=e.get(Wt),this.configurationService=e.get(Qe),this.hostService=e.get(At),this.contextService=e.get(Ai),this.storageService=e.get(ae),this.workingCopyBackupService=e.get(or),this.themeService=e.get(ie),this.extensionService=e.get(ar),this.logService=e.get(bn),this.telemetryService=e.get(Cs),this.auxiliaryWindowService=e.get(cr),this.editorService=e.get(Ct),this.editorGroupService=e.get(st),this.mainPartEditorService=this.editorService.createScoped(this.editorGroupService.mainPart,this._store),this.paneCompositeService=e.get(hr),this.viewDescriptorService=e.get(lr),this.titleService=e.get(vs),this.notificationService=e.get(Ae),this.statusBarService=e.get(Ie),e.get(nt),this.registerLayoutListeners(),this.initLayoutState(e.get(ei),e.get(dr))}registerLayoutListeners(){const e=()=>{this.isVisible(h.EDITOR_PART,A)||this.toggleMaximizedPanel()};this.editorGroupService.whenRestored.then(()=>{this._register(this.mainPartEditorService.onDidVisibleEditorsChange(e)),this._register(this.editorGroupService.mainPart.onDidActivateGroup(e)),this._register(this.mainPartEditorService.onDidActiveEditorChange(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED))))}),this._register(this.configurationService.onDidChangeConfiguration(i=>{if([...ic,q.SIDEBAR_POSITION,q.STATUSBAR_VISIBLE].some(s=>i.affectsConfiguration(s))){const s=i.affectsConfiguration("workbench.experimental.share.enabled")&&this.configurationService.getValue("workbench.experimental.share.enabled"),r=i.affectsConfiguration("workbench.navigationControl.enabled")&&this.configurationService.getValue("workbench.navigationControl.enabled");if((s||r)&&this.configurationService.getValue(_.COMMAND_CENTER)===!1){this.configurationService.updateValue(_.COMMAND_CENTER,!0);return}const n=i.affectsConfiguration(_.EDITOR_ACTIONS_LOCATION)&&this.configurationService.getValue(_.EDITOR_ACTIONS_LOCATION)===Bi.TITLEBAR,o=i.affectsConfiguration(_.COMMAND_CENTER)&&this.configurationService.getValue(_.COMMAND_CENTER),a=i.affectsConfiguration(_.LAYOUT_ACTIONS)&&this.configurationService.getValue(_.LAYOUT_ACTIONS);if((i.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)&&[ve.TOP,ve.BOTTOM].includes(this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION))||n||o||a)&&this.configurationService.getValue(ti.CUSTOM_TITLE_BAR_VISIBILITY)===Bs.NEVER){this.configurationService.updateValue(ti.CUSTOM_TITLE_BAR_VISIBILITY,Bs.AUTO);return}this.doUpdateLayoutConfiguration()}})),this._register(ur(i=>this.onFullscreenChanged(i))),this._register(this.editorGroupService.mainPart.onDidAddGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidRemoveGroup(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)))),this._register(this.editorGroupService.mainPart.onDidChangeGroupMaximized(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)))),this._register(H(this.mainContainer,$.SCROLL,()=>this.mainContainer.scrollTop=0)),(gt||Ot||ne)&&!_t(this.configurationService)&&this._register(this.titleService.onMenubarVisibilityChange(i=>this.onMenubarToggled(i))),this._register(this.themeService.onDidColorThemeChange(()=>this.updateWindowsBorder())),this._register(this.hostService.onDidChangeFocus(i=>this.onWindowFocusChanged(i))),this._register(this.hostService.onDidChangeActiveWindow(()=>this.onActiveWindowChanged())),ne&&typeof navigator.windowControlsOverlay=="object"&&this._register(H(navigator.windowControlsOverlay,"geometrychange",()=>this.onDidChangeWCO())),this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({window:i,disposables:s})=>{const r=i.window.vscodeWindowId;this.containerStylesLoaded.set(r,i.whenStylesHaveLoaded),i.whenStylesHaveLoaded.then(()=>this.containerStylesLoaded.delete(r)),s.add(Ce(()=>this.containerStylesLoaded.delete(r)));const n=s.add(new V);this._onDidAddContainer.fire({container:i.container,disposables:n}),s.add(i.onDidLayout(o=>this.handleContainerDidLayout(i.container,o)))}))}onMenubarToggled(e){if(e!==this.state.runtime.menuBar.toggled){this.state.runtime.menuBar.toggled=e;const t=Li(this.configurationService);ne&&t==="toggle"?this.workbenchGrid.setViewVisible(this.titleBarPartView,De(this.configurationService,A,this.state.runtime.menuBar.toggled)):this.state.runtime.mainWindowFullscreen&&(t==="toggle"||t==="classic")&&this.workbenchGrid.setViewVisible(this.titleBarPartView,De(this.configurationService,A,this.state.runtime.menuBar.toggled)),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}}handleContainerDidLayout(e,t){e===this.mainContainer&&this._onDidLayoutMainContainer.fire(t),Sn(e)&&this._onDidLayoutActiveContainer.fire(t),this._onDidLayoutContainer.fire({container:e,dimension:t})}onFullscreenChanged(e){e===A.vscodeWindowId&&(this.state.runtime.mainWindowFullscreen=Ls(A),this.state.runtime.mainWindowFullscreen?this.mainContainer.classList.add(D.FULLSCREEN):(this.mainContainer.classList.remove(D.FULLSCREEN),this.stateModel.getRuntimeValue(f.ZEN_MODE_EXIT_INFO).transitionedToFullScreen&&this.isZenModeActive()&&this.toggleZenMode()),this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen,this.workbenchGrid.setViewVisible(this.titleBarPartView,De(this.configurationService,A,this.state.runtime.menuBar.toggled)),this.updateWindowsBorder(!0))}onActiveWindowChanged(){const e=this.getActiveContainerId();this.state.runtime.activeContainerId!==e&&(this.state.runtime.activeContainerId=e,this.updateWindowsBorder(),this._onDidChangeActiveContainer.fire())}onWindowFocusChanged(e){this.state.runtime.hasFocus!==e&&(this.state.runtime.hasFocus=e,this.updateWindowsBorder())}getActiveContainerId(){const e=this.activeContainer;return z(e).vscodeWindowId}doUpdateLayoutConfiguration(e){this.updateCustomTitleBarVisibility(),this.updateMenubarVisibility(!!e),this.editorGroupService.whenRestored.then(()=>this.centerMainEditorLayout(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED),e))}setSideBarPosition(e){const t=this.getPart(h.ACTIVITYBAR_PART),i=this.getPart(h.SIDEBAR_PART),s=this.getPart(h.AUXILIARYBAR_PART),r=e===v.LEFT?"left":"right",n=e===v.RIGHT?"left":"right",o=this.getPanelAlignment(),a=this.getPanelPosition();this.stateModel.setRuntimeValue(f.SIDEBAR_POSITON,e);const c=re(t.getContainer()),l=re(i.getContainer()),m=re(s.getContainer());c.classList.remove(n),l.classList.remove(n),c.classList.add(r),l.classList.add(r),m.classList.remove(r),m.classList.add(n),t.updateStyles(),i.updateStyles(),s.updateStyles(),this.adjustPartPositions(e,o,a)}updateWindowsBorder(e=!1){if(ne||gt||(gt||Ot)&&fr(this.configurationService)||_t(this.configurationService))return;const t=this.themeService.getColorTheme(),i=t.getColor(gr),s=t.getColor(mr),r=this.hasMainWindowBorder();for(const n of this.containers){const o=n===this.mainContainer,a=this.activeContainer===n;let c=!1;if(!this.state.runtime.mainWindowFullscreen&&(i||s)){c=!0;const l=a&&this.state.runtime.hasFocus?i:s??i;n.style.setProperty("--window-border-color",l?.toString()??"transparent")}o&&(this.state.runtime.mainWindowBorder=c),n.classList.toggle(D.WINDOW_BORDER,c)}!e&&r!==this.hasMainWindowBorder()&&this.layout()}initLayoutState(e,t){this._mainContainerDimension=yi(this.parent,en),this.stateModel=new ji(this.storageService,this.configurationService,this.contextService),this.stateModel.load(this._mainContainerDimension),this.stateModel.getRuntimeValue(f.PANEL_HIDDEN)&&this.stateModel.getRuntimeValue(f.EDITOR_HIDDEN)&&this.stateModel.setRuntimeValue(f.EDITOR_HIDDEN,!1),this._register(this.stateModel.onDidChangeState(n=>{n.key===f.ACTIVITYBAR_HIDDEN&&this.setActivityBarHidden(n.value),n.key===f.STATUSBAR_HIDDEN&&this.setStatusBarHidden(n.value),n.key===f.SIDEBAR_POSITON&&this.setSideBarPosition(n.value),n.key===f.PANEL_POSITION&&this.setPanelPosition(n.value),n.key===f.PANEL_ALIGNMENT&&this.setPanelAlignment(n.value),this.doUpdateLayoutConfiguration()}));const i=this.getInitialEditorsState();i&&this.logService.trace("Initial editor state",i);const s={layout:{editors:i?.layout},editor:{restoreEditors:this.shouldRestoreEditors(this.contextService,i),editorsToOpen:this.resolveEditorsToOpen(t,i)},views:{defaults:this.getDefaultLayoutViews(this.environmentService,this.storageService),containerToRestore:{}}},r={activeContainerId:this.getActiveContainerId(),mainWindowFullscreen:Ls(A),hasFocus:this.hostService.hasFocus,maximized:new Set,mainWindowBorder:!1,menuBar:{toggled:!1},zenMode:{transitionDisposables:new pr}};if(this.state={initialization:s,runtime:r},this.isVisible(h.SIDEBAR_PART)){let n;!this.environmentService.isBuilt||e.startupKind===br.ReloadedWindow||this.environmentService.isExtensionDevelopment&&!this.environmentService.extensionTestsLocationURI?n=this.storageService.get(wa.activeViewletSettingsKey,E.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(y.Sidebar)?.id):n=this.viewDescriptorService.getDefaultViewContainer(y.Sidebar)?.id,n?this.state.initialization.views.containerToRestore.sideBar=n:this.stateModel.setRuntimeValue(f.SIDEBAR_HIDDEN,!0)}if(this.isVisible(h.PANEL_PART)){const n=this.storageService.get(_a.activePanelSettingsKey,E.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(y.Panel)?.id);n?this.state.initialization.views.containerToRestore.panel=n:this.stateModel.setRuntimeValue(f.PANEL_HIDDEN,!0)}if(this.isVisible(h.AUXILIARYBAR_PART)){const n=this.storageService.get(Da.activeViewSettingsKey,E.WORKSPACE,this.viewDescriptorService.getDefaultViewContainer(y.AuxiliaryBar)?.id);n?this.state.initialization.views.containerToRestore.auxiliaryBar=n:this.stateModel.setRuntimeValue(f.AUXILIARYBAR_HIDDEN,!0)}this.updateWindowsBorder(!0)}getDefaultLayoutViews(e,t){const i=e.options?.defaultLayout;if(!i||!i.force&&!t.isNew(E.WORKSPACE))return;const{views:s}=i;if(s?.length)return s.map(r=>r.id)}shouldRestoreEditors(e,t){return Sr(e.getWorkspace())?!1:!!(this.configurationService.getValue("window.restoreWindows")==="preserve")||t===void 0}willRestoreEditors(){return this.state.initialization.editor.restoreEditors}async resolveEditorsToOpen(e,t){if(t){const i=yt(await vi(t.filesToMerge,e,this.logService));if(i.length===4&&zt(i[0])&&zt(i[1])&&zt(i[2])&&zt(i[3]))return[{editor:{input1:{resource:i[0].resource},input2:{resource:i[1].resource},base:{resource:i[2].resource},result:{resource:i[3].resource},options:{pinned:!0}}}];const s=yt(await vi(t.filesToDiff,e,this.logService));if(s.length===2)return[{editor:{original:{resource:s[0].resource},modified:{resource:s[1].resource},options:{pinned:!0}}}];const r=[],n=await vi(t.filesToOpenOrCreate,e,this.logService);for(let o=0;o<n.length;o++){const a=n[o];a&&r.push({editor:a,viewColumn:t.filesToOpenOrCreate?.[o].viewColumn})}return r}else if(this.contextService.getWorkbenchState()===mt.EMPTY&&this.configurationService.getValue("workbench.startupEditor")==="newUntitledFile")return this.editorGroupService.hasRestorableState?[]:await this.workingCopyBackupService.hasBackups()?[]:[{editor:{resource:void 0}}];return[]}get openedDefaultEditors(){return this._openedDefaultEditors}getInitialEditorsState(){const e=this.environmentService.options?.defaultLayout;if((e?.editors?.length||e?.layout?.editors)&&(e.force||this.storageService.isNew(E.WORKSPACE)))return this._openedDefaultEditors=!0,{layout:e.layout?.editors,filesToOpenOrCreate:e?.editors?.map(r=>({viewColumn:r.viewColumn,fileUri:bi.revive(r.uri),openOnlyIfExists:r.openOnlyIfExists,options:r.options}))};const{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}=this.environmentService;if(t||i||s)return{filesToOpenOrCreate:t,filesToDiff:i,filesToMerge:s}}isRestored(){return this.restored}restoreParts(){const e=[],t=[];e.push((async()=>{O("code/willRestoreEditors"),await this.editorGroupService.whenReady,O("code/restoreEditors/editorGroupsReady"),this.state.initialization.layout?.editors&&this.editorGroupService.mainPart.applyLayout(this.state.initialization.layout.editors);const n=await this.state.initialization.editor.editorsToOpen;O("code/restoreEditors/editorsToOpenResolved");let o;if(n.length){const a=this.editorGroupService.mainPart.getGroups(Ar.GRID_APPEARANCE),c=new Map;for(const l of n){const m=a[(l.viewColumn??1)-1];let p=c.get(m.id);p||(p=new Set,c.set(m.id,p)),p.add(l.editor)}o=Promise.all(Array.from(c).map(async([l,m])=>{try{await this.editorService.openEditors(Array.from(m),l,{validateTrust:!0})}catch(p){this.logService.error(p)}}))}t.push(Promise.all([o?.finally(()=>O("code/restoreEditors/editorsOpened")),this.editorGroupService.whenRestored.finally(()=>O("code/restoreEditors/editorGroupsRestored"))]).finally(()=>{O("code/didRestoreEditors")}))})());const i=(async()=>{if(this.state.initialization.views.defaults?.length){O("code/willOpenDefaultViews");const n=[],o=l=>{const m=this.viewDescriptorService.getViewLocationById(l.id);if(m!==null){const p=this.viewDescriptorService.getViewContainerByViewId(l.id);if(p){l.order>=(n?.[m]?.order??0)&&(n[m]={id:p.id,order:l.order});const b=this.viewDescriptorService.getViewContainerModel(p);return b.setCollapsed(l.id,!1),b.setVisible(l.id,!0),!0}}return!1},a=[...this.state.initialization.views.defaults].reverse().map((l,m)=>({id:l,order:m}));let c=a.length;for(;c;)c--,o(a[c])&&a.splice(c,1);if(a.length){await this.extensionService.whenInstalledExtensionsRegistered();let l=a.length;for(;l;)l--,o(a[l])&&a.splice(l,1)}n[y.Sidebar]&&(this.state.initialization.views.containerToRestore.sideBar=n[y.Sidebar].id),n[y.Panel]&&(this.state.initialization.views.containerToRestore.panel=n[y.Panel].id),n[y.AuxiliaryBar]&&(this.state.initialization.views.containerToRestore.auxiliaryBar=n[y.AuxiliaryBar].id),O("code/didOpenDefaultViews")}})();e.push(i),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.sideBar&&(O("code/willRestoreViewlet"),await this.openViewContainer(y.Sidebar,this.state.initialization.views.containerToRestore.sideBar),O("code/didRestoreViewlet"))})()),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.panel&&(O("code/willRestorePanel"),await this.openViewContainer(y.Panel,this.state.initialization.views.containerToRestore.panel),O("code/didRestorePanel"))})()),e.push((async()=>{await i,this.state.initialization.views.containerToRestore.auxiliaryBar&&(O("code/willRestoreAuxiliaryBar"),await this.openViewContainer(y.AuxiliaryBar,this.state.initialization.views.containerToRestore.auxiliaryBar),O("code/didRestoreAuxiliaryBar"))})());const s=this.isZenModeActive(),r=tn(this.configurationService).restore;s&&(this.setZenModeActive(!r),this.toggleZenMode(!1,!0)),this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)&&this.centerMainEditorLayout(!0,!0),Ms.settled(e).finally(()=>{this.whenReadyPromise.complete(),Ms.settled(t).finally(()=>{this.restored=!0,this.whenRestoredPromise.complete()})})}async openViewContainer(e,t,i){let s=await this.paneCompositeService.openPaneComposite(t,e,i);s||(s=await this.paneCompositeService.openPaneComposite(this.viewDescriptorService.getDefaultViewContainer(e)?.id,e,i),!s&&await this.paneCompositeService.openPaneComposite(this.paneCompositeService.getVisiblePaneCompositeIds(e).at(0),e,i))}registerPart(e){const t=e.getId();return this.parts.set(t,e),Ce(()=>this.parts.delete(t))}getPart(e){const t=this.parts.get(e);if(!t)throw new Error(`Unknown part ${e}`);return t}registerNotifications(e){this._register(e.onDidChangeNotificationsVisibility(t=>this._onDidChangeNotificationsVisibility.fire(t)))}hasFocus(e){const t=this.getContainer(Ut(),e);if(!t)return!1;const i=mn();return i?Cr(i,t):!1}_getFocusedPart(){for(const e of this.parts.keys())if(this.hasFocus(e))return e}focusPart(e,t=A){const i=this.getContainer(t,e)??this.mainContainer;switch(e){case h.EDITOR_PART:this.editorGroupService.getPart(i).activeGroup.focus();break;case h.PANEL_PART:{this.paneCompositeService.getActivePaneComposite(y.Panel)?.focus();break}case h.SIDEBAR_PART:{this.paneCompositeService.getActivePaneComposite(y.Sidebar)?.focus();break}case h.AUXILIARYBAR_PART:{this.paneCompositeService.getActivePaneComposite(y.AuxiliaryBar)?.focus();break}case h.ACTIVITYBAR_PART:this.getPart(h.SIDEBAR_PART).focusActivityBar();break;case h.STATUSBAR_PART:this.statusBarService.getPart(i).focus();break;default:i?.focus()}}getContainer(e,t){if(typeof t>"u")return this.getContainerFromDocument(e.document);if(e===A)return this.getPart(t).getContainer();let i;if(t===h.EDITOR_PART?i=this.editorGroupService.getPart(this.getContainerFromDocument(e.document)):t===h.STATUSBAR_PART?i=this.statusBarService.getPart(this.getContainerFromDocument(e.document)):t===h.TITLEBAR_PART&&(i=this.titleService.getPart(this.getContainerFromDocument(e.document))),i instanceof Ci)return i.getContainer()}isVisible(e,t=A){if(t!==A&&e===h.EDITOR_PART)return!0;switch(e){case h.TITLEBAR_PART:return this.initialized?this.workbenchGrid.isViewVisible(this.titleBarPartView):De(this.configurationService,A,this.state.runtime.menuBar.toggled);case h.SIDEBAR_PART:return!this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN);case h.PANEL_PART:return!this.stateModel.getRuntimeValue(f.PANEL_HIDDEN);case h.AUXILIARYBAR_PART:return!this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN);case h.STATUSBAR_PART:return!this.stateModel.getRuntimeValue(f.STATUSBAR_HIDDEN);case h.ACTIVITYBAR_PART:return!this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN);case h.EDITOR_PART:return!this.stateModel.getRuntimeValue(f.EDITOR_HIDDEN);case h.BANNER_PART:return this.initialized?this.workbenchGrid.isViewVisible(this.bannerPartView):!1;default:return!1}}shouldShowBannerFirst(){return ne&&!Mi()}focus(){this.isPanelMaximized()&&this.mainContainer===this.activeContainer?this.focusPart(h.PANEL_PART):this.focusPart(h.EDITOR_PART,z(this.activeContainer))}focusPanelOrEditor(){const e=this.paneCompositeService.getActivePaneComposite(y.Panel);(this.hasFocus(h.PANEL_PART)||!this.isVisible(h.EDITOR_PART))&&e?e.focus():this.focus()}getMaximumEditorDimensions(e){const t=z(e),i=this.getContainerDimension(e);if(e===this.mainContainer){const s=x(this.getPanelPosition()),r=(this.isVisible(h.ACTIVITYBAR_PART)?this.activityBarPartView.minimumWidth:0)+(this.isVisible(h.SIDEBAR_PART)?this.sideBarPartView.minimumWidth:0)+(this.isVisible(h.PANEL_PART)&&!s?this.panelPartView.minimumWidth:0)+(this.isVisible(h.AUXILIARYBAR_PART)?this.auxiliaryBarPartView.minimumWidth:0),n=(this.isVisible(h.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(h.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0)+(this.isVisible(h.PANEL_PART)&&s?this.panelPartView.minimumHeight:0),o=i.width-r,a=i.height-n;return{width:o,height:a}}else{const s=(this.isVisible(h.TITLEBAR_PART,t)?this.titleBarPartView.minimumHeight:0)+(this.isVisible(h.STATUSBAR_PART,t)?this.statusBarPartView.minimumHeight:0);return{width:i.width,height:i.height-s}}}isZenModeActive(){return this.stateModel.getRuntimeValue(f.ZEN_MODE_ACTIVE)}setZenModeActive(e){this.stateModel.setRuntimeValue(f.ZEN_MODE_ACTIVE,e)}toggleZenMode(e,t=!1){const i=this._getFocusedPart();this.setZenModeActive(!this.isZenModeActive()),this.state.runtime.zenMode.transitionDisposables.clearAndDisposeAll();const s=a=>{for(const c of this.mainPartEditorService.visibleTextEditorControls){if(!a&&Rr(c)&&c.hasModel()){const l=c.getModel();a=this.configurationService.getValue("editor.lineNumbers",{resource:l.uri,overrideIdentifier:l.getLanguageId()})}a||(a=this.configurationService.getValue("editor.lineNumbers")),c.updateOptions({lineNumbers:a})}};let r=!1;const n=tn(this.configurationService),o=this.stateModel.getRuntimeValue(f.ZEN_MODE_EXIT_INFO);this.isZenModeActive()?(r=!this.state.runtime.mainWindowFullscreen&&n.fullScreen&&!Os,t||(o.transitionedToFullScreen=r,o.transitionedToCenteredEditorLayout=!this.isMainEditorLayoutCentered()&&n.centerLayout,o.handleNotificationsDoNotDisturbMode=this.notificationService.getFilter()===w.OFF,o.wasVisible.sideBar=this.isVisible(h.SIDEBAR_PART),o.wasVisible.panel=this.isVisible(h.PANEL_PART),o.wasVisible.auxiliaryBar=this.isVisible(h.AUXILIARYBAR_PART),this.stateModel.setRuntimeValue(f.ZEN_MODE_EXIT_INFO,o)),this.setPanelHidden(!0,!0),this.setAuxiliaryBarHidden(!0,!0),this.setSideBarHidden(!0),n.hideActivityBar&&this.setActivityBarHidden(!0),n.hideStatusBar&&this.setStatusBarHidden(!0),n.hideLineNumbers&&(s("off"),this.state.runtime.zenMode.transitionDisposables.set(W.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s("off")))),n.showTabs!==this.editorGroupService.partOptions.showTabs&&this.state.runtime.zenMode.transitionDisposables.set(W.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:n.showTabs})),n.silentNotifications&&o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(w.ERROR),n.centerLayout&&this.centerMainEditorLayout(!0,!0),this.state.runtime.zenMode.transitionDisposables.set("configurationChange",this.configurationService.onDidChangeConfiguration(a=>{if(a.affectsConfiguration(W.HIDE_ACTIVITYBAR)||a.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)){const c=this.configurationService.getValue(W.HIDE_ACTIVITYBAR),l=this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION);this.setActivityBarHidden(c?!0:l===ve.TOP||l===ve.BOTTOM)}if(a.affectsConfiguration(W.HIDE_STATUSBAR)){const c=this.configurationService.getValue(W.HIDE_STATUSBAR);this.setStatusBarHidden(c)}if(a.affectsConfiguration(W.CENTER_LAYOUT)){const c=this.configurationService.getValue(W.CENTER_LAYOUT);this.centerMainEditorLayout(c,!0)}if(a.affectsConfiguration(W.SHOW_TABS)){const c=this.configurationService.getValue(W.SHOW_TABS)??"multiple";this.state.runtime.zenMode.transitionDisposables.set(W.SHOW_TABS,this.editorGroupService.mainPart.enforcePartOptions({showTabs:c}))}if(a.affectsConfiguration(W.SILENT_NOTIFICATIONS)){const c=!!this.configurationService.getValue(W.SILENT_NOTIFICATIONS);o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(c?w.ERROR:w.OFF)}if(a.affectsConfiguration(W.HIDE_LINENUMBERS)){const c=this.configurationService.getValue(W.HIDE_LINENUMBERS)?"off":void 0;s(c),this.state.runtime.zenMode.transitionDisposables.set(W.HIDE_LINENUMBERS,this.mainPartEditorService.onDidVisibleEditorsChange(()=>s(c)))}}))):(o.wasVisible.panel&&this.setPanelHidden(!1,!0),o.wasVisible.auxiliaryBar&&this.setAuxiliaryBarHidden(!1,!0),o.wasVisible.sideBar&&this.setSideBarHidden(!1),this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN,!0)||this.setActivityBarHidden(!1),this.stateModel.getRuntimeValue(f.STATUSBAR_HIDDEN,!0)||this.setStatusBarHidden(!1),o.transitionedToCenteredEditorLayout&&this.centerMainEditorLayout(!1,!0),o.handleNotificationsDoNotDisturbMode&&this.notificationService.setFilter(w.OFF),s(),r=o.transitionedToFullScreen&&this.state.runtime.mainWindowFullscreen),e||this.layout(),r&&this.hostService.toggleFullScreen(A),i&&this.isVisible(i,z(this.activeContainer))?Er(i)?this.focusPart(i,z(this.activeContainer)):this.focusPart(i):this.focus(),this._onDidChangeZenMode.fire(this.isZenModeActive())}setStatusBarHidden(e){this.stateModel.setRuntimeValue(f.STATUSBAR_HIDDEN,e),e?this.mainContainer.classList.add(D.STATUSBAR_HIDDEN):this.mainContainer.classList.remove(D.STATUSBAR_HIDDEN),this.workbenchGrid.setViewVisible(this.statusBarPartView,!e)}createWorkbenchLayout(){const e=this.getPart(h.TITLEBAR_PART),t=this.getPart(h.BANNER_PART),i=this.getPart(h.EDITOR_PART),s=this.getPart(h.ACTIVITYBAR_PART),r=this.getPart(h.PANEL_PART),n=this.getPart(h.AUXILIARYBAR_PART),o=this.getPart(h.SIDEBAR_PART),a=this.getPart(h.STATUSBAR_PART);this.titleBarPartView=e,this.bannerPartView=t,this.sideBarPartView=o,this.activityBarPartView=s,this.editorPartView=i,this.panelPartView=r,this.auxiliaryBarPartView=n,this.statusBarPartView=a;const c={[h.ACTIVITYBAR_PART]:this.activityBarPartView,[h.BANNER_PART]:this.bannerPartView,[h.TITLEBAR_PART]:this.titleBarPartView,[h.EDITOR_PART]:this.editorPartView,[h.PANEL_PART]:this.panelPartView,[h.SIDEBAR_PART]:this.sideBarPartView,[h.STATUSBAR_PART]:this.statusBarPartView,[h.AUXILIARYBAR_PART]:this.auxiliaryBarPartView},l=({type:p})=>c[p],m=Ra.deserialize(this.createGridDescriptor(),{fromJSON:l},{proportionalLayout:!1});this.mainContainer.prepend(m.element),this.mainContainer.setAttribute("role","application"),this.workbenchGrid=m,this.workbenchGrid.edgeSnapping=this.state.runtime.mainWindowFullscreen;for(const p of[e,i,s,r,o,a,n,t])this._register(p.onDidVisibilityChange(b=>{p===o?this.setSideBarHidden(!b):p===r?this.setPanelHidden(!b,!0):p===n?this.setAuxiliaryBarHidden(!b,!0):p===i&&this.setEditorHidden(!b),this._onDidChangePartVisibility.fire(),this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension)}));this._register(this.storageService.onWillSaveState(p=>{const b=this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView):this.workbenchGrid.getViewSize(this.sideBarPartView).width;this.stateModel.setInitializationValue(f.SIDEBAR_SIZE,b);const M=this.stateModel.getRuntimeValue(f.PANEL_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView):x(this.stateModel.getRuntimeValue(f.PANEL_POSITION))?this.workbenchGrid.getViewSize(this.panelPartView).height:this.workbenchGrid.getViewSize(this.panelPartView).width;this.stateModel.setInitializationValue(f.PANEL_SIZE,M);const G=this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN)?this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView):this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width;this.stateModel.setInitializationValue(f.AUXILIARYBAR_SIZE,G),this.stateModel.save(!0,!0)}))}layout(){this.disposed||(this._mainContainerDimension=yi(this.state.runtime.mainWindowFullscreen?A.document.body:this.parent,en),this.logService.trace(`Layout#layout, height: ${this._mainContainerDimension.height}, width: ${this._mainContainerDimension.width}`),Ir(this.mainContainer,0,0,0,0,"relative"),Tr(this.mainContainer,this._mainContainerDimension.width,this._mainContainerDimension.height),this.workbenchGrid.layout(this._mainContainerDimension.width,this._mainContainerDimension.height),this.initialized=!0,this.handleContainerDidLayout(this.mainContainer,this._mainContainerDimension))}isMainEditorLayoutCentered(){return this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED)}centerMainEditorLayout(e,t){this.stateModel.setRuntimeValue(f.MAIN_EDITOR_CENTERED,e);const s=yt(this.editorGroupService.mainPart.groups.map(a=>a.activeEditor)).some(a=>a instanceof yr?this.configurationService.getValue("diffEditor.renderSideBySide"):!!a?.hasCapability(vr.MultipleEditors)),r=this.editorGroupService.getLayout();let n=!1;r.orientation===wr.HORIZONTAL?n=r.groups.length>1:n=r.groups.some(a=>a.groups&&a.groups.length>1),this.configurationService.getValue("workbench.editor.centeredLayoutAutoResize")&&(n&&!this.editorGroupService.mainPart.hasMaximizedGroup()||s)&&(e=!1),this.editorGroupService.mainPart.isLayoutCentered()!==e&&(this.editorGroupService.mainPart.centerLayout(e),t||this.layout()),this._onDidChangeMainEditorCenteredLayout.fire(this.stateModel.getRuntimeValue(f.MAIN_EDITOR_CENTERED))}getSize(e){return this.workbenchGrid.getViewSize(this.getPart(e))}setSize(e,t){this.workbenchGrid.resizeView(this.getPart(e),t)}resizePart(e,t,i){const s=Math.sign(t)*xs(Ut(),Math.abs(t)),r=Math.sign(i)*xs(Ut(),Math.abs(i));let n;switch(e){case h.SIDEBAR_PART:n=this.workbenchGrid.getViewSize(this.sideBarPartView),this.workbenchGrid.resizeView(this.sideBarPartView,{width:n.width+s,height:n.height});break;case h.PANEL_PART:n=this.workbenchGrid.getViewSize(this.panelPartView),this.workbenchGrid.resizeView(this.panelPartView,{width:n.width+(x(this.getPanelPosition())?0:s),height:n.height+(x(this.getPanelPosition())?r:0)});break;case h.AUXILIARYBAR_PART:n=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{width:n.width+s,height:n.height});break;case h.EDITOR_PART:if(n=this.workbenchGrid.getViewSize(this.editorPartView),this.editorGroupService.mainPart.count===1)this.workbenchGrid.resizeView(this.editorPartView,{width:n.width+s,height:n.height+r});else{const o=this.editorGroupService.mainPart.activeGroup,{width:a,height:c}=this.editorGroupService.mainPart.getSize(o);this.editorGroupService.mainPart.setSize(o,{width:a+s,height:c+r});const{width:l,height:m}=this.editorGroupService.mainPart.getSize(o);(r&&c===m||s&&a===l)&&this.workbenchGrid.resizeView(this.editorPartView,{width:n.width+(s&&a===l?s:0),height:n.height+(r&&c===m?r:0)})}break;default:return}}setActivityBarHidden(e){this.stateModel.setRuntimeValue(f.ACTIVITYBAR_HIDDEN,e),this.workbenchGrid.setViewVisible(this.activityBarPartView,!e)}setBannerHidden(e){this.workbenchGrid.setViewVisible(this.bannerPartView,!e)}setEditorHidden(e){this.stateModel.setRuntimeValue(f.EDITOR_HIDDEN,e),e?this.mainContainer.classList.add(D.MAIN_EDITOR_AREA_HIDDEN):this.mainContainer.classList.remove(D.MAIN_EDITOR_AREA_HIDDEN),this.workbenchGrid.setViewVisible(this.editorPartView,!e),e&&!this.isVisible(h.PANEL_PART)&&this.setPanelHidden(!1,!0)}getLayoutClasses(){return yt([this.isVisible(h.SIDEBAR_PART)?void 0:D.SIDEBAR_HIDDEN,this.isVisible(h.EDITOR_PART,A)?void 0:D.MAIN_EDITOR_AREA_HIDDEN,this.isVisible(h.PANEL_PART)?void 0:D.PANEL_HIDDEN,this.isVisible(h.AUXILIARYBAR_PART)?void 0:D.AUXILIARYBAR_HIDDEN,this.isVisible(h.STATUSBAR_PART)?void 0:D.STATUSBAR_HIDDEN,this.state.runtime.mainWindowFullscreen?D.FULLSCREEN:void 0])}setSideBarHidden(e){if(this.stateModel.setRuntimeValue(f.SIDEBAR_HIDDEN,e),e?this.mainContainer.classList.add(D.SIDEBAR_HIDDEN):this.mainContainer.classList.remove(D.SIDEBAR_HIDDEN),e&&this.paneCompositeService.getActivePaneComposite(y.Sidebar))this.paneCompositeService.hideActivePaneComposite(y.Sidebar),this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(y.Sidebar)){const t=this.paneCompositeService.getLastActivePaneCompositeId(y.Sidebar);t&&this.openViewContainer(y.Sidebar,t,!0)}this.workbenchGrid.setViewVisible(this.sideBarPartView,!e)}hasViews(e){const t=this.viewDescriptorService.getViewContainerById(e);if(!t)return!1;const i=this.viewDescriptorService.getViewContainerModel(t);return i?i.activeViewDescriptors.length>=1:!1}adjustPartPositions(e,t,i){const s=!x(i),r=s||!(t==="center"||e===v.LEFT&&t==="right"||e===v.RIGHT&&t==="left"),n=s||!(t==="center"||e===v.RIGHT&&t==="right"||e===v.LEFT&&t==="left"),o=this.isVisible(h.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).width:Tt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumWidth),a=this.isVisible(h.PANEL_PART)?this.workbenchGrid.getViewSize(this.panelPartView).height:Tt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.panelPartView)??this.panelPartView.minimumHeight),c=this.isVisible(h.SIDEBAR_PART)?this.workbenchGrid.getViewSize(this.sideBarPartView).width:Tt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.sideBarPartView)??this.sideBarPartView.minimumWidth),l=this.isVisible(h.AUXILIARYBAR_PART)?this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).width:Tt.Invisible(this.workbenchGrid.getViewCachedVisibleSize(this.auxiliaryBarPartView)??this.auxiliaryBarPartView.minimumWidth),m=[h.PANEL_PART,h.SIDEBAR_PART,h.AUXILIARYBAR_PART].find(p=>this.hasFocus(p));e===v.LEFT?(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,0]),this.workbenchGrid.moveView(this.sideBarPartView,c,r?this.editorPartView:this.activityBarPartView,r?U.Left:U.Right),n?this.workbenchGrid.moveView(this.auxiliaryBarPartView,l,this.editorPartView,U.Right):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,-1])):(this.workbenchGrid.moveViewTo(this.activityBarPartView,[2,-1]),this.workbenchGrid.moveView(this.sideBarPartView,c,r?this.editorPartView:this.activityBarPartView,r?U.Right:U.Left),n?this.workbenchGrid.moveView(this.auxiliaryBarPartView,l,this.editorPartView,U.Left):this.workbenchGrid.moveViewTo(this.auxiliaryBarPartView,[2,0])),m&&this.focusPart(m),s&&(this.workbenchGrid.moveView(this.panelPartView,o,this.editorPartView,i===v.LEFT?U.Left:U.Right),this.workbenchGrid.resizeView(this.panelPartView,{height:a,width:o})),this.isVisible(h.SIDEBAR_PART)&&this.workbenchGrid.resizeView(this.sideBarPartView,{height:this.workbenchGrid.getViewSize(this.sideBarPartView).height,width:c}),this.isVisible(h.AUXILIARYBAR_PART)&&this.workbenchGrid.resizeView(this.auxiliaryBarPartView,{height:this.workbenchGrid.getViewSize(this.auxiliaryBarPartView).height,width:l})}setPanelAlignment(e){x(this.getPanelPosition())||this.setPanelPosition(v.BOTTOM),e!=="center"&&this.isPanelMaximized()&&this.toggleMaximizedPanel(),this.stateModel.setRuntimeValue(f.PANEL_ALIGNMENT,e),this.adjustPartPositions(this.getSideBarPosition(),e,this.getPanelPosition()),this._onDidChangePanelAlignment.fire(e)}setPanelHidden(e,t){if(!this.workbenchGrid)return;const i=!this.isVisible(h.PANEL_PART);this.stateModel.setRuntimeValue(f.PANEL_HIDDEN,e);const s=this.isPanelMaximized(),r=this.panelOpensMaximized();e?this.mainContainer.classList.add(D.PANEL_HIDDEN):this.mainContainer.classList.remove(D.PANEL_HIDDEN);let n=!1;if(e&&this.paneCompositeService.getActivePaneComposite(y.Panel))this.paneCompositeService.hideActivePaneComposite(y.Panel),n=!Os;else if(!e&&!this.paneCompositeService.getActivePaneComposite(y.Panel)){let o=this.paneCompositeService.getLastActivePaneCompositeId(y.Panel);(!o||!this.hasViews(o))&&(o=this.viewDescriptorService.getViewContainersByLocation(y.Panel).find(a=>this.hasViews(a.id))?.id),o&&this.openViewContainer(y.Panel,o,!t)}e&&s&&this.toggleMaximizedPanel(),i!==e&&(this.workbenchGrid.setViewVisible(this.panelPartView,!e),e?this.stateModel.setRuntimeValue(f.PANEL_WAS_LAST_MAXIMIZED,s):!t&&s!==r&&this.toggleMaximizedPanel(),n&&this.editorGroupService.mainPart.activeGroup.focus())}toggleMaximizedPanel(){const e=this.workbenchGrid.getViewSize(this.panelPartView),t=this.getPanelPosition(),i=this.isPanelMaximized();i?(this.setEditorHidden(!1),this.workbenchGrid.resizeView(this.panelPartView,{width:x(t)?e.width:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH),height:x(t)?this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT):e.height})):(this.isVisible(h.PANEL_PART)&&(x(t)?this.stateModel.setRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT,e.height):this.stateModel.setRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH,e.width)),this.setEditorHidden(!0)),this.stateModel.setRuntimeValue(f.PANEL_WAS_LAST_MAXIMIZED,!i)}panelOpensMaximized(){if(this.getPanelAlignment()!=="center"&&x(this.getPanelPosition()))return!1;const e=_r(this.configurationService.getValue(Me.PANEL_OPENS_MAXIMIZED)),t=this.stateModel.getRuntimeValue(f.PANEL_WAS_LAST_MAXIMIZED);return e===ks.ALWAYS||e===ks.REMEMBER_LAST&&t}setAuxiliaryBarHidden(e,t){if(this.stateModel.setRuntimeValue(f.AUXILIARYBAR_HIDDEN,e),e?this.mainContainer.classList.add(D.AUXILIARYBAR_HIDDEN):this.mainContainer.classList.remove(D.AUXILIARYBAR_HIDDEN),e&&this.paneCompositeService.getActivePaneComposite(y.AuxiliaryBar))this.paneCompositeService.hideActivePaneComposite(y.AuxiliaryBar),this.focusPanelOrEditor();else if(!e&&!this.paneCompositeService.getActivePaneComposite(y.AuxiliaryBar)){let i=this.paneCompositeService.getLastActivePaneCompositeId(y.AuxiliaryBar);(!i||!this.hasViews(i))&&(i=this.viewDescriptorService.getViewContainersByLocation(y.AuxiliaryBar).find(s=>this.hasViews(s.id))?.id),i&&this.openViewContainer(y.AuxiliaryBar,i,!t)}this.workbenchGrid.setViewVisible(this.auxiliaryBarPartView,!e)}setPartHidden(e,t){switch(t){case h.ACTIVITYBAR_PART:return this.setActivityBarHidden(e);case h.SIDEBAR_PART:return this.setSideBarHidden(e);case h.EDITOR_PART:return this.setEditorHidden(e);case h.BANNER_PART:return this.setBannerHidden(e);case h.AUXILIARYBAR_PART:return this.setAuxiliaryBarHidden(e);case h.PANEL_PART:return this.setPanelHidden(e)}}hasMainWindowBorder(){return this.state.runtime.mainWindowBorder}getMainWindowBorderRadius(){return this.state.runtime.mainWindowBorder&&ce?"10px":void 0}isPanelMaximized(){return(this.getPanelAlignment()==="center"||!x(this.getPanelPosition()))&&!this.isVisible(h.EDITOR_PART,A)}getSideBarPosition(){return this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON)}getPanelAlignment(){return this.stateModel.getRuntimeValue(f.PANEL_ALIGNMENT)}updateMenubarVisibility(e){const t=De(this.configurationService,A,this.state.runtime.menuBar.toggled);!e&&this.workbenchGrid&&t!==this.isVisible(h.TITLEBAR_PART,A)&&this.workbenchGrid.setViewVisible(this.titleBarPartView,t)}updateCustomTitleBarVisibility(){const e=De(this.configurationService,A,this.state.runtime.menuBar.toggled),t=this.isVisible(h.TITLEBAR_PART);e!==t&&this.workbenchGrid.setViewVisible(this.titleBarPartView,e)}toggleMenuBar(){let e=Li(this.configurationService);typeof e!="string"&&(e="classic");let t;e==="visible"||e==="classic"?t=Oi(this.configurationService)?"toggle":"compact":t="classic",this.configurationService.updateValue(ws.MenuBarVisibility,t)}getPanelPosition(){return this.stateModel.getRuntimeValue(f.PANEL_POSITION)}setPanelPosition(e){this.isVisible(h.PANEL_PART)||this.setPanelHidden(!1);const t=this.getPart(h.PANEL_PART),i=lt(this.getPanelPosition()),s=lt(e),r=re(t.getContainer());r.classList.remove(i),r.classList.add(s),t.updateStyles();const n=this.workbenchGrid.getViewSize(this.panelPartView),o=this.workbenchGrid.getViewSize(this.sideBarPartView),a=this.workbenchGrid.getViewSize(this.auxiliaryBarPartView);let c=!this.isVisible(h.EDITOR_PART,A);s!==i&&!c&&(x(e)?this.stateModel.setRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH,n.width):x(Kt(i))&&this.stateModel.setRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT,n.height)),x(e)&&this.getPanelAlignment()!=="center"&&c&&(this.toggleMaximizedPanel(),c=!1),this.stateModel.setRuntimeValue(f.PANEL_POSITION,e);const l=this.isVisible(h.SIDEBAR_PART),m=this.isVisible(h.AUXILIARYBAR_PART),p=this.hasFocus(h.PANEL_PART);e===v.BOTTOM?this.workbenchGrid.moveView(this.panelPartView,c?n.height:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,U.Down):e===v.TOP?this.workbenchGrid.moveView(this.panelPartView,c?n.height:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_HEIGHT),this.editorPartView,U.Up):e===v.RIGHT?this.workbenchGrid.moveView(this.panelPartView,c?n.width:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,U.Right):this.workbenchGrid.moveView(this.panelPartView,c?n.width:this.stateModel.getRuntimeValue(f.PANEL_LAST_NON_MAXIMIZED_WIDTH),this.editorPartView,U.Left),p&&this.focusPart(h.PANEL_PART),this.workbenchGrid.resizeView(this.sideBarPartView,o),l||this.setSideBarHidden(!0),this.workbenchGrid.resizeView(this.auxiliaryBarPartView,a),m||this.setAuxiliaryBarHidden(!0),x(e)&&this.adjustPartPositions(this.getSideBarPosition(),this.getPanelAlignment(),e),this._onDidChangePanelPosition.fire(s)}isWindowMaximized(e){return this.state.runtime.maximized.has(xi(e))}updateWindowMaximizedState(e,t){this.mainContainer.classList.toggle(D.MAXIMIZED,t);const i=xi(e);t!==this.state.runtime.maximized.has(i)&&(t?this.state.runtime.maximized.add(i):this.state.runtime.maximized.delete(i),this.updateWindowsBorder(),this._onDidChangeWindowMaximized.fire({windowId:i,maximized:t}))}getVisibleNeighborPart(e,t){if(!this.workbenchGrid||!this.isVisible(e,A))return;const i=this.workbenchGrid.getNeighborViews(this.getPart(e),t,!1);if(i)for(const s of i){const r=[h.ACTIVITYBAR_PART,h.EDITOR_PART,h.PANEL_PART,h.AUXILIARYBAR_PART,h.SIDEBAR_PART,h.STATUSBAR_PART,h.TITLEBAR_PART].find(n=>this.getPart(n)===s&&this.isVisible(n,A));if(r!==void 0)return r}}onDidChangeWCO(){const e=this.workbenchGrid.getNeighborViews(this.titleBarPartView,U.Up,!1).length>0,t=this.shouldShowBannerFirst();e!==t&&this.workbenchGrid.moveView(this.bannerPartView,Tt.Distribute,this.titleBarPartView,t?U.Up:U.Down),this.workbenchGrid.setViewVisible(this.titleBarPartView,De(this.configurationService,A,this.state.runtime.menuBar.toggled))}arrangeEditorNodes(e,t,i){if(!e.sideBar&&!e.auxiliaryBar)return e.editor.size=t,e.editor;const s=[e.editor];return e.editor.size=i,e.sideBar&&(this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON)===v.LEFT?s.splice(0,0,e.sideBar):s.push(e.sideBar),e.editor.size-=this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN)?0:e.sideBar.size),e.auxiliaryBar&&(this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON)===v.RIGHT?s.splice(0,0,e.auxiliaryBar):s.push(e.auxiliaryBar),e.editor.size-=this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size),{type:"branch",data:s,size:t}}arrangeMiddleSectionNodes(e,t,i){const s=this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN)?0:e.activityBar.size,r=this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN)?0:e.sideBar.size,n=this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN)?0:e.auxiliaryBar.size,o=this.stateModel.getInitializationValue(f.PANEL_SIZE)?0:e.panel.size,a=this.stateModel.getRuntimeValue(f.PANEL_POSITION),c=this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON),l=[];if(!x(a))l.push(e.editor),e.editor.size=t-s-r-o-n,a===v.RIGHT?l.push(e.panel):l.splice(0,0,e.panel),c===v.LEFT?(l.push(e.auxiliaryBar),l.splice(0,0,e.sideBar),l.splice(0,0,e.activityBar)):(l.splice(0,0,e.auxiliaryBar),l.push(e.sideBar),l.push(e.activityBar));else{const m=this.stateModel.getRuntimeValue(f.PANEL_ALIGNMENT),p=!(m==="center"||c===v.LEFT&&m==="right"||c===v.RIGHT&&m==="left"),b=!(m==="center"||c===v.RIGHT&&m==="right"||c===v.LEFT&&m==="left"),M=t-s-(p?0:r)-(b?0:n),G=this.arrangeEditorNodes({editor:e.editor,sideBar:p?e.sideBar:void 0,auxiliaryBar:b?e.auxiliaryBar:void 0},i-o,M);l.push({type:"branch",data:a===v.BOTTOM?[G,e.panel]:[e.panel,G],size:M}),p||(c===v.LEFT?l.splice(0,0,e.sideBar):l.push(e.sideBar)),b||(c===v.RIGHT?l.splice(0,0,e.auxiliaryBar):l.push(e.auxiliaryBar)),c===v.LEFT?l.splice(0,0,e.activityBar):l.push(e.activityBar)}return l}createGridDescriptor(){const{width:e,height:t}=this._mainContainerDimension,i=this.stateModel.getInitializationValue(f.SIDEBAR_SIZE),s=this.stateModel.getInitializationValue(f.AUXILIARYBAR_SIZE),r=this.stateModel.getInitializationValue(f.PANEL_SIZE),n=this.titleBarPartView.minimumHeight,o=this.bannerPartView.minimumHeight,a=this.statusBarPartView.minimumHeight,c=this.activityBarPartView.minimumWidth,l=t-n-a,m=[{type:"leaf",data:{type:h.TITLEBAR_PART},size:n,visible:this.isVisible(h.TITLEBAR_PART,A)},{type:"leaf",data:{type:h.BANNER_PART},size:o,visible:!1}],p={type:"leaf",data:{type:h.ACTIVITYBAR_PART},size:c,visible:!this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN)},b={type:"leaf",data:{type:h.SIDEBAR_PART},size:i,visible:!this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN)},M={type:"leaf",data:{type:h.AUXILIARYBAR_PART},size:s,visible:this.isVisible(h.AUXILIARYBAR_PART)},G={type:"leaf",data:{type:h.EDITOR_PART},size:0,visible:!this.stateModel.getRuntimeValue(f.EDITOR_HIDDEN)},rt={type:"leaf",data:{type:h.PANEL_PART},size:r,visible:!this.stateModel.getRuntimeValue(f.PANEL_HIDDEN)},It=this.arrangeMiddleSectionNodes({activityBar:p,auxiliaryBar:M,editor:G,panel:rt,sideBar:b},e,l),Ii={root:{type:"branch",size:e,data:[...this.shouldShowBannerFirst()?m.reverse():m,{type:"branch",data:It,size:l},{type:"leaf",data:{type:h.STATUSBAR_PART},size:a,visible:!this.stateModel.getRuntimeValue(f.STATUSBAR_HIDDEN)}]},orientation:Dr.VERTICAL,width:e,height:t},Ln={activityBarVisible:!this.stateModel.getRuntimeValue(f.ACTIVITYBAR_HIDDEN),sideBarVisible:!this.stateModel.getRuntimeValue(f.SIDEBAR_HIDDEN),auxiliaryBarVisible:!this.stateModel.getRuntimeValue(f.AUXILIARYBAR_HIDDEN),panelVisible:!this.stateModel.getRuntimeValue(f.PANEL_HIDDEN),statusbarVisible:!this.stateModel.getRuntimeValue(f.STATUSBAR_HIDDEN),sideBarPosition:lt(this.stateModel.getRuntimeValue(f.SIDEBAR_POSITON)),panelPosition:lt(this.stateModel.getRuntimeValue(f.PANEL_POSITION))};return this.telemetryService.publicLog2("startupLayout",Ln),Ii}dispose(){super.dispose(),this.disposed=!0}}function tn(u){return u.getValue(Me.ZEN_MODE_CONFIG)}class Bn{constructor(e,t,i,s){this.name=e,this.scope=t,this.target=i,this.defaultValue=s}}class k extends Bn{constructor(e,t,i,s,r){super(e,t,i,s),this.zenModeIgnore=r,this.runtime=!0}}class Pi extends Bn{constructor(){super(...arguments),this.runtime=!1}}const f={MAIN_EDITOR_CENTERED:new k("editor.centered",E.WORKSPACE,R.MACHINE,!1),ZEN_MODE_ACTIVE:new k("zenMode.active",E.WORKSPACE,R.MACHINE,!1),ZEN_MODE_EXIT_INFO:new k("zenMode.exitInfo",E.WORKSPACE,R.MACHINE,{transitionedToCenteredEditorLayout:!1,transitionedToFullScreen:!1,handleNotificationsDoNotDisturbMode:!1,wasVisible:{auxiliaryBar:!1,panel:!1,sideBar:!1}}),SIDEBAR_SIZE:new Pi("sideBar.size",E.PROFILE,R.MACHINE,200),AUXILIARYBAR_SIZE:new Pi("auxiliaryBar.size",E.PROFILE,R.MACHINE,200),PANEL_SIZE:new Pi("panel.size",E.PROFILE,R.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_HEIGHT:new k("panel.lastNonMaximizedHeight",E.PROFILE,R.MACHINE,300),PANEL_LAST_NON_MAXIMIZED_WIDTH:new k("panel.lastNonMaximizedWidth",E.PROFILE,R.MACHINE,300),PANEL_WAS_LAST_MAXIMIZED:new k("panel.wasLastMaximized",E.WORKSPACE,R.MACHINE,!1),SIDEBAR_POSITON:new k("sideBar.position",E.WORKSPACE,R.MACHINE,v.LEFT),PANEL_POSITION:new k("panel.position",E.WORKSPACE,R.MACHINE,v.BOTTOM),PANEL_ALIGNMENT:new k("panel.alignment",E.PROFILE,R.USER,"center"),ACTIVITYBAR_HIDDEN:new k("activityBar.hidden",E.WORKSPACE,R.MACHINE,!1,!0),SIDEBAR_HIDDEN:new k("sideBar.hidden",E.WORKSPACE,R.MACHINE,!1),EDITOR_HIDDEN:new k("editor.hidden",E.WORKSPACE,R.MACHINE,!1),PANEL_HIDDEN:new k("panel.hidden",E.WORKSPACE,R.MACHINE,!0),AUXILIARYBAR_HIDDEN:new k("auxiliaryBar.hidden",E.WORKSPACE,R.MACHINE,!0),STATUSBAR_HIDDEN:new k("statusBar.hidden",E.WORKSPACE,R.MACHINE,!1,!0)};var Me;(function(u){u.AUXILIARYBAR_DEFAULT_VISIBILITY="workbench.secondarySideBar.defaultVisibility",u.ACTIVITY_BAR_VISIBLE="workbench.activityBar.visible",u.PANEL_POSITION="workbench.panel.defaultLocation",u.PANEL_OPENS_MAXIMIZED="workbench.panel.opensMaximized",u.ZEN_MODE_CONFIG="zenMode",u.EDITOR_CENTERED_LAYOUT_AUTO_RESIZE="workbench.editor.centeredLayoutAutoResize"})(Me||(Me={}));var q;(function(u){u.STATUSBAR_VISIBLE="workbench.statusBar.visible",u.SIDEBAR_POSITION="workbench.sideBar.location"})(q||(q={}));const ut=class ut extends ee{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.contextService=i,this._onDidChangeState=this._register(new I),this.onDidChangeState=this._onDidChangeState.event,this.stateCache=new Map,this._register(this.configurationService.onDidChangeConfiguration(s=>this.updateStateFromLegacySettings(s)))}updateStateFromLegacySettings(e){e.affectsConfiguration(_.ACTIVITY_BAR_LOCATION)&&this.setRuntimeValueAndFire(f.ACTIVITYBAR_HIDDEN,this.isActivityBarHidden()),e.affectsConfiguration(q.STATUSBAR_VISIBLE)&&this.setRuntimeValueAndFire(f.STATUSBAR_HIDDEN,!this.configurationService.getValue(q.STATUSBAR_VISIBLE)),e.affectsConfiguration(q.SIDEBAR_POSITION)&&this.setRuntimeValueAndFire(f.SIDEBAR_POSITON,Kt(this.configurationService.getValue(q.SIDEBAR_POSITION)??"left"))}updateLegacySettingsFromState(e,t){const i=this.getRuntimeValue(f.ZEN_MODE_ACTIVE);e.zenModeIgnore&&i||(e===f.ACTIVITYBAR_HIDDEN?this.configurationService.updateValue(_.ACTIVITY_BAR_LOCATION,t?ve.HIDDEN:void 0):e===f.STATUSBAR_HIDDEN?this.configurationService.updateValue(q.STATUSBAR_VISIBLE,!t):e===f.SIDEBAR_POSITON&&this.configurationService.updateValue(q.SIDEBAR_POSITION,lt(t)))}load(e){let t;for(t in f){const s=f[t],r=this.loadKeyFromStorage(s);r!==void 0&&this.stateCache.set(s.name,r)}this.stateCache.set(f.ACTIVITYBAR_HIDDEN.name,this.isActivityBarHidden()),this.stateCache.set(f.STATUSBAR_HIDDEN.name,!this.configurationService.getValue(q.STATUSBAR_VISIBLE)),this.stateCache.set(f.SIDEBAR_POSITON.name,Kt(this.configurationService.getValue(q.SIDEBAR_POSITION)??"left"));const i=this.contextService.getWorkbenchState();f.SIDEBAR_SIZE.defaultValue=Math.min(300,e.width/4),f.SIDEBAR_HIDDEN.defaultValue=i===mt.EMPTY,f.AUXILIARYBAR_SIZE.defaultValue=Math.min(300,e.width/4),f.AUXILIARYBAR_HIDDEN.defaultValue=(()=>{switch(this.configurationService.getValue(Me.AUXILIARYBAR_DEFAULT_VISIBILITY)){case"visible":return!1;case"visibleInWorkspace":return i===mt.EMPTY;default:return!0}})(),f.PANEL_SIZE.defaultValue=this.stateCache.get(f.PANEL_POSITION.name)??x(f.PANEL_POSITION.defaultValue)?e.height/3:e.width/4,f.PANEL_POSITION.defaultValue=Kt(this.configurationService.getValue(Me.PANEL_POSITION)??"bottom");for(t in f){const s=f[t];this.stateCache.get(s.name)===void 0&&this.stateCache.set(s.name,s.defaultValue)}this._register(this.storageService.onDidChangeValue(E.PROFILE,void 0,this._store)(s=>{let r;for(r in f){const n=f[r];if(n instanceof k&&n.scope===E.PROFILE&&n.target===R.USER&&`${ut.STORAGE_PREFIX}${n.name}`===s.key){const o=this.loadKeyFromStorage(n)??n.defaultValue;this.stateCache.get(n.name)!==o&&(this.stateCache.set(n.name,o),this._onDidChangeState.fire({key:n,value:o}))}}}))}save(e,t){let i;const s=this.getRuntimeValue(f.ZEN_MODE_ACTIVE);for(i in f){const r=f[i];if(e&&r.scope===E.WORKSPACE||t&&r.scope===E.PROFILE){if(s&&r instanceof k&&r.zenModeIgnore)continue;this.saveKeyToStorage(r)}}}getInitializationValue(e){return this.stateCache.get(e.name)}setInitializationValue(e,t){this.stateCache.set(e.name,t)}getRuntimeValue(e,t){if(t)switch(e){case f.ACTIVITYBAR_HIDDEN:this.stateCache.set(e.name,this.isActivityBarHidden());break;case f.STATUSBAR_HIDDEN:this.stateCache.set(e.name,!this.configurationService.getValue(q.STATUSBAR_VISIBLE));break;case f.SIDEBAR_POSITON:this.stateCache.set(e.name,this.configurationService.getValue(q.SIDEBAR_POSITION)??"left");break}return this.stateCache.get(e.name)}setRuntimeValue(e,t){this.stateCache.set(e.name,t);const i=this.getRuntimeValue(f.ZEN_MODE_ACTIVE);e.scope===E.PROFILE&&(!i||!e.zenModeIgnore)&&(this.saveKeyToStorage(e),this.updateLegacySettingsFromState(e,t))}isActivityBarHidden(){const e=this.configurationService.getValue(Me.ACTIVITY_BAR_VISIBLE);return e!==void 0?!e:this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION)!==ve.DEFAULT}setRuntimeValueAndFire(e,t){this.stateCache.get(e.name)!==t&&(this.setRuntimeValue(e,t),this._onDidChangeState.fire({key:e,value:t}))}saveKeyToStorage(e){const t=this.stateCache.get(e.name);this.storageService.store(`${ut.STORAGE_PREFIX}${e.name}`,typeof t=="object"?JSON.stringify(t):t,e.scope,e.target)}loadKeyFromStorage(e){let t=this.storageService.get(`${ut.STORAGE_PREFIX}${e.name}`,e.scope);if(t!==void 0)switch(typeof e.defaultValue){case"boolean":t=t==="true";break;case"number":t=parseInt(t);break;case"object":t=JSON.parse(t);break}return t}};ut.STORAGE_PREFIX="workbench.";let ji=ut;const nc=5e3;let qi=class extends ee{constructor(e,t,i){super(),this._accessibilitySignalService=i,this._scheduler=new An(()=>{this._signalLoop=this._accessibilitySignalService.playSignalLoop(pi.progress,t??nc)},e),this._scheduler.schedule()}dispose(){super.dispose(),this._signalLoop?.dispose(),this._scheduler.dispose()}};qi=T([d(2,mi)],qi);class rc{constructor(){this.priority=90,this.name="notifications",this.when=se,this.type=Fs.View}getProvider(e){const t=e.get(Pr),i=e.get(ct),s=e.get(ge),r=e.get(mi);function n(){const o=Ve(i);if(!o)return;s.executeCommand("notifications.showList");let a;const c=i.lastFocusedList;if(c instanceof As&&(a=c.indexOf(o)),a===void 0)return;function l(){if(s.executeCommand("notifications.showList"),c&&a!==void 0){c.domFocus();try{c.setFocus([a])}catch{}}}function m(){const b=Ve(i),M=b?.message.original.toString();if(b)return b.source?g(3364,"{0} Source: {1}",M,b.source):g(3365,"{0}",M)}const p=m();if(p)return o.onDidClose(()=>t.next()),new Nr(Vr.Notification,{type:Fs.View},()=>p,()=>l(),"accessibility.verbosity.notification",void 0,oc(o,r),()=>{if(c)return l(),c.focusNext(),m()},()=>{if(c)return l(),c.focusPrevious(),m()})}return n()}}function oc(u,e){let t;if(u.actions&&(t=[],u.actions.primary&&t.push(...u.actions.primary),u.actions.secondary&&t.push(...u.actions.secondary)),t)for(const s of t){s.class=F.asClassName(Z.bell);const r=s.run;s.run=()=>{r(),u.close()}}const i=t?.find(s=>s.label.includes("Manage Extension"));return i&&(i.class=F.asClassName(Z.gear)),t&&t.push({id:"clearNotification",label:g(3366,"Clear Notification"),tooltip:g(3366,"Clear Notification"),run:()=>{u.close(),e.playSignal(pi.clear)},enabled:!0,class:F.asClassName(Z.clearAll)}),t}class ac extends sc{constructor(e,t,i,s){super(e),this.options=t,this.serviceCollection=i,this._onWillShutdown=this._register(new I),this.onWillShutdown=this._onWillShutdown.event,this._onDidShutdown=this._register(new I),this.onDidShutdown=this._onDidShutdown.event,this.previousUnexpectedError={message:void 0,time:0},O("code/willStartWorkbench"),this.registerErrorHandler(s),this.parent.appendChild(this.mainContainer)}registerErrorHandler(e){A.addEventListener("unhandledrejection",t=>{Yt(t.reason),t.preventDefault()}),Cn(t=>this.handleUnexpectedError(t,e))}handleUnexpectedError(e,t){const i=Gt(e,!0);if(!i)return;const s=Date.now();i===this.previousUnexpectedError.message&&s-this.previousUnexpectedError.time<=1e3||(this.previousUnexpectedError.time=s,this.previousUnexpectedError.message=i,t.error(i))}startup(){try{this._register(Br(175));const e=this.initServices(this.serviceCollection);return e.invokeFunction(t=>{const i=t.get(ei),s=t.get(ae),r=t.get(Qe),n=t.get(At),o=t.get(Lr),a=t.get(Ae);this.initLayout(t),this.registerListeners(i,s,r,n,o),this.renderWorkbench(e,a,s,r),this.createWorkbenchLayout(),this.layout(),this.restore(i)}),e}catch(e){throw Yt(e),e}}initServices(e){e.set(te,this);const t=Mr();for(const[s,r]of t)e.set(s,r);const i=new Or(e,!0);return i.invokeFunction(s=>{const r=s.get(ei),n=s.get(Qe);typeof n.acquireInstantiationService=="function"&&n.acquireInstantiationService(i),r.phase=wt.Ready}),i}registerListeners(e,t,i,s,r){this._register(i.onDidChangeConfiguration(n=>this.updateFontAliasing(n,i))),Xt?this._register(t.onWillSaveState(n=>{n.reason===xr.SHUTDOWN&&this.storeFontInfo(t)})):this._register(e.onWillShutdown(()=>this.storeFontInfo(t))),this._register(e.onWillShutdown(n=>this._onWillShutdown.fire(n))),this._register(e.onDidShutdown(()=>{this._onDidShutdown.fire(),this.dispose()})),this._register(s.onDidChangeFocus(n=>{n||t.flush()})),this._register(r.onWillShowDialog(()=>this.mainContainer.classList.add("modal-dialog-visible"))),this._register(r.onDidShowDialog(()=>this.mainContainer.classList.remove("modal-dialog-visible")))}updateFontAliasing(e,t){if(!ce||e&&!e.affectsConfiguration("workbench.fontAliasing"))return;const i=t.getValue("workbench.fontAliasing");if(this.fontAliasing===i)return;this.fontAliasing=i;const s=["antialiased","none","auto"];this.mainContainer.classList.remove(...s.map(r=>`monaco-font-aliasing-${r}`)),s.some(r=>r===i)&&this.mainContainer.classList.add(`monaco-font-aliasing-${i}`)}restoreFontInfo(e,t){const i=e.get("editorFontInfo",E.APPLICATION);if(i)try{const s=JSON.parse(i);Array.isArray(s)&&wi.restoreFontInfo(A,s)}catch{}wi.readFontInfo(A,kr.createFromRawSettings(t.getValue("editor"),Hr.getInstance(A).value))}storeFontInfo(e){const t=wi.serializeFontInfo(A);t&&e.store("editorFontInfo",JSON.stringify(t),E.APPLICATION,R.MACHINE)}renderWorkbench(e,t,i,s){Fr(this.mainContainer),Gr((o,a)=>e.createInstance(qi,o,a));const n=yt(["monaco-workbench",gt?"windows":Ot?"linux":"mac",ne?"web":void 0,Wr?"chromium":zr?"firefox":Ur?"safari":void 0,...this.getLayoutClasses(),...this.options?.extraClasses?this.options.extraClasses:[]]);this.mainContainer.classList.add(...n),this.updateFontAliasing(void 0,s),this.restoreFontInfo(i,s);for(const{id:o,role:a,classes:c,options:l}of[{id:h.TITLEBAR_PART,role:"none",classes:["titlebar"]},{id:h.BANNER_PART,role:"banner",classes:["banner"]},{id:h.ACTIVITYBAR_PART,role:"none",classes:["activitybar",this.getSideBarPosition()===v.LEFT?"left":"right"]},{id:h.SIDEBAR_PART,role:"none",classes:["sidebar",this.getSideBarPosition()===v.LEFT?"left":"right"]},{id:h.EDITOR_PART,role:"main",classes:["editor"],options:{restorePreviousState:this.willRestoreEditors()}},{id:h.PANEL_PART,role:"none",classes:["panel","basepanel",lt(this.getPanelPosition())]},{id:h.AUXILIARYBAR_PART,role:"none",classes:["auxiliarybar","basepanel",this.getSideBarPosition()===v.LEFT?"right":"left"]},{id:h.STATUSBAR_PART,role:"status",classes:["statusbar"]}]){const m=this.createPart(o,a,c);O(`code/willCreatePart/${o}`),this.getPart(o).create(m,l),O(`code/didCreatePart/${o}`)}this.createNotificationsHandlers(e,t)}createPart(e,t,i){const s=document.createElement(t==="status"?"footer":"div");return s.classList.add("part",...i),s.id=e,s.setAttribute("role",t),t==="status"&&s.setAttribute("aria-live","off"),s}createNotificationsHandlers(e,t){const i=this._register(e.createInstance(Xi,this.mainContainer,t.model)),s=this._register(e.createInstance($i,this.mainContainer,t.model));this._register(e.createInstance(Qa,t.model));const r=e.createInstance(Zi,t.model);this._register(i.onDidChangeVisibility(()=>{r.update(i.isVisible,s.isVisible),s.update(i.isVisible)})),this._register(s.onDidChangeVisibility(()=>{r.update(i.isVisible,s.isVisible)})),Ka(i,s,t.model),Kr.register(new rc),this.registerNotifications({onDidChangeNotificationsVisibility:oe.map(oe.any(s.onDidChangeVisibility,i.onDidChangeVisibility),()=>s.isVisible||i.isVisible)})}restore(e){try{this.restoreParts()}catch(t){Yt(t)}this.whenReady.finally(()=>Promise.race([this.whenRestored,Yr(2e3)]).finally(()=>{function t(){O("code/didStartWorkbench"),performance.measure("perf: workbench create & restore","code/didLoadWorkbenchMain","code/didStartWorkbench")}this.isRestored()?t():this.whenRestored.finally(()=>t()),e.phase=wt.Restored,this._register(new An(()=>{this._register(Xr(A,()=>e.phase=wt.Eventually,2500))},2500)).schedule()}))}}const cc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Ji;let Qi=class{constructor(e,t,i,s){this._disposables=new V,this._onDidChangeVisibility=this._disposables.add(new I),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.element=document.createElement("div"),this.element.classList.add("command-center");const r=i.createInstance(Zr,this.element,B.CommandCenter,{contextMenu:B.TitleBarContext,hiddenItemStrategy:En.NoHide,toolbarOptions:{primaryGroup:()=>!0},telemetrySource:"commandCenter",actionViewItemProvider:(n,o)=>n instanceof $r&&n.item.submenu===B.CommandCenterCenter?i.createInstance(es,n,e,{...o,hoverDelegate:t}):_s(i,n,{...o,hoverDelegate:t})});this._disposables.add(oe.filter(s.onShow,()=>Sn(this.element),this._disposables)(this._setVisibility.bind(this,!1))),this._disposables.add(s.onHide(this._setVisibility.bind(this,!0))),this._disposables.add(r)}_setVisibility(e){this.element.classList.toggle("hide",!e),this._onDidChangeVisibility.fire()}dispose(){this._disposables.dispose()}};Qi=T([d(2,L),d(3,hn)],Qi);var Ye;let es=(Ye=class extends Gs{constructor(e,t,i,s,r,n,o){super(void 0,e.actions.find(a=>a.id==="workbench.action.quickOpenWithModes")??e.actions[0],i),this._submenu=e,this._windowTitle=t,this._hoverService=s,this._keybindingService=r,this._instaService=n,this._editorGroupService=o,this._hoverDelegate=i.hoverDelegate??Vi("mouse")}render(e){super.render(e),e.classList.add("command-center-center"),e.classList.toggle("multiple",this._submenu.actions.length>1);const t=this._store.add(this._hoverService.setupManagedHover(this._hoverDelegate,e,this.getTooltip()));this._store.add(this._windowTitle.onDidChange(()=>{t.update(this.getTooltip())}));const i=[];for(const s of this._submenu.actions)s instanceof jr?i.push(s.actions):i.push([s]);for(let s=0;s<i.length;s++){const r=i[s],n=this._instaService.createInstance(In,e,{hiddenItemStrategy:En.NoHide,telemetrySource:"commandCenterCenter",actionViewItemProvider:(o,a)=>{if(a={...a,hoverDelegate:this._hoverDelegate},o.id!==Ji._quickOpenCommandId)return _s(this._instaService,o,a);const c=this;return this._instaService.createInstance(class extends Gs{constructor(){super(void 0,o,a)}render(m){super.render(m),m.classList.toggle("command-center-quick-pick"),m.role="button";const p=this.action,b=document.createElement("span");b.ariaHidden="true",b.className=p.class??"",b.classList.add("search-icon");const M=this._getLabel(),G=document.createElement("span");G.classList.add("search-label"),G.innerText=M,Tn(m,b,G);const rt=this._store.add(c._hoverService.setupManagedHover(c._hoverDelegate,m,this.getTooltip()));this._store.add(c._windowTitle.onDidChange(()=>{rt.update(this.getTooltip()),G.innerText=this._getLabel()})),this._store.add(c._editorGroupService.onDidChangeEditorPartOptions(({newPartOptions:It,oldPartOptions:Ii})=>{It.showTabs!==Ii.showTabs&&(rt.update(this.getTooltip()),G.innerText=this._getLabel())}))}getTooltip(){return c.getTooltip()}_getLabel(){const{prefix:m,suffix:p}=c._windowTitle.getTitleDecorations();let b=c._windowTitle.workspaceName;return c._windowTitle.isCustomTitleFormat()?b=c._windowTitle.getWindowTitle():c._editorGroupService.partOptions.showTabs==="none"&&(b=c._windowTitle.fileName??b),b||(b=g(3486,"Search")),m&&(b=g(3487,"{0} {1}",m,b)),p&&(b=g(3488,"{0} {1}",b,p)),b.replaceAll(/\r\n|\r|\n/g,"⏎")}})}});if(n.setActions(r),this._store.add(n),s<i.length-1){const o=ki(Z.circleSmallFilled);o.style.padding="0 12px",o.style.height="100%",o.style.opacity="0.5",e.appendChild(o)}}}getTooltip(){const e=this._keybindingService.lookupKeybinding(this.action.id)?.getLabel();return e?g(3489,"Search {0} ({1}) — {2}",this._windowTitle.workspaceName,e,this._windowTitle.value):g(3490,"Search {0} — {1}",this._windowTitle.workspaceName,this._windowTitle.value)}},Ji=Ye,Ye._quickOpenCommandId="workbench.action.quickOpenWithModes",Ye);es=Ji=T([d(3,ys),d(4,it),d(5,L),d(6,st)],es);Te.appendMenuItem(B.CommandCenter,{submenu:B.CommandCenterCenter,title:g(3491,"Command Center"),icon:Z.shield,order:101});var ts;_e(cc);let is=class extends yn{constructor(e,t,i){super("workbench.titleService",i,t),this.instantiationService=e,this.properties=void 0,this.variables=new Map,this.mainPart=this._register(this.createMainTitlebarPart()),this.onMenubarVisibilityChange=this.mainPart.onMenubarVisibilityChange,this._register(this.registerPart(this.mainPart)),this.registerActions(),this.registerAPICommands()}createMainTitlebarPart(){return this.instantiationService.createInstance(ss)}registerActions(){const e=this;this._register(Ds(class extends Rs{constructor(){super({id:"workbench.action.focusTitleBar",title:le(3525,"Focus Title Bar"),category:Ps.View,f1:!0,precondition:qr})}run(){e.getPartByDocument(pn())?.focus()}}))}registerAPICommands(){this._register(Re.registerCommand({id:"registerWindowTitleVariable",handler:(e,t,i)=>{this.registerVariables([{name:t,contextKey:i}])},metadata:{description:"Registers a new title variable",args:[{name:"name",schema:{type:"string"},description:"The name of the variable to register"},{name:"contextKey",schema:{type:"string"},description:"The context key to use for the value of the variable"}]}}))}createAuxiliaryTitlebarPart(e,t,i){const s=S(".part.titlebar",{role:"none"});s.style.position="relative",e.insertBefore(s,e.firstChild);const r=new V,n=this.doCreateAuxiliaryTitlebarPart(s,t,i);return r.add(this.registerPart(n)),r.add(oe.runAndSubscribe(n.onDidChange,()=>s.style.height=`${n.height}px`)),n.create(s),this.properties&&n.updateProperties(this.properties),this.variables.size&&n.registerVariables(Array.from(this.variables.values())),oe.once(n.onWillDispose)(()=>r.dispose()),n}doCreateAuxiliaryTitlebarPart(e,t,i){return i.createInstance(ns,e,t,this.mainPart)}updateProperties(e){this.properties=e;for(const t of this.parts)t.updateProperties(e)}registerVariables(e){const t=[];for(const i of e)this.variables.has(i.name)||(this.variables.set(i.name,i),t.push(i));for(const i of this.parts)i.registerVariables(t)}};is=T([d(0,L),d(1,ae),d(2,ie)],is);let li=class extends Ci{get minimumHeight(){const e=ne&&Mi();let t=this.isCommandCenterVisible||e?Jr:30;return e&&(t=Math.max(t,Qr(z(this.element))?.height??0)),t/(this.preventZoom?Zt(z(this.element)):1)}get maximumHeight(){return this.minimumHeight}constructor(e,t,i,s,r,n,o,a,c,l,m,p,b,M,G){super(e,{hasTitle:!1},a,c,l),this.editorGroupsContainer=i,this.contextMenuService=s,this.configurationService=r,this.environmentService=n,this.instantiationService=o,this.storageService=c,this.contextKeyService=m,this.hostService=p,this.editorService=b,this.menuService=M,this.keybindingService=G,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this._onMenubarVisibilityChange=this._register(new I),this.onMenubarVisibilityChange=this._onMenubarVisibilityChange.event,this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this.customMenubar=this._register(new Ne),this.actionToolBarDisposable=this._register(new V),this.editorActionsChangeDisposable=this._register(new V),this.globalToolbarMenuDisposables=this._register(new V),this.editorToolbarMenuDisposables=this._register(new V),this.layoutToolbarMenuDisposables=this._register(new V),this.activityToolbarDisposables=this._register(new V),this.titleDisposables=this._register(new V),this.isInactive=!1,this.isCompact=!1,this.isAuxiliary=t.vscodeWindowId!==A.vscodeWindowId,this.isCompactContextKey=eo.bindTo(this.contextKeyService),this.titleBarStyle=to(this.configurationService),this.windowTitle=this._register(o.createInstance(io,t)),this.hoverDelegate=this._register(so()),this.registerListeners(xi(t))}registerListeners(e){this._register(this.hostService.onDidChangeFocus(t=>t?this.onFocus():this.onBlur())),this._register(this.hostService.onDidChangeActiveWindow(t=>t===e?this.onFocus():this.onBlur())),this._register(this.configurationService.onDidChangeConfiguration(t=>this.onConfigurationChanged(t))),this._register(this.editorGroupsContainer.onDidChangeEditorPartOptions(t=>this.onEditorPartConfigurationChange(t)))}onBlur(){this.isInactive=!0,this.updateStyles()}onFocus(){this.isInactive=!1,this.updateStyles()}onEditorPartConfigurationChange({oldPartOptions:e,newPartOptions:t}){(e.editorActionsLocation!==t.editorActionsLocation||e.showTabs!==t.showTabs)&&this.actionToolBar&&(this.createActionToolBar(),this.createActionToolBarMenus({editorActions:!0}),this._onDidChange.fire(void 0))}onConfigurationChanged(e){if(!this.isAuxiliary&&!Oi(this.configurationService,this.titleBarStyle)&&(!ce||ne)&&e.affectsConfiguration(ws.MenuBarVisibility)&&(this.currentMenubarVisibility==="compact"?this.uninstallMenubar():this.installMenubar()),this.actionToolBar){const t=e.affectsConfiguration(_.LAYOUT_ACTIONS),i=e.affectsConfiguration(_.ACTIVITY_BAR_LOCATION);(t||i)&&(this.createActionToolBarMenus({layoutActions:t,activityActions:i}),this._onDidChange.fire(void 0))}e.affectsConfiguration(_.COMMAND_CENTER)&&this.recreateTitle()}recreateTitle(){this.createTitle(),this._onDidChange.fire(void 0)}updateOptions(e){const t=this.isCompact;this.isCompact=e.compact,this.isCompactContextKey.set(this.isCompact),t!==this.isCompact&&(this.recreateTitle(),this.createActionToolBarMenus(!0))}installMenubar(){this.menubar||(this.customMenubar.value=this.instantiationService.createInstance(no),this.menubar=J(this.leftContent,S("div.menubar")),this.menubar.setAttribute("role","menubar"),this._register(this.customMenubar.value.onVisibilityChange(e=>this.onMenubarVisibilityChanged(e))),this.customMenubar.value.create(this.menubar))}uninstallMenubar(){this.customMenubar.value=void 0,this.menubar?.remove(),this.menubar=void 0,this.onMenubarVisibilityChanged(!1)}onMenubarVisibilityChanged(e){(ne||gt||Ot)&&(this.lastLayoutDimensions&&this.layout(this.lastLayoutDimensions.width,this.lastLayoutDimensions.height),this._onMenubarVisibilityChange.fire(e))}updateProperties(e){this.windowTitle.updateProperties(e)}registerVariables(e){this.windowTitle.registerVariables(e)}createContentArea(e){if(this.element=e,this.rootContainer=J(e,S(".titlebar-container")),this.leftContent=J(this.rootContainer,S(".titlebar-left")),this.centerContent=J(this.rootContainer,S(".titlebar-center")),this.rightContent=J(this.rootContainer,S(".titlebar-right")),(gt||Ot)&&!_t(this.configurationService,this.titleBarStyle)&&(this.appIcon=Ws(this.leftContent,S("a.window-appicon"))),this.dragRegion=Ws(this.rootContainer,S("div.titlebar-drag-region")),!this.isAuxiliary&&!Oi(this.configurationService,this.titleBarStyle)&&(!ce||ne)&&this.currentMenubarVisibility!=="compact"&&this.installMenubar(),this.title=J(this.centerContent,S("div.window-title")),this.createTitle(),this.actionToolBarElement=J(this.rightContent,S("div.action-toolbar-container")),this.createActionToolBar(),this.createActionToolBarMenus(),!_t(this.configurationService,this.titleBarStyle)){let t=ce?"left":"right";ce&&Xt&&ro.Locale(oo).value?.textInfo?.direction==="rtl"&&(t="right"),ce&&Xt&&t==="left"||ao(this.configurationService)===co.HIDDEN||(this.windowControlsContainer=J(t==="left"?this.leftContent:this.rightContent,S("div.window-controls-container")),ne&&J(t==="left"?this.rightContent:this.leftContent,S("div.window-controls-container")),Mi()&&this.windowControlsContainer.classList.add("wco-enabled"))}return this._register(H(this.rootContainer,$.CONTEXT_MENU,t=>{Se.stop(t);let i;ce&&Si(t.target)&&ho(t.target,this.title)?i=B.TitleBarTitleContext:i=B.TitleBarContext,this.onContextMenu(t,i)})),ce&&this._register(H(this.title,$.MOUSE_DOWN,t=>{t.metaKey&&(Se.stop(t,!0),this.onContextMenu(t,B.TitleBarTitleContext))},!0)),this.updateStyles(),this.element}createTitle(){this.titleDisposables.clear();const e=_t(this.configurationService,this.titleBarStyle);if(!this.isCommandCenterVisible)e||(this.title.innerText=this.windowTitle.value,this.titleDisposables.add(this.windowTitle.onDidChange(()=>{this.title.innerText=this.windowTitle.value,this.lastLayoutDimensions&&this.updateLayout(this.lastLayoutDimensions)})));else{const t=this.instantiationService.createInstance(Qi,this.windowTitle,this.hoverDelegate);Tn(this.title,t.element),this.titleDisposables.add(t)}}actionViewItemProvider(e,t){if(!this.isAuxiliary){if(e.id===zs)return this.instantiationService.createInstance(lo,{position:()=>Us.BELOW},t);if(e.id===Ks)return this.instantiationService.createInstance(uo,{position:()=>Us.BELOW},t)}const i=this.editorGroupsContainer.activeGroup?.activeEditorPane;if(i&&i instanceof fo){const s=i.getActionViewItem(e,t);if(s)return s}return _s(this.instantiationService,e,{...t,menuAsChild:!1})}getKeybinding(e){const t=this.editorGroupsContainer.activeGroup?.activeEditorPane?.scopedContextKeyService??this.contextKeyService;return this.keybindingService.lookupKeybinding(e.id,t)}createActionToolBar(){this.actionToolBarDisposable.clear(),this.actionToolBar=this.actionToolBarDisposable.add(this.instantiationService.createInstance(In,this.actionToolBarElement,{contextMenu:B.TitleBarContext,orientation:po.HORIZONTAL,ariaLabel:g(3526,"Title actions"),getKeyBinding:e=>this.getKeybinding(e),overflowBehavior:{maxItems:9,exempted:[Ks,zs,...mo]},anchorAlignmentProvider:()=>go.RIGHT,telemetrySource:"titlePart",highlightToggledItems:this.editorActionsEnabled||this.isAuxiliary,actionViewItemProvider:(e,t)=>this.actionViewItemProvider(e,t),hoverDelegate:this.hoverDelegate})),this.editorActionsEnabled&&this.actionToolBarDisposable.add(this.editorGroupsContainer.onDidChangeActiveGroup(()=>this.createActionToolBarMenus({editorActions:!0})))}createActionToolBarMenus(e=!0){e===!0&&(e={editorActions:!0,layoutActions:!0,globalActions:!0,activityActions:!0});const t=()=>{const i={primary:[],secondary:[]};if(this.editorActionsEnabled){this.editorActionsChangeDisposable.clear();const s=this.editorGroupsContainer.activeGroup;if(s){const r=s.createEditorActions(this.editorActionsChangeDisposable,this.isAuxiliary&&this.isCompact?B.CompactWindowEditorTitle:B.EditorTitle);i.primary.push(...r.actions.primary),i.secondary.push(...r.actions.secondary),this.editorActionsChangeDisposable.add(r.onDidChange(()=>t()))}}this.globalToolbarMenu&&Ys(this.globalToolbarMenu.getActions(),i),this.layoutToolbarMenu&&Ys(this.layoutToolbarMenu.getActions(),i,()=>!this.editorActionsEnabled||this.isCompact),this.activityActionsEnabled&&(_o(this.storageService)&&i.primary.push(Do),i.primary.push(Ro)),this.actionToolBar.setActions(Xs(i.primary),Xs(i.secondary))};if(e.editorActions)if(this.editorToolbarMenuDisposables.clear(),this.editorActionsEnabled&&this.editorService.activeEditor!==void 0){const i={groupId:this.editorGroupsContainer.activeGroup.id};this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new bo(i)),this.actionToolBar.context=i}else this.actionToolBar.actionRunner=this.editorToolbarMenuDisposables.add(new Ss),this.actionToolBar.context=void 0;e.layoutActions&&(this.layoutToolbarMenuDisposables.clear(),this.layoutControlEnabled?(this.layoutToolbarMenu=this.menuService.createMenu(B.LayoutControlMenu,this.contextKeyService),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu),this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu.onDidChange(()=>t()))):this.layoutToolbarMenu=void 0),e.globalActions&&(this.globalToolbarMenuDisposables.clear(),this.globalActionsEnabled?(this.globalToolbarMenu=this.menuService.createMenu(B.TitleBar,this.contextKeyService),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu),this.globalToolbarMenuDisposables.add(this.globalToolbarMenu.onDidChange(()=>t()))):this.globalToolbarMenu=void 0),e.activityActions&&(this.activityToolbarDisposables.clear(),this.activityActionsEnabled&&this.activityToolbarDisposables.add(this.storageService.onDidChangeValue(E.PROFILE,So.ACCOUNTS_VISIBILITY_PREFERENCE_KEY,this._store)(()=>t()))),t()}updateStyles(){if(super.updateStyles(),this.element){this.isInactive?this.element.classList.add("inactive"):this.element.classList.remove("inactive");const e=this.getColor(this.isInactive?Ao:Co,(s,r)=>s.isOpaque()?s:s.makeOpaque(Eo(r)))||"";this.element.style.backgroundColor=e,this.appIconBadge&&(this.appIconBadge.style.backgroundColor=e),e&&Io.fromHex(e).isLighter()?this.element.classList.add("light"):this.element.classList.remove("light");const t=this.getColor(this.isInactive?To:yo);this.element.style.color=t||"";const i=this.getColor(vo);this.element.style.borderBottom=i?`1px solid ${i}`:""}}onContextMenu(e,t){const i=new vn(z(this.element),e);this.contextMenuService.showContextMenu({getAnchor:()=>i,menuId:t,contextKeyService:this.contextKeyService,domForShadowRoot:ce&&Xt?i.target:void 0})}get currentMenubarVisibility(){return this.isAuxiliary?"hidden":Li(this.configurationService)}get layoutControlEnabled(){return this.configurationService.getValue(_.LAYOUT_ACTIONS)!==!1}get isCommandCenterVisible(){return!this.isCompact&&this.configurationService.getValue(_.COMMAND_CENTER)!==!1}get editorActionsEnabled(){return this.editorGroupsContainer.partOptions.editorActionsLocation===Bi.TITLEBAR||this.editorGroupsContainer.partOptions.editorActionsLocation===Bi.DEFAULT&&this.editorGroupsContainer.partOptions.showTabs===wo.NONE}get activityActionsEnabled(){const e=this.configurationService.getValue(_.ACTIVITY_BAR_LOCATION);return!this.isCompact&&!this.isAuxiliary&&(e===ve.TOP||e===ve.BOTTOM)}get globalActionsEnabled(){return!this.isCompact}get hasZoomableElements(){const e=!(this.currentMenubarVisibility==="hidden"||this.currentMenubarVisibility==="compact"||!ne&&ce),t=this.isCommandCenterVisible,i=this.globalActionsEnabled||this.layoutControlEnabled||this.editorActionsEnabled||this.activityActionsEnabled;return e||t||i}get preventZoom(){return Zt(z(this.element))<1||!this.hasZoomableElements}layout(e,t){this.updateLayout(new et(e,t)),super.layoutContents(e,t)}updateLayout(e){this.lastLayoutDimensions=e;{const t=Zt(z(this.element));if(this.element.style.setProperty("--zoom-factor",t.toString()),this.rootContainer.classList.toggle("counter-zoom",this.preventZoom),this.customMenubar.value){const i=new et(0,e.height);this.customMenubar.value.layout(i)}}}focus(){this.customMenubar.value?this.customMenubar.value.toggleFocus():this.element.querySelector('[tabindex]:not([tabindex="-1"])')?.focus()}toJSON(){return{type:h.TITLEBAR_PART}}dispose(){this._onWillDispose.fire(),super.dispose()}};li=T([d(3,me),d(4,Qe),d(5,Wt),d(6,L),d(7,ie),d(8,ae),d(9,te),d(10,Ee),d(11,At),d(12,Ct),d(13,Ns),d(14,it)],li);let ss=class extends li{constructor(e,t,i,s,r,n,o,a,c,l,m,p,b){super(h.TITLEBAR_PART,A,l.mainPart,e,t,i,s,r,n,o,a,c,m,p,b)}};ss=T([d(0,me),d(1,Qe),d(2,Wt),d(3,L),d(4,ie),d(5,ae),d(6,te),d(7,Ee),d(8,At),d(9,st),d(10,Ct),d(11,Ns),d(12,it)],ss);var Xe;let ns=(Xe=class extends li{get height(){return this.minimumHeight}constructor(e,t,i,s,r,n,o,a,c,l,m,p,b,M,G,rt){const It=ts.COUNTER++;super(`workbench.parts.auxiliaryTitle.${It}`,z(e),t,s,r,n,o,a,c,l,m,p,M,G,rt),this.container=e,this.mainTitlebar=i}get preventZoom(){return Zt(z(this.element))<1||!this.mainTitlebar.hasZoomableElements}},ts=Xe,Xe.COUNTER=1,Xe);ns=ts=T([d(3,me),d(4,Qe),d(5,Wt),d(6,L),d(7,ie),d(8,ae),d(9,te),d(10,Ee),d(11,At),d(12,st),d(13,Ct),d(14,Ns),d(15,it)],ns);function hc(){return{[vs.toString()]:new Le(is,[],!1)}}wn(async u=>{u.get(vs)});const lc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class dc extends j{constructor(e,t,i){super(e,t,void 0,!0),this.model=i,this.checked=!i.isHidden(e)}async run(){this.model.isHidden(this.id)?this.model.show(this.id):this.model.hide(this.id)}}class uc extends j{constructor(e,t,i){super(e,g(3482,"Hide '{0}'",t),void 0,!0),this.model=i}async run(){this.model.hide(this.id)}}let rs=class extends j{constructor(e,t){super("statusbar.manage.extension",g(3483,"Manage Extension")),this.extensionId=e,this.commandService=t}run(){return this.commandService.executeCommand("_extensions.manage",this.extensionId)}};rs=T([d(1,ge)],rs);P.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusPrevious",weight:N.WorkbenchContrib,primary:C.LeftArrow,secondary:[C.UpArrow],when:Et,handler:u=>{u.get(Ie).focusPreviousEntry()}});P.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusNext",weight:N.WorkbenchContrib,primary:C.RightArrow,secondary:[C.DownArrow],when:Et,handler:u=>{u.get(Ie).focusNextEntry()}});P.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusFirst",weight:N.WorkbenchContrib,primary:C.Home,when:Et,handler:u=>{const e=u.get(Ie);e.focus(!1),e.focusNextEntry()}});P.registerCommandAndKeybindingRule({id:"workbench.statusBar.focusLast",weight:N.WorkbenchContrib,primary:C.End,when:Et,handler:u=>{const e=u.get(Ie);e.focus(!1),e.focusPreviousEntry()}});P.registerCommandAndKeybindingRule({id:"workbench.statusBar.clearFocus",weight:N.WorkbenchContrib,primary:C.Escape,when:Et,handler:u=>{const e=u.get(Ie),t=u.get(Ct);e.isEntryFocused()?e.focus(!1):t.activeEditorPane&&t.activeEditorPane.focus()}});class fc extends Rs{constructor(){super({id:"workbench.action.focusStatusBar",title:le(3484,"Focus Status Bar"),category:Ps.View,f1:!0})}async run(e){e.get(te).focusPart(h.STATUSBAR_PART,Ut())}}Ds(fc);const Be=class Be extends ee{get entries(){return this._entries.slice(0)}get lastFocusedEntry(){return this._lastFocusedEntry&&!this.isHidden(this._lastFocusedEntry.id)?this._lastFocusedEntry:void 0}constructor(e){super(),this.storageService=e,this._onDidChangeEntryVisibility=this._register(new I),this.onDidChangeEntryVisibility=this._onDidChangeEntryVisibility.event,this._entries=[],this.hidden=new Set,this.restoreState(),this.registerListeners()}restoreState(){const e=this.storageService.get(Be.HIDDEN_ENTRIES_KEY,E.PROFILE);if(e)try{this.hidden=new Set(JSON.parse(e))}catch{}}registerListeners(){this._register(this.storageService.onDidChangeValue(E.PROFILE,Be.HIDDEN_ENTRIES_KEY,this._store)(()=>this.onDidStorageValueChange()))}onDidStorageValueChange(){const e=new Set(this.hidden);this.hidden.clear(),this.restoreState();const t=new Set;for(const i of e)this.hidden.has(i)||t.add(i);for(const i of this.hidden)e.has(i)||t.add(i);if(t.size>0)for(const i of this._entries)t.has(i.id)&&(this.updateVisibility(i.id,!0),t.delete(i.id))}add(e){this._entries.push(e),this.updateVisibility(e,!1),this.sort(),this.markFirstLastVisibleEntry()}remove(e){const t=this._entries.indexOf(e);t>=0&&(this._entries.splice(t,1),this._entries.some(i=>$t(i.priority.primary)&&i.priority.primary.location.id===e.id)&&this.sort(),this.markFirstLastVisibleEntry())}isHidden(e){return this.hidden.has(e)}hide(e){this.hidden.has(e)||(this.hidden.add(e),this.updateVisibility(e,!0),this.saveState())}show(e){this.hidden.has(e)&&(this.hidden.delete(e),this.updateVisibility(e,!0),this.saveState())}findEntry(e){return this._entries.find(t=>t.container===e)}getEntries(e){return this._entries.filter(t=>t.alignment===e)}focusNextEntry(){this.focusEntry(1,0)}focusPreviousEntry(){this.focusEntry(-1,this.entries.length-1)}isEntryFocused(){return!!this.getFocusedEntry()}getFocusedEntry(){return this._entries.find(e=>Je(e.container))}focusEntry(e,t){const i=n=>{let o=n,a=o>=0&&o<this._entries.length?this._entries[o]:void 0;for(;a&&this.isHidden(a.id);)o+=e,a=o>=0&&o<this._entries.length?this._entries[o]:void 0;return a},s=this.getFocusedEntry();if(s){const n=i(this._entries.indexOf(s)+e);if(n){this._lastFocusedEntry=n,n.labelContainer.focus();return}}const r=i(t);r&&(this._lastFocusedEntry=r,r.labelContainer.focus())}updateVisibility(e,t){if(typeof e=="string"){const i=e;for(const s of this._entries)s.id===i&&this.updateVisibility(s,t)}else{const i=e,s=this.isHidden(i.id);s?_n(i.container):Dn(i.container),t&&this._onDidChangeEntryVisibility.fire({id:i.id,visible:!s}),this.markFirstLastVisibleEntry()}}saveState(){this.hidden.size>0?this.storageService.store(Be.HIDDEN_ENTRIES_KEY,JSON.stringify(Array.from(this.hidden.values())),E.PROFILE,R.USER):this.storageService.remove(Be.HIDDEN_ENTRIES_KEY,E.PROFILE)}sort(){const e=new Set(this._entries.map(n=>n.id)),t=new Map,i=new Map;for(let n=0;n<this._entries.length;n++){const o=this._entries[n];if(typeof o.priority.primary=="number"||!e.has(o.priority.primary.location.id))t.set(o,n);else{const a=o.priority.primary.location.id;let c=i.get(a);if(!c){for(const l of i.values())if(l.has(a)){c=l;break}c||(c=new Map,i.set(a,c))}c.set(o.id,o)}}const s=Array.from(t.keys());s.sort((n,o)=>{if(n.alignment===o.alignment){const a=typeof n.priority.primary=="number"?n.priority.primary:n.priority.primary.location.priority,c=typeof o.priority.primary=="number"?o.priority.primary:o.priority.primary.location.priority;return a!==c?c-a:n.priority.secondary!==o.priority.secondary?o.priority.secondary-n.priority.secondary:t.get(n)-t.get(o)}return n.alignment===K.LEFT?-1:o.alignment===K.LEFT?1:0});let r;if(i.size>0){r=[];for(const n of s){const o=i.get(n.id),a=o?Array.from(o.values()):void 0;a&&r.push(...a.filter(c=>$t(c.priority.primary)&&c.priority.primary.alignment===K.LEFT).sort((c,l)=>l.priority.secondary-c.priority.secondary)),r.push(n),a&&r.push(...a.filter(c=>$t(c.priority.primary)&&c.priority.primary.alignment===K.RIGHT).sort((c,l)=>l.priority.secondary-c.priority.secondary)),i.delete(n.id)}for(const[,n]of i)r.push(...Array.from(n.values()).sort((o,a)=>a.priority.secondary-o.priority.secondary))}else r=s;this._entries=r}markFirstLastVisibleEntry(){this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(K.LEFT)),this.doMarkFirstLastVisibleStatusbarItem(this.getEntries(K.RIGHT))}doMarkFirstLastVisibleStatusbarItem(e){let t,i;for(const s of e)s.container.classList.remove("first-visible-item","last-visible-item"),!this.isHidden(s.id)&&(t||(t=s),i=s);t?.container.classList.add("first-visible-item"),i?.container.classList.add("last-visible-item")}};Be.HIDDEN_ENTRIES_KEY="workbench.statusbar.hidden";let os=Be,as=class extends ee{get name(){return re(this.entry).name}get hasCommand(){return typeof this.entry?.command<"u"}constructor(e,t,i,s,r,n,o,a){super(),this.container=e,this.hoverDelegate=i,this.commandService=s,this.hoverService=r,this.notificationService=n,this.telemetryService=o,this.themeService=a,this.entry=void 0,this.foregroundListener=this._register(new Ne),this.backgroundListener=this._register(new Ne),this.commandMouseListener=this._register(new Ne),this.commandTouchListener=this._register(new Ne),this.commandKeyboardListener=this._register(new Ne),this.hover=void 0,this.labelContainer=S("a.statusbar-item-label",{role:"button",tabIndex:-1}),this._register(Is.addTarget(this.labelContainer)),this.label=this._register(new gc(this.labelContainer)),this.container.appendChild(this.labelContainer),this.beakContainer=S(".status-bar-item-beak-container"),this.container.appendChild(this.beakContainer),this.update(t)}update(e){if(this.label.showProgress=e.showProgress??!1,(!this.entry||e.text!==this.entry.text)&&(this.label.text=e.text,e.text?Dn(this.labelContainer):_n(this.labelContainer)),(!this.entry||e.ariaLabel!==this.entry.ariaLabel)&&(this.container.setAttribute("aria-label",e.ariaLabel),this.labelContainer.setAttribute("aria-label",e.ariaLabel)),(!this.entry||e.role!==this.entry.role)&&this.labelContainer.setAttribute("role",e.role||"button"),!this.entry||!this.isEqualTooltip(this.entry,e)){let i,s;Po(e.tooltip)?(s=e.tooltip.content,i={actions:e.tooltip.commands.map(n=>({commandId:n.id,label:n.title,run:()=>this.executeCommand(n)}))}):s=e.tooltip;const r=_i(s)?{markdown:s,markdownNotSupportedFallback:void 0}:s;this.hover?this.hover.update(r,i):this.hover=this._register(this.hoverService.setupManagedHover(this.hoverDelegate,this.container,r,i))}if(!this.entry||e.command!==this.entry.command){this.commandMouseListener.clear(),this.commandTouchListener.clear(),this.commandKeyboardListener.clear();const i=e.command;i&&(i!==Zs||this.hover)?(this.commandMouseListener.value=H(this.labelContainer,$.CLICK,()=>this.executeCommand(i)),this.commandTouchListener.value=H(this.labelContainer,Ts.Tap,()=>this.executeCommand(i)),this.commandKeyboardListener.value=H(this.labelContainer,$.KEY_DOWN,s=>{const r=new dn(s);r.equals(C.Space)||r.equals(C.Enter)?(Se.stop(s),this.executeCommand(i)):(r.equals(C.Escape)||r.equals(C.LeftArrow)||r.equals(C.RightArrow))&&(Se.stop(s),this.hover?.hide())}),this.labelContainer.classList.remove("disabled")):this.labelContainer.classList.add("disabled")}(!this.entry||e.showBeak!==this.entry.showBeak)&&(e.showBeak?this.container.classList.add("has-beak"):this.container.classList.remove("has-beak"));const t=!!e.backgroundColor||e.kind&&e.kind!=="standard";if(!this.entry||e.kind!==this.entry.kind){for(const i of No)this.container.classList.remove(`${i}-kind`);e.kind&&e.kind!=="standard"&&this.container.classList.add(`${e.kind}-kind`),this.container.classList.toggle("has-background-color",t)}(!this.entry||e.color!==this.entry.color)&&this.applyColor(this.labelContainer,e.color),(!this.entry||e.backgroundColor!==this.entry.backgroundColor)&&(this.container.classList.toggle("has-background-color",t),this.applyColor(this.container,e.backgroundColor,!0)),this.entry=e}isEqualTooltip({tooltip:e},{tooltip:t}){return e===void 0?t===void 0:_i(e)?_i(t)&&Vo(e,t):e===t}async executeCommand(e){if(e===Zs)this.hover?.show(!0);else{const t=typeof e=="string"?e:e.id,i=typeof e=="string"?[]:e.arguments??[];this.telemetryService.publicLog2("workbenchActionExecuted",{id:t,from:"status bar"});try{await this.commandService.executeCommand(t,...i)}catch(s){this.notificationService.error(Gt(s))}}}applyColor(e,t,i){let s;if(i?this.backgroundListener.clear():this.foregroundListener.clear(),t)if(Bo(t)){s=this.themeService.getColorTheme().getColor(t.id)?.toString();const r=this.themeService.onDidColorThemeChange(n=>{const o=n.getColor(t.id)?.toString();i?e.style.backgroundColor=o??"":e.style.color=o??""});i?this.backgroundListener.value=r:this.foregroundListener.value=r}else s=t;i?e.style.backgroundColor=s??"":e.style.color=s??""}};as=T([d(3,ge),d(4,ys),d(5,Ae),d(6,Cs),d(7,ie)],as);class gc extends Lo{constructor(e){super(e),this.container=e,this.progressCodicon=ki($s),this.currentText="",this.currentShowProgress=!1}set showProgress(e){this.currentShowProgress!==e&&(this.currentShowProgress=e,this.progressCodicon=ki(e==="syncing"?$s:Mo),this.text=this.currentText)}set text(e){if(this.currentShowProgress){this.container.firstChild!==this.progressCodicon&&this.container.appendChild(this.progressCodicon);for(const i of Array.from(this.container.childNodes))i!==this.progressCodicon&&i.remove();let t=e??"";t&&(t=` ${t}`),J(this.container,...Oo(t))}else super.text=e}}var jt,cs;_e(lc);var Ze;let Ft=(Ze=class extends Ci{constructor(e,t,i,s,r,n,o,a){super(e,{hasTitle:!1},i,r,n),this.instantiationService=t,this.contextService=s,this.contextMenuService=o,this.contextKeyService=a,this.minimumWidth=0,this.maximumWidth=Number.POSITIVE_INFINITY,this.minimumHeight=jt.HEIGHT,this.maximumHeight=jt.HEIGHT,this.pendingEntries=[],this._onWillDispose=this._register(new I),this.onWillDispose=this._onWillDispose.event,this.onDidOverrideEntry=this._register(new I),this.entryOverrides=new Map,this.compactEntriesDisposable=this._register(new Ne),this.styleOverrides=new Set,this.viewModel=this._register(new os(r)),this.onDidChangeEntryVisibility=this.viewModel.onDidChangeEntryVisibility,this.hoverDelegate=this._register(this.instantiationService.createInstance(xo,"element",{instantHover:!0,dynamicDelay(c){if(typeof c=="function"||Si(c)||ko(c)&&typeof c.markdown=="function"||Ho(c))return 500}},(c,l)=>({persistence:{hideOnKeyDown:!0,sticky:l},appearance:{maxHeightRatio:.9}}))),this.registerListeners()}registerListeners(){this._register(this.onDidChangeEntryVisibility(()=>this.updateCompactEntries())),this._register(this.contextService.onDidChangeWorkbenchState(()=>this.updateStyles()))}overrideEntry(e,t){return this.entryOverrides.set(e,t),this.onDidOverrideEntry.fire(e),Ce(()=>{this.entryOverrides.get(e)===t&&(this.entryOverrides.delete(e),this.onDidOverrideEntry.fire(e))})}withEntryOverride(e,t){const i=this.entryOverrides.get(t);return i&&(e={...e,...i}),e}addEntry(e,t,i,s=0){let r;return Fo(s)?r=s:r={primary:s,secondary:Go(t)},this.element?this.doAddEntry(e,t,i,r):this.doAddPendingEntry(e,t,i,r)}doAddPendingEntry(e,t,i,s){const r={entry:e,id:t,alignment:i,priority:s};return this.pendingEntries.push(r),{update:o=>{r.accessor?r.accessor.update(o):r.entry=o},dispose:()=>{r.accessor?r.accessor.dispose():this.pendingEntries=this.pendingEntries.filter(o=>o!==r)}}}doAddEntry(e,t,i,s){const r=new V,n=this.doCreateStatusItem(t,i),o=r.add(this.instantiationService.createInstance(as,n,this.withEntryOverride(e,t),this.hoverDelegate)),a=new class{constructor(){this.id=t,this.extensionId=e.extensionId,this.alignment=i,this.priority=s,this.container=n,this.labelContainer=o.labelContainer}get name(){return o.name}get hasCommand(){return o.hasCommand}},{needsFullRefresh:c}=this.doAddOrRemoveModelEntry(a,!0);c?this.appendStatusbarEntries():this.appendStatusbarEntry(a);let l=e;const m={update:p=>{l=p,o.update(this.withEntryOverride(p,t))},dispose:()=>{const{needsFullRefresh:p}=this.doAddOrRemoveModelEntry(a,!1);p?this.appendStatusbarEntries():(n.remove(),this.updateCompactEntries()),r.dispose()}};return r.add(this.onDidOverrideEntry.event(p=>{p===t&&m.update(l)})),m}doCreateStatusItem(e,t,...i){const s=S(".statusbar-item",{id:e});return i&&s.classList.add(...i),t===K.RIGHT?s.classList.add("right"):s.classList.add("left"),s}doAddOrRemoveModelEntry(e,t){const i=this.viewModel.entries;t?this.viewModel.add(e):this.viewModel.remove(e);const s=this.viewModel.entries;return t?i.splice(s.indexOf(e),0,e):i.splice(i.indexOf(e),1),{needsFullRefresh:!cn(i,s)}}isEntryVisible(e){return!this.viewModel.isHidden(e)}updateEntryVisibility(e,t){t?this.viewModel.show(e):this.viewModel.hide(e)}focusNextEntry(){this.viewModel.focusNextEntry()}focusPreviousEntry(){this.viewModel.focusPreviousEntry()}isEntryFocused(){return this.viewModel.isEntryFocused()}focus(e=!0){this.getContainer()?.focus();const t=this.viewModel.lastFocusedEntry;e&&t&&setTimeout(()=>t.labelContainer.focus(),0)}createContentArea(e){this.element=e;const t=this._register(this.contextKeyService.createScoped(this.element));return Et.bindTo(t).set(!0),this.leftItemsContainer=S(".left-items.items-container"),this.element.appendChild(this.leftItemsContainer),this.element.tabIndex=0,this.rightItemsContainer=S(".right-items.items-container"),this.element.appendChild(this.rightItemsContainer),this._register(H(e,$.CONTEXT_MENU,i=>this.showContextMenu(i))),this._register(Is.addTarget(e)),this._register(H(e,Ts.Contextmenu,i=>this.showContextMenu(i))),this.createInitialStatusbarEntries(),this.element}createInitialStatusbarEntries(){for(this.appendStatusbarEntries();this.pendingEntries.length;){const e=this.pendingEntries.shift();e&&(e.accessor=this.addEntry(e.entry,e.id,e.alignment,e.priority.primary))}}appendStatusbarEntries(){const e=re(this.leftItemsContainer),t=re(this.rightItemsContainer);qe(e),qe(t);for(const i of[...this.viewModel.getEntries(K.LEFT),...this.viewModel.getEntries(K.RIGHT).reverse()])(i.alignment===K.LEFT?e:t).appendChild(i.container);this.updateCompactEntries()}appendStatusbarEntry(e){const t=this.viewModel.getEntries(e.alignment);e.alignment===K.RIGHT&&t.reverse();const i=re(e.alignment===K.LEFT?this.leftItemsContainer:this.rightItemsContainer),s=t.indexOf(e);s+1===t.length?i.appendChild(e.container):i.insertBefore(e.container,t[s+1].container),this.updateCompactEntries()}updateCompactEntries(){const e=this.viewModel.entries,t=new Map;for(const n of e)this.viewModel.isHidden(n.id)||t.set(n.id,n),n.container.classList.remove("compact-left","compact-right");const i=new Map;for(const n of t.values())if($t(n.priority.primary)&&n.priority.primary.compact){const o=n.priority.primary.location.id,a=t.get(o);if(!a)continue;let c=i.get(o);if(!c){for(const l of i.values())if(l.has(o)){c=l;break}c||(c=new Map,i.set(o,c))}c.set(n.id,n),c.set(a.id,a),n.priority.primary.alignment===K.LEFT?(a.container.classList.add("compact-left"),n.container.classList.add("compact-right")):(a.container.classList.add("compact-right"),n.container.classList.add("compact-left"))}const s=this.getColor(Wo),r=this.getColor(zo);if(this.compactEntriesDisposable.value=new V,s&&r&&!Uo(this.theme.type))for(const[,n]of i)for(const o of n.values())o.hasCommand&&(this.compactEntriesDisposable.value.add(H(o.labelContainer,$.MOUSE_OVER,()=>{n.forEach(a=>a.labelContainer.style.backgroundColor=s),o.labelContainer.style.backgroundColor=r})),this.compactEntriesDisposable.value.add(H(o.labelContainer,$.MOUSE_OUT,()=>{n.forEach(a=>a.labelContainer.style.backgroundColor="")})))}showContextMenu(e){Se.stop(e,!0);const t=new vn(z(this.element),e);let i;this.contextMenuService.showContextMenu({getAnchor:()=>t,getActions:()=>(i=this.getContextMenuActions(t),i),onHide:()=>{i&&ia(i)}})}getContextMenuActions(e){const t=[];t.push(Jt({id:js.ID,label:g(3485,"Hide Status Bar"),run:()=>this.instantiationService.invokeFunction(r=>new js().run(r))})),t.push(new Lt);const i=new Set;for(const r of this.viewModel.entries)i.has(r.id)||(t.push(new dc(r.id,r.name,this.viewModel)),i.add(r.id));let s;for(let r=e.target;r;r=r.parentElement){const n=this.viewModel.findEntry(r);if(n){s=n;break}}return s&&(t.push(new Lt),s.extensionId&&t.push(this.instantiationService.createInstance(rs,s.extensionId)),t.push(new uc(s.id,s.name,this.viewModel))),t}updateStyles(){super.updateStyles();const e=re(this.getContainer()),t=[...this.styleOverrides].sort((a,c)=>a.priority-c.priority)[0],i=this.getColor(t?.background??(this.contextService.getWorkbenchState()!==mt.EMPTY?Ko:Yo))||"";e.style.backgroundColor=i;const s=this.getColor(t?.foreground??(this.contextService.getWorkbenchState()!==mt.EMPTY?Xo:Zo))||"";e.style.color=s;const r=this.getColor($o),n=this.getColor(t?.border??(this.contextService.getWorkbenchState()!==mt.EMPTY?jo:qo))||this.getColor(Jo);n?(e.classList.add("status-border-top"),e.style.setProperty("--status-border-top-color",n)):(e.classList.remove("status-border-top"),e.style.removeProperty("--status-border-top-color"));const o=this.getColor(Qo);this.styleElement||(this.styleElement=ea(e)),this.styleElement.textContent=`
|
|
2
2
|
|
|
3
3
|
/* Status bar focus outline */
|
|
4
4
|
.monaco-workbench .part.statusbar:focus {
|